mariadb/storage/innobase
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
..
btr Bug#24346574 PAGE CLEANER THREAD, ASSERT BLOCK->N_POINTERS == 0 2017-04-26 23:03:27 +03:00
buf Bug#25048573: STD::MAP INSTANTIATIONS CAUSE STATIC ASSERT FAILURES ON FREEBSD 11 2017-04-26 23:03:29 +03:00
data MDEV-12488 Remove type mismatch in InnoDB printf-like calls 2017-04-21 18:03:15 +03:00
dict Bug#25048573: STD::MAP INSTANTIATIONS CAUSE STATIC ASSERT FAILURES ON FREEBSD 11 2017-04-26 23:03:29 +03:00
eval MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
fil Fix a crash when page_compression fails during IMPORT TABLESPACE 2017-04-21 18:44:37 +03:00
fsp Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
fts BUG#24331265 MEMORY LEAK IN SOME INNODB FTS TESTS 2017-04-24 15:33:51 +03:00
fut MDEV-12270 Port MySQL 8.0 Bug#21141390 REMOVE UNUSED FUNCTIONS AND CONVERT GLOBAL SYMBOLS TO STATIC 2017-03-17 12:48:50 +02:00
gis Minor code cleanup. 2017-04-17 03:20:34 +03:00
ha Bug#24346574 PAGE CLEANER THREAD, ASSERT BLOCK->N_POINTERS == 0 2017-04-26 23:03:27 +03:00
handler BUG#25126722 FOREIGN KEY CONSTRAINT NAME IS NULL IN INFORMATION_SCHEMA AFTER RESTART 2017-04-26 23:03:30 +03:00
ibuf Bug#24346574 PAGE CLEANER THREAD, ASSERT BLOCK->N_POINTERS == 0 2017-04-26 23:03:27 +03:00
include BUG#25032066 PREPARED TRANSACTION SHOULD NOT BE ROLLED BACK BY HIGH PRIORITY TRANSACTION 2017-04-26 23:03:29 +03:00
lock BUG#23477773 OPTION TO TURN OFF/ON DEADLOCK CHECKER 2017-04-24 15:09:18 +03:00
log Minor cleanup 2017-04-26 23:03:28 +03:00
mach Fix Bug#24707869 GCC 5 AND 6 MISCOMPILE MACH_PARSE_COMPRESSED 2017-04-26 23:03:29 +03:00
mem MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
mtr MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
mysql-test/storage_engine MDEV-11782: Redefine the innodb_encrypt_log format 2017-02-15 08:07:20 +02:00
os Bug #24711351 64 BIT WINDOWS MYSQLD BUILD REPORTS INNODB: OPERATING SYSTEM ERROR NUMBER 995 2017-04-26 23:03:29 +03:00
page MDEV-12488 Remove type mismatch in InnoDB printf-like calls 2017-04-21 18:03:15 +03:00
pars Remove unused tokens from the InnoDB SQL parser. 2017-04-17 03:20:34 +03:00
que MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
read Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
rem Bug#23044098 INSERT OF GIS DATA INTO RTREE HITS ASSERT IN RTR_CUR_RESTORE_POSITION_FUNC() 2017-04-26 23:03:30 +03:00
row BUG#25082593 FOREIGN KEY VALIDATION DOESN'T NEED TO ACQUIRE GAP LOCK IN READ COMMITTED 2017-04-26 23:03:29 +03:00
srv Adapt the innodb_undo tests from MySQL 5.7 2017-04-26 23:03:28 +03:00
sync Bug#25048573: STD::MAP INSTANTIATIONS CAUSE STATIC ASSERT FAILURES ON FREEBSD 11 2017-04-26 23:03:29 +03:00
trx Adapt the innodb_undo tests from MySQL 5.7 2017-04-26 23:03:28 +03:00
usr MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
ut MDEV-12488 Remove type mismatch in InnoDB printf-like calls 2017-04-21 18:03:15 +03:00
bzip2.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
CMakeLists.txt cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
compile-innodb move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Google move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Percona move to storage/innobase 2015-05-04 19:17:21 +02:00
innodb.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
lz4.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
lzma.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
lzo.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00
plugin_exports Solaris compilation failure: xtradb is linked in statically, ha_innodb.so needs 2014-05-01 14:05:52 +02:00
snappy.cmake cleanup: innodb files in cmake/ 2017-03-29 00:40:22 +02:00