summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-07-28 23:39:58 +0100
committerAlfranio Correia <alfranio.correia@sun.com>2009-07-28 23:39:58 +0100
commitd871bef758aab5993daea0a7727a358a1f0b576e (patch)
tree09015943fdf27031d92aa94d8fe3f3ee96838d79 /mysql-test
parent1df8ad6c1471602abb9e11865ad2ba302a8fca08 (diff)
parent043e09b5433df9b9b0d4a14cb94cd979984a4b0a (diff)
downloadmariadb-git-d871bef758aab5993daea0a7727a358a1f0b576e.tar.gz
auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/rpl/r/rpl_sf.result47
-rw-r--r--mysql-test/suite/rpl/t/rpl_sf.test121
2 files changed, 165 insertions, 3 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_sf.result b/mysql-test/suite/rpl/r/rpl_sf.result
index 46defc6908a..085ba1ebb8a 100644
--- a/mysql-test/suite/rpl/r/rpl_sf.result
+++ b/mysql-test/suite/rpl/r/rpl_sf.result
@@ -19,5 +19,50 @@ fn16456()
timestamp
set binlog_format=STATEMENT;
select fn16456();
-ERROR HY000: Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events
+ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+drop function fn16456;
+set global log_bin_trust_function_creators=0;
+create function fn16456()
+returns int deterministic
+begin
+return unix_timestamp();
+end|
+set binlog_format=ROW;
+select fn16456();
+fn16456()
+timestamp
+set binlog_format=STATEMENT;
+select fn16456();
+fn16456()
+timestamp
+drop function fn16456;
+set global log_bin_trust_function_creators=0;
+create function fn16456()
+returns int no sql
+begin
+return unix_timestamp();
+end|
+set binlog_format=ROW;
+select fn16456();
+fn16456()
+timestamp
+set binlog_format=STATEMENT;
+select fn16456();
+fn16456()
+timestamp
+drop function fn16456;
+set global log_bin_trust_function_creators=0;
+create function fn16456()
+returns int reads sql data
+begin
+return unix_timestamp();
+end|
+set binlog_format=ROW;
+select fn16456();
+fn16456()
+timestamp
+set binlog_format=STATEMENT;
+select fn16456();
+fn16456()
+timestamp
drop function fn16456;
diff --git a/mysql-test/suite/rpl/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test
index ecf91a723fa..4d12f3839a2 100644
--- a/mysql-test/suite/rpl/t/rpl_sf.test
+++ b/mysql-test/suite/rpl/t/rpl_sf.test
@@ -1,6 +1,7 @@
-- source include/have_log_bin.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
@@ -55,15 +56,131 @@ select fn16456();
set binlog_format=STATEMENT;
---error ER_BINLOG_ROW_RBR_TO_SBR
+--error ER_BINLOG_UNSAFE_ROUTINE
select fn16456();
-# restore status
+# 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
eval set binlog_format=$oblf;
eval set global log_bin_trust_function_creators=$otfc;