From d44dfeeb243c0039346c7acfd98fc631aec2defd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 24 May 2026 15:20:49 -0400 Subject: [PATCH] cherry-pick changelog from 2.0.50 --- doc/build/changelog/changelog_20.rst | 112 +++++++++++++++++++- doc/build/changelog/unreleased_20/10528.rst | 12 --- doc/build/changelog/unreleased_20/13203.rst | 9 -- doc/build/changelog/unreleased_20/13229.rst | 8 -- doc/build/changelog/unreleased_20/13230.rst | 5 - doc/build/changelog/unreleased_20/13241.rst | 9 -- doc/build/changelog/unreleased_20/13243.rst | 13 --- doc/build/changelog/unreleased_20/13301.rst | 13 --- doc/build/changelog/unreleased_20/13306.rst | 11 -- doc/build/changelog/unreleased_20/13317.rst | 9 -- doc/build/changelog/unreleased_20/13319.rst | 11 -- 11 files changed, 111 insertions(+), 101 deletions(-) delete mode 100644 doc/build/changelog/unreleased_20/10528.rst delete mode 100644 doc/build/changelog/unreleased_20/13203.rst delete mode 100644 doc/build/changelog/unreleased_20/13229.rst delete mode 100644 doc/build/changelog/unreleased_20/13230.rst delete mode 100644 doc/build/changelog/unreleased_20/13241.rst delete mode 100644 doc/build/changelog/unreleased_20/13243.rst delete mode 100644 doc/build/changelog/unreleased_20/13301.rst delete mode 100644 doc/build/changelog/unreleased_20/13306.rst delete mode 100644 doc/build/changelog/unreleased_20/13317.rst delete mode 100644 doc/build/changelog/unreleased_20/13319.rst diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index 14a3889c54..26c6e17e7f 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -10,7 +10,117 @@ .. changelog:: :version: 2.0.50 - :include_notes_from: unreleased_20 + :released: May 24, 2026 + + .. change:: + :tags: bug, sql + :tickets: 10528 + + Fixed issue where floor division (``//``) between a :class:`.Float` or + :class:`.Numeric` numerator and an :class:`.Integer` denominator would omit + the ``FLOOR()`` SQL wrapper on dialects where + :attr:`.Dialect.div_is_floordiv` is ``True`` (the default, including + PostgreSQL and SQLite). ``FLOOR()`` is now applied if either the + denominator or the numerator is a non-integer, so that expressions such as + ``float_col // int_col`` render as ``FLOOR(float_col / int_col)`` instead + of the incorrect ``float_col / int_col``. Pull request courtesy r266-tech. + + .. change:: + :tags: bug, orm + :tickets: 13203 + + Fixed issue where using :func:`_orm.joinedload` with + :meth:`.PropComparator.of_type` targeting a joined-table subclass combined + with :meth:`.PropComparator.and_` referencing a column on that subclass + would generate invalid SQL, where the subclass column was not adapted to + the subquery alias. Pull request courtesy Joaquin Hui Gomez. + + .. change:: + :tags: postgresql, bug + :tickets: 13229 + + Improve handling of two phase transaction identifiers for PostgreSQL + when the identifier is provided by the user. + As part of this change the psycopg dialect was updated to use the DBAPI + two phase transaction API instead of executing the SQL directly. + + .. change:: + :tags: bug, sqlite + :tickets: 13230 + + Escape key and pragma values when utilizing the pysqlcipher dialect. + + .. change:: + :tags: bug, postgresql + :tickets: 13241 + + Fixed issue where the asyncpg driver could throw an insufficiently-handled + exception ``InternalClientError`` under some circumstances, leading to + connections not being properly marked as invalidated. + + + + .. change:: + :tags: bug, mysql, reflection + :tickets: 13243 + + Narrowed the scope of the internal workaround for MySQL bugs `#88718 + `_ and `#96365 + `_ so that it is only applied + where needed: MySQL 8.0.1 through 8.0.13 (where bug 88718 is present), and + on systems with ``lower_case_table_names=2`` (where bug 96365 applies, + typically macOS). Previously the workaround was applied unconditionally + for all MySQL 8.0+ versions, which caused a ``KeyError`` during foreign key + reflection when the database user lacked SELECT privileges on referred + tables. + + .. change:: + :tags: bug, orm + :tickets: 13301 + + Fixed issue where the presence of a :meth:`.SessionEvents.do_orm_execute` + event hook would cause internal execution options such as ``yield_per`` and + loader-specific state from the first ``orm_pre_session_exec`` pass to leak + into the second pass, leading to errors when using relationship loaders + such as :func:`.selectinload` and :func:`.immediateload`. The execution + options passed to the second compilation pass are now based on the original + options plus only the explicit updates made via + :meth:`.ORMExecuteState.update_execution_options` within the event hook. + + + .. change:: + :tags: bug, mysql + :tickets: 13306 + + Fixed issue in aiomysql and asyncmy dialects that appears as of using + pymysql 1.2.0; the dialects were not properly taking into account logic + that detects the argument signature of pymysql's ``ping()`` method which + was added as part of :ticket:`10492`. + + + + + .. change:: + :tags: bug, postgresql + :tickets: 13317 + + Fixed issue where the :class:`.ExcludeConstraint` construct did not + correctly forward the :paramref:`.ExcludeConstraint.info` parameter to + the superclass, causing user-defined metadata to be lost. Pull request + courtesy Wiktor Byrka. + + + .. change:: + :tags: bug, orm + :tickets: 13319 + + Fixed issue where using :func:`_orm.with_polymorphic` on a leaf class (a + subclass with no further descendants) or a non-inherited class would fail + with an ``AttributeError`` when used in an ORM statement, due to + :func:`_orm.configure_mappers` not being triggered implicitly. The fix + ensures that :class:`.AliasedInsp` participates in the ``_post_inspect`` + hook, triggering mapper configuration during ORM statement compilation. + .. changelog:: :version: 2.0.49 diff --git a/doc/build/changelog/unreleased_20/10528.rst b/doc/build/changelog/unreleased_20/10528.rst deleted file mode 100644 index db7000ea5e..0000000000 --- a/doc/build/changelog/unreleased_20/10528.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 10528 - - Fixed issue where floor division (``//``) between a :class:`.Float` or - :class:`.Numeric` numerator and an :class:`.Integer` denominator would omit - the ``FLOOR()`` SQL wrapper on dialects where - :attr:`.Dialect.div_is_floordiv` is ``True`` (the default, including - PostgreSQL and SQLite). ``FLOOR()`` is now applied if either the - denominator or the numerator is a non-integer, so that expressions such as - ``float_col // int_col`` render as ``FLOOR(float_col / int_col)`` instead - of the incorrect ``float_col / int_col``. Pull request courtesy r266-tech. diff --git a/doc/build/changelog/unreleased_20/13203.rst b/doc/build/changelog/unreleased_20/13203.rst deleted file mode 100644 index c2adc1076f..0000000000 --- a/doc/build/changelog/unreleased_20/13203.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 13203 - - Fixed issue where using :func:`_orm.joinedload` with - :meth:`.PropComparator.of_type` targeting a joined-table subclass combined - with :meth:`.PropComparator.and_` referencing a column on that subclass - would generate invalid SQL, where the subclass column was not adapted to - the subquery alias. Pull request courtesy Joaquin Hui Gomez. diff --git a/doc/build/changelog/unreleased_20/13229.rst b/doc/build/changelog/unreleased_20/13229.rst deleted file mode 100644 index e02886bed0..0000000000 --- a/doc/build/changelog/unreleased_20/13229.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: postgresql, bug - :tickets: 13229 - - Improve handling of two phase transaction identifiers for PostgreSQL - when the identifier is provided by the user. - As part of this change the psycopg dialect was updated to use the DBAPI - two phase transaction API instead of executing the SQL directly. diff --git a/doc/build/changelog/unreleased_20/13230.rst b/doc/build/changelog/unreleased_20/13230.rst deleted file mode 100644 index a9cb60e670..0000000000 --- a/doc/build/changelog/unreleased_20/13230.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. change:: - :tags: bug, sqlite - :tickets: 13230 - - Escape key and pragma values when utilizing the pysqlcipher dialect. diff --git a/doc/build/changelog/unreleased_20/13241.rst b/doc/build/changelog/unreleased_20/13241.rst deleted file mode 100644 index 3b129450d2..0000000000 --- a/doc/build/changelog/unreleased_20/13241.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 13241 - - Fixed issue where the asyncpg driver could throw an insufficiently-handled - exception ``InternalClientError`` under some circumstances, leading to - connections not being properly marked as invalidated. - - diff --git a/doc/build/changelog/unreleased_20/13243.rst b/doc/build/changelog/unreleased_20/13243.rst deleted file mode 100644 index 2a19b9e474..0000000000 --- a/doc/build/changelog/unreleased_20/13243.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. change:: - :tags: bug, mysql, reflection - :tickets: 13243 - - Narrowed the scope of the internal workaround for MySQL bugs `#88718 - `_ and `#96365 - `_ so that it is only applied - where needed: MySQL 8.0.1 through 8.0.13 (where bug 88718 is present), and - on systems with ``lower_case_table_names=2`` (where bug 96365 applies, - typically macOS). Previously the workaround was applied unconditionally - for all MySQL 8.0+ versions, which caused a ``KeyError`` during foreign key - reflection when the database user lacked SELECT privileges on referred - tables. diff --git a/doc/build/changelog/unreleased_20/13301.rst b/doc/build/changelog/unreleased_20/13301.rst deleted file mode 100644 index d4fd2d4d04..0000000000 --- a/doc/build/changelog/unreleased_20/13301.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 13301 - - Fixed issue where the presence of a :meth:`.SessionEvents.do_orm_execute` - event hook would cause internal execution options such as ``yield_per`` and - loader-specific state from the first ``orm_pre_session_exec`` pass to leak - into the second pass, leading to errors when using relationship loaders - such as :func:`.selectinload` and :func:`.immediateload`. The execution - options passed to the second compilation pass are now based on the original - options plus only the explicit updates made via - :meth:`.ORMExecuteState.update_execution_options` within the event hook. - diff --git a/doc/build/changelog/unreleased_20/13306.rst b/doc/build/changelog/unreleased_20/13306.rst deleted file mode 100644 index 8537baab41..0000000000 --- a/doc/build/changelog/unreleased_20/13306.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, mysql - :tickets: 13306 - - Fixed issue in aiomysql and asyncmy dialects that appears as of using - pymysql 1.2.0; the dialects were not properly taking into account logic - that detects the argument signature of pymysql's ``ping()`` method which - was added as part of :ticket:`10492`. - - - diff --git a/doc/build/changelog/unreleased_20/13317.rst b/doc/build/changelog/unreleased_20/13317.rst deleted file mode 100644 index 8000af1f8b..0000000000 --- a/doc/build/changelog/unreleased_20/13317.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 13317 - - Fixed issue where the :class:`.ExcludeConstraint` construct did not - correctly forward the :paramref:`.ExcludeConstraint.info` parameter to - the superclass, causing user-defined metadata to be lost. Pull request - courtesy Wiktor Byrka. - diff --git a/doc/build/changelog/unreleased_20/13319.rst b/doc/build/changelog/unreleased_20/13319.rst deleted file mode 100644 index 76b8b4c4e0..0000000000 --- a/doc/build/changelog/unreleased_20/13319.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 13319 - - Fixed issue where using :func:`_orm.with_polymorphic` on a leaf class (a - subclass with no further descendants) or a non-inherited class would fail - with an ``AttributeError`` when used in an ORM statement, due to - :func:`_orm.configure_mappers` not being triggered implicitly. The fix - ensures that :class:`.AliasedInsp` participates in the ``_post_inspect`` - hook, triggering mapper configuration during ORM statement compilation. - -- 2.47.3