From: Mike Bayer Date: Mon, 15 Jun 2026 15:41:37 +0000 (-0400) Subject: cherry-pick changelog from 2.0.51 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d33bd476656e6bbb2f67884fac0871471398eb8e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git cherry-pick changelog from 2.0.51 --- diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index 8f5ff87073..aa76cd9f08 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -10,7 +10,71 @@ .. changelog:: :version: 2.0.51 - :include_notes_from: unreleased_20 + :released: June 15, 2026 + + .. change:: + :tags: bug, sql + :tickets: 10827 + + Fixed issue where :class:`_sql.StatementLambdaElement` would proxy + attribute access through the cached "expected" expression rather than the + resolved expression, causing stale closure-bound parameter values to be + used when a lambda statement was extended with non-lambda criteria such as + an additional ``.where()`` clause. Courtesy cjc0013. + + .. change:: + :tags: bug, orm + :tickets: 13207 + + Fixed issue where :func:`_orm.subqueryload` combined with + :meth:`.PropComparator.of_type` and :meth:`.PropComparator.and_` would + silently drop the additional filter criteria, causing all related objects + to be loaded instead of only those matching the filter. The + :class:`.LoaderCriteriaOption` was being constructed against the base + entity rather than the effective entity indicated by + :meth:`.PropComparator.of_type`. Pull request courtesy Arya Rizky. + + .. change:: + :tags: bug, postgresql + :tickets: 13355 + + Repaired bug introduced in :ticket:`13229` where a two-phase + transaction recovery would not return the correct transaction + identifier when generating the identifiers using the ``xid()`` + method of the psycopg connection. + + .. change:: + :tags: bug, orm + :tickets: 13356 + + Fixed bug where a failure during ``tpc_prepare()`` within + :meth:`_orm.Session.commit` for a two-phase session would raise + :class:`.IllegalStateChangeError` instead of the original database + exception. The internal ``_prepare_impl()`` method's error handler + was unable to invoke :meth:`_orm.SessionTransaction.rollback` due + to a state-change guard, preventing proper cleanup and masking the + underlying error. + + .. change:: + :tags: bug, postgresql + :tickets: 13370 + + Fixed regular expression in the pure Python hstore result processor, + used when ``use_native_hstore=False`` is set, which could hang on + malformed hstore text containing unterminated quoted segments with + backslashes. Pull request courtesy dxbjavid. + + .. change:: + :tags: bug, engine + :tickets: 9427 + + Fixed issue where :meth:`.Result.freeze` would lose track of ambiguous + column names present in the original :class:`.CursorResult`, causing + key-based access on the thawed result to silently return a value instead of + raising :class:`.InvalidRequestError`. The + :class:`.SimpleResultMetaData` now accepts and propagates ambiguous key + information so that frozen, thawed, and pickled results raise consistently + for duplicate column names. Pull request courtesy Saurabh Kohli. .. changelog:: :version: 2.0.50 diff --git a/doc/build/changelog/unreleased_20/10827.rst b/doc/build/changelog/unreleased_20/10827.rst deleted file mode 100644 index 879fa1dd1d..0000000000 --- a/doc/build/changelog/unreleased_20/10827.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 10827 - - Fixed issue where :class:`_sql.StatementLambdaElement` would proxy - attribute access through the cached "expected" expression rather than the - resolved expression, causing stale closure-bound parameter values to be - used when a lambda statement was extended with non-lambda criteria such as - an additional ``.where()`` clause. Courtesy cjc0013. diff --git a/doc/build/changelog/unreleased_20/13207.rst b/doc/build/changelog/unreleased_20/13207.rst deleted file mode 100644 index c7b8580db3..0000000000 --- a/doc/build/changelog/unreleased_20/13207.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 13207 - - Fixed issue where :func:`_orm.subqueryload` combined with - :meth:`.PropComparator.of_type` and :meth:`.PropComparator.and_` would - silently drop the additional filter criteria, causing all related objects - to be loaded instead of only those matching the filter. The - :class:`.LoaderCriteriaOption` was being constructed against the base - entity rather than the effective entity indicated by - :meth:`.PropComparator.of_type`. Pull request courtesy Arya Rizky. diff --git a/doc/build/changelog/unreleased_20/13355.rst b/doc/build/changelog/unreleased_20/13355.rst deleted file mode 100644 index cad4508ef0..0000000000 --- a/doc/build/changelog/unreleased_20/13355.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 13355 - - Repaired bug introduced in :ticket:`13229` where a two-phase - transaction recovery would not return the correct transaction - identifier when generating the identifiers using the ``xid()`` - method of the psycopg connection. diff --git a/doc/build/changelog/unreleased_20/13356.rst b/doc/build/changelog/unreleased_20/13356.rst deleted file mode 100644 index 047d36fe67..0000000000 --- a/doc/build/changelog/unreleased_20/13356.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 13356 - - Fixed bug where a failure during ``tpc_prepare()`` within - :meth:`_orm.Session.commit` for a two-phase session would raise - :class:`.IllegalStateChangeError` instead of the original database - exception. The internal ``_prepare_impl()`` method's error handler - was unable to invoke :meth:`_orm.SessionTransaction.rollback` due - to a state-change guard, preventing proper cleanup and masking the - underlying error. diff --git a/doc/build/changelog/unreleased_20/13370.rst b/doc/build/changelog/unreleased_20/13370.rst deleted file mode 100644 index 26e8945b64..0000000000 --- a/doc/build/changelog/unreleased_20/13370.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 13370 - - Fixed regular expression in the pure Python hstore result processor, - used when ``use_native_hstore=False`` is set, which could hang on - malformed hstore text containing unterminated quoted segments with - backslashes. Pull request courtesy dxbjavid. diff --git a/doc/build/changelog/unreleased_20/9427.rst b/doc/build/changelog/unreleased_20/9427.rst deleted file mode 100644 index a601fe9977..0000000000 --- a/doc/build/changelog/unreleased_20/9427.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, engine - :tickets: 9427 - - Fixed issue where :meth:`.Result.freeze` would lose track of ambiguous - column names present in the original :class:`.CursorResult`, causing - key-based access on the thawed result to silently return a value instead of - raising :class:`.InvalidRequestError`. The - :class:`.SimpleResultMetaData` now accepts and propagates ambiguous key - information so that frozen, thawed, and pickled results raise consistently - for duplicate column names. Pull request courtesy Saurabh Kohli.