~percona-dev/percona-server/release-5.5.11-20.2-fix-bug-764138

« back to all changes in this revision

Viewing changes to mysql-test/processlist_row_stats.patch/percona_processlist_row_stats.result

  • Committer: Ignacio Nin
  • Date: 2011-03-27 18:30:06 UTC
  • mfrom: (88.2.3 5.5.10)
  • Revision ID: ignacio.nin@percona.com-20110327183006-ij0o2pdyhzaerish
Merge 5.5.10 changes

Merge 5.5.10 changes to release-5.5.9-20.1 in order to create release-5.5.10-20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE IF EXISTS t1;
 
2
DROP TABLE IF EXISTS t2;
 
3
CREATE TABLE t2 (a INT);
 
4
INSERT INTO t2 VALUES(10);
 
5
INSERT INTO t2 VALUES(10);
 
6
INSERT INTO t2 VALUES(20);
 
7
INSERT INTO t2 VALUES(10);
 
8
INSERT INTO t2 VALUES(20);
 
9
Issuing operation that should not return any rows and stopping the thread #1
 
10
SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
 
11
CREATE TABLE t1 (a INT);
 
12
Issuing row-returning query and stopping the thread #2 at the end of query
 
13
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
 
14
SELECT a FROM t2 WHERE a > 15;
 
15
SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
 
16
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
 
17
Threads #1 and #2 stopped, look at their state
 
18
SHOW PROCESSLIST;
 
19
Id      User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
 
20
###     root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       2
 
21
###     root    ###     test    Query   ###     ###     CREATE TABLE t1 (a INT) 0       0       1
 
22
###     root    ###     test    Query   ###     ###     SELECT a FROM t2 WHERE a > 15   2       5       6
 
23
SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist 
 
24
ORDER BY id;
 
25
id      info    rows_sent       rows_examined   rows_read
 
26
###     SELECT id, info, rows_sent, rows_examined, rows_read FROM information_schema.processlist 
 
27
ORDER BY id     0       0       1
 
28
###     CREATE TABLE t1 (a INT) 0       0       1
 
29
###     SELECT a FROM t2 WHERE a > 15   2       5       6
 
30
Let threads #1 and #2 finish their job
 
31
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
 
32
a
 
33
20
 
34
20
 
35
Issuing row-returning query and stopping the thread #2 in the middle of query
 
36
SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
 
37
SELECT a FROM t2 WHERE a > 15;
 
38
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
 
39
Thread #2 stopped, look at its state
 
40
SHOW PROCESSLIST;
 
41
Id      User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
 
42
###     root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       4
 
43
###     root    ###     test    Sleep   ###     ###     NULL    0       0       1
 
44
###     root    ###     test    Query   ###     ###     SELECT a FROM t2 WHERE a > 15   1       0       3
 
45
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
 
46
id      rows_sent       rows_examined   rows_read
 
47
###     0       0       1
 
48
###     0       0       1
 
49
###     1       0       3
 
50
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
 
51
Let thread #2 finish its job
 
52
a
 
53
20
 
54
20
 
55
Issuing an UPDATE and stopping thread #2
 
56
SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
 
57
UPDATE t2 SET a = 15 WHERE a = 10;
 
58
SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
 
59
Thread #2 stopped, look at its state
 
60
SHOW PROCESSLIST;
 
61
Id      User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
 
62
###     root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       4
 
63
###     root    ###     test    Sleep   ###     ###     NULL    0       0       1
 
64
###     root    ###     test    Query   ###     ###     UPDATE t2 SET a = 15 WHERE a = 10       0       5       6
 
65
SELECT id,rows_sent,rows_examined,rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Id;
 
66
id      rows_sent       rows_examined   rows_read
 
67
###     0       0       1
 
68
###     0       0       1
 
69
###     0       5       6
 
70
SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
 
71
Let thread #2 finish its job
 
72
DROP TABLES t1, t2;