You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t1 (a int, b int, c int);
select column_name, ordinal_position from information_schema.columns where table_schema=database() and table_name='t1' and column_name='c';
2. What did you expect to see? (Required)
select ordinal_position from information_schema.columns where /* ... */ column_name='c' should show 3 because this is the 3rd column in the table. However, filtering using a WHERE clause seems to reset the ordinal_position counter so that it refers to the position in the resultset?
3. What did you see instead (Required)
MySQL [test]> create table t1 (a int, b int, c int);
seQuery OK, 0 rows affected (0.54 sec)
MySQL [test]> select column_name, ordinal_position from information_schema.columns where table_schema=database() and table_name='t1';
+-------------+------------------+
| column_name | ordinal_position |
+-------------+------------------+
| a | 1 |
| b | 2 |
| c | 3 |
+-------------+------------------+
3 rows in set (0.00 sec)
MySQL [test]> select column_name, ordinal_position from information_schema.columns where table_schema=database() and table_name='t1' and column_name='c';
+-------------+------------------+
| column_name | ordinal_position |
+-------------+------------------+
| c | 1 |
+-------------+------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
MySQL [test]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v7.0.0
Edition: Community
Git Commit Hash: 8783269d3d97f3fd1858c083170eacaf7b732bcd
Git Branch: HEAD
UTC Build Time: 2023-04-12 18:44:47
GoVersion: go1.20
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
select ordinal_position from information_schema.columns where /* ... */ column_name='c'
should show3
because this is the 3rd column in the table. However, filtering using a WHERE clause seems to reset theordinal_position
counter so that it refers to the position in the resultset?3. What did you see instead (Required)
MySQL [test]> create table t1 (a int, b int, c int);
seQuery OK, 0 rows affected (0.54 sec)
MySQL [test]> select column_name, ordinal_position from information_schema.columns where table_schema=database() and table_name='t1';
+-------------+------------------+
| column_name | ordinal_position |
+-------------+------------------+
| a | 1 |
| b | 2 |
| c | 3 |
+-------------+------------------+
3 rows in set (0.00 sec)
MySQL [test]> select column_name, ordinal_position from information_schema.columns where table_schema=database() and table_name='t1' and column_name='c';
+-------------+------------------+
| column_name | ordinal_position |
+-------------+------------------+
| c | 1 |
+-------------+------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: