Skip to content

Releases

2.1.9

Choose a tag to compare

@sqlalchemy-bot sqlalchemy-bot released this 16 Nov 20:50

2.1.9

Released: November 16, 2026

orm

  • [orm] [bug] Fixed issue where deleting the parent object of a one-to-many
    relationship configured with _orm.relationship.post_update,
    such as the one-to-many side of a bidirectional post_update
    relationship, would emit the UPDATE that sets the foreign key of the
    remaining related objects to NULL twice: once within the regular UPDATE
    for those objects and again as the post-update. Only the post-update
    UPDATE is now emitted, and it is explicitly ordered to run before the
    DELETE of the parent row. Fix approach courtesy 18Abhinav07, with
    thanks to canblmz1 for the initial analysis.

    This change is also backported to: 2.0.58

    References: #10936

  • [orm] [bug] Fixed issue where criteria applied to a relationship using
    PropComparator.and_() within _orm.selectinload() or
    _orm.lazyload(), where the criteria referred to an
    _orm.aliased() construct against a subquery that's also the parent
    entity of the loader option, would load the related collection using
    the bound parameter values within that subquery from the first
    execution of the statement, once the statement was retrieved from the
    compiled cache.

    This change is also backported to: 2.0.58

    References: #13766

  • [orm] [bug] Fixed issue where loader options nested beneath a
    _orm.selectin_polymorphic() option, such as a
    _orm.selectinload() for a subclass-specific relationship, would be
    silently skipped when the enclosing relationship load was against an
    aliased entity such as one produced by _orm.with_polymorphic(), and
    a structurally different parent statement using the same loader options
    had been executed and cached previously. The selectin polymorphic loader
    now uses options from the cached statement in the same way as the
    selectin relationship loader already does.

    This change is also backported to: 2.0.58

    References: #13777

  • [orm] [bug] Fixed issue where loader options nested beneath a
    _orm.subqueryload() option against an aliased entity, such as
    subqueryload(A.bs.of_type(aliased(B))), would be silently skipped
    when the statement was served from the compiled cache and was
    constructed using a new _orm.aliased() or
    _orm.with_polymorphic() object, as is typical when the statement
    is built within a function. Nested options such as
    _orm.load_only(), _orm.undefer() and
    _orm.selectinload() took effect only the first time the statement
    was run. The subquery loader now uses options from the cached statement
    in the same way as the selectin relationship loader.

    This change is also backported to: 2.0.58

    References: #13779

  • [orm] [bug] Fixed issue where a subclass configured with
    _orm.Mapper.polymorphic_load set to "selectin" would
    cause a statement to raise ArgumentError when the statement
    selected from an _orm.aliased() or _orm.with_polymorphic()
    construct against the base class, or included another entity, along with
    loader options such as _orm.undefer() or _orm.selectinload()
    against that construct or entity. The automatic load of the subclass
    now leaves out loader options that refer to other entities, which were
    already applied by the enclosing statement.

    This change is also backported to: 2.0.58

    References: #13780

  • [orm] [bug] Fixed issue where joined eager loading that wraps the statement in a
    subquery, as occurs with LIMIT, OFFSET or DISTINCT, would populate
    joined inheritance subclass objects loaded by the main entity with column
    values from another row, when the statement also joined to an
    _orm.aliased() construct of that same subclass and referred to its
    columns, such as in ORDER BY.

    This change is also backported to: 2.0.58

    References: #13798

  • [orm] [bug] [regression] Fixed regression caused by #11226 where a relationship to an
    aliased class against a correlated LATERAL subquery, when loaded with
    _orm.joinedload() in a query that includes DISTINCT or GROUP BY,
    would render the LATERAL without its correlation, returning incorrect
    rows. The correlated elements within the LATERAL are now adapted along
    with the rest of the eager join when the query is wrapped in a subquery.

    References: #13783

  • [orm] [bug] Fixed issue where a relationship to an aliased class against a correlated
    LATERAL subquery would render the LATERAL without its correlation,
    returning incorrect rows, when loaded with _orm.selectinload(),
    _orm.subqueryload(), _orm.lazyload() or
    _orm.immediateload(), or when joined or joined eager loaded from an
    _orm.aliased() parent. The correlated elements within the LATERAL
    are now adapted to the parent in each of these cases.

    References: #13786

  • [orm] [bug] [regression] Fixed regression caused by #13748 where an ORM mapped dataclass
    that included a column using _orm.orm_insert_sentinel(), or a
    _orm.mapped_column() given a ColumnDefault or
    Sequence object for _orm.mapped_column.default,
    would fail to flush, as the default object itself would be delivered to
    the INSERT statement as a parameter value. These objects now apply to
    the Column only, and are no longer used as the Python-side
    default value of the attribute, which now remains None until the
    object is flushed.

    References: #13788

engine

  • [engine] [performance] Improved the performance of _engine.Result.mappings() and
    _asyncio.AsyncResult.mappings() when the Cython extensions are in
    use. The conversion of each _engine.Row into a
    _engine.RowMapping is now performed within the compiled
    extension, rather than through a Python-level access of the
    _engine.Row._mapping attribute, substantially reducing per-row
    overhead when fetching rows as mappings.

    References: #13769

  • [engine] [bug] Fixed issue in _engine.URL.update_query_pairs() where a key that
    was repeated with a sequence of strings as its value would produce a
    nested tuple in _engine.URL.query, causing the URL to fail to
    render as a string. Passing a sequence of strings as a value, which was
    indicated by the type annotations but not documented, is now documented,
    and the annotations for _engine.URL.update_query_pairs() and
    _engine.URL.update_query_dict() are corrected to accept any
    sequence of strings rather than only a list.

    This change is also backported to: 2.0.58

    References: #13770

