summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-05-18 11:07:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-05-18 11:43:38 -0400
commitc124fa36d5af2c85c87c51d24e92387adffbe3d2 (patch)
treee065a4fedb2f79a0d7f5267a91fa5e789befeb8b /lib/sqlalchemy/engine
parentfb45433f1504978c63a1318a0dc616d79cfff04d (diff)
downloadsqlalchemy-c124fa36d5af2c85c87c51d24e92387adffbe3d2.tar.gz
Support "blank" schema when MetaData.schema is set
Previously, it was impossible to have a Table that has None for a schema name when the "schema" parameter on MetaData was set. A new symbol sqlalchemy.schema.BLANK_SCHEMA is added which indicates that the schema name should unconditionally be set to None. In particular, this value must be passed within cross-schema foreign key reflection, so that a Table which is in the "default" schema can be represented properly. Fixes: #3716 Change-Id: I3d24f99c22cded206c5379fd32a225e74edb7a8e
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/reflection.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index eaa5e2e48..2d524978d 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -693,6 +693,7 @@ class Inspector(object):
else:
sa_schema.Table(referred_table, table.metadata, autoload=True,
autoload_with=self.bind,
+ schema=sa_schema.BLANK_SCHEMA,
**reflection_options
)
for column in referred_columns: