#13575·sqlalchemy

Support UPDATE..RETURNING on MariaDB 13.0.1+ when MDEV-41113 can be fixed

Author: rusherCreated Sep 10, 2026Updated Sep 13, 2026
Labelsuse casemariadbcode review in progressdml

Describe the use case

MariaDB 13.0.1 adds RETURNING to single-table UPDATE (MDEV-5092). The MariaDB dialect already enables insert_returning (10.5) and delete_returning (10.0.5) but leaves update_returning off. Enable it for server version >= 13.0.1. update_returning_multifrom must stay False: RETURNING is single-table only.

Databases / Backends / Drivers targeted

MariaDB 13.0.1+, all MariaDB drivers. Not MySQL.

Example Use

update(t).where(t.c.id == 5).values(name="x").returning(t.c.id)

UPDATE t SET name=%s WHERE t.id = %s RETURNING t.id

Additional context

https://mariadb.com/kb/en/update/ https://jira.mariadb.org/browse/MDEV-5092 Patch ready, will submit a PR once labelled "open for pull requests".