Bug #83681 Foreign key recreation in information_schema fails on slave replicated databases
Submitted: 3 Nov 2016 18:53 Modified: 11 Nov 2016 12:37
Reporter: Jan Novotný Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:8.0.0-dmr OS:Other (dokcer image mysql:8.0)
Assigned to: CPU Architecture:Any
Tags: replication foreign_keys foreign_key 8.0

[3 Nov 2016 18:53] Jan Novotný
Description:
When I set up a database for replication (Foreign keys were already created), the slave database succesfully updated itself, including all data etc. When I run SHOW TABLE CREATE <table>, I see the foreign keys there, but they are missing from information_schema. 

How to repeat:
set up master server, couple of tables, have foreign keys between them. Then replicate this database. I am not sure if this happened straight away, or after the first update on the master database in that table, or possible an ALTER TABLE command, adding a column to the table.
[4 Nov 2016 7:53] Gopal Shankar
By 'from information_schema' do you mean I_S.KEY_COLUMN_USAGE ?
if yes, then it could be same as http://bugs.mysql.com/bug.php?id=82961 ?
[4 Nov 2016 12:48] Jan Novotný
Hello Gopal,
it certainly seems to be related, however I don't have this issue on the master database - there it runs without problems.
[11 Nov 2016 12:37] MySQL Verification Team
Most likely duplicate of Bug #82961 as Gopal observed.
Please try the latest 8.0 build once it is released and report us back if you are still seeing this issue. Bug #82961 is fixed and here is the change log entry: Fixed as of the upcoming 8.0.0 release, and here's the changelog entry:

In some cases, INFORMATION_SCHEMA.KEY_COLUMN_USAGE did not report data
for all foreign key constraints.