]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Generalize SQLite paren counting to fix PG CHECK constraint parsing
authorLeSingh1 <sshaurya914@gmail.com>
Mon, 20 Jul 2026 17:14:38 +0000 (13:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Aug 2026 19:20:54 +0000 (15:20 -0400)
commitebb7993232721731c37e472c8ec42f9f40f19a6f
tree46ccc52c69715e1fa08f809e648f6e1ac179d552
parent5995834ee06fc5cae45f86992d778fd5357c08ee
Generalize SQLite paren counting to fix PG CHECK constraint parsing

Fixed reflection of PostgreSQL CHECK constraints where an expression made
up of multiple parenthesized sub-expressions, such as ``(x IS NULL OR y IS
NULL) AND (x IS NULL OR y IS NULL)``, would have its leading and trailing
parentheses incorrectly stripped, producing an unbalanced and
syntactically invalid reflected expression.  Pull request courtesy
Shaurya Singh.

Fixes #13157
Closes: #13303
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13303
Pull-request-sha: 79bb5f3855ab434d9110864bc467bda66de08a2c

Change-Id: I8312a82527b39aeade731fa358cf7d1959e32427
doc/build/changelog/unreleased_20/13157.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/langhelpers.py
test/base/test_utils.py