diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/binlog/t/binlog_sf.test | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/binlog/t/binlog_sf.test')
-rw-r--r-- | mysql-test/suite/binlog/t/binlog_sf.test | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog/t/binlog_sf.test b/mysql-test/suite/binlog/t/binlog_sf.test new file mode 100644 index 00000000..fecc4736 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_sf.test @@ -0,0 +1,187 @@ + +# We change binlog format inside the test, so no need to re-run with +# more than one binlog_format. +-- source include/have_binlog_format_statement.inc + +# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR +# BUG#41166 stored function requires "deterministic" if binlog_format is "statement" + +# save status + +let $otfc=`select @@log_bin_trust_function_creators`; +set global log_bin_trust_function_creators=0; + +# fail *on definition* + +set binlog_format=STATEMENT; + +delimiter |; +--error ER_BINLOG_UNSAFE_ROUTINE +create function fn16456() + returns int +begin + return unix_timestamp(); +end| +delimiter ;| + + + +# force in definition, so we can see whether we fail on call + +set global log_bin_trust_function_creators=1; + +delimiter |; +create function fn16456() + returns int +begin + return unix_timestamp(); +end| +delimiter ;| + +set global log_bin_trust_function_creators=0; + + + +# allow funcall in RBR + +set binlog_format=ROW; + +--replace_column 1 timestamp +select fn16456(); + + + +# fail funcall in SBR + +set binlog_format=STATEMENT; + +--error ER_BINLOG_UNSAFE_ROUTINE +select fn16456(); + + + +# clean + +drop function fn16456; + + + +# success in definition with deterministic + +set global log_bin_trust_function_creators=0; + +delimiter |; +create function fn16456() + returns int deterministic +begin + return unix_timestamp(); +end| +delimiter ;| + + + +# allow funcall in RBR + +set binlog_format=ROW; + +--replace_column 1 timestamp +select fn16456(); + + + +# allow funcall in SBR + +set binlog_format=STATEMENT; + +--replace_column 1 timestamp +select fn16456(); + + + +# clean + +drop function fn16456; + + +# success in definition with NO SQL + +set global log_bin_trust_function_creators=0; + +delimiter |; +create function fn16456() + returns int no sql +begin + return unix_timestamp(); +end| +delimiter ;| + + + +# allow funcall in RBR + +set binlog_format=ROW; + +--replace_column 1 timestamp +select fn16456(); + + + +# allow funcall in SBR + +set binlog_format=STATEMENT; + +--replace_column 1 timestamp +select fn16456(); + + +# clean + +drop function fn16456; + + + +# success in definition with reads sql data + +set global log_bin_trust_function_creators=0; + +delimiter |; +create function fn16456() + returns int reads sql data +begin + return unix_timestamp(); +end| +delimiter ;| + + + +# allow funcall in RBR + +set binlog_format=ROW; + +--replace_column 1 timestamp +select fn16456(); + + + +# allow funcall in SBR + +set binlog_format=STATEMENT; + +--replace_column 1 timestamp +select fn16456(); + + + +# clean + +drop function fn16456; + + + +# restore status + +--disable_query_log +set binlog_format=STATEMENT; +eval set global log_bin_trust_function_creators=$otfc; +reset master; +--enable_query_log |