1--source include/not_embedded.inc
2
3# Save the initial number of concurrent sessions
4--source include/count_sessions.inc
5
6connect (con1,localhost,root,,);
7connect (con2,localhost,root,,);
8connection con1;
9dirty_close con1;
10connection con2;
11
12--disable_warnings
13DROP TABLE IF EXISTS t1;
14--enable_warnings
15
16CREATE TABLE t1 (n INT);
17INSERT INTO t1 VALUES (1),(2),(3);
18SELECT * FROM t1;
19DROP TABLE t1;
20
21connection default;
22disconnect con2;
23
24# End of 4.1 tests
25
26#
27# Bug#10374 GET_LOCK does not let connection to close on the server side if it's aborted
28#
29
30connection default;
31SELECT GET_LOCK("dangling", 0);
32connect(con1, localhost, root,,);
33connection con1;
34--send SELECT GET_LOCK('dangling', 3600);
35connection default;
36let $wait_condition=
37  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = "User lock"
38  AND INFO = "SELECT GET_LOCK('dangling', 3600)";
39--source include/wait_condition.inc
40dirty_close con1;
41let $wait_condition=
42  SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = "User lock"
43  AND INFO = "SELECT GET_LOCK('dangling', 3600)";
44--source include/wait_condition.inc
45connect(con1, localhost, root,,);
46--send SELECT GET_LOCK('dangling', 3600);
47connection default;
48let $wait_condition=
49  SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = "User lock"
50  AND INFO = "SELECT GET_LOCK('dangling', 3600)";
51--source include/wait_condition.inc
52SELECT RELEASE_LOCK('dangling');
53connection con1;
54--reap
55connection default;
56disconnect con1;
57
58# Wait till all disconnects are completed
59--source include/wait_until_count_sessions.inc
60
61