summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-01-05 10:25:36 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-01-05 10:25:36 -0500
commit197ffa2be2cadce3df8bfb0799b3c80158250286 (patch)
treea67320139e3ae72014a71bdd56396660408a4b12 /lib/sqlalchemy/sql/compiler.py
parent04b1a52783a38148e52d50566161bdaf5262cd43 (diff)
downloadsqlalchemy-197ffa2be2cadce3df8bfb0799b3c80158250286.tar.gz
- Fixed 1.0 regression where the eager fetch of cursor.rowcount was
no longer called for an UPDATE or DELETE statement emitted via plain text or via the :func:`.text` construct, affecting those drivers that erase cursor.rowcount once the cursor is closed such as SQL Server ODBC and Firebird drivers. fixes #3622
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 6766c99b7..2ca549267 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -286,6 +286,7 @@ class _CompileLabel(visitors.Visitable):
def self_group(self, **kw):
return self
+
class SQLCompiler(Compiled):
"""Default implementation of Compiled.
@@ -305,6 +306,8 @@ class SQLCompiler(Compiled):
INSERT/UPDATE/DELETE
"""
+ isplaintext = False
+
returning = None
"""holds the "returning" collection of columns if
the statement is CRUD and defines returning columns
@@ -688,6 +691,9 @@ class SQLCompiler(Compiled):
else:
return self.bindparam_string(name, **kw)
+ if not self.stack:
+ self.isplaintext = True
+
# un-escape any \:params
return BIND_PARAMS_ESC.sub(
lambda m: m.group(1),