]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
pass executemany context to _repr_params
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Oct 2019 17:55:19 +0000 (13:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Oct 2019 15:11:53 +0000 (11:11 -0400)
commitd5d88e3c6ee50213d01de9d22c969ac7db5d1314
tree807cff2f040d51927678844a70e3b4664455f905
parent3787de9d6b9f930f4eb8d222d5a6ca69350e35d8
pass executemany context to _repr_params

Fixed bug where parameter repr as used in logging and error reporting needs
additional context in order to distinguish between a list of parameters for
a single statement and a list of parameter lists, as the "list of lists"
structure could also indicate a single parameter list where the first
parameter itself is a list, such as for an array parameter.   The
engine/connection now passes in an additional boolean indicating how the
parameters should be considered.  The only SQLAlchemy backend that expects
arrays as parameters is that of  psycopg2 which uses pyformat parameters,
so this issue has not been too apparent, however as other drivers that use
positional gain more features it is important that this be supported. It
also eliminates the need for the parameter repr function to guess based on
the parameter structure passed.

Fixes: #4902
Change-Id: I086246ee0eb51484adbefd83e07295fa56576c5f
(cherry picked from commit 9488480abea15298ded6996aa13b42edf134e467)
doc/build/changelog/unreleased_13/4902.rst [new file with mode: 0644]
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/testing/__init__.py
lib/sqlalchemy/testing/assertions.py
test/base/test_except.py
test/engine/test_logging.py