]> git.pld-linux.org Git - packages/mysql.git/blobdiff - processlist_row_stats.patch
- added link patch (fixes build with systemtap probes)
[packages/mysql.git] / processlist_row_stats.patch
index 4c0e243affffd2d5d1499bf32a19155fe9a4fab2..6bddefde90cc83c006fdbca5453f42784ef57345 100644 (file)
@@ -7,7 +7,7 @@
 # should be done or reviewed by the maintainer!
 --- a/sql/sql_class.cc
 +++ b/sql/sql_class.cc
-@@ -2288,6 +2288,7 @@
+@@ -2424,6 +2424,7 @@
  
    thd->sent_row_count++;
    thd->sent_row_count_2++;
@@ -87,7 +87,7 @@
        if (schema_table_store_record(thd, table))
        {
          mysql_mutex_unlock(&LOCK_thread_count);
-@@ -8117,6 +8143,12 @@
+@@ -8140,6 +8166,12 @@
     SKIP_OPEN_TABLE},
    {"TIME_MS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG,
     0, 0, "Time_ms", SKIP_OPEN_TABLE},
    {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
  };
  
+--- /dev/null
++++ b/mysql-test/include/percona_processlist_row_stats_show.inc
+@@ -0,0 +1,7 @@
++--replace_column 1 ### 3 ### 6 ### 7 ###
++SHOW PROCESSLIST;
++
++--replace_column 1 ###
++SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
++
++SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
+--- /dev/null
++++ b/mysql-test/r/percona_processlist_row_stats.result
+@@ -0,0 +1,70 @@
++DROP TABLE IF EXISTS t1;
++DROP TABLE IF EXISTS t2;
++CREATE TABLE t2 (a INT);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(20);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(20);
++SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
++CREATE TABLE t1 (a INT);
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
++SELECT a FROM t2 WHERE a > 15;
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++SHOW PROCESSLIST;
++Id    User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
++###   root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       2
++###   root    ###     test    Query   ###     ###     CREATE TABLE t1 (a INT) 0       0       1
++###   root    ###     test    Query   ###     ###     SELECT a FROM t2 WHERE a > 15   2       5       6
++SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
++id    info    rows_sent       rows_examined   rows_read
++###   SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id    0       0       1
++###   CREATE TABLE t1 (a INT) 0       0       1
++###   SELECT a FROM t2 WHERE a > 15   2       5       6
++SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
++a
++20
++20
++SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
++SELECT a FROM t2 WHERE a < 15;
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
++SELECT a FROM t2 WHERE a > 15;
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++SHOW PROCESSLIST;
++Id    User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
++###   root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       4
++###   root    ###     test    Query   ###     ###     SELECT a FROM t2 WHERE a < 15   1       0       1
++###   root    ###     test    Query   ###     ###     SELECT a FROM t2 WHERE a > 15   1       0       3
++SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
++id    info    rows_sent       rows_examined   rows_read
++###   SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id    0       0       1
++###   SELECT a FROM t2 WHERE a < 15   1       0       1
++###   SELECT a FROM t2 WHERE a > 15   1       0       3
++SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
++a
++10
++10
++10
++a
++20
++20
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
++UPDATE t2 SET a = 15 WHERE a = 20;
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
++UPDATE t2 SET a = 15 WHERE a = 10;
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++SHOW PROCESSLIST;
++Id    User    Host    db      Command Time    State   Info    Rows_sent       Rows_examined   Rows_read
++###   root    ###     test    Query   ###     ###     SHOW PROCESSLIST        0       0       4
++###   root    ###     test    Query   ###     ###     UPDATE t2 SET a = 15 WHERE a = 20       0       5       6
++###   root    ###     test    Query   ###     ###     UPDATE t2 SET a = 15 WHERE a = 10       0       5       6
++SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id;
++id    info    rows_sent       rows_examined   rows_read
++###   SELECT id, info, rows_sent, rows_examined, rows_read FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY id    0       0       1
++###   UPDATE t2 SET a = 15 WHERE a = 20       0       5       6
++###   UPDATE t2 SET a = 15 WHERE a = 10       0       5       6
++SET DEBUG_SYNC= 'now SIGNAL threads_dumped';
++DROP TABLES t1, t2;
+--- /dev/null
++++ b/mysql-test/t/percona_processlist_row_stats.test
+@@ -0,0 +1,79 @@
++# Testing of INFORMATION_SCHEMA.PROCESSLIST fields ROWS_SENT, ROWS_EXAMINED, ROWS_READ
++--source include/have_debug_sync.inc
++
++--disable_warnings
++DROP TABLE IF EXISTS t1;
++DROP TABLE IF EXISTS t2;
++--enable_warnings
++
++CREATE TABLE t2 (a INT);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(20);
++INSERT INTO t2 VALUES(10);
++INSERT INTO t2 VALUES(20);
++
++--connect (conn1, localhost, root, ,)
++--connect (conn2, localhost, root, ,)
++
++--connection conn1
++SET DEBUG_SYNC= 'locked_table_name SIGNAL thread1_ready WAIT_FOR threads_dumped';
++send CREATE TABLE t1 (a INT);
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++
++--connection conn2
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
++send SELECT a FROM t2 WHERE a > 15;
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++
++--source include/percona_processlist_row_stats_show.inc
++
++--connection conn1
++reap;
++--connection conn2
++reap;
++
++--connection conn1
++SET DEBUG_SYNC= 'sent_row SIGNAL thread1_ready WAIT_FOR threads_dumped';
++send SELECT a FROM t2 WHERE a < 15;
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++
++--connection conn2
++SET DEBUG_SYNC= 'sent_row SIGNAL thread2_ready WAIT_FOR threads_dumped';
++send SELECT a FROM t2 WHERE a > 15;
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++
++--source include/percona_processlist_row_stats_show.inc
++
++--connection conn1
++reap;
++--connection conn2
++reap;
++
++--connection conn1
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread1_ready WAIT_FOR threads_dumped';
++send UPDATE t2 SET a = 15 WHERE a = 20;
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread1_ready';
++
++--connection conn2
++SET DEBUG_SYNC= 'execute_command_after_close_tables SIGNAL thread2_ready WAIT_FOR threads_dumped';
++send UPDATE t2 SET a = 15 WHERE a = 10;
++--connection default
++SET DEBUG_SYNC= 'now WAIT_FOR thread2_ready';
++
++--source include/percona_processlist_row_stats_show.inc
++
++--connection conn1
++reap;
++--connection conn2
++reap;
++
++--connection default
++disconnect conn1;
++disconnect conn2;
++DROP TABLES t1, t2;
This page took 0.135287 seconds and 4 git commands to generate.