[MDEV-31770] Non-full binary log row image for INSERT ... ON DUPLICATE KEY UPDATE Created: 2023-07-24  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.2.44, 11.0.2, 10.3.39, 10.8.8, 10.4.30, 10.7, 10.5.21, 10.6.14, 10.9.7, 10.10.5, 10.11.4
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0

Type: Bug Priority: Major
Reporter: Dmitry Assignee: Andrei Elkin
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-21810 MBR: Unexpected "Unsafe statement" wa... Closed
relates to MDEV-28310 Missing binlog data for INSERT .. ON ... Closed

 Description   

I assume, for server with configuration

binlog-format=MIXED
binlog-row-image=FULL

there is an issue with non-full binary log representation for at least INSERT and UPDATE statements when "ON DUPLICATE KEY UPDATE" is used which was described in https://jira.mariadb.org/browse/MDEV-21810 and https://jira.mariadb.org/browse/MDEV-28310.

As far as I can see, examples from those tickets still produce non-full binary log result on checked 10.2 - 11.0 versions currently.



 Comments   
Comment by Alice Sherepa [ 2023-07-25 ]

Thank you for the report!
I repeated the test case from MDEV-21810, with binlog_row_image=FULL - not full image is generated, the part about warning was fixed

10.4 7d968f8c8aaca01614dfb46

#230725 10:06:25 server id 1  end_log_pos 847 CRC32 0x92b5c0ed 	Annotate_rows:
#Q> INSERT INTO t1 (a,b) VALUES (1,20) ON DUPLICATE KEY UPDATE b = 30
#230725 10:06:25 server id 1  end_log_pos 894 CRC32 0x9078d8d8 	Table_map: `test`.`t1` mapped to number 32
# at 894
#230725 10:06:25 server id 1  end_log_pos 946 CRC32 0x6feff097 	Update_rows: table id 32 flags: STMT_END_F
 
BINLOG '
gYK/ZBMBAAAALwAAAH4DAAAAACAAAAAAAAEABHRlc3QAAnQxAAMDAwMAB9jYeJA=
gYK/ZBgBAAAANAAAALIDAAAAACAAAAAAAAEAA/8D/AEAAAAKAAAA/AEAAAAeAAAAl/Dvbw==
'/*!*/;
### UPDATE `test`.`t1`
### WHERE
###   @1=1
###   @2=10
###   @3=NULL
### SET
###   @1=1
###   @2=30
# Number of rows: 1

Generated at Thu Feb 08 10:26:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.