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

« back to all changes in this revision

Viewing changes to mysql-test/r/sp_notembedded.result

  • 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
set @old_concurrent_insert= @@global.concurrent_insert;
 
2
set @@global.concurrent_insert= 0;
 
3
drop table if exists t1,t3;
 
4
drop procedure if exists bug4902|
 
5
create procedure bug4902()
 
6
begin
 
7
show grants for 'root'@'localhost';
 
8
end|
 
9
call bug4902()|
 
10
Grants for root@localhost
 
11
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
 
12
call bug4902()|
 
13
Grants for root@localhost
 
14
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
 
15
drop procedure bug4902|
 
16
drop procedure if exists bug4902_2|
 
17
create procedure bug4902_2()
 
18
begin
 
19
show processlist;
 
20
end|
 
21
call bug4902_2()|
 
22
show warnings|
 
23
Level   Code    Message
 
24
call bug4902_2()|
 
25
show warnings|
 
26
Level   Code    Message
 
27
drop procedure bug4902_2|
 
28
drop table if exists t1|
 
29
create table t1 (
 
30
id   char(16) not null default '',
 
31
data int not null
 
32
)|
 
33
drop procedure if exists bug3583|
 
34
drop procedure if exists bug3583|
 
35
create procedure bug3583()
 
36
begin
 
37
declare c int;
 
38
select * from t1;
 
39
select count(*) into c from t1;
 
40
select c;
 
41
end|
 
42
insert into t1 values ("x", 3), ("y", 5)|
 
43
set @x = @@query_cache_size|
 
44
set global query_cache_size = 10*1024*1024|
 
45
flush status|
 
46
flush query cache|
 
47
show status like 'Qcache_hits'|
 
48
Variable_name   Value
 
49
Qcache_hits     0
 
50
call bug3583()|
 
51
id      data
 
52
x       3
 
53
y       5
 
54
c
 
55
2
 
56
show status like 'Qcache_hits'|
 
57
Variable_name   Value
 
58
Qcache_hits     0
 
59
call bug3583()|
 
60
id      data
 
61
x       3
 
62
y       5
 
63
c
 
64
2
 
65
call bug3583()|
 
66
id      data
 
67
x       3
 
68
y       5
 
69
c
 
70
2
 
71
show status like 'Qcache_hits'|
 
72
Variable_name   Value
 
73
Qcache_hits     2
 
74
set global query_cache_size = @x|
 
75
flush status|
 
76
flush query cache|
 
77
delete from t1|
 
78
drop procedure bug3583|
 
79
drop table t1|
 
80
drop procedure if exists bug6807|
 
81
create procedure bug6807()
 
82
begin
 
83
declare id int;
 
84
set id = connection_id();
 
85
kill query id;
 
86
select 'Not reached';
 
87
end|
 
88
call bug6807()|
 
89
ERROR 70100: Query execution was interrupted
 
90
call bug6807()|
 
91
ERROR 70100: Query execution was interrupted
 
92
drop procedure bug6807|
 
93
drop function if exists bug10100f|
 
94
drop procedure if exists bug10100p|
 
95
drop procedure if exists bug10100t|
 
96
drop procedure if exists bug10100pt|
 
97
drop procedure if exists bug10100pv|
 
98
drop procedure if exists bug10100pd|
 
99
drop procedure if exists bug10100pc|
 
100
create function bug10100f(prm int) returns int
 
101
begin
 
102
if prm > 1 then
 
103
return prm * bug10100f(prm - 1);
 
104
end if;
 
105
return 1;
 
106
end|
 
107
create procedure bug10100p(prm int, inout res int)
 
108
begin
 
109
set res = res * prm;
 
110
if prm > 1 then
 
111
call bug10100p(prm - 1, res);
 
112
end if;
 
113
end|
 
114
create procedure bug10100t(prm int)
 
115
begin
 
116
declare res int;
 
117
set res = 1;
 
118
call bug10100p(prm, res);
 
119
select res;
 
120
end|
 
121
create table t3 (a int)|
 
122
insert into t3 values (0)|
 
123
create view v1 as select a from t3;
 
124
create procedure bug10100pt(level int, lim int)
 
125
begin
 
126
if level < lim then
 
127
update t3 set a=level;
 
128
FLUSH TABLES;
 
129
call bug10100pt(level+1, lim);
 
130
else
 
131
select * from t3;
 
132
end if;
 
133
end|
 
134
create procedure bug10100pv(level int, lim int)
 
135
begin
 
136
if level < lim then
 
137
update v1 set a=level;
 
138
FLUSH TABLES;
 
139
call bug10100pv(level+1, lim);
 
140
else
 
141
select * from v1;
 
142
end if;
 
143
end|
 
144
prepare stmt2 from "select * from t3;";
 
145
create procedure bug10100pd(level int, lim int)
 
146
begin
 
147
if level < lim then
 
148
select level;
 
149
prepare stmt1 from "update t3 set a=a+2";
 
150
execute stmt1;
 
151
FLUSH TABLES;
 
