~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/kill.test

  • Committer: Monty Taylor
  • Date: 2008-10-07 19:30:18 UTC
  • mfrom: (322.2.8 stdize-code)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: monty@inaugust.com-20081007193018-22fhaywc990akeqa
Merged code from Mats that I should have merged a while ago.

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
 
3
6
connect (con1, localhost, root,,);
4
7
connect (con2, localhost, root,,);
5
8
 
23
26
 
24
27
--disable_query_log
25
28
--disable_result_log
26
 
 
27
29
# One of the following statements should fail
28
 
--error EE_OK,EE_BADCLOSE,EE_UNKNOWN_CHARSET,EE_CANT_SYMLINK
29
 
select 1;
30
 
 
31
 
--error EE_OK,EE_BADCLOSE,EE_UNKNOWN_CHARSET,EE_CANT_SYMLINK
32
 
select 1;
33
 
 
 
30
--error 0,2006,2013
 
31
select 1;
 
32
--error 0,2006,2013
 
33
select 1;
34
34
--enable_query_log
35
35
--enable_result_log
36
36
 
45
45
drop table t1;
46
46
connection default;
47
47
 
 
48
--error ER_NOT_SUPPORTED_YET
 
49
kill (select count(*) from mysql.user);
 
50
 
48
51
#
49
52
# BUG#14851: killing long running subquery processed via a temporary table.
50
53
#
56
59
 
57
60
-- disable_result_log
58
61
-- disable_query_log
59
 
begin;
60
62
let $1 = 4096;
61
63
while ($1)
62
64
{
63
65
  eval insert into t1 values ($1);
64
66
  dec $1;
65
67
}
66
 
commit;
67
68
-- enable_query_log
68
69
-- enable_result_log
69
70
 
87
88
kill @id;
88
89
 
89
90
connection conn1;
90
 
#-- error 1053,2013,1104
91
 
--error ER_SERVER_SHUTDOWN, ER_TOO_BIG_SELECT
 
91
-- error 1053,2013
92
92
reap;
93
93
 
94
94
connection default;
97
97
 
98
98
# End of 4.1 tests
99
99
 
100
 
# Fix issue with kill $
101
 
#create table t1(f1 int);
102
 
#
103
 
## Test UPDATE
104
 
#insert into t1 values(0);
105
 
#connection con2;
106
 
#send update t1 set f1= bug27563();
107
 
#real_sleep 2;
108
 
#connection con1;
109
 
#disable_query_log;
110
 
#kill query $ID;
111
 
#enable_query_log;
112
 
#connection con2;
113
 
#--error ER_QUERY_INTERRUPTED
114
 
#reap;
115
 
#select @a;
116
 
#connection con1;
117
 
#select * from t1;
118
 
#
119
 
## Test DELETE
120
 
#insert into t1 values(1);
121
 
#connection con2;
122
 
#send delete from t1 where bug27563() is null;
123
 
#real_sleep 2;
124
 
#connection con1;
125
 
#disable_query_log;
126
 
#eval kill query $ID;
127
 
#enable_query_log;
128
 
#connection con2;
129
 
#--error ER_QUERY_INTERRUPTED
130
 
#reap;
131
 
#select @a;
132
 
#connection con1;
133
 
#select * from t1;
134
 
#
135
 
## Test SELECT
136
 
#connection con2;
137
 
#send select * from t1 where f1= bug27563();
138
 
#real_sleep 2;
139
 
#connection con1;
140
 
#disable_query_log;
141
 
#eval kill query $ID;
142
 
#enable_query_log;
143
 
#connection con2;
144
 
#--error ER_QUERY_INTERRUPTED
145
 
#reap;
146
 
#select @a;
147
 
#
148
 
#
 
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
 
149
168
###########################################################################
150
169
 
151
170
--echo #
161
180
 
162
181
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing 
163
182
--echo # of close of the connection socket
164
 
 
165
 
--error EE_OK,EE_BADCLOSE,EE_UNKNOWN_CHARSET,EE_CANT_SYMLINK
 
183
--error 2013, 2006 
166
184
SELECT 1;
167
 
 
168
185
--connection default
169
186
 
170
187
###########################################################################
 
188
 
 
189
# Restore global concurrent_insert value. Keep in the end of the test file.
 
190
set @@global.concurrent_insert= @old_concurrent_insert;