-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE t1 (col1 INT, INDEX ((col1 + col1)));
SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = "t1";
ALTER TABLE t1 ADD COLUMN col2 INT;
SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = "t1";
2. What did you expect to see? (Required)
mysql> CREATE TABLE t1 (col1 INT, INDEX ((col1 + col1)));
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
-> WHERE TABLE_NAME = "t1";
+-------------+------------------+
| COLUMN_NAME | ORDINAL_POSITION |
+-------------+------------------+
| col1 | 1 |
+-------------+------------------+
1 row in set (0.01 sec)
mysql>
mysql> ALTER TABLE t1 ADD COLUMN col2 INT;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
mysql> SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
-> WHERE TABLE_NAME = "t1";
+-------------+------------------+
| COLUMN_NAME | ORDINAL_POSITION |
+-------------+------------------+
| col1 | 1 |
| col2 | 2 |
+-------------+------------------+
2 rows in set (0.00 sec)
3. What did you see instead (Required)
mysql> CREATE TABLE t1 (col1 INT, INDEX ((col1 + col1)));
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
-> WHERE TABLE_NAME = "t1";
+-------------+------------------+
| COLUMN_NAME | ORDINAL_POSITION |
+-------------+------------------+
| col1 | 1 |
+-------------+------------------+
1 row in set (0.02 sec)
mysql>
mysql> ALTER TABLE t1 ADD COLUMN col2 INT;
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> SELECT COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS
-> WHERE TABLE_NAME = "t1";
+-------------+------------------+
| COLUMN_NAME | ORDINAL_POSITION |
+-------------+------------------+
| col1 | 1 |
| col2 | 3 |
+-------------+------------------+
2 rows in set (0.02 sec)
4. What is your TiDB version? (Required)
| Release Version: v5.4.0-alpha-184-g51f53f337-dirty
Edition: Community
Git Commit Hash: 51f53f3376bd548b302f654d6c11096f89119145
Git Branch: master
UTC Build Time: 2021-11-23 02:51:51
GoVersion: go1.16.9
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
Metadata
Metadata
Assignees
Labels
severity/moderatesig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.