So im attempting to get a list of table and any foreign constraints that exist on them for the sake of attempting some automated mariabackup restores in python. im running the following query:
SELECT a.TABLE_NAME, b.CONSTRAINT_NAME from information_schema.tables a
LEFT JOIN information_schema.table_constraints b
ON a.table_name = b.table_name
WHERE a.table_schema = 'world'
AND b.constraint_type = 'FOREIGN KEY';
My "world" test table, has 3 columns on it - Country (No FK's), CountryLanguage (one fk) and City (one FK). With the above query i'd be expecting 3 tables, 2 returning the FK name and 1 null however the return i get is only the 2 tables with the FK's on them.
I'm sure im missing something but cant quite pin it.