# Feature idea + PoC patch: binlog\_row\_format\_relay\_statements

**URL:** <https://forums.percona.com/t/feature-idea-poc-patch-binlog-row-format-relay-statements/41525>\
**Category:** MySQL & MariaDB\
**Tags:** percona, mysql\
**Created:** [December 4, 2026, 10:58am UTC](https://forums.percona.com/t/feature-idea-poc-patch-binlog-row-format-relay-statements/41525 "2026-12-04T10:58:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![edhunter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/edhunter/32/18922_2.png) [@edhunter](https://forums.percona.com/u/edhunter)\
**Post date:** [December 4, 2026, 10:58am UTC](https://forums.percona.com/t/feature-idea-poc-patch-binlog-row-format-relay-statements/41525/1 "2026-12-04T10:58:01Z")

</div>

Hi everyone,

In complex multi-master or multi-hop topologies running `binlog_format=ROW`, fixing data drift across downstream nodes from a single origin is challenging. While executing statements within a transaction like `START TRANSACTION; DELETE ...; INSERT ...; COMMIT;` on an intermediate node works locally, it converts those statements into `ROW` events in its own binlog, causing replication issues downstream if data drift differs.

**Proposed Solution:**  
A global dynamic boolean variable `binlog_row_format_relay_statements` (default `OFF`) that allows intermediate replicas with `binlog_format=ROW` to re-log incoming `STATEMENT` events (`Query_log_event`) as statements rather than converting them to row-based events, while keeping local writes and incoming `ROW` events unaffected.

I have created and tested a PoC patch for **MySQL 5.7.44** (designed and tested as a DBA, with C++ code drafted via AI assistance) and shared it as a reference for the community/developers to evaluate:

**Patch & full description (GitHub Gist):**

> <https://gist.github.com/georgi-iovchev/08f5647c1d3575c5e1dcbe7ec641c29d>
