1
by brian
clean slate |
1 |
# Disable concurrent inserts to avoid test failures when reading the |
2 |
# connection id which was inserted into a table by another thread. |
|
3 |
connect (con1, localhost, root,,); |
|
4 |
connect (con2, localhost, root,,); |
|
5 |
||
6 |
#remember id of con1 |
|
7 |
connection con1; |
|
8 |
--disable_warnings |
|
9 |
drop table if exists t1, t2, t3; |
|
10 |
--enable_warnings |
|
11 |
||
12 |
--disable_reconnect |
|
13 |
create table t1 (kill_id int); |
|
14 |
insert into t1 values(connection_id()); |
|
15 |
||
16 |
#kill con1 |
|
17 |
connection con2; |
|
18 |
select ((@id := kill_id) - kill_id) from t1; |
|
19 |
kill @id; |
|
20 |
||
21 |
connection con1; |
|
22 |
--sleep 2 |
|
23 |
||
24 |
--disable_query_log |
|
25 |
--disable_result_log |
|
2107.1.1
by Brian Aker
Add in all of the error messages, also remove all cases of --error number |
26 |
|
1
by brian
clean slate |
27 |
# One of the following statements should fail |
2107.1.1
by Brian Aker
Add in all of the error messages, also remove all cases of --error number |
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 |
||
1
by brian
clean slate |
34 |
--enable_query_log |
35 |
--enable_result_log |
|
36 |
||
37 |
--enable_reconnect |
|
38 |
# this should work, and we should have a new connection_id() |
|
39 |
select ((@id := kill_id) - kill_id) from t1; |
|
40 |
select @id != connection_id(); |
|
41 |
||
42 |
#make sure the server is still alive |
|
43 |
connection con2; |
|
44 |
select 4; |
|
45 |
drop table t1; |
|
46 |
connection default; |
|
47 |
||
48 |
#
|
|
49 |
# BUG#14851: killing long running subquery processed via a temporary table. |
|
50 |
#
|
|
51 |
create table t1 (id int primary key); |
|
413.2.2
by Brian Aker
Removed UNSIGNED from parser. |
52 |
create table t2 (id int not null); |
1
by brian
clean slate |
53 |
|
54 |
connect (conn1, localhost, root,,); |
|
55 |
connection conn1; |
|
56 |
||
57 |
-- disable_result_log |
|
58 |
-- disable_query_log |
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
59 |
begin; |
1
by brian
clean slate |
60 |
let $1 = 4096; |
61 |
while ($1) |
|
62 |
{
|
|
63 |
eval insert into t1 values ($1); |
|
64 |
dec $1; |
|
65 |
}
|
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
66 |
commit; |
1
by brian
clean slate |
67 |
-- enable_query_log |
68 |
-- enable_result_log |
|
69 |
||
70 |
insert into t2 select id from t1; |
|
71 |
||
72 |
create table t3 (kill_id int); |
|
73 |
insert into t3 values(connection_id()); |
|
74 |
connect (conn2, localhost, root,,); |
|
75 |
connection conn2; |
|
76 |
||
77 |
connection conn1; |
|
78 |
-- disable_result_log |
|
79 |
# This is a very long running query. If this test start failing, it may |
|
80 |
# be necessary to change to an even longer query. |
|
81 |
send select id from t1 where id in (select distinct a.id from t2 a, t2 b, t2 c, t2 d group by a.id, b.id, c.id, d.id having a.id between 10 and 20); |
|
82 |
-- enable_result_log |
|
83 |
||
84 |
connection conn2; |
|
85 |
select ((@id := kill_id) - kill_id) from t3; |
|
86 |
-- sleep 1 |
|
87 |
kill @id; |
|
88 |
||
89 |
connection conn1; |
|
2114.2.1
by Brian Aker
Next pass through of tests (remove number, use label for error). |
90 |
#-- error 1053,2013,1104 |
91 |
--error ER_SERVER_SHUTDOWN, ER_TOO_BIG_SELECT |
|
1
by brian
clean slate |
92 |
reap; |
93 |
||
94 |
connection default; |
|
95 |
||
96 |
drop table t1, t2, t3; |
|
97 |
||
98 |
# End of 4.1 tests |
|
99 |
||
520.1.19
by Brian Aker
Adding kill test |
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; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
113 |
#--error ER_QUERY_INTERRUPTED |
520.1.19
by Brian Aker
Adding kill test |
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; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
129 |
#--error ER_QUERY_INTERRUPTED |
520.1.19
by Brian Aker
Adding kill test |
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; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
144 |
#--error ER_QUERY_INTERRUPTED |
520.1.19
by Brian Aker
Adding kill test |
145 |
#reap; |
146 |
#select @a; |
|
147 |
#
|
|
148 |
#
|
|
1
by brian
clean slate |
149 |
###########################################################################
|
150 |
||
151 |
--echo # |
|
152 |
--echo # Bug#19723: kill of active connection yields different error code |
|
153 |
--echo # depending on platform. |
|
154 |
--echo # |
|
155 |
||
156 |
--echo |
|
157 |
--echo # Connection: con2. |
|
158 |
--connection con2 |
|
159 |
||
160 |
KILL CONNECTION_ID(); |
|
161 |
||
162 |
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing |
|
163 |
--echo # of close of the connection socket |
|
2107.1.1
by Brian Aker
Add in all of the error messages, also remove all cases of --error number |
164 |
|
165 |
--error EE_OK,EE_BADCLOSE,EE_UNKNOWN_CHARSET,EE_CANT_SYMLINK |
|
1
by brian
clean slate |
166 |
SELECT 1; |
2107.1.1
by Brian Aker
Add in all of the error messages, also remove all cases of --error number |
167 |
|
1
by brian
clean slate |
168 |
--connection default |
169 |
||
170 |
###########################################################################
|