MacLochlainns Weblog

Michael McLaughlin's Technical Blog

Site Admin

MySQL 8+ Catalog

without comments

I was working through some tutorials for my students and noticed that there was a change in how a WHERE clause must be written against the information_schema.table_constraints table. It might have been made in an earlier release, I actually hadn’t checked it since 2014 when I wrote this early post on capturing MySQL Foreign Keys.

You could use the following WHERE case insensitive clause:

WHERE    tc.constraint_type = 'foreign key'

Now, you must use a case sensitive WHERE clause:

WHERE    tc.constraint_type = 'FOREIGN KEY'

I’d love to know why but I can’t seem to find a note on the change. As always, I hope this helps those looking for an answer.

Written by maclochlainn

November 30th, 2021 at 11:06 pm

Posted in MySQL,MySQL 8,sql