diff --git a/contrib/drivers/mysql/mysql_table_fields.go b/contrib/drivers/mysql/mysql_table_fields.go index 72ffa7e29ec..7b4888e80ea 100644 --- a/contrib/drivers/mysql/mysql_table_fields.go +++ b/contrib/drivers/mysql/mysql_table_fields.go @@ -29,6 +29,7 @@ SELECT FROM information_schema.COLUMNS AS c LEFT JOIN information_schema.CHECK_CONSTRAINTS AS ch ON c.TABLE_NAME = ch.TABLE_NAME + AND c.TABLE_SCHEMA = ch.CONSTRAINT_SCHEMA AND c.COLUMN_NAME = ch.CONSTRAINT_NAME WHERE c.TABLE_SCHEMA = '%s'