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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
#
# MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
#
source include/have_debug.inc;
source include/have_debug_sync.inc;
let $tid= `SELECT CONNECTION_ID()`;
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
send SELECT 1;
connect (con1,localhost,root,,);
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
--replace_result $tid TID
send_eval SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":$tid:";
connection default;
reap;
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
connection con1;
--replace_result $tid TID
reap;
set debug_sync='reset';
connection default;
#
# MDEV-4683 query start_time not reset when going to sleep
#
connection con1;
# This DBUG insertion triggers a DEBUG_SYNC signal "query_done" once
# the below SELECT SLEEP(5) has gone from "Query" to "Sleep" command
# state. (We cannot just set the DEBUG_SYNC directly here, because
# then it can trigger at the end of the SET DEBUG_SYNC statement (or
# at the end of the Prepare step of the SELECT, if --ps-protocol),
# thus occuring too early).
SET debug_dbug="+d,sleep_inject_query_done_debug_sync";
select sleep(5); #run a query that will take some time
connection default;
# Need to ensure that the previous query has really completed. Otherwise,
# the select could see the previous query still in "Query" stage in the
# processlist.
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
# verify that the time in COM_SLEEP doesn't include the query run time
select command, time < 5 from information_schema.processlist where id != connection_id();
disconnect con1;
set debug_sync='reset';
--echo #
--echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
--echo #
connect (con1,localhost,root,,);
connection con1;
let $q= `select CONCAT("SELECT user FROM mysql.user WHERE user ='some", CHAR(0), "' or sleep (30)")`;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
--disable_query_log
--send_eval $q;
--enable_query_log
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
exec $MYSQL test -e "SHOW PROCESSLIST" > $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
let SEARCH_PATTERN=sleep;
source include/search_pattern_in_file.inc;
remove_file $MYSQLTEST_VARDIR/tmp//MDEV-20466.text;
disconnect con1;
SET DEBUG_SYNC = 'RESET';
--echo End of 5.5 tests
|