]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
assume table.schema, not None, when constraint reflection has no explicit schema...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 5 Jan 2009 16:08:12 +0000 (16:08 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 5 Jan 2009 16:08:12 +0000 (16:08 +0000)
CHANGES
lib/sqlalchemy/databases/mysql.py

diff --git a/CHANGES b/CHANGES
index f26d70e412404502f4a376855a652db3ea8317bc..ebf0f75a2b46aef44aadb2a96fad7558c9a29b99 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -375,6 +375,9 @@ CHANGES
       
     - Fixed bug in exception raise when FK columns not present
       during reflection. [ticket:1241]
+    
+    - Fixed bug involving reflection of a remote-schema table with
+      a foreign key ref to another table in that schema.
       
 - associationproxy
     - The association proxy properties are make themselves available
index 1b977dce90e52345209e5ac3c3290c2a2d2845a4..045225c93e73d7f9449c88ff0177524111d45fc7 100644 (file)
@@ -2306,7 +2306,7 @@ class MySQLSchemaReflector(object):
         for spec in constraints:
             # only FOREIGN KEYs
             ref_name = spec['table'][-1]
-            ref_schema = len(spec['table']) > 1 and spec['table'][-2] or None
+            ref_schema = len(spec['table']) > 1 and spec['table'][-2] or table.schema
 
             if not ref_schema:
                 if default_schema is None: