Bug #37070 | I_S.key_column_usage corruption | ||
---|---|---|---|
Submitted: | 29 May 2008 13:48 | Modified: | 30 May 2008 9:37 |
Reporter: | Claude Martin | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Information schema | Severity: | S3 (Non-critical) |
Version: | 5.0.51a-community/5.1/6.0 | OS: | Linux |
Assigned to: | Sergei Glukhov | CPU Architecture: | Any |
[29 May 2008 13:48]
Claude Martin
[29 May 2008 14:30]
MySQL Verification Team
Thank you for the bug report. Verified as described.
[30 May 2008 8:58]
Sergei Glukhov
It's not a bug, see example below create table ATABLE(F1 decimal(5,2) primary key, F2 char(20)); create unique index f1ind on ATABLE (F2); select table_schema, table_name, constraint_name, constraint_type from information_schema.table_constraints where table_name= 'ATABLE'; table_schema table_name constraint_name constraint_type test ATABLE PRIMARY PRIMARY KEY test ATABLE f1ind UNIQUE -------- This result is correct. select table_schema, table_name, constraint_name, column_name, ordinal_position from information_schema.key_column_usage where table_name= 'ATABLE'; table_schema table_name constraint_name column_name ordinal_position test ATABLE PRIMARY F1 1 test ATABLE f1ind F2 1 -------- This result is correct too. See also http://dev.mysql.com/doc/refman/5.1/en/key-column-usage-table.html The value of ORDINAL_POSITION is the column's position within the constraint, not the column's position within the table. Column positions are numbered beginning with 1. So result of select from this bug report is correct too.