2
# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
3
# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
7
let $oblf=`select @@SESSION.BINLOG_FORMAT`;
8
let $otfc=`select @@log_bin_trust_function_creators`;
10
set global log_bin_trust_function_creators=0;
14
# fail *on definition*
16
set binlog_format=STATEMENT;
19
--error ER_BINLOG_UNSAFE_ROUTINE
20
create function fn16456()
23
return unix_timestamp();
29
# force in definition, so we can see whether we fail on call
31
set global log_bin_trust_function_creators=1;
34
create function fn16456()
37
return unix_timestamp();
41
set global log_bin_trust_function_creators=0;
45
# allow funcall in RBR
47
set binlog_format=ROW;
49
--replace_column 1 timestamp
56
set binlog_format=STATEMENT;
58
--error ER_BINLOG_UNSAFE_ROUTINE
65
drop function fn16456;
69
# success in definition with deterministic
71
set global log_bin_trust_function_creators=0;
74
create function fn16456()
75
returns int deterministic
77
return unix_timestamp();
83
# allow funcall in RBR
85
set binlog_format=ROW;
87
--replace_column 1 timestamp
92
# allow funcall in SBR
94
set binlog_format=STATEMENT;
96
--replace_column 1 timestamp
103
drop function fn16456;
106
# success in definition with NO SQL
108
set global log_bin_trust_function_creators=0;
111
create function fn16456()
114
return unix_timestamp();
120
# allow funcall in RBR
122
set binlog_format=ROW;
124
--replace_column 1 timestamp
129
# allow funcall in SBR
131
set binlog_format=STATEMENT;
133
--replace_column 1 timestamp
139
drop function fn16456;
143
# success in definition with reads sql data
145
set global log_bin_trust_function_creators=0;
148
create function fn16456()
149
returns int reads sql data
151
return unix_timestamp();
157
# allow funcall in RBR
159
set binlog_format=ROW;
161
--replace_column 1 timestamp
166
# allow funcall in SBR
168
set binlog_format=STATEMENT;
170
--replace_column 1 timestamp
177
drop function fn16456;
184
eval set binlog_format=$oblf;
185
eval set global log_bin_trust_function_creators=$otfc;