~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/rpl_sf.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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