]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Turn off pyodbc setinputsizes() by default
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Mar 2021 15:23:07 +0000 (11:23 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Mar 2021 17:03:17 +0000 (13:03 -0400)
commit8945b82f5261b2c815634d33c78608252ddbd878
tree7d2a5ecac26ab9bf19103ed3542cd1caa448e634
parentfb9099d8c4b0bca350d1a88e22fcfb6a8f2d079d
Turn off pyodbc setinputsizes() by default

Fixed regression where a new setinputsizes() API that's available for
pyodbc was enabled, which is apparently incompatible with pyodbc's
fast_executemany() mode in the absence of more accurate typing information,
which as of yet is not fully implemented or tested. The pyodbc dialect and
connector has been modified so that setinputsizes() is not used at all
unless the parameter ``use_setinputsizes`` is passed to the dialect, e.g.
via :func:`_sa.create_engine`, at which point its behavior can be
customized using the :meth:`.DialectEvents.do_setinputsizes` hook.

Fixes: #6058
Change-Id: I99c2be3a5cd76fc3e490d10865292ed85ffc23ae
doc/build/changelog/unreleased_14/6058.rst [new file with mode: 0644]
lib/sqlalchemy/connectors/pyodbc.py
lib/sqlalchemy/dialects/mssql/pyodbc.py
lib/sqlalchemy/engine/events.py
test/dialect/mssql/test_engine.py