sql

  • [sql] [bug] Fixed issue in cache key generation where calling
    _sql.Select.correlate() or _sql.Select.correlate_except()
    with None would not change the cache key of the _sql.Select,
    so that a statement which disables correlation, or correlates all FROM
    objects to enclosing SELECTs, could share a cached SQL string with an
    otherwise identical statement using the default auto-correlation
    behavior, leading to incorrect SQL being emitted for whichever statement
    was executed second.

    This change is also backported to: 2.0.58

    References: #13767

  • [sql] [bug] Fixed issue where a _sql.select() that refers to a CTE
    only within _sql.Select.select_from(), as the left side of
    _sql.Select.join_from(), or within a join that was followed by
    _sql.Select.with_only_columns(), would not be copied correctly by
    _sql.Select.params() or visitors.cloned_traverse(), such that
    the new parameter values could be ignored when the statement was invoked
    using the compiled cache, with the original values used instead. On the
    2.1 series, where _sql.Select.params() no longer copies the
    statement, the issue still applies to visitors.cloned_traverse()
    and similar traversals.

    Also fixed a related issue where, if a traversal such as
    visitors.replacement_traverse() replaced the target of
    _sql.Select.join() or _sql.Select.join_from() with a
    Join, that join would render twice in the FROM clause of the
    resulting statement.

    This change is also backported to: 2.0.58

    References: #13791

  • [sql] [bug] Split the OperatorClass.COMPARISON into equality and ordering
    operators (OperatorClass.EQUALITY and
    OperatorClass.ORDERING).
    The types _postgresql.HSTORE and the type used
    by FunctionElement.table_valued() now have the
    OperatorClass.EQUALITY operator class.

    References: #13781

asyncio

  • [asyncio] [bug] The asyncio.CancelledError that occurs frequently for tasks cancelled
    under anyio, where the connection is nonetheless successfully terminated,
    is now logged by the connection pool at DEBUG level rather than ERROR.

    This change is also backported to: 2.0.58

    References: #13772

postgresql

  • [postgresql] [bug] Fixed issue w...
Read more

2.0.58

Choose a tag to compare

@sqlalchemy-bot sqlalchemy-bot released this 16 Nov 20:32

2.0.58

Released: November 16, 2026

orm

  • [orm] [bug] Fixed issue where deleting the parent object of a one-to-many
    relationship configured with _orm.relationship.post_update,
    such as the one-to-many side of a bidirectional post_update
    relationship, would emit the UPDATE that sets the foreign key of the
    remaining related objects to NULL twice: once within the regular UPDATE
    for those objects and again as the post-update. Only the post-update
    UPDATE is now emitted, and it is explicitly ordered to run before the
    DELETE of the parent row. Fix approach courtesy 18Abhinav07, with
    thanks to canblmz1 for the initial analysis.

    References: #10936

  • [orm] [bug] Fixed issue where criteria applied to a relationship using
    PropComparator.and_() within _orm.selectinload() or
    _orm.lazyload(), where the criteria referred to an
    _orm.aliased() construct against a subquery that's also the parent
    entity of the loader option, would load the related collection using
    the bound parameter values within that subquery from the first
    execution of the statement, once the statement was retrieved from the
    compiled cache.

    References: #13766

  • [orm] [bug] Fixed issue where loader options nested beneath a
    _orm.selectin_polymorphic() option, such as a
    _orm.selectinload() for a subclass-specific relationship, would be
    silently skipped when the enclosing relationship load was against an
    aliased entity such as one produced by _orm.with_polymorphic(), and
    a structurally different parent statement using the same loader options
    had been executed and cached previously. The selectin polymorphic loader
    now uses options from the cached statement in the same way as the
    selectin relationship loader already does.

    References: #13777

  • [orm] [bug] Fixed issue where loader options nested beneath a
    _orm.subqueryload() option against an aliased entity, such as
    subqueryload(A.bs.of_type(aliased(B))), would be silently skipped
    when the statement was served from the compiled cache and was
    constructed using a new _orm.aliased() or
    _orm.with_polymorphic() object, as is typical when the statement
    is built within a function. Nested options such as
    _orm.load_only(), _orm.undefer() and
    _orm.selectinload() took effect only the first time the statement
    was run. The subquery loader now uses options from the cached statement
    in the same way as the selectin relationship loader.

    References: #13779

  • [orm] [bug] Fixed issue where a subclass configured with
    _orm.Mapper.polymorphic_load set to "selectin" would
    cause a statement to raise ArgumentError when the statement
    selected from an _orm.aliased() or _orm.with_polymorphic()
    construct against the base class, or included another entity, along with
    loader options such as _orm.undefer() or _orm.selectinload()
    against that construct or entity. The automatic load of the subclass
    now leaves out loader options that refer to other entities, which were
    already applied by the enclosing statement.

    References: #13780

  • [orm] [bug] Fixed issue where joined eager loading that wraps the statement in a
    subquery, as occurs with LIMIT, OFFSET or DISTINCT, would populate
    joined inheritance subclass objects loaded by the main entity with column
    values from another row, when the statement also joined to an
    _orm.aliased() construct of that same subclass and referred to its
    columns, such as in ORDER BY.

    References: #13798

engine

  • [engine] [bug] Fixed issue in _engine.URL.update_query_pairs() where a key that
    was repeated with a sequence of strings as its value would produce a
    nested tuple in _engine.URL.query, causing the URL to fail to
    render as a string. Passing a sequence of strings as a value, which was
    indicated by the type annotations but not documented, is now documented,
    and the annotations for _engine.URL.update_query_pairs() and
    _engine.URL.update_query_dict() are corrected to accept any
    sequence of strings rather than only a list.

    References: #13770

sql

  • [sql] [bug] Fixed issue in cache key generation where calling
    _sql.Select.correlate() or _sql.Select.correlate_except()
    with None would not change the cache key of the _sql.Select,
    so that a statement which disables correlation, or correlates all FROM
    objects to enclosing SELECTs, could share a cached SQL string with an
    otherwise identical statement using the default auto-correlation
    behavior, leading to incorrect SQL being emitted for whichever statement
    was executed second.

    References: #13767

  • [sql] [bug] Fixed issue where a _sql.select() that refers to a CTE
    only within _sql.Select.select_from(), as the left side of
    _sql.Select.join_from(), or within a join that was followed by
    _sql.Select.with_only_columns(), would not be copied correctly by
    _sql.Select.params() or visitors.cloned_traverse(), such that
    the new parameter values could be ignored when the statement was invoked
    using the compiled cache, with the original values used instead. On the
    2.1 series, where _sql.Select.params() no longer copies the
    statement, the issue still applies to visitors.cloned_traverse()
    and similar traversals.

    Also fixed a related issue where, if a traversal such as
    visitors.replacement_traverse() replaced the target of
    _sql.Select.join() or _sql.Select.join_from() with a
    Join, that join would render twice in the FROM clause of the
    resulting statement.

    References: #13791

