| 1 |
## I. Kill query that executes for a long time(contains SQL sleep). It must be killed from another |
| 2 |
# XSession. |
| 3 |
# 1. Sleep is execute inside "WHERE" clause (of SELECT statement) |
| 4 |
# 2. Sleep is execute inside "select_expr" of SELECT statement, and must return multiple rows |
| 5 |
|
| 6 |
CREATE TABLE data(b INT); |
| 7 |
INSERT INTO data(b) VALUES (1),(2),(3); |
| 8 |
|
| 9 |
# |
| 10 |
# I.1 |
| 11 |
connecting... |
| 12 |
active session is now 'second' |
| 13 |
RUN SELECT connection_id() AS Value; |
| 14 |
RUN SELECT * FROM mysql.user WHERE SLEEP(30); |
| 15 |
switched to session default |
| 16 |
RUN KILL QUERY $ID |
| 17 |
|
| 18 |
0 rows affected |
| 19 |
switched to session second |
| 20 |
Got expected error: Query execution was interrupted (code 1317) |
| 21 |
RUN SELECT '"Second" session must work' AS state |
| 22 |
state |
| 23 |
"Second" session must work |
| 24 |
0 rows affected |
| 25 |
closing session second |
| 26 |
Mysqlx.Ok { |
| 27 |
msg: "bye!" |
| 28 |
} |
| 29 |
switched to session default |
| 30 |
RUN SELECT 'Default session must work' AS state |
| 31 |
state |
| 32 |
Default session must work |
| 33 |
0 rows affected |
| 34 |
|
| 35 |
# |
| 36 |
# I.2 |
| 37 |
connecting... |
| 38 |
active session is now 'third' |
| 39 |
RUN SELECT connection_id() AS Value; |
| 40 |
RUN select sleep(20),b from data; |
| 41 |
switched to session default |
| 42 |
RUN KILL QUERY $ID |
| 43 |
|
| 44 |
0 rows affected |
| 45 |
switched to session third |
| 46 |
sleep(20) b |
| 47 |
1 1 |
| 48 |
Got expected error: Query execution was interrupted (code 1317) |
| 49 |
RUN SELECT '"third" session must work' AS state |
| 50 |
state |
| 51 |
"third" session must work |
| 52 |
0 rows affected |
| 53 |
closing session third |
| 54 |
Mysqlx.Ok { |
| 55 |
msg: "bye!" |
| 56 |
} |
| 57 |
switched to session default |
| 58 |
Mysqlx.Ok { |
| 59 |
msg: "bye!" |
| 60 |
} |
| 61 |
ok |
| 62 |
DROP TABLE data; |