1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-20 10:24:14 +03:00

MDEV-24617 OPTIMIZE on a sequence causes unexpected ER_BINLOG_UNSAFE_STATEMENT

The warning out of OPTIMIZE
  Statement is unsafe because it uses a system function
was indeed counterfactual and was resulted by checking an
insufficiently strict property of lex' sql_command_flags.

Fixed with deploying an additional checking of weather
the current sql command that modifes a share->non_determinstic_insert
table is capable of generating ROW format events.
The extra check rules out the unsafety to OPTIMIZE et al, while the
existing check continues to do so to CREATE TABLE (which is
perculiarly tagged as ROW-event generative sql command).

As a side effect sql_sequence.binlog test gets corrected and
binlog_stm_unsafe_warning.test is reinforced to add up
an unsafe CREATE..SELECT test.
This commit is contained in:
Andrei
2022-03-03 17:47:54 +02:00
parent 8ea08505a1
commit e7cf871dda
5 changed files with 64 additions and 5 deletions

View File

@ -1,5 +1,5 @@
--source include/have_udf.inc
--source include/have_log_bin.inc
--source include/have_sequence.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/binlog_start_pos.inc
#
@ -21,6 +21,17 @@ select next value for s1, minimum_value from s1 where maximum_value> 4;
#
alter sequence s1 maxvalue 1000;
# MDEV-24617 OPTIMIZE on a sequence causes unexpected
# ER_BINLOG_UNSAFE_STATEMENT The test below verifies no unsafe
# warnings anymore for any relavant commands that like OPTIMIZE can
# not produce ROW format events therefore the unsafe warning either.
optimize table s1;
analyze table s1;
repair table s1;
check table s1;
rename table s1 to tmp_s;
rename table tmp_s to s1;
drop sequence s1;
--let $binlog_file = LAST