Code

Ticket #2700: table_schema.diff

File table_schema.diff, 620 bytes (added by serbaut@…, 8 years ago)
Line 
1Index: introspection.py
2===================================================================
3--- introspection.py    (revision 3745)
4+++ introspection.py    (working copy)
5@@ -35,7 +35,7 @@
6         cursor.execute("""
7             SELECT column_name, referenced_table_name, referenced_column_name
8             FROM information_schema.key_column_usage
9-            WHERE table_name = %s
10+            WHERE table_name = %s AND table_schema = DATABASE()
11                 AND referenced_table_name IS NOT NULL
12                 AND referenced_column_name IS NOT NULL""", [table_name])
13         constraints.extend(cursor.fetchall())