Skip to content
/ server Public

Comments

MDEV-27837: Disallow SET @@session.server_id within transaction#4660

Open
shabbann wants to merge 2 commits intoMariaDB:10.6from
shabbann:MDEV-27837-disallow-set-@@session.server_id-within-transaction
Open

MDEV-27837: Disallow SET @@session.server_id within transaction#4660
shabbann wants to merge 2 commits intoMariaDB:10.6from
shabbann:MDEV-27837-disallow-set-@@session.server_id-within-transaction

Conversation

@shabbann
Copy link

Setting server_id within a transaction is dangerous for replication as it
can cause events to be filtered incorrectly on the replica, especially in
parallel replication mode.

This patch adds a check to prevent SET @@session.server_id from being
executed while a transaction is active

Setting server_id within a transaction is dangerous for replication.
Added check_not_in_transaction validation to server_id variable.
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 17, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This is a preliminary review. Once this is done I will solicit a final review on this.

- Add specific error codes ER_CANT_SET_SERVER_ID_IN_TRANSACTION and
  ER_CANT_SET_SERVER_ID_IN_SUBSTATEMENT
- Extend test to cover trigger and stored procedure cases
@shabbann shabbann requested a review from gkodinov February 17, 2026 16:59
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your quick fixes! Stand by for the final review please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants