~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/kill.test

  • Committer: Brian Aker
  • Date: 2009-06-05 05:40:36 UTC
  • mfrom: (1046.1.15 merge)
  • Revision ID: brian@gaz-20090605054036-1024tm3gv0oloipw
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Disable concurrent inserts to avoid test failures when reading the
2
2
# connection id which was inserted into a table by another thread.
3
 
set @old_concurrent_insert= @@global.concurrent_insert;
4
 
set @@global.concurrent_insert= 0;
5
 
 
6
3
connect (con1, localhost, root,,);
7
4
connect (con2, localhost, root,,);
8
5
 
27
24
--disable_query_log
28
25
--disable_result_log
29
26
# One of the following statements should fail
30
 
--error 0,2006,2013
 
27
--error 0,5,20,23
31
28
select 1;
32
 
--error 0,2006,2013
 
29
--error 0,5,20,23
33
30
select 1;
34
31
--enable_query_log
35
32
--enable_result_log
45
42
drop table t1;
46
43
connection default;
47
44
 
48
 
--error ER_NOT_SUPPORTED_YET
49
 
kill (select count(*) from mysql.user);
50
 
 
51
45
#
52
46
# BUG#14851: killing long running subquery processed via a temporary table.
53
47
#
54
48
create table t1 (id int primary key);
55
 
create table t2 (id int unsigned not null);
 
49
create table t2 (id int not null);
56
50
 
57
51
connect (conn1, localhost, root,,);
58
52
connection conn1;
59
53
 
60
54
-- disable_result_log
61
55
-- disable_query_log
 
56
begin;
62
57
let $1 = 4096;
63
58
while ($1)
64
59
{
65
60
  eval insert into t1 values ($1);
66
61
  dec $1;
67
62
}
 
63
commit;
68
64
-- enable_query_log
69
65
-- enable_result_log
70
66
 
88
84
kill @id;
89
85
 
90
86
connection conn1;
 
87
-- error 1053,2013,1104
91
88
reap;
92
89
 
93
90
connection default;
97
93
 
98
94
# End of 4.1 tests
99
95
 
100
 
#
101
 
# test of blocking of sending ERROR after OK or EOF
102
 
#
103
 
connection con1;
104
 
select get_lock("a", 10);
105
 
connection con2;
106
 
let $ID= `select connection_id()`;
107
 
send select get_lock("a", 10);
108
 
real_sleep 2;
109
 
connection con1;
110
 
disable_query_log;
111
 
eval kill query $ID;
112
 
enable_query_log;
113
 
connection con2;
114
 
reap;
115
 
select 1;
116
 
connection con1;
117
 
select RELEASE_LOCK("a");
118
 
 
119
 
create table t1(f1 int);
120
 
 
121
 
 
122
 
# Test UPDATE
123
 
insert into t1 values(0);
124
 
connection con2;
125
 
send update t1 set f1= bug27563();
126
 
real_sleep 2;
127
 
connection con1;
128
 
disable_query_log;
129
 
eval kill query $ID;
130
 
enable_query_log;
131
 
connection con2;
132
 
--error 1317
133
 
reap;
134
 
select @a;
135
 
connection con1;
136
 
select * from t1;
137
 
 
138
 
# Test DELETE
139
 
insert into t1 values(1);
140
 
connection con2;
141
 
send delete from t1 where bug27563() is null;
142
 
real_sleep 2;
143
 
connection con1;
144
 
disable_query_log;
145
 
eval kill query $ID;
146
 
enable_query_log;
147
 
connection con2;
148
 
--error 1317
149
 
reap;
150
 
select @a;
151
 
connection con1;
152
 
select * from t1;
153
 
 
154
 
# Test SELECT
155
 
connection con2;
156
 
send select * from t1 where f1= bug27563();
157
 
real_sleep 2;
158
 
connection con1;
159
 
disable_query_log;
160
 
eval kill query $ID;
161
 
enable_query_log;
162
 
connection con2;
163
 
--error 1317
164
 
reap;
165
 
select @a;
166
 
 
167
 
 
 
96
# Fix issue with kill $
 
97
#create table t1(f1 int);
 
98
#
 
99
## Test UPDATE
 
100
#insert into t1 values(0);
 
101
#connection con2;
 
102
#send update t1 set f1= bug27563();
 
103
#real_sleep 2;
 
104
#connection con1;
 
105
#disable_query_log;
 
106
#kill query $ID;
 
107
#enable_query_log;
 
108
#connection con2;
 
109
#--error 1317
 
110
#reap;
 
111
#select @a;
 
112
#connection con1;
 
113
#select * from t1;
 
114
#
 
115
## Test DELETE
 
116
#insert into t1 values(1);
 
117
#connection con2;
 
118
#send delete from t1 where bug27563() is null;
 
119
#real_sleep 2;
 
120
#connection con1;
 
121
#disable_query_log;
 
122
#eval kill query $ID;
 
123
#enable_query_log;
 
124
#connection con2;
 
125
#--error 1317
 
126
#reap;
 
127
#select @a;
 
128
#connection con1;
 
129
#select * from t1;
 
130
#
 
131
## Test SELECT
 
132
#connection con2;
 
133
#send select * from t1 where f1= bug27563();
 
134
#real_sleep 2;
 
135
#connection con1;
 
136
#disable_query_log;
 
137
#eval kill query $ID;
 
138
#enable_query_log;
 
139
#connection con2;
 
140
#--error 1317
 
141
#reap;
 
142
#select @a;
 
143
#
 
144
#
168
145
###########################################################################
169
146
 
170
147
--echo #
180
157
 
181
158
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing 
182
159
--echo # of close of the connection socket
183
 
--error 2013, 2006 
 
160
--error 5, 20, 23
184
161
SELECT 1;
185
162
--connection default
186
163
 
187
164
###########################################################################
188
 
 
189
 
# Restore global concurrent_insert value. Keep in the end of the test file.
190
 
set @@global.concurrent_insert= @old_concurrent_insert;