Skip to content

Commit cc97dad

Browse files
committed
Move supports_sane_rowcount_returning = False to dialect level
Fixes: sqlalchemy#5321 Change-Id: Id83e98e9013818424c133297a850746302633158
1 parent 5311a85 commit cc97dad

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. change::
2+
:tags: change, mssql
3+
:tickets: 5321
4+
5+
Moved the ``supports_sane_rowcount_returning = False`` requirement from
6+
the ``PyODBCConnector`` level to the ``MSDialect_pyodbc`` since pyodbc
7+
does work properly in some circumstances.

lib/sqlalchemy/connectors/pyodbc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
class PyODBCConnector(Connector):
1515
driver = "pyodbc"
1616

17-
supports_sane_rowcount_returning = False
17+
# this is no longer False for pyodbc in general
18+
supports_sane_rowcount_returning = True
1819
supports_sane_multi_rowcount = False
1920

2021
supports_unicode_statements = True

lib/sqlalchemy/dialects/mssql/pyodbc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ def post_exec(self):
314314

315315
class MSDialect_pyodbc(PyODBCConnector, MSDialect):
316316

317+
# mssql still has problems with this on Linux
318+
supports_sane_rowcount_returning = False
319+
317320
execution_ctx_cls = MSExecutionContext_pyodbc
318321

319322
colspecs = util.update_copy(

0 commit comments

Comments
 (0)