asyncio

  • [asyncio] [bug] The asyncio.CancelledError that occurs frequently for tasks cancelled
    under anyio, where the connection is nonetheless successfully terminated,
    is now logged by the connection pool at DEBUG level rather than ERROR.

    References: #13772

postgresql

  • [postgresql] [bug] Fixed issue where reflection of PostgreSQL columns of type tsquery or
    regconfig would return NullType and emit a warning, even
    though the _postgresql.TSQUERY and _postgresql.REGCONFIG
    types are provided by the PostgreSQL dialect. These types are now mapped
    for reflection in the same way as _postgresql.TSVECTOR. Pull
    request courtesy Lushiyao5.

    References: #13762

2.1.8

Choose a tag to compare

@sqla-tester sqla-tester released this 04 Nov 01:17

2.1.8

Released: November 3, 2026

general

  • [general] [change] All files published to PyPI for a release, including the source
    distribution as well as all wheels, are now uploaded using PyPI's trusted
    publishing mechanism from SQLAlchemy's GitHub Actions workflow, and include
    a PEP 740 attestation, so that every file in a release carries
    provenance information. Previously, the source distribution and some
    wheels were uploaded without an attestation, which caused PyPI to display
    provenance warnings for recent releases.

    This change is also backported to: 2.0.57

    References: #13759

2.0.57

Choose a tag to compare

@sqla-tester sqla-tester released this 04 Nov 00:53

2.0.57

Released: November 3, 2026

general

  • [general] [change] All files published to PyPI for a release, including the source
    distribution as well as all wheels, are now uploaded using PyPI's trusted
    publishing mechanism from SQLAlchemy's GitHub Actions workflow, and include
    a PEP 740 attestation, so that every file in a release carries
    provenance information. Previously, the source distribution and some
    wheels were uploaded without an attestation, which caused PyPI to display
    provenance warnings for recent releases.

    References: #13759

2.1.7

Choose a tag to compare

@sqla-tester sqla-tester released this 03 Nov 20:34

2.1.7

Released: November 3, 2026

orm

  • [orm] [feature] Added _orm.SessionTransaction.connections and
    _orm.SessionTransaction.bound_connection(), which return the
    connections a _orm.SessionTransaction has already acquired,
    without acquiring a new one. This allows, for example, checking whether
    any connection in the transaction has been invalidated before emitting
    further SQL. A SAVEPOINT transaction returned by
    _orm.Session.begin_nested() reports only the connections used
    within that SAVEPOINT; the root transaction returned by
    _orm.Session.get_transaction() reports all connections. The same
    accessors are available on _asyncio.AsyncSessionTransaction,
    returning _asyncio.AsyncConnection objects. Pull request
    courtesy Artur Shiriev.

    References: #13685

  • [orm] [bug] An informative InvalidRequestError is now raised when more than
    one PropComparator.of_type() loader option is applied along the
    same relationship using targets of differing classes, such as two
    _orm.aliased() constructs against different subclasses, which
    previously failed with a bare AssertionError during compilation.
    These options can't be combined since each target brings its own aliased
    copy of the base table; to load multiple subclasses along a single
    relationship, a single _orm.with_polymorphic() object that includes
    all of the target classes should be used.

    This change is also backported to: 2.0.56

    References: #13751

  • [orm] [bug] Fixed issue where criteria applied to a relationship using
    PropComparator.and_() within _orm.selectinload() or
    _orm.lazyload() would not be parenthesized against the
    relationship's join condition when the enclosing statement was retrieved
    from the compiled cache, so that criteria consisting of an
    _sql.or_() would render as a = ? AND b = ? OR c = ?. For
    _orm.lazyload(), this could load rows belonging to other parents into
    the collection. The issue typically appeared as a race condition in
    multithreaded applications, but could also occur within a single thread
    depending on the order in which statements were executed.

    This change is also backported to: 2.0.56

    References: #13753

  • [orm] [bug] [regression] Fixed regression caused by #13070 where using two or more
    orm.with_loader_criteria() options for different entities, where
    the criteria of each referred to the other entity, such as by using
    RelationshipProperty.Comparator.any() and
    RelationshipProperty.Comparator.has(), would fail with a
    RecursionError when compiling. A loader criteria option is now
    no longer applied to a SELECT that's nested at any level within its own
    criteria; previously this was only checked for the immediate SELECT
    within the criteria. This also repairs the same RecursionError for
    criteria which refer to each other using explicit subqueries, an issue
    also present in the 2.0 series. No backport is planned at the moment as
    this is an unusual use case.

    References: #13714

  • [orm] [bug] Fixed issue where _orm.Session.merge_all() did not disable autoflush
    while merging, as _orm.Session.merge() does, so that a lazy load
    emitted during the merge cascade could autoflush a partially merged
    object, leading to integrity errors or other failures.

    References: #13715

  • [orm] [bug] [regression] Fixed regression caused by #12168 where a collection-based
    _orm.relationship() using the
    orm_declarative_native_dataclasses feature with a custom
    _orm.relationship.collection_class such as
    _orm.attribute_keyed_dict() would raise an error if
    _orm.relationship.default_factory were set to the plain
    dict, list or set type that the collection class is based on,
    such as default_factory=dict for _orm.attribute_keyed_dict().
    The plain collection type is now accepted as the
    _orm.relationship.default_factory in addition to the exact
    collection class.

    References: #13718

  • [orm] [bug] [regression] Fixed regression caused by #5987 where the selectinload()
    loader strategy, when loading a many-to-many relationship against an
    aliased target, such as when using PropComparator.of_type() with a
    single-inheritance subclass or an aliased() construct, would render
    the join between the association table and the aliased target using the
    unaliased table name, producing invalid SQL.

    References: #13726

  • [orm] [bug] [regression] Fixed issue where a SAVEPOINT started by _orm.Session.begin_nested()
    would apply execution options to the connection a second time, causing
    options such as isolation_level to raise. Additionally, execution
    options passed to _orm.Session.connection() within a SAVEPOINT are
    now ignored with a warning if the connection is already present, as
    documented, where previously they were applied.

    References: #13744, #13745

  • [orm] [bug] [regression] Fixed regression caused by #12168 where a
    _orm.mapped_column() using
    _orm.mapped_column.use_existing_column along with
    _orm.mapped_column.default in an
    orm_declarative_native_dataclasses mapping would not persist the
    given default value. As the existing _schema.Column from the
    superclass table is mapped in this case, the default value would not take
    effect for INSERT, and the default from the superclass column, if any,
    would be used instead. The unit of work now delivers the dataclass
    default of an attribute that was never set to the INSERT statement in
    those cases where the mapped _schema.Column does not supply that
    same default, while the attribute continues to remain un-set until the
    object is flushed, so that the behaviors established by #12168
    are maintained.

    This includes a behavioral change for an attribute that is set to None
    explicitly, which the ORM treats as the default case for a column that has
    a default, as described at session_forcing_null. Such an attribute
    now receives the dataclass default of the subclass, consistent with an
    attribute that was never set, where previously the default of the
    superclass column would take effect.

    References: #13748

