-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow any select statement for CREATE TABLE AS SELECT ...
#1355
Conversation
This fixes dolthub/dolt#1478 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -313,7 +313,7 @@ var CharsetCollationEngineTests = []CharsetCollationEngineTest{ | |||
{ | |||
Query: "SHOW CREATE TABLE test4;", | |||
Expected: []sql.Row{ | |||
{"test4", "CREATE TABLE `test4` (\n `pk` bigint NOT NULL,\n `v1` varchar(255) COLLATE utf8mb4_unicode_ci,\n PRIMARY KEY (`pk`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}, | |||
{"test4", "CREATE TABLE `test4` (\n `pk` bigint NOT NULL,\n `v1` varchar(255) COLLATE utf8mb4_unicode_ci\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to double check this one, but it looks like my test was wrong! It doesn't carry over primary keys, which makes sense as it also doesn't carry over indexes, so it would have to special-case it for primary keys, which doesn't really make sense. A small detail that I didn't catch, just assumed it brought those over. I checked this against MySQL the first time too, that makes it even worse lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I saw the comment later on regarding stripping the schema. Wrote the above comment before I got to that part in the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rare Daylon error, hard to catch you slippin
Also fixes a semantics bug in the schema produced by some such statements.