Commits

Mike Bayer committed ab4243b

assume table.schema, not None, when constraint reflection has no explicit schema. unit test TBD.

Comments (0)

Files changed (2)

       
     - 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

lib/sqlalchemy/databases/mysql.py

         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: