1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-08 00:28:29 +03:00

MDEV-37356 Annotate_rows written in a 'random' position

Ensure that Annotate_rows is always written direct after GTID information,
before any table_map events.

Before this patch, the following problems existed when mixing
transactional and not transactional tables in the same statement:
- Annotate rows could be written after row events or in the next GTID
  event.
  - See rpl_row_mixing_engines

- Annotate_rows was not always written to binary log in case of error
  with a transactional table (rolled back) but a not transactional
  table was updated.
  - See sp_trans_log, binlog_row_mix_innodb_myisam

Fixed by writing the Annotate_rows event into the non transactional
cache if there are not transactional tables used. If not, write the
event into the transactional cache.
This commit is contained in:
Monty
2025-08-02 16:47:38 +03:00
parent 24821e9585
commit d2ce0650ad
13 changed files with 484 additions and 163 deletions

View File

@@ -3060,10 +3060,10 @@ public:
int binlog_update_row(TABLE* table, bool is_transactional,
const uchar *old_data, const uchar *new_data);
bool prepare_handlers_for_update(uint flag);
bool binlog_write_annotated_row(Log_event_writer *writer);
bool binlog_write_annotated_row(bool use_trans_cache);
void binlog_prepare_for_row_logging();
bool binlog_write_table_maps();
bool binlog_write_table_map(TABLE *table, bool with_annotate);
bool binlog_write_table_map(TABLE *table);
static void binlog_prepare_row_images(TABLE* table);
void set_server_id(uint32 sid) { variables.server_id = sid; }