summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/engines/funcs/t/rpl_sf.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/engines/funcs/t/rpl_sf.test
parentInitial commit. (diff)
downloadmariadb-upstream.tar.xz
mariadb-upstream.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/engines/funcs/t/rpl_sf.test')
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_sf.test69
1 files changed, 69 insertions, 0 deletions
diff --git a/mysql-test/suite/engines/funcs/t/rpl_sf.test b/mysql-test/suite/engines/funcs/t/rpl_sf.test
new file mode 100644
index 00000000..7ce6dc00
--- /dev/null
+++ b/mysql-test/suite/engines/funcs/t/rpl_sf.test
@@ -0,0 +1,69 @@
+# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
+--source include/master-slave.inc
+# save status
+
+let $oblf=`select @@SESSION.BINLOG_FORMAT`;
+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();
+
+
+
+# restore status
+
+drop function fn16456;
+
+--disable_query_log
+eval set binlog_format=$oblf;
+eval set global log_bin_trust_function_creators=$otfc;
+--enable_query_log
+--source include/rpl_end.inc