]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure escaping of percent signs in columns, parameters
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Oct 2020 15:39:56 +0000 (11:39 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Oct 2020 17:15:57 +0000 (13:15 -0400)
commit296c84313ab29bf9599634f38caaf7dd092e4e23
treec354411cbb809544a9d471afbf35571e61886ded
parent3179f70408cb91c7586fc2021959efb5b2fe9f0e
Ensure escaping of percent signs in columns, parameters

Improved support for column names that contain percent signs in the string,
including repaired issues involving anoymous labels that also embedded a
column name with a percent sign in it, as well as re-established support
for bound parameter names with percent signs embedded on the psycopg2
dialect, using a late-escaping process similar to that used by the
cx_Oracle dialect.

* Added new constructor for _anonymous_label() that ensures incoming
  string tokens based on column or table names will have percent
  signs escaped; abstracts away the format of the label.

* generalized cx_Oracle's quoted_bind_names facility into the compiler
  itself, and leveraged this for the psycopg2 dialect's issue with
  percent signs in names as well.  the parameter substitution is now
  integrated with compiler.construct_parameters() as well as the
  recently reworked set_input_sizes(), reducing verbosity in the
  cx_Oracle dialect.

Fixes: #5653
Change-Id: Ia2ad13ea68b4b0558d410026e5a33f5cb3fbab2c
doc/build/changelog/unreleased_14/5653.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/selectable.py
test/requirements.py
test/sql/test_compiler.py
test/sql/test_selectable.py