2.0.50
Released: May 24, 2026
orm
-
[orm] [bug] Fixed issue where using
_orm.joinedload()withPropComparator.of_type()targeting a joined-table subclass combined withPropComparator.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.References: #13203
-
[orm] [bug] Fixed issue where the presence of a
SessionEvents.do_orm_execute()event hook would cause internal execution options such asyield_perand loader-specific state from the firstorm_pre_session_execpass to leak into the second pass, leading to errors when using relationship loaders such asselectinload()andimmediateload(). The execution options passed to the second compilation pass are now based on the original options plus only the explicit updates made viaORMExecuteState.update_execution_options()within the event hook.References: #13301
-
[orm] [bug] Fixed issue where using
_orm.with_polymorphic()on a leaf class (a subclass with no further descendants) or a non-inherited class would fail with anAttributeErrorwhen used in an ORM statement, due to_orm.configure_mappers()not being triggered implicitly. The fix ensures thatAliasedInspparticipates in the_post_inspecthook, triggering mapper configuration during ORM statement compilation.References: #13319
sql
-
[sql] [bug] Fixed issue where floor division (
//) between aFloatorNumericnumerator and anIntegerdenominator would omit theFLOOR()SQL wrapper on dialects whereDialect.div_is_floordivisTrue(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 asfloat_col // int_colrender asFLOOR(float_col / int_col)instead of the incorrectfloat_col / int_col. Pull request courtesy r266-tech.References: #10528
postgresql
-
[postgresql] [bug] 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.
References: #13229
-
[postgresql] [bug] Fixed issue where the asyncpg driver could throw an insufficiently-handled exception
InternalClientErrorunder some circumstances, leading to connections not being properly marked as invalidated.References: #13241
-
[postgresql] [bug] Fixed issue where the
ExcludeConstraintconstruct did not correctly forward theExcludeConstraint.infoparameter to the superclass, causing user-defined metadata to be lost. Pull request courtesy Wiktor Byrka.References: #13317
mysql
-
[mysql] [bug] [reflection] 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 aKeyErrorduring foreign key reflection when the database user lacked SELECT privileges on referred tables.References: #13243
-
[mysql] [bug] 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 #10492.References: #13306
sqlite
-
[sqlite] [bug] Escape key and pragma values when utilizing the pysqlcipher dialect.
References: #13230