Skip to content

MDEV-38633 | Row events in statement based binlog: optimization possible? - #5575

Open
pranavktiwari wants to merge 1 commit into
12.3from
bb-MDEV-38633-pranav
Open

MDEV-38633 | Row events in statement based binlog: optimization possible?#5575
pranavktiwari wants to merge 1 commit into
12.3from
bb-MDEV-38633-pranav

Conversation

@pranavktiwari

@pranavktiwari pranavktiwari commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

fixes MDEV-38633

Problem:

Row events in statement based binlog: optimization possible?

Cause:

A failing multi-table UPDATE or DELETE marked every target temporary table as not up to date in the binary log, even when nothing had been changed.
Any later statement reading such a table was then forced to use row logging.

Fix:

Only mark the tables when something was actually changed—that is, when rows were updated/deleted or a non-transactional table was modified.
If nothing changed, set THD::tmp_table_binlog_handled so that mark_tmp_table_as_free_for_reuse() does not mark them either.
1- multi_update::abort_result_set(), Sql_cmd_update::update_single_table resets the binlog state
2- Added the same logic for multi_delete::abort_result_set() and Sql_cmd_delete::delete_from_single_table

@pranavktiwari pranavktiwari changed the title bug fix. DRAFT | bug fix. Aug 20, 2026
@pranavktiwari
pranavktiwari force-pushed the bb-MDEV-38633-pranav branch 2 times, most recently from 116b83a to a04fd00 Compare August 20, 2026 12:21
A failing multi-table UPDATE or DELETE marked every target temporary table as not up to date in the binary log, even when nothing had been changed.
Any later statement reading such a table was then forced to use row logging.
Only mark the tables when something was actually changed—that is, when rows were updated/deleted or a non-transactional table was modified.
If nothing changed, set THD::tmp_table_binlog_handled so that mark_tmp_table_as_free_for_reuse() does not mark them either.
@pranavktiwari pranavktiwari changed the title DRAFT | bug fix. MDEV-38633 | Row events in statement based binlog: optimization possible? Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant