mariadb/mysql-test/suite
Debarun Banerjee 49edf2d476 BUG#25126722 FOREIGN KEY CONSTRAINT NAME IS NULL IN INFORMATION_SCHEMA AFTER RESTART
Problem :
---------
Information_Schema.referential_constraints (UNIQUE_CONSTRAINT_NAME)
shows NULL for a foreign key constraint after restarting the server.
If any dml or query (select/insert/update/delete) is done on
referenced table, then the constraint name is correctly shown.

Solution :
----------
UNIQUE_CONSTRAINT_NAME column is the key name of the referenced table.
In innodb, FK reference is stored as a list of columns in referenced
table in INNODB_SYS_FOREIGN and INNODB_SYS_FOREIGN_COLS. The referenced
column must have at least one index/key with the referenced column as
prefix but the key name itself is not included in FK metadata. For this
reason, the UNIQUE_CONSTRAINT_NAME is only filled up when the
referenced table is actually loaded in innodb dictionary cache.

The information_schema view calls handler::get_foreign_key_list() on
foreign key table to read the FK metadata. The UNIQUE_CONSTRAINT_NAME
information shows NULL based on whether the referenced table is
already loaded or not.

One way to fix this issue is to load the referenced table while reading
the FK metadata information, if needed.

Reviewed-by: Sunny Bains <sunny.bains@oracle.com>

RB: 14654
2017-04-26 23:03:30 +03:00
..
archive MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
binlog MDEV-12017 Unclear error with flashback: Variable 'binlog_format' can't ... 2017-04-26 11:08:23 +05:30
binlog_encryption search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
csv MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
encryption search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
engines MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
federated Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
funcs_1 Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
funcs_2 Merge branch 'bb-10.2-serg-merge' into 10.2 2017-02-11 09:45:34 +01:00
galera MDEV-11703 InnoDB background threads show up in the processlist 2017-03-29 00:40:21 +02:00
galera_3nodes Merge 10.1 into 10.2 2016-12-30 08:53:54 +02:00
gcol Bug #23533396 ASSERTION !M_PREBUILT->TRX->CHECK_FOREIGNS 2017-04-26 23:03:27 +03:00
handler MDEV-7660 - MySQL WL#6671 "Improve scalability by not using thr_lock.c locks 2016-11-03 16:35:15 +04:00
heap MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
innodb BUG#25126722 FOREIGN KEY CONSTRAINT NAME IS NULL IN INFORMATION_SCHEMA AFTER RESTART 2017-04-26 23:03:30 +03:00
innodb_fts Fixes for innodb crash recovery tests from Serg 2017-04-02 17:29:04 +00:00
innodb_gis Bug#23044098 INSERT OF GIS DATA INTO RTREE HITS ASSERT IN RTR_CUR_RESTORE_POSITION_FUNC() 2017-04-26 23:03:30 +03:00
innodb_undo Adapt the innodb_undo tests from MySQL 5.7 2017-04-26 23:03:28 +03:00
innodb_zip MDEV-11995 ALTER TABLE proceeds despite reporting ER_TOO_LONG_KEY error 2017-04-07 09:55:54 +02:00
jp MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
json MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work 2017-02-14 20:43:41 +01:00
large_tests
maria MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
mtr/t
mtr2
multi_source Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
ndb
optimizer_unfixed_bugs MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
parts Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
percona MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
perfschema Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
perfschema_stress
plugins Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
roles MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
rpl search_pattern_in_file.inc changes 2017-03-31 19:28:58 +02:00
storage_engine cleanup: remove Item::intro_version 2016-12-12 20:27:25 +01:00
stress MDEV-6720 - enable connection log in mysqltest by default 2016-03-31 10:11:16 +04:00
sys_vars Adapt the innodb_undo tests from MySQL 5.7 2017-04-26 23:03:28 +03:00
unit update libmariadb, enable C/C unit tests 2017-03-30 09:27:03 +02:00
vcol vcol.wrong_arena fails in fulltest 2017-04-01 19:32:36 +02:00
wsrep MDEV-11870 Message "MariaDB Galera and flashback does not support" 2017-01-23 01:06:31 +02:00