1
# Disable concurrent inserts to avoid test failures when reading the
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;
6
connect (con1, localhost, root,,);
7
connect (con2, localhost, root,,);
12
drop table if exists t1, t2, t3;
16
create table t1 (kill_id int);
17
insert into t1 values(connection_id());
21
select ((@id := kill_id) - kill_id) from t1;
29
# One of the following statements should fail
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();
42
#make sure the server is still alive
48
--error ER_NOT_SUPPORTED_YET
49
kill (select count(*) from mysql.user);
52
# BUG#14851: killing long running subquery processed via a temporary table.
54
create table t1 (id int primary key);
55
create table t2 (id int not null);
57
connect (conn1, localhost, root,,);
63
eval insert into t1 values ($1);
67
insert into t2 select id from t1;
69
create table t3 (kill_id int);
70
insert into t3 values(connection_id());
71
connect (conn2, localhost, root,,);
75
# This is a very long running query. If this test start failing, it may
76
# be necessary to change to an even longer query.
77
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);
80
select ((@id := kill_id) - kill_id) from t3;
88
drop table t1, t2, t3;
93
# test of blocking of sending ERROR after OK or EOF
96
select get_lock("a", 10);
98
let $ID= `select connection_id()`;
99
send select get_lock("a", 10);
109
select RELEASE_LOCK("a");
111
create table t1(f1 int);
115
insert into t1 values(0);
117
send update t1 set f1= bug27563();
131
insert into t1 values(1);
133
send delete from t1 where bug27563() is null;
148
send select * from t1 where f1= bug27563();
160
###########################################################################
163
--echo # Bug#19723: kill of active connection yields different error code
164
--echo # depending on platform.
168
--echo # Connection: con2.
171
KILL CONNECTION_ID();
173
--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
174
--echo # of close of the connection socket
179
###########################################################################
181
# Restore global concurrent_insert value. Keep in the end of the test file.
182
set @@global.concurrent_insert= @old_concurrent_insert;