-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
create table select from not supported. #4754
Comments
@bb7133 Thanks for your contribution! |
fix pingcap#4754, fix pingcap#3839
fix pingcap#4754, fix pingcap#3839
fix pingcap#4754, fix pingcap#3839
fix pingcap#4754, fix pingcap#3839
fix pingcap#4754, fix pingcap#3839
Here is a minimal test case:
Confirming it is still pending:
|
Hi, I got the same error working with Flyway and Java Welcome to the MySQL monitor. Commands end with ; or \g. Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SELECT tidb_version()\G This is the issue: [log4j] 2020-08-16 23:42:57 [main] WARN org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: 'CREATE TABLE ... SELECT' is not implemented yet (SQL State: HY000 - Error Code: 1105), |
Isn't this the same as #3839 ? |
why not support? |
There are always ways to make a workaround just like 'CREATE TABLE LIKE ..." + "INSERT INTO ... SELECT", so the priority of it is low. |
Please note that when using MySQL there is a big restriction on using this: In MySQL 5.7 and MySQL 8.0.20 and before this isn't allowed when GTID is used. Source: https://dev.mysql.com/doc/refman/8.0/en/replication-gtids-restrictions.html While I don't see any real problem for implementing this in TiDB I would still recommend people to avoid this. I think it is often better to not combine DDL and DML in a single statement. Also it is often better to more explicitly define a table structure as it may be difficult and/or impossible for the database to use the right data types. For example |
MySQL:
TiDB:
What version of TiDB are you using (
tidb-server -V
)?ref https://dev.mysql.com/doc/refman/5.7/en/create-table-select.html
this case is from mysql-test/alias.test
The text was updated successfully, but these errors were encountered: