Debian Codegraph @

mysql-test/suite/engines/funcs/t/rpl_sf.test

raw
1 # Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
2 --source include/master-slave.inc
3 # save status
4
5 let $oblf=`select @@SESSION.BINLOG_FORMAT`;
6 let $otfc=`select @@log_bin_trust_function_creators`;
7
8 set global log_bin_trust_function_creators=0;
9
10
11
12 # fail *on definition*
13
14 set binlog_format=STATEMENT;
15
16 delimiter |;
17 --error ER_BINLOG_UNSAFE_ROUTINE
18 create function fn16456()
19 returns int
20 begin
21 return unix_timestamp();
22 end|
23 delimiter ;|
24
25
26
27 # force in definition, so we can see whether we fail on call
28
29 set global log_bin_trust_function_creators=1;
30
31 delimiter |;
32 create function fn16456()
33 returns int
34 begin
35 return unix_timestamp();
36 end|
37 delimiter ;|
38
39 set global log_bin_trust_function_creators=0;
40
41
42
43 # allow funcall in RBR
44
45 set binlog_format=ROW;
46
47 --replace_column 1 timestamp
48 select fn16456();
49
50
51
52 # fail funcall in SBR
53
54 set binlog_format=STATEMENT;
55
56 --error ER_BINLOG_UNSAFE_ROUTINE
57 select fn16456();
58
59
60
61 # restore status
62
63 drop function fn16456;
64
65 --disable_query_log
66 eval set binlog_format=$oblf;
67 eval set global log_bin_trust_function_creators=$otfc;
68 --enable_query_log
69 --source include/rpl_end.inc