summaryrefslogtreecommitdiff
path: root/mysql-test/t/filesort_debug.test
blob: 88d957e47c3a0504f192d5eefc53835817a9dec2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/count_sessions.inc

SET @old_debug= @@session.debug;

--echo #
--echo # Bug#36022 please log more information about "Sort aborted" queries
--echo #

CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);

SET session debug_dbug= '+d,make_char_array_fail';
CALL mtr.add_suppression("Out of sort memory");
--error ER_OUT_OF_SORTMEMORY
SELECT * FROM t1 ORDER BY f1 ASC, f0;
SET session debug_dbug= @old_debug;

CREATE FUNCTION f1() RETURNS INT RETURN 1;
--error ER_SP_WRONG_NO_OF_ARGS
DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;

DROP TABLE t1;
DROP FUNCTION f1;

--echo #
--echo # Bug #11747102
--echo # 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES
--echo #

connect (con1, localhost, root);
connect (con2, localhost, root);

--echo # connection 1
connection con1;
CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);

let $ID= `SELECT @id := CONNECTION_ID()`;

SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed';
--echo # Sending: (not reaped since connection is killed later)
--send SELECT * FROM t1 ORDER BY f1 ASC, f0

--echo # connection 2
connection con2;
let $ignore= `SELECT @id := $ID`;
SET DEBUG_SYNC='now WAIT_FOR filesort_started';
KILL @id;
SET DEBUG_SYNC='now SIGNAL filesort_killed';

--echo # connection default
connection default;
disconnect con1;
disconnect con2;
--source include/wait_until_count_sessions.inc
SET DEBUG_SYNC= "RESET";
DROP TABLE t1;