engine

  • [engine] [bug] Fixed issue where the _sa.create_engine.hide_parameters
    parameter was not honored when logging bound parameters for "side"
    statements that are executed separately from the main statement, such as
    pre-executed SQL expression column defaults, so that parameter values were
    written to the log in plain form. These parameters are now hidden in the
    same way as those of the main statement.

    This change is also backported to: 2.0.56

    References: #13724

  • [engine] [bug] Fixed issue where event listeners established on the
    _engine.Connection class itself, such as
    _events.ConnectionEvents.before_execute(), would not be invoked
    for connections procured from an _engine.Engine that did not
    itself have any event listeners associated with it.

    This change is also backported to: 2.0.56

    References: #13743

  • [engine] [bug] Fixed issue where URL.difference_update_query() would not remove
    any parameters when passed a generator or other single-use iterable, as
    the iterable was consumed twice internally. Pull request courtesy
    Huang-404-Q.

    This change is also backported to: 2.0.56

    References: #13757

  • [engine] [bug] [regression] Fixed regression where a checked-out pool connection that was garbage
    collected as part of a reference cycle would not be returned to the pool
    on Python 3.15, permanently consuming a slot in the pool. This occurred
    because Python 3.15 changed the garbage collector to clear weak references
    that have no callback only after weak reference callbacks have run, which
    interfered with the pool's weakref.finalize() based cleanup introduced
    in 2.1.0rc2. An ORM _orm.Session or _engine.Connection
    that was dropped without being closed while in a transaction was affected.

    References: #13738

