Well, great. I just realized that the command in the metadata is not correct, and INFORMATION_SCHEMA.KEY_COLUMN_USAGE should be used.
So I changed Imported keys and Exported keys, was about to come to ask if I should check them in, and... :)
Well, I forgot to subscribe to the topic so I wasn't informed about the message...
Edit: I think it won't throw an exception but data won't be returned. If I run the command SHOW TABLE STATUS FROM xxx on MySQL 8, the "Comment" field is always null which would be needed for key extraction.
The query I ended up using was
Code: Select all
SELECT CONSTRAINT_CATALOG, REFERENCED_TABLE_SCHEMA, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
Can you please check if this can be executed on earlier versions? If no, we have to make a split according to version number as the old query is not suitable for newer versions for sure.