-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Closed
Copy link
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.severity/minorsig/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)
use test;
create table t1 (a int, b int, index(a, b));
create table t2 (a int, b int, index(a, b), constraint fk foreign key(a, b) references t1(a, b));2. What did you expect to see? (Required)
test> select CONSTRAINT_NAME, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_SCHEMA, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where CONSTRAINT_SCHEMA='test' and TABLE_NAME='t2' and REFERENCED_TABLE_SCHEMA is not null and REFERENCED_COLUMN_NAME is not null;
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+
| CONSTRAINT_NAME | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | REFERENCED_TABLE_SCHEMA | REFERENCED_TABLE_NAME | REFERENCED_COLUMN_NAME |
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+
| fk | test | t2 | a | test | t1 | a |
| fk | test | t2 | b | test | t1 | b |
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+3. What did you see instead (Required)
test> select CONSTRAINT_NAME, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_SCHEMA, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where CONSTRAINT_SCHEMA='test' and TABLE_NAME='t2' and REFERENCED_TABLE_SCHEMA is not null and REFERENCED_COLUMN_NAME is not null;
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+
| CONSTRAINT_NAME | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | REFERENCED_TABLE_SCHEMA | REFERENCED_TABLE_NAME | REFERENCED_COLUMN_NAME |
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+
| fk | test | t2 | a | test | t1 | a |
| fk | test | t2 | b | test | t1 | a |
+-----------------+--------------+------------+-------------+-------------------------+-----------------------+------------------------+4. What is your TiDB version? (Required)
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.6.0-alpha
Edition: Community
Git Commit Hash: bf2cc452066cb0269f4036d748ad4fa96eb021b8
Git Branch: heads/refs/tags/v6.6.0-alpha
UTC Build Time: 2023-01-04 14:25:26
GoVersion: go1.19.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikvReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.severity/minorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.