[MDEV-24617] OPTIMIZE on a sequence causes unexpected ER_BINLOG_UNSAFE_STATEMENT warning Created: 2021-01-18  Updated: 2022-08-24  Resolved: 2022-03-10

Status: Closed
Project: MariaDB Server
Component/s: Replication, Sequences
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Andrei Elkin
Resolution: Fixed Votes: 0
Labels: replication-statement-format-unsafe

Issue Links:
Duplicate
duplicates MDEV-16285 OPTIMIZE TABLE on sequence causes une... Closed

 Description   

OPTIMIZE TABLE on a sequence causes ER_BINLOG_UNSAFE_STATEMENT warning ("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"), even with binlog_format set to mixed or row.

--source include/have_log_bin.inc
--source include/have_binlog_format_mixed_or_row.inc
CREATE SEQUENCE s;
OPTIMIZE TABLE s;
 
# Cleanup
DROP SEQUENCE s;

10.3 f130adbf

OPTIMIZE TABLE s;
Table	Op	Msg_type	Msg_text
test.s	optimize	note	The storage engine for the table doesn't support optimize
Warnings:
Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave

2021-01-18 18:38:18 5 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave Statement: OPTIMIZE TABLE s



 Comments   
Comment by Andrei Elkin [ 2022-03-03 ]

Brandon, could you please review the patch the soonest, as it is a support case.
The current commit is here:
2c15244e6db HEAD -> bb-10.3-andrei

Thank you.

Andrei

Comment by Brandon Nesterenko [ 2022-03-03 ]

Approved after discussion and analysis on Slack looking into the completeness of CF_CAN_GENERATE_ROW_EVENTS and other use cases which set the variable share->non_determinstic_insert

Generated at Thu Feb 08 09:31:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.