2.0.51
Released: June 15, 2026
orm
-
[orm] [bug] Fixed issue where
_orm.subqueryload()combined withPropComparator.of_type()andPropComparator.and_()would silently drop the additional filter criteria, causing all related objects to be loaded instead of only those matching the filter. TheLoaderCriteriaOptionwas being constructed against the base entity rather than the effective entity indicated byPropComparator.of_type(). Pull request courtesy Arya Rizky.References: #13207
-
[orm] [bug] Fixed bug where a failure during
tpc_prepare()within_orm.Session.commit()for a two-phase session would raiseIllegalStateChangeErrorinstead of the original database exception. The internal_prepare_impl()method's error handler was unable to invoke_orm.SessionTransaction.rollback()due to a state-change guard, preventing proper cleanup and masking the underlying error.References: #13356
engine
-
[engine] [bug] Fixed issue where
Result.freeze()would lose track of ambiguous column names present in the originalCursorResult, causing key-based access on the thawed result to silently return a value instead of raisingInvalidRequestError. TheSimpleResultMetaDatanow accepts and propagates ambiguous key information so that frozen, thawed, and pickled results raise consistently for duplicate column names. Pull request courtesy Saurabh Kohli.References: #9427
sql
-
[sql] [bug] Fixed issue where
_sql.StatementLambdaElementwould 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.References: #10827
postgresql
-
[postgresql] [bug] Repaired bug introduced in #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.References: #13355
-
[postgresql] [bug] Fixed regular expression in the pure Python hstore result processor, used when
use_native_hstore=Falseis set, which could hang on malformed hstore text containing unterminated quoted segments with backslashes. Pull request courtesy dxbjavid.References: #13370