Skip to content

Add MariaDB UPDATE RETURNING INTO support with feature detection - #935

Merged
abondvt89 merged 4 commits into
TPC-Council:masterfrom
HammerDBLtd:mdev-39563-update-returning
Sep 22, 2026
Merged

abondvt89 merged 4 commits into
TPC-Council:masterfrom
HammerDBLtd:mdev-39563-update-returning

Conversation

@sm-shaw

@sm-shaw sm-shaw commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This adds support for MariaDB UPDATE ... RETURNING ... INTO in the TPROC-C NEWORD stored procedure.

The implementation uses feature detection rather than a MariaDB version check. During schema creation HammerDB attempts to create a temporary stored procedure containing UPDATE ... RETURNING ... INTO.

If supported, NEWORD uses UPDATE ... RETURNING ... INTO for the district and stock updates, removing the separate SELECT ... FOR UPDATE / UPDATE operations.

If unsupported, HammerDB retains the existing implementation.

Validation

  • MariaDB 13.1.1:
    • UPDATE ... RETURNING is supported.
    • UPDATE ... RETURNING ... INTO is not supported.
    • HammerDB correctly detects this and retains the existing NEWORD implementation.
  • bb-13.1-bar-MDEV-39563:
    • UPDATE ... RETURNING ... INTO is supported and executes successfully.
    • HammerDB selects the new NEWORD implementation.

This allows the optimisation to be used when MDEV-39563 support is available while retaining compatibility with existing MariaDB releases.

Fixes #933.

@sm-shaw
sm-shaw requested a review from a team as a code owner September 18, 2026 15:47
@sm-shaw sm-shaw added the database Database specific label Sep 22, 2026
@abondvt89

Copy link
Copy Markdown
Contributor

Merging after reviews of the two current members of the TPC OSS Code Maintenance Team

@abondvt89
abondvt89 merged commit 63eefb0 into TPC-Council:master Sep 22, 2026
@sm-shaw sm-shaw removed the database Database specific label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement UPDATE ... RETURNING ... INTO for MariaDB TPROC-C

2 participants