1
# This test doesn't work with the embedded version as this code
2
# assumes that one query is running while we are doing queries on
4
# This would work if mysqltest run would be threaded and handle each
5
# connection in a separate thread.
7
-- source include/not_embedded.inc
9
# Disable concurrent inserts to avoid test failures when reading the
10
# connection id which was inserted into a table by another thread.
11
set @old_concurrent_insert= @@global.concurrent_insert;
12
set @@global.concurrent_insert= 0;
14
connect (con1, localhost, root,,);
15
connect (con2, localhost, root,,);
20
drop table if exists t1, t2, t3;
24
create table t1 (kill_id int);
25
insert into t1 values(connection_id());
29
select ((@id := kill_id) - kill_id) from t1;
37
# One of the following statements should fail
46
# this should work, and we should have a new connection_id()
47
select ((@id := kill_id) - kill_id) from t1;
48
select @id != connection_id();
50
#make sure the server is still alive
56
--error ER_NOT_SUPPORTED_YET
57
kill (select count(*) from mysql.user);
60
# BUG#14851: killing long running subquery processed via a temporary table.
62
create table t1 (id int primary key);
63
create table t2 (id int unsigned not null);
65
connect (conn1, localhost, root,,);
73
eval insert into t1 values ($1);
79
insert into t2 select id from t1;
81
create table t3 (kill_id int);
82
insert into t3 values(connection_id());
83
connect (conn2, localhost, root,,);
88
# This is a very long running query. If this test start failing, it may
89
# be necessary to change to an even longer query.
90
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);
94
select ((@id := kill_id) - kill_id) from t3;
104
drop table t1, t2, t3;
109
# test of blocking of sending ERROR after OK or EOF
112
select get_lock("a", 10);
114
let $ID= `select connection_id()`;
115
send select get_lock("a", 10);
125
select RELEASE_LOCK("a");
127
create table t1(f1 int);
131
insert into t1 values(0);
133
send update t1 set f1= bug27563();
147
insert into t1 values(1);
149
send delete from t1 where bug27563() is null;
164
send select * from t1 where f1= bug27563();
176
###########################################################################
179
--echo # Bug#19723: kill of active connection yields different error code
180
--echo # depending on platform.
184
--echo # Connection: con2.
187
KILL CONNECTION_ID();
189
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
190
--echo # of close of the connection socket
195
###########################################################################
197
# Restore global concurrent_insert value. Keep in the end of the test file.
198
set @@global.concurrent_insert= @old_concurrent_insert;