tidb
tidb copied to clipboard
'create table if not exists ... like' doesn't work for existing table
Please answer these questions before submitting your issue. Thanks!
- What did you do?
mysql> show tables;
+-------------------+
| Tables_in_ctwl_db |
+-------------------+
| t |
| t1 |
+-------------------+
2 rows in set (0.00 sec)
mysql> create table if not exists t like t1;
ERROR 1050 (42S01): Table 'ctwl_db.t' already exists
-
What did you expect to see? KEYWORD '
if not exists' should work, TiDB should simply produce a 'NOTE' rather than 'ERROR' -
What did you see instead? As shown above
-
What version of TiDB are you using (
tidb-server -Vor runselect tidb_version();on TiDB)?
mysql> select version();
+---------------------------------------+
| version() |
+---------------------------------------+
| 5.7.10-TiDB-v2.1.0-alpha-53-g5445ced7 |
+---------------------------------------+
1 row in set (0.00 sec)
@bb7133 Thank you for your feedback!
You want to see that like this:
mysql> create table if not exists t like t1;
Query OK, 0 rows affected, 1 warning (0.00 sec)