152
execute stmt1;
 
153
FLUSH TABLES;
 
154
execute stmt1;
 
155
FLUSH TABLES;
 
156
deallocate prepare stmt1;
 
157
execute stmt2;
 
158
select * from t3;
 
159
call bug10100pd(level+1, lim);
 
160
else
 
161
execute stmt2;
 
162
end if;
 
163
end|
 
164
create procedure bug10100pc(level int, lim int)
 
165
begin
 
166
declare lv int;
 
167
declare c cursor for select a from t3;
 
168
open c;
 
169
if level < lim then
 
170
select level;
 
171
fetch c into lv;
 
172
select lv;
 
173
update t3 set a=level+lv;
 
174
FLUSH TABLES;
 
175
call bug10100pc(level+1, lim);
 
176
else
 
177
select * from t3;
 
178
end if;
 
179
close c;
 
180
end|
 
181
set @@max_sp_recursion_depth=255|
 
182
set @var=1|
 
183
call bug10100p(255, @var)|
 
184
call bug10100pt(1,255)|
 
185
call bug10100pv(1,255)|
 
186
call bug10100pd(1,255)|
 
187
call bug10100pc(1,255)|
 
188
set @@max_sp_recursion_depth=0|
 
189
deallocate prepare stmt2|
 
190
drop function bug10100f|
 
191
drop procedure bug10100p|
 
192
drop procedure bug10100t|
 
193
drop procedure bug10100pt|
 
194
drop procedure bug10100pv|
 
195
drop procedure bug10100pd|
 
196
drop procedure bug10100pc|
 
197
drop view v1|
 
198
drop table t3|
 
199
drop procedure if exists bug15298_1;
 
200
drop procedure if exists bug15298_2;
 
201
grant all privileges on test.* to 'mysqltest_1'@'localhost';
 
202
create procedure 15298_1 () sql security definer show grants for current_user;
 
203
create procedure 15298_2 () sql security definer show grants;
 
204
call 15298_1();
 
205
Grants for root@localhost
 
206
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
 
207
call 15298_2();
 
208
Grants for root@localhost
 
209
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
 
210
drop user mysqltest_1@localhost;
 
211
drop procedure 15298_1;
 
212
drop procedure 15298_2;
 
213
drop table if exists t1;
 
214
drop procedure if exists p1;
 
215
create table t1 (value varchar(15));
 
216
create procedure p1() update t1 set value='updated' where value='old';
 
217
call p1();
 
218
insert into t1 (value) values ("old");
 
219
select get_lock('b26162',120);
 
220
get_lock('b26162',120)
 
221
1
 
222
select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
 
223
set session low_priority_updates=on;
 
224
call p1();;
 
225
select 'rl_contender', value from t1;
 
226
rl_contender    value
 
227
rl_contender    old
 
228
select release_lock('b26162');
 
229
release_lock('b26162')
 
230
1
 
231
rl_acquirer     value
 
232
rl_acquirer     old
 
233
drop procedure p1;
 
234
drop table t1;
 
235
set session low_priority_updates=default;
 
236
INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv,
 
237
Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv,
 
238
Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv,
 
239
Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv,
 
240
Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv,
 
241
Create_user_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions,
 
242
max_updates, max_connections, max_user_connections) 
 
243
VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N',
 
244
'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '',
 
245
'', '', '', '0', '0', '0', '0');
 
246
FLUSH PRIVILEGES;
 
247
CREATE PROCEDURE p1(i INT) BEGIN END;
 
248
DROP PROCEDURE p1;
 
249
DELETE FROM mysql.user WHERE User='mysqltest_1';
 
250
FLUSH PRIVILEGES;
 
251
set @@global.concurrent_insert= @old_concurrent_insert;
 
252
#
 
253
# Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
 
254
#
 
255
SELECT GET_LOCK('Bug44521', 0);
 
256
GET_LOCK('Bug44521', 0)
 
257
1
 
258
** Connection con1
 
259
CREATE PROCEDURE p()
 
260
BEGIN
 
261
SELECT 1;
 
262
SELECT GET_LOCK('Bug44521', 100);
 
263
SELECT 2;
 
264
END$
 
265
CALL p();;
 
266
** Default connection
 
267
SELECT RELEASE_LOCK('Bug44521');
 
268
RELEASE_LOCK('Bug44521')
 
269
1
 
270
DROP PROCEDURE p;
 
271
CREATE TABLE t1(a int);
 
272
INSERT INTO t1 VALUES (1);
 
273
CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
 
274
CREATE VIEW v1 AS SELECT f1('a') FROM t1;
 
275
SELECT * FROM v1;;
 
276
SELECT * FROM v1;
 
277
ERROR 70100: Query execution was interrupted
 
278
ERROR 70100: Query execution was interrupted
 
279
DROP VIEW v1;
 
280
DROP TABLE t1;
 
281
DROP FUNCTION f1;
 
282
# ------------------------------------------------------------------
 
283
# -- End of 5.1 tests
 
284
# ------------------------------------------------------------------