~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_sf.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_log_bin.inc
 
2
 
 
3
# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
 
4
# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
 
5
 
 
6
# save status
 
7
 
 
8
let $oblf=`select @@SESSION.BINLOG_FORMAT`;
 
9
let $otfc=`select @@log_bin_trust_function_creators`;
 
10
 
 
11
set global log_bin_trust_function_creators=0;
 
12
 
 
13
 
 
14
 
 
15
# fail *on definition*
 
16
 
 
17
set binlog_format=STATEMENT;
 
18
 
 
19
delimiter |;
 
20
--error ER_BINLOG_UNSAFE_ROUTINE
 
21
create function fn16456()
 
22
       returns int
 
23
begin
 
24
       return unix_timestamp();
 
25
end|
 
26
delimiter ;|
 
27
 
 
28
 
 
29
 
 
30
# force in definition, so we can see whether we fail on call
 
31
 
 
32
set global log_bin_trust_function_creators=1;
 
33
 
 
34
delimiter |;
 
35
create function fn16456()
 
36
       returns int
 
37
begin
 
38
       return unix_timestamp();
 
39
end|
 
40
delimiter ;|
 
41
 
 
42
set global log_bin_trust_function_creators=0;
 
43
 
 
44
 
 
45
 
 
46
# allow funcall in RBR
 
47
 
 
48
set binlog_format=ROW;
 
49
 
 
50
--replace_column 1 timestamp
 
51
select fn16456();
 
52
 
 
53
 
 
54
 
 
55
# fail funcall in SBR
 
56
 
 
57
set binlog_format=STATEMENT;
 
58
 
 
59
--error ER_BINLOG_UNSAFE_ROUTINE
 
60
select fn16456();
 
61
 
 
62
 
 
63
 
 
64
# clean
 
65
 
 
66
drop function fn16456;
 
67
 
 
68
 
 
69
 
 
70
# success in definition with deterministic
 
71
 
 
72
set global log_bin_trust_function_creators=0;
 
73
 
 
74
delimiter |;
 
75
create function fn16456()
 
76
       returns int deterministic
 
77
begin
 
78
       return unix_timestamp();
 
79
end|
 
80
delimiter ;|
 
81
 
 
82
 
 
83
 
 
84
# allow funcall in RBR
 
85
 
 
86
set binlog_format=ROW;
 
87
 
 
88
--replace_column 1 timestamp
 
89
select fn16456();
 
90
 
 
91
 
 
92
 
 
93
# allow funcall in SBR
 
94
 
 
95
set binlog_format=STATEMENT;
 
96
 
 
97
--replace_column 1 timestamp
 
98
select fn16456();
 
99
 
 
100
 
 
101
 
 
102
# clean
 
103
 
 
104
drop function fn16456;
 
105
 
 
106
 
 
107
# success in definition with NO SQL
 
108
 
 
109
set global log_bin_trust_function_creators=0;
 
110
 
 
111
delimiter |;
 
112
create function fn16456()
 
113
       returns int no sql
 
114
begin
 
115
       return unix_timestamp();
 
116
end|
 
117
delimiter ;|
 
118
 
 
119
 
 
120
 
 
121
# allow funcall in RBR
 
122
 
 
123
set binlog_format=ROW;
 
124
 
 
125
--replace_column 1 timestamp
 
126
select fn16456();
 
127
 
 
128
 
 
129
 
 
130
# allow funcall in SBR
 
131
 
 
132
set binlog_format=STATEMENT;
 
133
 
 
134
--replace_column 1 timestamp
 
135
select fn16456();
 
136
 
 
137
 
 
138
# clean
 
139
 
 
140
drop function fn16456;
 
141
 
 
142
 
 
143
 
 
144
# success in definition with reads sql data
 
145
 
 
146
set global log_bin_trust_function_creators=0;
 
147
 
 
148
delimiter |;
 
149
create function fn16456()
 
150
       returns int reads sql data
 
151
begin
 
152
       return unix_timestamp();
 
153
end|
 
154
delimiter ;|
 
155
 
 
156
 
 
157
 
 
158
# allow funcall in RBR
 
159
 
 
160
set binlog_format=ROW;
 
161
 
 
162
--replace_column 1 timestamp
 
163
select fn16456();
 
164
 
 
165
 
 
166
 
 
167
# allow funcall in SBR
 
168
 
 
169
set binlog_format=STATEMENT;
 
170
 
 
171
--replace_column 1 timestamp
 
172
select fn16456();
 
173
 
 
174
 
 
175
 
 
176
# clean
 
177
 
 
178
drop function fn16456;
 
179
 
 
180
 
 
181
 
 
182
# restore status
 
183
 
 
184
--disable_query_log
 
185
eval set binlog_format=$oblf;
 
186
eval set global log_bin_trust_function_creators=$otfc;
 
187
--enable_query_log