Fix underspecification of constraint lookups.
This commit is contained in:
parent
5f7bee14a0
commit
14b9122a08
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ func (m *MySQLDriver) Columns(schema, tableName string) ([]bdb.Column, error) {
|
|||
on tc.constraint_name = kcu.constraint_name and tc.table_name = kcu.table_name and tc.table_schema = kcu.table_schema
|
||||
where c.column_name = kcu.column_name and tc.table_name = c.table_name and
|
||||
(tc.constraint_type = 'PRIMARY KEY' or tc.constraint_type = 'UNIQUE') and
|
||||
(select count(*) from information_schema.key_column_usage where constraint_name = tc.constraint_name) = 1
|
||||
(select count(*) from information_schema.key_column_usage where table_schema = kcu.table_schema and table_name = tc.table_name and constraint_name = tc.constraint_name) = 1
|
||||
) as is_unique
|
||||
from information_schema.columns as c
|
||||
where table_name = ? and table_schema = ?;
|
||||
|
|
Loading…
Reference in a new issue