diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-30 18:23:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-30 18:23:21 -0400 |
commit | 502152de2a77d213489d9652f1779dffde1e6d7b (patch) | |
tree | 4c0fb75fb93775e83fc8b9b103ea85b3cc730dc5 /lib/sqlalchemy/engine | |
parent | 061d5cfab13c1e9e5546248ea48178cafbebb7a5 (diff) | |
download | sqlalchemy-502152de2a77d213489d9652f1779dffde1e6d7b.tar.gz |
mssql: - [bug] Fixed bug where reflection of primary key constraint
would double up columns if the same constraint/table
existed in multiple schemas.
- force returns_rows to False for inserts where we know rows shouldnt be returned;
allows post_exec() to use the cursor without issue
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/engine/result.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index e8b22fdc6..05ca0f980 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -882,8 +882,10 @@ class Connection(Connectable): if context._is_implicit_returning: context._fetch_implicit_returning(result) result.close(_autoclose_connection=False) + result._metadata = None elif not context._is_explicit_returning: result.close(_autoclose_connection=False) + result._metadata = None elif result._metadata is None: # no results, get rowcount # (which requires open cursor on some drivers diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py index a9bb248b3..bf6410f15 100644 --- a/lib/sqlalchemy/engine/result.py +++ b/lib/sqlalchemy/engine/result.py @@ -369,6 +369,7 @@ class ResultProxy(object): _process_row = RowProxy out_parameters = None _can_close_connection = False + _metadata = None def __init__(self, context): self.context = context @@ -382,9 +383,7 @@ class ResultProxy(object): def _init_metadata(self): metadata = self._cursor_description() - if metadata is None: - self._metadata = None - else: + if metadata is not None: self._metadata = ResultMetaData(self, metadata) def keys(self): |