sql

  • [sql] [bug] [oracle] [postgresql] Reworked the validation applied to the keyword phrases accepted by the
    _schema.ForeignKeyConstraint.ondelete,
    _schema.ForeignKeyConstraint.onupdate,
    _schema.ForeignKeyConstraint.initially and
    _schema.ForeignKeyConstraint.match parameters so that it is
    applied consistently on all backends. Previously, some of these phrases
    were checked against a fixed list of keywords, which rejected
    backend-specific syntaxes, while others were not validated at all,
    including MATCH on all backends, ON DELETE on the Oracle dialect,
    and the column list accepted by PostgreSQL for SET NULL / `SET
    DEFAULT...
Read more

2.0.56

Choose a tag to compare

@sqla-tester sqla-tester released this 03 Nov 20:26

2.0.56

Released: November 3, 2026

orm

  • [orm] [bug] Fixed issue where a Session flush that replaced an expired
    object in the identity map with a newly flushed object of the same
    primary key would emit a SELECT to refresh the expired object, solely in
    order to determine whether to emit an "Identity map already had an
    identity" warning. This could occur when a row loaded within a
    transaction is rolled back and its primary key value is subsequently
    reused, and could lead to an AttributeError if the expired object
    were garbage collected during that load. The check now emits no SQL, and
    an expired object that is replaced in this way no longer causes the
    warning to be emitted.

    References: #13711

  • [orm] [bug] An informative InvalidRequestError is now raised when more than
    one PropComparator.of_type() loader option is applied along the
    same relationship using targets of differing classes, such as two
    _orm.aliased() constructs against different subclasses, which
    previously failed with a bare AssertionError during compilation.
    These options can't be combined since each target brings its own aliased
    copy of the base table; to load multiple subclasses along a single
    relationship, a single _orm.with_polymorphic() object that includes
    all of the target classes should be used.

    References: #13751

  • [orm] [bug] Fixed issue where criteria applied to a relationship using
    PropComparator.and_() within _orm.selectinload() or
    _orm.lazyload() would not be parenthesized against the
    relationship's join condition when the enclosing statement was retrieved
    from the compiled cache, so that criteria consisting of an
    _sql.or_() would render as a = ? AND b = ? OR c = ?. For
    _orm.lazyload(), this could load rows belonging to other parents into
    the collection. The issue typically appeared as a race condition in
    multithreaded applications, but could also occur within a single thread
    depending on the order in which statements were executed.

    References: #13753

orm extensions

  • [bug] [orm extensions] Fixed an issue in the instrumentation_toplevel extension where
    unrelated classes inheriting from typing.Generic could incorrectly
    raise a TypeError when using different instrumentation implementations.
    Pull request courtesy TomasCaruso10.

    References: #13680

engine

  • [engine] [bug] Fixed issue where the _sa.create_engine.hide_parameters
    parameter was not honored when logging bound parameters for "side"
    statements that are executed separately from the main statement, such as
    pre-executed SQL expression column defaults, so that parameter values were
    written to the log in plain form. These parameters are now hidden in the
    same way as those of the main statement.

    References: #13724

  • [engine] [bug] Fixed issue where event listeners established on the
    _engine.Connection class itself, such as
    _events.ConnectionEvents.before_execute(), would not be invoked
    for connections procured from an _engine.Engine that did not
    itself have any event listeners associated with it.

    References: #13743

  • [engine] [bug] Fixed issue where URL.difference_update_query() would not remove
    any parameters when passed a generator or other single-use iterable, as
    the iterable was consumed twice internally. Pull request courtesy
    Huang-404-Q.

    References: #13757

sql

  • [sql] [bug] Fixed issues in cache key generation involving the DML constructs
    Insert, Update and Delete. The
    Insert.from_select.include_defaults,
    UpdateBase.return_defaults() and
    UpdateBase.return_defaults.supplemental_cols
    parameters/attributes are now considered as part of the cache key.

    References: #13686, #13687

  • [sql] [bug] Fixed issue where the individual bound parameters generated for an
    "expanding" parameter, such as that of an IN expression, at statement
    execution time could take on the same name as another bound parameter in
    the same statement, causing the value of the other parameter to be
    silently replaced with that of an element of the IN list. Names are now
    disambiguated from one another in this scenario.

    References: #13695

  • [sql] [bug] [oracle] [postgresql] Reworked the validation applied to the keyword phrases accepted by the
    _schema.ForeignKeyConstraint.ondelete,
    _schema.ForeignKeyConstraint.onupdate,
    _schema.ForeignKeyConstraint.initially and
    _schema.ForeignKeyConstraint.match parameters so that it is
    applied consistently on all backends. Previously, some of these phrases
    were checked against a fixed list of keywords, which rejected
    backend-specific syntaxes, while others were not validated at all,
    including MATCH on all backends, ON DELETE on the Oracle dialect,
    and the column list accepted by PostgreSQL for SET NULL / SET DEFAULT, allowing arbitrary text to be rendered into DDL. These phrases
    are now accepted as any sequence of SQL keywords, leaving it to the
    database to determine if the keywords are valid, and a
    CompileError is raised for a phrase that contains other
    characters such as punctuation or quotes. On PostgreSQL, the column list
    for SET NULL / SET DEFAULT is accepted as a comma-separated list
    of plain or double-quoted column names. Pull request courtesy
    basavaraj-sm05.

    References: #13727

asyncio

  • [asyncio] [bug] Fixed issue where calling _asyncio.AsyncResult.unique() or
    _asyncio.AsyncResult.columns() on an _asyncio.AsyncResult
    would have no effect on a subsequent call to
    _asyncio.AsyncResult.scalars() or
    _asyncio.AsyncResult.mappings(), as the resulting
    _asyncio.AsyncScalarResult or
    _asyncio.AsyncMappingResult was built from the underlying
    synchronous result, which did not include those modifications. Unique
    filtering and column selection are now carried over in the same way as for
    _engine.Result.scalars() and _engine.Result.mappings(). Among
    other things, this allows _asyncio.AsyncSession.stream() to be used
    with a joined eager load against a collection, followed by
    .unique().scalars(), which would previously raise an error indicating
    that _asyncio.AsyncResult.unique() must be invoked.

    References: #13688

  • [asyncio] [bug] Fixed issue where the _asyncio.AsyncResult.freeze() method would
    fail to fetch rows from the result, producing a
    _engine.FrozenResult that would raise TypeError when invoked
    for a Core result, or raising AttributeError immediately for an ORM
    result that returns a single entity per row. The method now fully
    fetches all rows from the async cursor, honoring
    _asyncio.AsyncResult.unique() and
    _asyncio.AsyncResult.columns() in the same way as the synchronous
    _engine.Result.freeze() method.

    References: #13689

  • [asyncio] [bug] Fixed regression caused by #12710 where a cancellation received
    by _asyncio.AsyncConnection.close() was not handled properly,
    leaving the _asyncio.AsyncConnection in an inconsistent state
    that could interfere with connections subsequently checked out from the
    pool. The connection is now fully closed in this case.

    References: #13699

  • [asyncio] [bug] Fixed issue where an asyncio cancellation delivered to a task waiting for
    a connection from AsyncAdaptedQueuePool would be lost on Python
    3.11, if a connection were returned to the pool in the same event loop
    iteration in which the task was cancelled. The task would receive the
    connection and continue running as though it had not been cancelled.
    This was due to a known issue in asyncio.wait_for() which is fixed in
    Python 3.12; on Python 3.11, the pool now uses asyncio.timeout() in
    place of asyncio.wait_for() when waiting for a connection. The issue
    remains on Python 3.10 and earlier, where asyncio.timeout() is not
    available.

    References: #13749

mysql

  • [mysql] [bug] Fixed issue where backslashes in the values of a mysql.ENUM or
    mysql.SET type were not escaped when rendered in DDL, leading to
    incorrect values or a malformed statement under MySQL's default
    sql_mode. Backslashes are now escaped in the same way as for other
    string literals, unless NO_BACKSLASH_ESCAPES is in effect. Pull
    request courtesy dxbjavid.

    References: #13466

mssql

  • [mssql] [bug] [reflection] Reflection of SQL Server local temporary tables, such as #tmp, now
    supports tables of the same name existing in multiple sessions at once,
    each session reflecting its own table. Previously, the table was located
    without the use of the object_id() function, which is what limits the
    lookup to the current session, so that same-named tables in other sessions
    would interfere wit...
Read more

2.1.6

Choose a tag to compare

@sqla-tester sqla-tester released this 21 Oct 16:25

2.1.6

Released: October 21, 2026

orm

  • [orm] [bug] Fixed issue where a Session flush that replaced an expired
    object in the identity map with a newly flushed object of the same
    primary key would emit a SELECT to refresh the expired object, solely in
    order to determine whether to emit an "Identity map already had an
    identity" warning. This could occur when a row loaded within a
    transaction is rolled back and its primary key value is subsequently
    reused, and could lead to an AttributeError if the expired object
    were garbage collected during that load. The check now emits no SQL, and
    an expired object that is replaced in this way no longer causes the
    warning to be emitted.

    This change is also backported to: 2.0.56

    References: #13711

  • [orm] [bug] [regression] Fixed regression caused by #13070 where using more than one
    orm.with_loader_criteria() option for the same entity, where the
    criteria made use of correlated subqueries referring to that entity, would
    fail with a RecursionError when compiling.

    References: #13701

  • [orm] [bug] [regression] Fixed regression caused by the new implementation of .params() for
    statements introduced in #7066, where parameter values passed to
    the .params() method of an ORM statement created using
    Select.from_statement() would not be applied when the statement
    was compiled without the compiled statement cache, such as when the cache
    was disabled or when the statement was stringified directly, leading to
    an error that a value is required for the bound parameter.

    References: #13709

orm extensions

  • [bug] [orm extensions] Fixed an issue in the instrumentation_toplevel extension where
    unrelated classes inheriting from typing.Generic could incorrectly
    raise a TypeError when using different instrumentation implementations.
    Pull request courtesy TomasCaruso10.

    This change is also backported to: 2.0.56

    References: #13680

engine

  • [engine] [usecase] Added make_url.keep_blank_values and
    URL.update_query_string.keep_blank_values parameters, which
    when set to True retain query string parameters with blank values such as
    key= in the URL.query dictionary as empty strings. This allows
    a URL with empty-string query values to round trip through
    URL.render_as_string() and make_url(). The default behavior
    of omitting blank values is unchanged, as dialects may not accept an empty
    string for query parameters that are coerced to other types.

    References: #13697

sql

  • [sql] [bug] Fixed issues in cache key generation involving the DML constructs
    Insert, Update and Delete. The
    Insert.from_select.include_defaults,
    UpdateBase.return_defaults() and
    UpdateBase.return_defaults.supplemental_cols
    parameters/attributes are now considered as part of the cache key.

    This change is also backported to: 2.0.56

    References: #13686, #13687

  • [sql] [bug] Fixed issue where the individual bound parameters generated for an
    "expanding" parameter, such as that of an IN expression, at statement
    execution time could take on the same name as another bound parameter in
    the same statement, causing the value of the other parameter to be
    silently replaced with that of an element of the IN list. Names are now
    disambiguated from one another in this scenario.

    This change is also backported to: 2.0.56

    References: #13695

asyncio

  • [asyncio] [bug] Fixed issue where calling _asyncio.AsyncResult.unique() or
    _asyncio.AsyncResult.columns() on an _asyncio.AsyncResult
    would have no effect on a subsequent call to
    _asyncio.AsyncResult.scalars() or
    _asyncio.AsyncResult.mappings(), as the resulting
    _asyncio.AsyncScalarResult or
    _asyncio.AsyncMappingResult was built from the underlying
    synchronous result, which did not include those modifications. Unique
    filtering and column selection are now carried over in the same way as for
    _engine.Result.scalars() and _engine.Result.mappings(). Among
    other things, this allows _asyncio.AsyncSession.stream() to be used
    with a joined eager load against a collection, followed by
    .unique().scalars(), which would previously raise an error indicating
    that _asyncio.AsyncResult.unique() must be invoked.

    This change is also backported to: 2.0.56

    References: #13688

  • [asyncio] [bug] Fixed issue where the _asyncio.AsyncResult.freeze() method would
    fail to fetch rows from the result, producing a
    _engine.FrozenResult that would raise TypeError when invoked
    for a Core result, or raising AttributeError immediately for an ORM
    result that returns a single entity per row. The method now fully
    fetches all rows from the async cursor, honoring
    _asyncio.AsyncResult.unique() and
    _asyncio.AsyncResult.columns() in the same way as the synchronous
    _engine.Result.freeze() method.

    This change is also backported to: 2.0.56

    References: #13689

  • [asyncio] [bug] Fixed regression caused by #12710 where a cancellation received
    by _asyncio.AsyncConnection.close() was not handled properly,
    leaving the _asyncio.AsyncConnection in an inconsistent state
    that could interfere with connections subsequently checked out from the
    pool. The connection is now fully closed in this case.

    This change is also backported to: 2.0.56

    References: #13699

mysql

  • [mysql] [bug] Fixed issue where backslashes in the values of a mysql.ENUM or
    mysql.SET type were not escaped when rendered in DDL, leading to
    incorrect values or a malformed statement under MySQL's default
    sql_mode. Backslashes are now escaped in the same way as for other
    string literals, unless NO_BACKSLASH_ESCAPES is in effect. Pull
    request courtesy dxbjavid.

    This change is also backported to: 2.0.56

    References: #13466

2.1.5

Choose a tag to compare

@sqla-tester sqla-tester released this 16 Oct 20:52

2.1.5

Released: October 16, 2026

orm

  • [orm] [feature] Added the _orm.Unmapped annotation and the
    _orm.unmapped_column() construct, providing a declarative-compatible
    approach to having "excluded" columns in a Declarative model, that is,
    columns that are part of the _schema.Table but are not mapped,
    replacing the use of _orm.Mapper.exclude_properties for this
    purpose when using a Declarative mapping.

    References: #13650

  • [orm] [bug] [regression] Fixed regression caused by #11917 in version 2.0.36 where an ORM
    enabled _sql.update() using WHERE criteria which matched more than
    one object present in the _orm.Session would expire server-side
    onupdate columns, as well as columns that were SET to a SQL expression, on
    only one of the matched objects, leaving the remaining objects with stale
    values for those attributes. The columns are now expired for all matched
    objects.

    This change is also backported to: 2.0.55

    References: #13675

  • [orm] [deprecated] Using the _orm.Mapper.exclude_properties or
    _orm.Mapper.include_properties parameters on a Declarative
    mapping to exclude attributes that are declared on the class, such as with
    _orm.mapped_column(), is deprecated and now emits a deprecation
    warning. This use was never supported, and depending on the arguments
    passed to _orm.mapped_column(), the attribute could remain mapped
    regardless; in particular, as of 2.1 this includes ORM mapped dataclasses
    where _orm.mapped_column.default is present. The new
    _orm.unmapped_column() construct should be used instead. Excluding
    columns that are present only in the _schema.Table, such as those
    from __table__, __table_args__ or table reflection, is not
    affected.

    References: #13650

schema

  • [schema] [bug] Fixed issue where dialect-specific keyword arguments established on a
    ForeignKeyConstraint, ForeignKey or
    CheckConstraint, such as postgresql_not_valid, were not
    carried along to the copy of the constraint produced by
    Table.to_metadata(), so that the copied Table would
    generate DDL without these options. The fix for #5276 had
    established this behavior for Column,
    PrimaryKeyConstraint and UniqueConstraint only.

    This change is also backported to: 2.0.55

    References: #13677

asyncio

  • [asyncio] [bug] Fixed issue where a task that was cancelled a second time while the
    connection pool was closing an asyncio connection invalidated by the
    first cancellation, such as one received while a statement was
    executing, would leave the closed connection in place in the pool, where
    it would be handed out to the next checkout and fail upon first use.
    The pool now discards the connection in all cases once a close has been
    attempted. This condition occurs unconditionally for tasks cancelled by
    an AnyIO cancel scope, which delivers the cancellation repeatedly until
    the task exits the scope.

    This change is also backported to: 2.0.55

    References: #13673

  • [asyncio] [bug] Fixed regression caused by #13548 where an asyncio cancellation
    delivered while the pool was closing a connection stranded by an
    exception raised within the _events.PoolEvents.connect() event
    handler would be suppressed, with the original exception raised in its
    place. The task would then not end as cancelled, and code that catches
    ordinary exceptions in order to retry would continue running after it
    had been cancelled. The CancelledError is now propagated.

    As part of this change, a variety of other cancellation scenarios were
    caught and repaired.

    This change is also backported to: 2.0.55

    References: #13678

2.0.55

Choose a tag to compare

@sqla-tester sqla-tester released this 16 Oct 20:45

2.0.55

Released: October 16, 2026

orm

  • [orm] [bug] Fixed issue in Annotated Declarative where an annotation naming an
    undefined symbol, where the annotation is not wrapped in
    _orm.Mapped, would raise TypeError rather than the expected
    MappedAnnotationError when running under Python 3.14 without
    from __future__ import annotations in effect. Under PEP 649, such
    an annotation is delivered as a ForwardRef rather than a string, a
    form which was not accommodated by the check that determines whether an
    unresolvable annotation was intended to be mapped.

    References: #13602

  • [orm] [bug] [regression] Fixed regression caused by #11917 in version 2.0.36 where an ORM
    enabled _sql.update() using WHERE criteria which matched more than
    one object present in the _orm.Session would expire server-side
    onupdate columns, as well as columns that were SET to a SQL expression, on
    only one of the matched objects, leaving the remaining objects with stale
    values for those attributes. The columns are now expired for all matched
    objects.

    References: #13675

orm extensions

  • [bug] [orm extensions] Fixed issue in the mutable_toplevel extension where the in-place
    |= operator on MutableDict and the in-place *= operator
    on MutableList did not emit change events, so that the
    modification was not detected and was not persisted on the next flush.
    These operators now invoke Mutable.changed() in the same way as
    the in-place set operators of MutableSet and the +=
    operator of MutableList.

    References: #13643

engine

  • [engine] [bug] [regression] Fixed regression from the 1.4 series where the DBAPI cursor used for a
    compiled statement that returns no rows, which includes DDL constructs
    such as CreateTable and DropTable as well as the
    SAVEPOINT, ROLLBACK TO SAVEPOINT and RELEASE SAVEPOINT statements emitted
    by _engine.Connection.begin_nested(), was not closed after
    execution, and was instead left to be released when garbage collected.
    The cursor is now closed immediately, as was the case in 1.3 and as is
    already the case for INSERT, UPDATE, DELETE and _sql.text()
    statements.

    References: #13640

  • [engine] [bug] Fixed issue in the
    _engine.Connection.execution_options.logging_token option
    where setting the value to None or another false value would raise
    AttributeError if a logging token had not already been established on
    that _engine.Connection, such as on a newly checked out
    connection, when the option was set at the _engine.Engine level,
    or when the token was reset to None more than once. Regression
    introduced in 2.0.30 as part of #11210.

    References: #13641

sql

  • [sql] [performance] Added instance-level caching to the "comparator factory" method of the
    TypeDecorator class. This attribute is used in most SQL
    comparison operations and was generating a new class on the fly each time
    it was called. Special steps have been taken to allow this class to be
    cached while still allowing for pickling of the TypeDecorator
    itself.

    References: #13617

  • [sql] [bug] Fixed an additional race condition related to those fixed as part of
    #12302, where concurrent access to the
    FromClause.primary_key or FromClause.foreign_keys
    collections on a newly created Alias or Subquery
    could raise an AssertionError if another thread was in the midst of
    generating these collections.

    References: #12302

  • [sql] [bug] Fixed issue where literal text within a SQL statement that resembled a
    pyformat bound parameter, such as %(name)s, would be rewritten as a
    bound parameter placeholder when compiling for a dialect using a
    positional paramstyle such as qmark, format, numeric or
    numeric_dollar. This would occur for string values rendered with the
    literal_binds compiler option, as well as for literal text within
    _sql.text() or _sql.literal_column() constructs, leading to a
    SQL statement that silently compared against a different value, or that
    raised a KeyError for numeric paramstyles. This was a regression
    caused by the change in the 2.0 series where statements for positional
    paramstyles are first compiled using named parameters, which are then
    converted to positional placeholders.

    References: #13609

  • [sql] [bug] The rendering of bound parameters within a _sql.text() construct no
    longer considers the $ character to be part of a bound parameter name,
    matching the parsing already performed by _sql.text() itself when
    the construct is created. Previously, a string such as :foo$bar would
    be rendered as a single bound parameter named foo$bar, for which a
    value could not be passed, and which would fail when executed. The
    string is now rendered as the bound parameter foo followed by the
    literal text $bar. Additionally, _sql.text() no longer
    establishes a spurious bound parameter from a name that is immediately
    followed by a colon, such as thi for the string :this:that or
    va for the string :val::int; these strings are not rendered as
    bound parameters, and _sql.text() now uses the same parsing as the
    compiler to determine this.

    References: #13609

  • [sql] [bug] Fixed issue where the
    UpdateBase.return_defaults.supplemental_cols parameter of
    UpdateBase.return_defaults() was not included in the cache key of
    an Insert or Update construct, causing a statement
    that used this parameter to share a cached compiled form with an otherwise
    identical statement that did not, or that used different supplemental
    columns. This would cause the supplemental RETURNING rows to be missing
    or incorrect depending on which form of the statement was compiled first.

schema

  • [schema] [bug] Fixed issue where dialect-specific keyword arguments established on a
    ForeignKeyConstraint, ForeignKey or
    CheckConstraint, such as postgresql_not_valid, were not
    carried along to the copy of the constraint produced by
    Table.to_metadata(), so that the copied Table would
    generate DDL without these options. The fix for #5276 had
    established this behavior for Column,
    PrimaryKeyConstraint and UniqueConstraint only.

    References: #13677

asyncio

  • [asyncio] [bug] Fixed issue where cancelling a task while an asyncio context manager
    such as _asyncio.AsyncConnection or _asyncio.AsyncSession
    was closing on exit would allow the task to complete while the close
    continued in the background. An application that disposed of the
    engine at that point, as is typical at shutdown, would have the
    connection returned to the disposed pool afterwards, where nothing
    would close it. The context manager now waits for the close to complete
    before propagating the cancellation.

    Also fixed related issues in the connection pool where a cancellation
    received while a connection was being reset on return to the pool, or a
    second cancellation received while the pool was cleaning up after a
    first cancellation during checkout, would prevent the connection's slot
    from being returned to the pool, reducing the pool's capacity until the
    connection object was garbage collected, or permanently in the latter
    case.

    References: #12710, #13622

  • [asyncio] [bug] Fixed issue where a task that was cancelled a second time while the
    connection pool was closing an asyncio connection invalidated by the
    first cancellation, such as one received while a statement was
    executing, would leave the closed connection in place in the pool, where
    it would be handed out to the next checkout and fail upon first use.
    The pool now discards the connection in all cases once a close has been
    attempted. This condition occurs unconditionally for tasks cancelled by
    an AnyIO cancel scope, which delivers the cancellation repeatedly until
    the task exits the scope.

    References: #13673

  • [asyncio] [bug] Fixed regression caused by #13548 where an asyncio cancellation
    delivered while the pool was closing a connection stranded by an
    exception raised within the _events.PoolEvents.connect() event
    handler would be suppressed, with the original exception raised in its
    place. The task would then not end as cancelled, and code that catches
    ordinary exceptions in order to retry would continue running after it
    had been cancelled. The CancelledError is now propagated.

    As part of this change, a variety of other cancellation scenarios were
    caught and repaired.

    References: #13678

postgresql

  • [postgresql] [bug] [reflection] Fixed issue in PostgreSQL ref...
Read more

2.1.4

Choose a tag to compare

@sqla-tester sqla-tester released this 07 Oct 17:34

2.1.4

Released: October 7, 2026

orm

  • [orm] [bug] [regression] Fixed regression caused by #13333 where assigning a
    MetaData object to the metadata attribute of a mapped
    Declarative class, in order to place that class's Table in a
    MetaData collection other than that of the
    _orm.registry, would emit a warning that the attribute name
    metadata should be left reserved. The warning is now emitted only
    when the metadata attribute is assigned to an object other than a
    MetaData.

    References: #13659

engine

  • [engine] [bug] [regression] Fixed regression from the 1.4 series where the DBAPI cursor used for a
    compiled statement that returns no rows, which includes DDL constructs
    such as CreateTable and DropTable as well as the
    SAVEPOINT, ROLLBACK TO SAVEPOINT and RELEASE SAVEPOINT statements emitted
    by _engine.Connection.begin_nested(), was not closed after
    execution, and was instead left to be released when garbage collected.
    The cursor is now closed immediately, as was the case in 1.3 and as is
    already the case for INSERT, UPDATE, DELETE and _sql.text()
    statements.

    This change is also backported to: 2.0.55

    References: #13640

  • [engine] [bug] Fixed issue in the
    _engine.Connection.execution_options.logging_token option
    where setting the value to None or another false value would raise
    AttributeError if a logging token had not already been established on
    that _engine.Connection, such as on a newly checked out
    connection, when the option was set at the _engine.Engine level,
    or when the token was reset to None more than once. Regression
    introduced in 2.0.30 as part of #11210.

    This change is also backported to: 2.0.55

    References: #13641

  • [engine] [bug] [regression] Fixed regression where iterating a Result directly would create
    reference cycles that prevented the Result along with the DBAPI
    cursor from being freed immediately, instead relying upon cyclic GC to free
    it; also fixed a similar issue when using scalar-returning methods such as
    Result.scalars(). The issues were introduced as part of a 2.1
    refactoring of Result into Cython code.

    References: #13639

  • [engine] [bug] Fixed issue where an exception raised by the rollback performed within
    _engine.Connection.close(), which was not otherwise classified as a
    disconnect, would leave the _engine.Connection open and its
    pooled DBAPI connection checked out, emitting a warning when later
    garbage collected; for an asyncio driver, the connection could not be
    closed at that point and was leaked. The DBAPI connection is now
    returned to the pool, which resets it as usual, invalidating it if that
    reset fails as well, and the original exception is raised.

    References: #13657

sql

  • [sql] [bug] Fixed issue where the
    UpdateBase.return_defaults.supplemental_cols parameter of
    UpdateBase.return_defaults() was not included in the cache key of
    an Insert or Update construct, causing a statement
    that used this parameter to share a cached compiled form with an otherwise
    identical statement that did not, or that used different supplemental
    columns. This would cause the supplemental RETURNING rows to be missing
    or incorrect depending on which form of the statement was compiled first.

    This change is also backported to: 2.0.55

  • [sql] [bug] [regression] Fixed regression where stringifying a statement that includes the
    _functions.aggregate_strings function, such as via str(),
    would raise TypeError. Additionally, compiling the function with the
    default dialect or with a third party dialect that doesn't provide its own
    rendering for this function now raises CompileError rather than
    TypeError.

    References: #13642

postgresql

  • [postgresql] [bug] Fixed regression where copying a _postgresql.DOMAIN datatype,
    as occurs when using TypeEngine.copy(), Table.to_metadata(),
    or when a Column referring to a _postgresql.DOMAIN is
    placed on a declarative mixin, would drop the
    _postgresql.DOMAIN.collation,
    _postgresql.DOMAIN.default,
    _postgresql.DOMAIN.constraint_name,
    _postgresql.DOMAIN.not_null and
    _postgresql.DOMAIN.check parameters, causing the
    CREATE DOMAIN statement emitted for the copied type to omit these
    elements. The regression was introduced in version 2.0.42.

    Additionally, copies of _postgresql.ENUM now retain the
    _types.Enum.sort_key_function,
    _types.Enum.create_constraint and
    _types.Enum.length parameters, and copies of
    _types.Enum now retain the
    _types.Enum.sort_key_function parameter, all of which were
    previously reset to their default values.

    This change is also backported to: 2.0.55

    References: #13644

  • [postgresql] [bug] [regression] Fixed regression in the asyncpg dialect where a failure to start a
    transaction, such as when an asyncpg connection is used from a different
    event loop than the one it was created on, would leave the failed asyncpg
    transaction in place, so that the subsequent rollback raised an
    InterfaceError that masked the original error.

    References: #13657

mssql

  • [mssql] [bug] Fixed issue where the Python true division operator / would truncate
    the fractional part of the divisor on SQL Server when the divisor's type
    was not numeric, such as when using a SQL function like NULLIF() that
    has no known return type. The divisor was rendered as CAST(... AS NUMERIC), which on SQL Server implies a scale of zero; the divisor is
    now rendered as (... + 0.0), the same approach used by the SQLite
    dialect, which promotes it to a decimal value without truncation.
    Pull request courtesy James Guthrie.

    This change is also backported to: 2.0.55

    References: #13631

misc

  • [bug] [ext] Fixed issue in the mutable_toplevel extension where the in-place
    |= operator on MutableDict and the in-place *= operator
    on MutableList did not emit change events, so that the
    modification was not detected and was not persisted on the next flush.
    These operators now invoke Mutable.changed() in the same way as
    the in-place set operators of MutableSet and the +=
    operator of MutableList.

    This change is also backported to: 2.0.55

    References: #13643