diff --git a/mysql-test/include/maria_empty_logs.inc b/mysql-test/include/maria_empty_logs.inc index a4f893d7fd4c5..24b3e3e642568 100644 --- a/mysql-test/include/maria_empty_logs.inc +++ b/mysql-test/include/maria_empty_logs.inc @@ -11,6 +11,7 @@ connection default; let $default_db=`select database()`; let $MYSQLD_DATADIR= `SELECT @@datadir`; +let $pid_file=`select @@pid_file`; #it will used at end of test for wait_for_status_var.inc primitive #let $status_var= Threads_connected; @@ -23,6 +24,7 @@ wait-maria_empty_logs.inc EOF --source include/mysqladmin_shutdown.inc +--source include/wait_until_no_pidfile.inc --disable_warnings if (!$mel_keep_control_file) diff --git a/mysql-test/include/wait_until_no_pidfile.inc b/mysql-test/include/wait_until_no_pidfile.inc new file mode 100644 index 0000000000000..9448400522b2c --- /dev/null +++ b/mysql-test/include/wait_until_no_pidfile.inc @@ -0,0 +1,30 @@ +# Include this script after a shutdown to wait until the pid file, +# stored in $pid_file, has disappered. + +#--echo $pid_file + +--disable_result_log +--disable_query_log +# Wait one minute +let $counter= 600; +while ($counter) +{ +--error 0,1 +--file_exists $pid_file + if (!$errno) + { + dec $counter; + --real_sleep 0.1 + } + if ($errno) + { + let $counter= 0; + } +} +if (!$errno) +{ + --die Pid file "$pid_file" failed to disappear +} + +--enable_query_log +--enable_result_log diff --git a/mysql-test/main/log_slow.test b/mysql-test/main/log_slow.test index 7c1725897de30..5da546e569e0a 100644 --- a/mysql-test/main/log_slow.test +++ b/mysql-test/main/log_slow.test @@ -184,6 +184,7 @@ drop function get_zero; --enable_view_protocol --enable_ps2_protocol +--enable_view_protocol --echo # --echo # End of 10.4 tests diff --git a/mysql-test/main/order_by_optimizer_innodb.result b/mysql-test/main/order_by_optimizer_innodb.result index cbb5551b7cfec..e5e98cff096b4 100644 --- a/mysql-test/main/order_by_optimizer_innodb.result +++ b/mysql-test/main/order_by_optimizer_innodb.result @@ -3,10 +3,6 @@ SET GLOBAL innodb_stats_persistent=OFF; # # MDEV-6402: Optimizer doesn't choose best execution plan when composite key is used # -create table t0(a int); -insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -create table t1(a int); -insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; CREATE TABLE t2 ( pk1 int(11) NOT NULL, pk2 int(11) NOT NULL, @@ -18,13 +14,13 @@ UNIQUE KEY ux_pk1_fd5 (pk1,fd5) ) ENGINE=InnoDB; insert into t2 select -round(log(2,t1.a+1)), -t1.a, -t1.a, +round(log(2,seq+1)), +seq, +seq, REPEAT('filler-data-', 10), REPEAT('filler-data-', 10) from -t1; +seq_0_to_1999; select pk1, count(*) from t2 group by pk1; pk1 count(*) 0 1 @@ -37,7 +33,8 @@ pk1 count(*) 7 91 8 181 9 362 -10 276 +10 724 +11 552 # The following should use range(ux_pk1_fd5), two key parts (key_len=5+8=13) EXPLAIN SELECT * FROM t2 USE INDEX(ux_pk1_fd5) WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10; id select_type table type possible_keys key key_len ref rows Extra @@ -46,7 +43,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t2 WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range PRIMARY,ux_pk1_fd5 ux_pk1_fd5 13 NULL 138 Using where -drop table t0,t1, t2; +drop table t2; # # MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY # diff --git a/mysql-test/main/order_by_optimizer_innodb.test b/mysql-test/main/order_by_optimizer_innodb.test index 33f67e522adaa..c0f7612b8117f 100644 --- a/mysql-test/main/order_by_optimizer_innodb.test +++ b/mysql-test/main/order_by_optimizer_innodb.test @@ -1,4 +1,5 @@ --source include/have_innodb.inc +--source include/have_sequence.inc SET @save_stats_persistent=@@GLOBAL.innodb_stats_persistent; SET GLOBAL innodb_stats_persistent=OFF; @@ -6,11 +7,6 @@ SET GLOBAL innodb_stats_persistent=OFF; --echo # --echo # MDEV-6402: Optimizer doesn't choose best execution plan when composite key is used --echo # -create table t0(a int); -insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); - -create table t1(a int); -insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; CREATE TABLE t2 ( pk1 int(11) NOT NULL, @@ -24,13 +20,13 @@ CREATE TABLE t2 ( insert into t2 select - round(log(2,t1.a+1)), - t1.a, - t1.a, + round(log(2,seq+1)), + seq, + seq, REPEAT('filler-data-', 10), REPEAT('filler-data-', 10) from - t1; + seq_0_to_1999; select pk1, count(*) from t2 group by pk1; @@ -39,7 +35,7 @@ EXPLAIN SELECT * FROM t2 USE INDEX(ux_pk1_fd5) WHERE pk1=9 AND fd5 < 500 ORDER B --echo # This also must use range, not ref. key_len must be 13 EXPLAIN SELECT * FROM t2 WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10; -drop table t0,t1, t2; +drop table t2; --echo # --echo # MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY diff --git a/mysql-test/suite/innodb/r/undo_space_dblwr.result b/mysql-test/suite/innodb/r/undo_space_dblwr.result new file mode 100644 index 0000000000000..7954c42634194 --- /dev/null +++ b/mysql-test/suite/innodb/r/undo_space_dblwr.result @@ -0,0 +1,21 @@ +call mtr.add_suppression("Checksum mismatch in the first page of file"); +show variables like 'innodb_doublewrite'; +Variable_name Value +innodb_doublewrite ON +create table t1(f1 int not null, f2 int not null)engine=innodb; +insert into t1 values (1, 1); +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; +InnoDB 0 transactions not purged +set GLOBAL innodb_log_checkpoint_now=1; +# Make the first page dirty for undo tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 1; +SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0; +SET GLOBAL innodb_max_dirty_pages_pct=0.0; +# Kill the server +# restart +FOUND 1 /Checksum mismatch in the first page of file/ in mysqld.1.err +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/suite/innodb/t/undo_space_dblwr.opt b/mysql-test/suite/innodb/t/undo_space_dblwr.opt new file mode 100644 index 0000000000000..0b4f59176f3b8 --- /dev/null +++ b/mysql-test/suite/innodb/t/undo_space_dblwr.opt @@ -0,0 +1,2 @@ +--innodb_undo_tablespaces=3 +--innodb_sys_tablespaces diff --git a/mysql-test/suite/innodb/t/undo_space_dblwr.test b/mysql-test/suite/innodb/t/undo_space_dblwr.test new file mode 100644 index 0000000000000..c746f37ead752 --- /dev/null +++ b/mysql-test/suite/innodb/t/undo_space_dblwr.test @@ -0,0 +1,47 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/not_embedded.inc +call mtr.add_suppression("Checksum mismatch in the first page of file"); +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +let MYSQLD_DATADIR=`select @@datadir`; + +show variables like 'innodb_doublewrite'; +create table t1(f1 int not null, f2 int not null)engine=innodb; +insert into t1 values (1, 1); + +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; +--source include/wait_all_purged.inc + +set GLOBAL innodb_log_checkpoint_now=1; +--source ../include/no_checkpoint_start.inc + +--echo # Make the first page dirty for undo tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 1; + +SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0; +SET GLOBAL innodb_max_dirty_pages_pct=0.0; + +sleep 1; +--let CLEANUP_IF_CHECKPOINT=drop table t1; +--source ../include/no_checkpoint_end.inc + +perl; +use IO::Handle; +my $fname= "$ENV{'MYSQLD_DATADIR'}/undo001"; +my $page_size = $ENV{INNODB_PAGE_SIZE}; +die unless open(FILE, "+<", $fname); +sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n"; +substr($page, 49, 4) = pack("N", 1000); +sysseek(FILE, 0, 0)||die "Unable to seek $fname\n"; +die unless syswrite(FILE, $page, $page_size) == $page_size; +close FILE; +EOF + +--source include/start_mysqld.inc +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +let SEARCH_PATTERN= Checksum mismatch in the first page of file; +--source include/search_pattern_in_file.inc + +check table t1; +drop table t1; diff --git a/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc index 2375bdf1cacf2..49489b495e5b1 100644 --- a/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc +++ b/mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc @@ -4,17 +4,6 @@ # Wait until there is only one session left, this one. -let $wait_condition= - select count(*) = 1 from information_schema.processlist; ---source include/wait_condition.inc - -# Threads are removed from information_schema.processlist -# very soon, but continue to execute in the server, -# before finally be removed from performance_schema.threads. -# Because instrumentation is optional, we use "<=" here. - -let $wait_condition= - select count(*) <= 2 from performance_schema.threads - where `TYPE`='FOREGROUND'; +let $wait_condition= select count(*) = 1 from performance_schema.threads where `type`='foreground'; --source include/wait_condition.inc diff --git a/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result b/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result deleted file mode 100644 index 8f3a17a0fc51e..0000000000000 --- a/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result +++ /dev/null @@ -1,41 +0,0 @@ -SET default_storage_engine=InnoDB; -SELECT @save_instrument_enabled := ENABLED -, @save_instrument_timed := TIMED -FROM performance_schema.setup_instruments -WHERE NAME = 'wait/lock/table/sql/handler'; -@save_instrument_enabled := ENABLED @save_instrument_timed := TIMED -YES YES -SELECT @save_consumer_enabled := ENABLED -FROM performance_schema.setup_consumers -WHERE NAME = 'events_waits_current'; -@save_consumer_enabled := ENABLED -YES -UPDATE performance_schema.setup_instruments -SET ENABLED = 'YES', TIMED = 'YES' -WHERE NAME = 'wait/lock/table/sql/handler'; -UPDATE performance_schema.setup_consumers -SET ENABLED = 'YES' -WHERE NAME = 'events_waits_current'; -CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200)); -INSERT INTO t1 VALUES (1, 'aa'); -INSERT INTO t1 VALUES (2, 'bb'); -connect con1,localhost,root,,test; -connect con2,localhost,root,,test; -connection con1; -START TRANSACTION; -connection con2; -START TRANSACTION; -SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; -connection default; -SELECT event_name FROM performance_schema.events_waits_current -WHERE event_name LIKE '%wait/lock/table/sql/handler%'; -event_name -UPDATE performance_schema.setup_instruments -SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed -WHERE NAME = 'wait/lock/table/sql/handler'; -UPDATE performance_schema.setup_consumers -SET ENABLED = @save_consumer_enabled -WHERE NAME = 'events_waits_current'; -disconnect con1; -disconnect con2; -DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/r/show_aggregate.result b/mysql-test/suite/perfschema/r/show_aggregate.result index 69861fa42c94b..3facb3c5f04b0 100644 --- a/mysql-test/suite/perfschema/r/show_aggregate.result +++ b/mysql-test/suite/perfschema/r/show_aggregate.result @@ -7,6 +7,7 @@ SET @@session.sql_log_bin=OFF; # CREATE 3 CLIENTS, 3 CONNECTIONS, RESULTS TABLE connection default; USE test; +flush status; # # Create results table CREATE TABLE test.status_results @@ -82,9 +83,9 @@ ROLLBACK; connection default; # Get thread ids for each connection. USE performance_schema; -SELECT thread_id INTO @con1_id FROM threads WHERE processlist_user IN ('user1'); -SELECT thread_id INTO @con2_id FROM threads WHERE processlist_user IN ('user2'); -SELECT thread_id INTO @con3_id FROM threads WHERE processlist_user IN ('user3'); +SELECT thread_id INTO @con1_id FROM threads WHERE processlist_user IN ('user1') and processlist_id; +SELECT thread_id INTO @con2_id FROM threads WHERE processlist_user IN ('user2') and processlist_id; +SELECT thread_id INTO @con3_id FROM threads WHERE processlist_user IN ('user3') and processlist_id; #================= # Global results #================= @@ -204,100 +205,99 @@ USE performance_schema; # # Verify expected counts for 'handler_delete' per thread # -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con1_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 1,'OK1','ERROR1') AS Expected FROM status_by_thread WHERE thread_id = @con1_id AND variable_name IN ('handler_delete', 'handler_rollback'); THREAD_ID VARIABLE_NAME VARIABLE_VALUE Expected -con_1 Handler_delete 1 OK -con_1 Handler_rollback 1 OK +con_1 Handler_delete 1 OK1 +con_1 Handler_rollback 1 OK1 # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con2_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 2,'OK2','ERROR2') AS Expected FROM status_by_thread WHERE thread_id = @con2_id AND variable_name IN ('handler_delete', 'handler_rollback'); THREAD_ID VARIABLE_NAME VARIABLE_VALUE Expected -con_2 Handler_delete 2 OK -con_2 Handler_rollback 2 OK +con_2 Handler_delete 2 OK2 +con_2 Handler_rollback 2 OK2 # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con3_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 3,'OK3','ERROR3') AS Expected FROM status_by_thread WHERE thread_id = @con3_id AND variable_name IN ('handler_delete', 'handler_rollback'); THREAD_ID VARIABLE_NAME VARIABLE_VALUE Expected -con_3 Handler_delete 3 OK -con_3 Handler_rollback 3 OK +con_3 Handler_delete 3 OK3 +con_3 Handler_rollback 3 OK3 # # STATUS_BY_THREAD vs. GLOBAL_STATUS # -SELECT variable_name, t1, t2, t3, delta, thread, IF(thread=delta,'OK','ERROR') Expected +SELECT variable_name, t1, t2, t3, delta, thread, IF(thread=delta,'OK4','ERROR4') Expected FROM test.status_results ORDER BY variable_name; variable_name t1 t2 t3 delta thread Expected -Handler_delete 1 2 3 6 6 OK -Handler_rollback 1 2 3 6 6 OK +Handler_delete 1 2 3 6 6 OK4 +Handler_rollback 1 2 3 6 6 OK4 # # ================================================================================ # TEST 2: STATUS_BY_USER: Verify expected status counts per user (1,2,3) # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OK5','ERROR5') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user1 Handler_delete 1 OK +user1 Handler_delete 1 OK5 # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OK6','ERROR6') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user2 Handler_delete 2 OK +user2 Handler_delete 2 OK6 # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OK7','ERROR7') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user3 Handler_delete 3 OK +user3 Handler_delete 3 OK7 # # STATUS_BY_USER vs. GLOBAL_STATUS # -SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK','ERROR') Expected +SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK8','ERROR8') Expected FROM test.status_results ORDER BY variable_name; variable_name u1 u2 u3 delta user Expected -Handler_delete 1 2 3 6 6 OK -Handler_rollback 1 2 3 6 6 OK +Handler_delete 1 2 3 6 6 OK8 +Handler_rollback 1 2 3 6 6 OK8 # # ================================================================================ # TEST 3: STATUS_BY_ACCOUNT: Verify expected status counts per user, host (1,2,3) # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OK9','ERROR9') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user1 localhost Handler_delete 1 OK +user1 localhost Handler_delete 1 OK9 # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKa','ERRORa') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user2 localhost Handler_delete 2 OK +user2 localhost Handler_delete 2 OKa # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKb','ERRORb') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user3 localhost Handler_delete 3 OK +user3 localhost Handler_delete 3 OKb # # STATUS_BY_ACCOUNT vs. GLOBAL_STATUS # -SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OK','ERROR') Expected +SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OKc','ERRORc') Expected FROM test.status_results ORDER BY variable_name; variable_name a1 a2 a3 delta acct Expected -Handler_delete 1 2 3 6 6 OK -Handler_rollback 1 2 3 6 6 OK +Handler_delete 1 2 3 6 6 OKc +Handler_rollback 1 2 3 6 6 OKc # ================================================================================ # TEST 4: STATUS_BY_HOST: Verify expected status counts per host (6) # ================================================================================ -SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 6,'OKd','ERRORd') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); HOST VARIABLE_NAME VARIABLE_VALUE Expected -localhost Handler_delete 6 OK +localhost Handler_delete 6 OKd # # STATUS_BY_HOST vs. GLOBAL_STATUS # # Special case: No way to isolate pre-existing 'localhost' activity, so # just check global totals = sum(status_by_host). # -SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OK','ERROR') Expected +SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OKe','ERRORe') Expected FROM test.status_results ORDER BY variable_name; variable_name h1 h2 h3 delta host Expected -Handler_delete 6 0 0 6 6 OK -Handler_rollback 6 0 0 6 6 OK +Handler_delete 6 0 0 6 6 OKe +Handler_rollback 6 0 0 6 6 OKe # # ================================================================================ # DISCONNECT ALL USERS AND RUN THE TESTS AGAIN. RESULTS SHOULD NOT CHANGE. # ================================================================================ -connection default; disconnect con1; disconnect con2; disconnect con3; @@ -429,68 +429,68 @@ USE performance_schema; # ================================================================================ # TEST 5: STATUS_BY_USER: Verify expected status counts per user (1,2,3) # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OKf','ERRORf') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user1 Handler_delete 1 OK +user1 Handler_delete 1 OKf # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKg','ERRORg') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user2 Handler_delete 2 OK +user2 Handler_delete 2 OKg # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKh','ERRORh') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); USER VARIABLE_NAME VARIABLE_VALUE Expected -user3 Handler_delete 3 OK +user3 Handler_delete 3 OKh # # STATUS_BY_USER vs. GLOBAL_STATUS # -SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK','ERROR') Expected +SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OKi','ERRORi') Expected FROM test.status_results ORDER BY variable_name; variable_name u1 u2 u3 delta user Expected -Handler_delete 1 2 3 6 6 OK -Handler_rollback 1 2 3 6 6 OK +Handler_delete 1 2 3 6 6 OKi +Handler_rollback 1 2 3 6 6 OKi # # ================================================================================ # TEST 6: STATUS_BY_ACCOUNT: Verify expected status counts per user:host (1,2,3) # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OKj','ERRORj') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user1 localhost Handler_delete 1 OK +user1 localhost Handler_delete 1 OKj # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKk','ERRORk') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user2 localhost Handler_delete 2 OK +user2 localhost Handler_delete 2 OKk # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKl','ERRORl') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); USER HOST VARIABLE_NAME VARIABLE_VALUE Expected -user3 localhost Handler_delete 3 OK +user3 localhost Handler_delete 3 OKl # # STATUS_BY_ACCOUNT vs. GLOBAL_STATUS # -SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OK','ERROR') Expected +SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OKn','ERRORn') Expected FROM test.status_results ORDER BY variable_name; variable_name a1 a2 a3 delta acct Expected -Handler_delete 1 2 3 6 6 OK -Handler_rollback 1 2 3 6 6 OK +Handler_delete 1 2 3 6 6 OKn +Handler_rollback 1 2 3 6 6 OKn # ================================================================================ # TEST 7: STATUS_BY_HOST: Verify expected status counts per host (6) # ================================================================================ -SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 6,'OKo','ERRORo') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); HOST VARIABLE_NAME VARIABLE_VALUE Expected -localhost Handler_delete 6 OK +localhost Handler_delete 6 OKo # # STATUS_BY_HOST vs. GLOBAL_STATUS # # Special case: No way to isolate pre-existing 'localhost' activity, so # just check global totals = sum(status_by_host). # -SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OK','ERROR') Expected +SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OKp','ERRORp') Expected FROM test.status_results ORDER BY variable_name; variable_name h1 h2 h3 delta host Expected -Handler_delete 6 0 0 6 6 OK -Handler_rollback 6 0 0 6 6 OK +Handler_delete 6 0 0 6 6 OKp +Handler_rollback 6 0 0 6 6 OKp # ================================================================================ # TEST 8: FLUSH STATUS should clear account, host and user status # ================================================================================ diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index 47f4d7ba346fe..52ece6d289d8a 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -202,8 +202,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -260,8 +262,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -324,8 +328,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -423,8 +429,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -492,8 +500,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -603,8 +613,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -677,8 +689,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -800,8 +814,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -875,8 +891,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -947,8 +965,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1019,8 +1039,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1088,8 +1110,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1156,8 +1180,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1223,8 +1249,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1289,8 +1317,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1357,8 +1387,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1424,8 +1456,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1491,8 +1525,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1558,8 +1594,10 @@ wait/io/table/sql/handler 71 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1625,8 +1663,10 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index 9810d104ed96f..b0ea06f42540c 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -211,9 +211,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -276,9 +279,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -347,9 +353,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -453,9 +462,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -529,9 +541,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -647,9 +662,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 56 TABLE test t2 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -728,9 +746,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 56 TABLE test t2 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -858,9 +879,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 41 TABLE test t1 -wait/lock/table/sql/handler 56 TABLE test t2 -wait/lock/table/sql/handler 78 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -940,9 +964,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1019,9 +1046,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1098,9 +1128,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1174,9 +1207,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1249,9 +1285,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1323,9 +1362,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1396,9 +1438,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1471,9 +1516,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1545,9 +1593,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1619,9 +1670,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1693,9 +1747,12 @@ wait/io/table/sql/handler 103 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 17 11 6 11 2 4 0 @@ -1767,9 +1824,12 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 45 TABLE test t1 -wait/lock/table/sql/handler 60 TABLE test t2 -wait/lock/table/sql/handler 82 TABLE test t3 +wait/io/table/sql/handler 21 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t2 +wait/lock/table/sql/handler 28 TABLE test t2 +wait/io/table/sql/handler 50 TABLE test t3 +wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 367a8a089eb51..0a6dea739e498 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -202,8 +202,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -260,8 +262,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -324,8 +328,10 @@ wait/io/table/sql/handler 23 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -423,8 +429,10 @@ wait/io/table/sql/handler 58 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 38 TABLE test t1 -wait/lock/table/sql/handler 68 TABLE test t3 +wait/io/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 40 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 14 9 5 9 2 3 0 @@ -492,8 +500,10 @@ wait/io/table/sql/handler 58 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 38 TABLE test t1 -wait/lock/table/sql/handler 68 TABLE test t3 +wait/io/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 40 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 14 9 5 9 2 3 0 @@ -603,8 +613,10 @@ wait/io/table/sql/handler 106 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 61 TABLE test t1 -wait/lock/table/sql/handler 117 TABLE test t3 +wait/io/table/sql/handler 31 TABLE test t1 +wait/lock/table/sql/handler 30 TABLE test t1 +wait/io/table/sql/handler 75 TABLE test t3 +wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 25 16 9 16 3 6 0 @@ -677,8 +689,10 @@ wait/io/table/sql/handler 106 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 61 TABLE test t1 -wait/lock/table/sql/handler 117 TABLE test t3 +wait/io/table/sql/handler 31 TABLE test t1 +wait/lock/table/sql/handler 30 TABLE test t1 +wait/io/table/sql/handler 75 TABLE test t3 +wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 25 16 9 16 3 6 0 @@ -800,8 +814,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 87 TABLE test t1 -wait/lock/table/sql/handler 176 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 56 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -875,8 +891,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -947,8 +965,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1019,8 +1039,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1088,8 +1110,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1156,8 +1180,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1223,8 +1249,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1289,8 +1317,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1357,8 +1387,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1424,8 +1456,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1491,8 +1525,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1558,8 +1594,10 @@ wait/io/table/sql/handler 167 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1625,8 +1663,10 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index ed1ac9d979be8..c2eda2b8f23f6 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -211,9 +211,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -276,9 +279,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -347,9 +353,12 @@ wait/io/table/sql/handler 33 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 18 TABLE test t1 -wait/lock/table/sql/handler 22 TABLE test t2 -wait/lock/table/sql/handler 29 TABLE test t3 +wait/io/table/sql/handler 8 TABLE test t1 +wait/lock/table/sql/handler 10 TABLE test t1 +wait/io/table/sql/handler 10 TABLE test t2 +wait/lock/table/sql/handler 12 TABLE test t2 +wait/io/table/sql/handler 15 TABLE test t3 +wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -453,9 +462,12 @@ wait/io/table/sql/handler 84 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 38 TABLE test t1 -wait/lock/table/sql/handler 50 TABLE test t2 -wait/lock/table/sql/handler 68 TABLE test t3 +wait/io/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 26 TABLE test t2 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/io/table/sql/handler 40 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 14 9 5 9 2 3 0 @@ -529,9 +541,12 @@ wait/io/table/sql/handler 84 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 38 TABLE test t1 -wait/lock/table/sql/handler 50 TABLE test t2 -wait/lock/table/sql/handler 68 TABLE test t3 +wait/io/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 20 TABLE test t1 +wait/io/table/sql/handler 26 TABLE test t2 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/io/table/sql/handler 40 TABLE test t3 +wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 14 9 5 9 2 3 0 @@ -647,9 +662,12 @@ wait/io/table/sql/handler 154 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 61 TABLE test t1 -wait/lock/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 117 TABLE test t3 +wait/io/table/sql/handler 31 TABLE test t1 +wait/lock/table/sql/handler 30 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t2 +wait/lock/table/sql/handler 36 TABLE test t2 +wait/io/table/sql/handler 75 TABLE test t3 +wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 25 16 9 16 3 6 0 @@ -728,9 +746,12 @@ wait/io/table/sql/handler 154 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 61 TABLE test t1 -wait/lock/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 117 TABLE test t3 +wait/io/table/sql/handler 31 TABLE test t1 +wait/lock/table/sql/handler 30 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t2 +wait/lock/table/sql/handler 36 TABLE test t2 +wait/io/table/sql/handler 75 TABLE test t3 +wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 25 16 9 16 3 6 0 @@ -858,9 +879,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 87 TABLE test t1 -wait/lock/table/sql/handler 124 TABLE test t2 -wait/lock/table/sql/handler 176 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 48 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 56 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -940,9 +964,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1019,9 +1046,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1098,9 +1128,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1174,9 +1207,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1249,9 +1285,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1323,9 +1362,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1396,9 +1438,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1471,9 +1516,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1545,9 +1593,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1619,9 +1670,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1693,9 +1747,12 @@ wait/io/table/sql/handler 243 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 39 25 14 25 4 10 0 @@ -1767,9 +1824,12 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/lock/table/sql/handler 91 TABLE test t1 -wait/lock/table/sql/handler 128 TABLE test t2 -wait/lock/table/sql/handler 180 TABLE test t3 +wait/io/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 44 TABLE test t1 +wait/io/table/sql/handler 76 TABLE test t2 +wait/lock/table/sql/handler 52 TABLE test t2 +wait/io/table/sql/handler 120 TABLE test t3 +wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test b/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test deleted file mode 100644 index d9330ee5a9d4b..0000000000000 --- a/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test +++ /dev/null @@ -1,62 +0,0 @@ -# -# proper event name wait/lock/table/sql/handler recorded in -# PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. Before this fix, it was -# labeled as wait/io/table/sql/handler. -# - ---source include/have_innodb.inc ---source include/have_perfschema.inc ---source include/not_embedded.inc - -SET default_storage_engine=InnoDB; - -SELECT @save_instrument_enabled := ENABLED -, @save_instrument_timed := TIMED -FROM performance_schema.setup_instruments -WHERE NAME = 'wait/lock/table/sql/handler'; - -SELECT @save_consumer_enabled := ENABLED -FROM performance_schema.setup_consumers -WHERE NAME = 'events_waits_current'; - -UPDATE performance_schema.setup_instruments -SET ENABLED = 'YES', TIMED = 'YES' -WHERE NAME = 'wait/lock/table/sql/handler'; - -UPDATE performance_schema.setup_consumers -SET ENABLED = 'YES' -WHERE NAME = 'events_waits_current'; - -CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200)); -INSERT INTO t1 VALUES (1, 'aa'); -INSERT INTO t1 VALUES (2, 'bb'); - -connect (con1,localhost,root,,test); -connect (con2,localhost,root,,test); - -connection con1; -START TRANSACTION; -let $wait_condition= - SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; ---source include/wait_condition.inc - -connection con2; -START TRANSACTION; -send SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; - -connection default; -SELECT event_name FROM performance_schema.events_waits_current -WHERE event_name LIKE '%wait/lock/table/sql/handler%'; - -# clean up -UPDATE performance_schema.setup_instruments -SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed -WHERE NAME = 'wait/lock/table/sql/handler'; - -UPDATE performance_schema.setup_consumers -SET ENABLED = @save_consumer_enabled -WHERE NAME = 'events_waits_current'; - -disconnect con1; -disconnect con2; -DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/t/show_aggregate.test b/mysql-test/suite/perfschema/t/show_aggregate.test index a15dea45268fc..c84e99f6efcad 100644 --- a/mysql-test/suite/perfschema/t/show_aggregate.test +++ b/mysql-test/suite/perfschema/t/show_aggregate.test @@ -13,8 +13,7 @@ --source include/not_embedded.inc --source include/no_protocol.inc --source include/maybe_pool_of_threads.inc - ---enable_connect_log +--source include/wait_for_pfs_thread_count.inc --echo # --echo # ================================================================================ @@ -26,10 +25,7 @@ SET @@session.sql_log_bin=OFF; connection default; USE test; -# Clear user, host and account status accumulated from preliminary checks by mtr. ---disable_query_log flush status; ---enable_query_log --echo # --echo # Create results table @@ -112,9 +108,9 @@ ROLLBACK; connection default; --echo # Get thread ids for each connection. USE performance_schema; -SELECT thread_id INTO @con1_id FROM threads WHERE processlist_user IN ('user1'); -SELECT thread_id INTO @con2_id FROM threads WHERE processlist_user IN ('user2'); -SELECT thread_id INTO @con3_id FROM threads WHERE processlist_user IN ('user3'); +SELECT thread_id INTO @con1_id FROM threads WHERE processlist_user IN ('user1') and processlist_id; +SELECT thread_id INTO @con2_id FROM threads WHERE processlist_user IN ('user2') and processlist_id; +SELECT thread_id INTO @con3_id FROM threads WHERE processlist_user IN ('user3') and processlist_id; --source ../include/show_aggregate.inc @@ -135,18 +131,18 @@ USE performance_schema; --echo # Verify expected counts for 'handler_delete' per thread --echo # --replace_column 1 con_1 -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con1_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 1,'OK1','ERROR1') AS Expected FROM status_by_thread WHERE thread_id = @con1_id AND variable_name IN ('handler_delete', 'handler_rollback'); --echo # --replace_column 1 con_2 -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con2_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 2,'OK2','ERROR2') AS Expected FROM status_by_thread WHERE thread_id = @con2_id AND variable_name IN ('handler_delete', 'handler_rollback'); --echo # --replace_column 1 con_3 -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_thread WHERE thread_id = @con3_id AND variable_name IN ('handler_delete', 'handler_rollback'); +SELECT *, IF (variable_value = 3,'OK3','ERROR3') AS Expected FROM status_by_thread WHERE thread_id = @con3_id AND variable_name IN ('handler_delete', 'handler_rollback'); --echo # --echo # STATUS_BY_THREAD vs. GLOBAL_STATUS --echo # -SELECT variable_name, t1, t2, t3, delta, thread, IF(thread=delta,'OK','ERROR') Expected +SELECT variable_name, t1, t2, t3, delta, thread, IF(thread=delta,'OK4','ERROR4') Expected FROM test.status_results ORDER BY variable_name; @@ -154,16 +150,16 @@ ORDER BY variable_name; --echo # ================================================================================ --echo # TEST 2: STATUS_BY_USER: Verify expected status counts per user (1,2,3) --echo # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OK5','ERROR5') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OK6','ERROR6') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OK7','ERROR7') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_USER vs. GLOBAL_STATUS --echo # -SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK','ERROR') Expected +SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK8','ERROR8') Expected FROM test.status_results ORDER BY variable_name; @@ -171,23 +167,23 @@ ORDER BY variable_name; --echo # ================================================================================ --echo # TEST 3: STATUS_BY_ACCOUNT: Verify expected status counts per user, host (1,2,3) --echo # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OK9','ERROR9') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKa','ERRORa') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKb','ERRORb') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_ACCOUNT vs. GLOBAL_STATUS --echo # -SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OK','ERROR') Expected +SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OKc','ERRORc') Expected FROM test.status_results ORDER BY variable_name; --echo # ================================================================================ --echo # TEST 4: STATUS_BY_HOST: Verify expected status counts per host (6) --echo # ================================================================================ -SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 6,'OKd','ERRORd') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_HOST vs. GLOBAL_STATUS @@ -195,7 +191,7 @@ SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host W --echo # Special case: No way to isolate pre-existing 'localhost' activity, so --echo # just check global totals = sum(status_by_host). --echo # -SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OK','ERROR') Expected +SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OKe','ERRORe') Expected FROM test.status_results ORDER BY variable_name; @@ -203,10 +199,10 @@ ORDER BY variable_name; --echo # ================================================================================ --echo # DISCONNECT ALL USERS AND RUN THE TESTS AGAIN. RESULTS SHOULD NOT CHANGE. --echo # ================================================================================ -connection default; disconnect con1; disconnect con2; disconnect con3; + --echo # USE test; --echo # @@ -218,6 +214,9 @@ UPDATE test.status_results h1=0, h2=0, h3=0, host=0, a1=0, a2=0, a3=0, acct=0; +let $wait_condition= select count(*) = 0 from performance_schema.threads where processlist_user like 'user%' and processlist_id; +--source include/wait_condition.inc + #--echo DEBUG #SELECT * FROM test.status_results; --echo # @@ -232,16 +231,16 @@ USE performance_schema; --echo # ================================================================================ --echo # TEST 5: STATUS_BY_USER: Verify expected status counts per user (1,2,3) --echo # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OKf','ERRORf') AS Expected FROM status_by_user WHERE user IN ('user1') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKg','ERRORg') AS Expected FROM status_by_user WHERE user IN ('user2') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKh','ERRORh') AS Expected FROM status_by_user WHERE user IN ('user3') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_USER vs. GLOBAL_STATUS --echo # -SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OK','ERROR') Expected +SELECT variable_name, u1, u2, u3, delta, user, IF(user=delta,'OKi','ERRORi') Expected FROM test.status_results ORDER BY variable_name; @@ -249,23 +248,23 @@ ORDER BY variable_name; --echo # ================================================================================ --echo # TEST 6: STATUS_BY_ACCOUNT: Verify expected status counts per user:host (1,2,3) --echo # ================================================================================ -SELECT *, IF (variable_value = 1,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 1,'OKj','ERRORj') AS Expected FROM status_by_account WHERE user IN ('user1') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 2,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 2,'OKk','ERRORk') AS Expected FROM status_by_account WHERE user IN ('user2') AND variable_name IN ('handler_delete'); --echo # -SELECT *, IF (variable_value = 3,'OK','ERROR') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 3,'OKl','ERRORl') AS Expected FROM status_by_account WHERE user IN ('user3') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_ACCOUNT vs. GLOBAL_STATUS --echo # -SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OK','ERROR') Expected +SELECT variable_name, a1, a2, a3, delta, acct, IF(acct=delta,'OKn','ERRORn') Expected FROM test.status_results ORDER BY variable_name; --echo # ================================================================================ --echo # TEST 7: STATUS_BY_HOST: Verify expected status counts per host (6) --echo # ================================================================================ -SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); +SELECT *, IF (variable_value = 6,'OKo','ERRORo') AS Expected FROM status_by_host WHERE host IN ('localhost') AND variable_name IN ('handler_delete'); --echo # --echo # STATUS_BY_HOST vs. GLOBAL_STATUS @@ -273,11 +272,10 @@ SELECT *, IF (variable_value = 6,'OK','ERROR') AS Expected FROM status_by_host W --echo # Special case: No way to isolate pre-existing 'localhost' activity, so --echo # just check global totals = sum(status_by_host). --echo # -SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OK','ERROR') Expected +SELECT variable_name, h1, h2, h3, delta, host, IF(host=delta,'OKp','ERRORp') Expected FROM test.status_results ORDER BY variable_name; - --echo # ================================================================================ --echo # TEST 8: FLUSH STATUS should clear account, host and user status --echo # ================================================================================ @@ -290,7 +288,6 @@ SELECT * FROM status_by_host WHERE host IN ('localhost') AND variable_name IN (' --echo # SELECT * FROM status_by_user WHERE user IN ('user1', 'user2', 'user3') AND variable_name IN ('handler_delete'); - --echo # ================================================================================ --echo # CLEANUP --echo # ================================================================================ diff --git a/plugin/type_test/mysql-test/type_test/type_test_double.result b/plugin/type_test/mysql-test/type_test/type_test_double.result index 6241ff95b8aea..edcfdc0eff81f 100644 --- a/plugin/type_test/mysql-test/type_test/type_test_double.result +++ b/plugin/type_test/mysql-test/type_test/type_test_double.result @@ -290,7 +290,7 @@ DATA_TYPE test_double CHARACTER_MAXIMUM_LENGTH NULL CHARACTER_OCTET_LENGTH NULL NUMERIC_PRECISION 22 -NUMERIC_SCALE 31 +NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL diff --git a/sql/field.cc b/sql/field.cc index 2dc35171a4b8e..ac580ea1cb565 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4743,6 +4743,30 @@ bool Field_longlong::is_max() single precision float ****************************************************************************/ +Field_float::Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, + const LEX_CSTRING *field_name_arg, + decimal_digits_t dec_arg, + bool zero_arg, bool unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + (dec_arg >= FLOATING_POINT_DECIMALS ? NOT_FIXED_DEC : dec_arg), + zero_arg, unsigned_arg) +{ +} + +Field_float::Field_float(uint32 len_arg, bool maybe_null_arg, + const LEX_CSTRING *field_name_arg, + decimal_digits_t dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0, + NONE, field_name_arg, + (dec_arg >= FLOATING_POINT_DECIMALS ? NOT_FIXED_DEC : dec_arg), + 0, 0) +{ +} + + int Field_float::store(const char *from,size_t len,CHARSET_INFO *cs) { int error; @@ -4891,6 +4915,40 @@ Binlog_type_info Field_float::binlog_type_info() const double precision floating point numbers ****************************************************************************/ +Field_double::Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, + const LEX_CSTRING *field_name_arg, + decimal_digits_t dec_arg, + bool zero_arg, bool unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + (dec_arg >= FLOATING_POINT_DECIMALS ? NOT_FIXED_DEC : dec_arg), + zero_arg, unsigned_arg) +{ +} + +Field_double::Field_double(uint32 len_arg, bool maybe_null_arg, + const LEX_CSTRING *field_name_arg, + decimal_digits_t dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, + (dec_arg >= FLOATING_POINT_DECIMALS ? NOT_FIXED_DEC : dec_arg), + 0, 0) +{ +} + +Field_double::Field_double(uint32 len_arg, bool maybe_null_arg, + const LEX_CSTRING *field_name_arg, + decimal_digits_t dec_arg, bool not_fixed_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, + (dec_arg >= FLOATING_POINT_DECIMALS ? NOT_FIXED_DEC : dec_arg), + 0, 0) +{ + not_fixed= not_fixed_arg; +} + int Field_double::store(const char *from,size_t len,CHARSET_INFO *cs) { int error; @@ -5048,7 +5106,7 @@ Converter_double_to_longlong::push_warning(THD *thd, } -int Field_real::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg) +int Field_real::store_time_dec(const MYSQL_TIME *ltime, uint) { return store(TIME_to_double(ltime)); } @@ -6593,7 +6651,7 @@ int Field_year::store(longlong nr, bool unsigned_val) } -int Field_year::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg) +int Field_year::store_time_dec(const MYSQL_TIME *ltime, uint) { ErrConvTime str(ltime); if (Field_year::store(ltime->year, 0)) diff --git a/sql/field.h b/sql/field.h index 98f526c6ff142..c456b2e774e1d 100644 --- a/sql/field.h +++ b/sql/field.h @@ -2885,22 +2885,9 @@ class Field_float final :public Field_real { Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg) - :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, - unireg_check_arg, field_name_arg, - dec_arg, zero_arg, unsigned_arg) - { - if (dec_arg >= FLOATING_POINT_DECIMALS) - dec_arg= NOT_FIXED_DEC; - } + decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg); Field_float(uint32 len_arg, bool maybe_null_arg, - const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg) - :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0, - NONE, field_name_arg, dec_arg, 0, 0) - { - if (dec_arg >= FLOATING_POINT_DECIMALS) - dec_arg= NOT_FIXED_DEC; - } + const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg); const Type_handler *type_handler() const override { return &type_handler_float; } enum ha_base_keytype key_type() const override { return HA_KEYTYPE_FLOAT; } @@ -2933,32 +2920,12 @@ class Field_double :public Field_real { Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg) - :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, - unireg_check_arg, field_name_arg, - dec_arg, zero_arg, unsigned_arg) - { - if (dec_arg >= FLOATING_POINT_DECIMALS) - dec_arg= NOT_FIXED_DEC; - } + decimal_digits_t dec_arg,bool zero_arg,bool unsigned_arg); Field_double(uint32 len_arg, bool maybe_null_arg, - const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg) - :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, - NONE, field_name_arg, dec_arg, 0, 0) - { - if (dec_arg >= FLOATING_POINT_DECIMALS) - dec_arg= NOT_FIXED_DEC; - } + const LEX_CSTRING *field_name_arg, decimal_digits_t dec_arg); Field_double(uint32 len_arg, bool maybe_null_arg, const LEX_CSTRING *field_name_arg, - decimal_digits_t dec_arg, bool not_fixed_arg) - :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, - NONE, field_name_arg, dec_arg, 0, 0) - { - not_fixed= not_fixed_arg; - if (dec_arg >= FLOATING_POINT_DECIMALS) - dec_arg= NOT_FIXED_DEC; - } + decimal_digits_t dec_arg, bool not_fixed_arg); void init_for_tmp_table(Field *org_field, TABLE *new_table) override { Field::init_for_tmp_table(org_field, new_table); diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 6d84ff7a242ba..8a28a2b66adf9 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -362,7 +362,7 @@ void buf_dblwr_t::recover() { byte *page= *i; const uint32_t page_no= page_get_page_no(page); - if (!page_no) /* recovered via Datafile::restore_from_doublewrite() */ + if (!page_no) /* recovered via recv_dblwr_t::restore_first_page() */ continue; const lsn_t lsn= mach_read_from_8(page + FIL_PAGE_LSN); diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index e93ca4bc1772b..cafff419b0581 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -449,7 +449,8 @@ Datafile::validate_for_recovery() return DB_SUCCESS; /* empty file */ } - if (restore_from_doublewrite()) { + if (recv_sys.dblwr.restore_first_page( + m_space_id, m_filepath, m_handle)) { return m_defer ? err : DB_CORRUPTION; } @@ -749,60 +750,6 @@ Datafile::find_space_id() return(DB_CORRUPTION); } - -/** Restore the first page of the tablespace from -the double write buffer. -@return whether the operation failed */ -bool -Datafile::restore_from_doublewrite() -{ - if (srv_operation > SRV_OPERATION_EXPORT_RESTORED) { - return true; - } - - /* Find if double write buffer contains page_no of given space id. */ - const page_id_t page_id(m_space_id, 0); - const byte* page = recv_sys.dblwr.find_page(page_id); - - if (!page) { - /* If the first page of the given user tablespace is not there - in the doublewrite buffer, then the recovery is going to fail - now. Hence this is treated as an error. */ - - ib::error() - << "Corrupted page " << page_id - << " of datafile '" << m_filepath - << "' could not be found in the doublewrite buffer."; - return(true); - } - - uint32_t flags = mach_read_from_4( - FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page); - - if (!fil_space_t::is_valid_flags(flags, m_space_id)) { - flags = fsp_flags_convert_from_101(flags); - /* recv_dblwr_t::validate_page() inside find_page() - checked this already. */ - ut_ad(flags != UINT32_MAX); - /* The flags on the page should be converted later. */ - } - - ulint physical_size = fil_space_t::physical_size(flags); - - ut_a(page_get_page_no(page) == page_id.page_no()); - - ib::info() << "Restoring page " << page_id - << " of datafile '" << m_filepath - << "' from the doublewrite buffer. Writing " - << ib::bytes_iec{physical_size} << " into file '" - << m_filepath << "'"; - - return(os_file_write( - IORequestWrite, - m_filepath, m_handle, page, 0, physical_size) - != DB_SUCCESS); -} - /** Read an InnoDB Symbolic Link (ISL) file by name. @param link_filepath filepath of the ISL file @return data file name (must be freed by the caller) diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index 3016f71afada2..e4a43e481f81b 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -588,7 +588,9 @@ inline dberr_t SysTablespace::read_lsn_and_check_flags() if (err != DB_SUCCESS && (retry == 1 - || it->restore_from_doublewrite())) { + || recv_sys.dblwr.restore_first_page( + it->m_space_id, it->m_filepath, + it->handle()))) { it->close(); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 09e6f0e84812d..63c084b0e3b9b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20023,30 +20023,6 @@ static TABLE* innodb_find_table_for_vc(THD* thd, dict_table_t* table) return mysql_table; } -/** Only used by the purge thread -@param[in,out] table table whose virtual column template to be built */ -TABLE* innobase_init_vc_templ(dict_table_t* table) -{ - DBUG_ENTER("innobase_init_vc_templ"); - - ut_ad(table->vc_templ == NULL); - - TABLE *mysql_table= innodb_find_table_for_vc(current_thd, table); - - ut_ad(mysql_table); - if (!mysql_table) { - DBUG_RETURN(NULL); - } - - dict_vcol_templ_t* vc_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); - - dict_sys.lock(SRW_LOCK_CALL); - table->vc_templ = vc_templ; - innobase_build_v_templ(mysql_table, table, vc_templ, nullptr, true); - dict_sys.unlock(); - DBUG_RETURN(mysql_table); -} - /** Change dbname and table name in table->vc_templ. @param[in,out] table the table whose virtual column template dbname and tbname to be renamed. */ diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h index ce11b868bd170..67e79f1aa8173 100644 --- a/storage/innobase/include/fsp0file.h +++ b/storage/innobase/include/fsp0file.h @@ -388,11 +388,6 @@ class Datafile { else DB_ERROR. */ dberr_t find_space_id(); - /** Restore the first page of the tablespace from - the double write buffer. - @return whether the operation failed */ - bool restore_from_doublewrite(); - /** Points into m_filepath to the file name with extension */ char* m_filename; diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index e8a7326a50927..6d75e15a67eb1 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -108,6 +108,14 @@ struct recv_dblwr_t byte* find_page(const page_id_t page_id, const fil_space_t *space= NULL, byte *tmp_buf= NULL); + /** Restore the first page of the given tablespace from + doublewrite buffer. + @param space_id tablespace identifier + @param name tablespace filepath + @param file tablespace file handle + @return whether the operation failed */ + bool restore_first_page(uint32_t space_id, const char *name, os_file_t file); + typedef std::deque > list; /** Recovered doublewrite buffer page frames */ diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 2e5bdceb67719..878d9c9f1a267 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -814,11 +814,6 @@ innobase_get_computed_value( const upd_t* update=NULL, bool ignore_warnings=false); -/** Get the computed value by supplying the base column values. -@param[in,out] table the table whose virtual column - template to be built */ -TABLE* innobase_init_vc_templ(dict_table_t* table); - /** Change dbname and table name in table->vc_templ. @param[in,out] table the table whose virtual column template dbname and tbname to be renamed. */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 85c7d596855d7..f479428d9876f 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4817,6 +4817,11 @@ byte *recv_dblwr_t::find_page(const page_id_t page_id, if (page_get_page_no(page) != page_id.page_no() || page_get_space_id(page) != page_id.space()) continue; + uint32_t flags= mach_read_from_4( + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page); + if (!fil_space_t::is_valid_flags(flags, page_id.space())) + continue; + const lsn_t lsn= mach_read_from_8(page + FIL_PAGE_LSN); if (lsn <= max_lsn || !validate_page(page_id, page, space, tmp_buf)) @@ -4825,9 +4830,38 @@ byte *recv_dblwr_t::find_page(const page_id_t page_id, memset(page + FIL_PAGE_LSN, 0, 8); continue; } + + ut_a(page_get_page_no(page) == page_id.page_no()); max_lsn= lsn; result= page; } return result; } + +bool recv_dblwr_t::restore_first_page(uint32_t space_id, const char *name, + os_file_t file) +{ + const page_id_t page_id(space_id, 0); + const byte* page= find_page(page_id); + if (!page) + { + /* If the first page of the given user tablespace is not there + in the doublewrite buffer, then the recovery is going to fail + now. Hence this is treated as error. */ + ib::error() + << "Corrupted page " << page_id << " of datafile '" + << name <<"' could not be found in the doublewrite buffer."; + return true; + } + + ulint physical_size= fil_space_t::physical_size( + mach_read_from_4(page + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS)); + ib::info() << "Restoring page " << page_id << " of datafile '" + << name << "' from the doublewrite buffer. Writing " + << physical_size << " bytes into file '" << name << "'"; + + return os_file_write( + IORequestWrite, name, file, page, 0, physical_size) != + DB_SUCCESS; +} diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 4783408f2f9eb..290bef49949de 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -380,8 +380,9 @@ static uint32_t trx_rseg_get_n_undo_tablespaces() @param[in] name tablespace file name @param[in] i undo tablespace count @return undo tablespace identifier -@retval 0 on failure */ -static uint32_t srv_undo_tablespace_open(bool create, const char *name, +@retval 0 if file doesn't exist +@retval ~0U if page0 is corrupted */ +static uint32_t srv_undo_tablespace_open(bool create, const char* name, uint32_t i) { bool success; @@ -417,14 +418,13 @@ static uint32_t srv_undo_tablespace_open(bool create, const char *name, { page_t *page= static_cast(aligned_malloc(srv_page_size, srv_page_size)); - dberr_t err= os_file_read(IORequestRead, fh, page, 0, srv_page_size, - nullptr); - if (err != DB_SUCCESS) + if (os_file_read(IORequestRead, fh, page, 0, srv_page_size, nullptr) != + DB_SUCCESS) { err_exit: ib::error() << "Unable to read first page of file " << name; aligned_free(page); - return err; + return ~0U; } uint32_t id= mach_read_from_4(FIL_PAGE_SPACE_ID + page); @@ -433,19 +433,20 @@ static uint32_t srv_undo_tablespace_open(bool create, const char *name, FSP_HEADER_OFFSET + FSP_SPACE_ID + page, 4)) { ib::error() << "Inconsistent tablespace ID in file " << name; - err= DB_CORRUPTION; goto err_exit; } + space_id= id; fsp_flags= mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page); + if (buf_page_is_corrupted(false, page, fsp_flags)) { - ib::error() << "Checksum mismatch in the first page of file " << name; - err= DB_CORRUPTION; - goto err_exit; + sql_print_error("InnoDB: Checksum mismatch in the first page of file %s", + name); + if (recv_sys.dblwr.restore_first_page(space_id, name, fh)) + goto err_exit; } - space_id= id; aligned_free(page); } @@ -557,17 +558,19 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, char name[OS_FILE_MAX_PATH]; snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i + 1); uint32_t space_id= srv_undo_tablespace_open(create_new_db, name, i); - if (!space_id) - { + switch (space_id) { + case ~0U: + return DB_CORRUPTION; + case 0: if (!create_new_db) - break; - ib::error() << "Unable to open create tablespace '" << name << "'."; + goto unused_undo; + sql_print_error("InnoDB: Unable to open create tablespace '%s'.", name); return DB_ERROR; + default: + /* Should be no gaps in undo tablespace ids. */ + ut_a(!i || prev_id + 1 == space_id); } - /* Should be no gaps in undo tablespace ids. */ - ut_a(!i || prev_id + 1 == space_id); - prev_id= space_id; /* Note the first undo tablespace id in case of @@ -580,13 +583,14 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, We stop at the first failure. These are undo tablespaces that are not in use and therefore not required by recovery. We only check that there are no gaps. */ - +unused_undo: for (uint32_t i= prev_id + 1; i < srv_undo_space_id_start + TRX_SYS_N_RSEGS; ++i) { char name[OS_FILE_MAX_PATH]; snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i); - if (!srv_undo_tablespace_open(create_new_db, name, i)) + uint32_t space_id= srv_undo_tablespace_open(create_new_db, name, i); + if (!space_id || space_id == ~0U) break; ++srv_undo_tablespaces_open; } diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index daf27822085cf..4625b5d6cd93b 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -639,8 +639,9 @@ static void trx_undo_write_xid(buf_block_t *block, uint16_t offset, static_cast(xid.bqual_length)); const ulint xid_length= static_cast(xid.gtrid_length + xid.bqual_length); - mtr->memcpy(*block, &block->page.frame[offset + TRX_UNDO_XA_XID], - xid.data, xid_length); + mtr->memcpy(*block, + &block->page.frame[offset + TRX_UNDO_XA_XID], + xid.data, xid_length); if (UNIV_LIKELY(xid_length < XIDDATASIZE)) mtr->memset(block, offset + TRX_UNDO_XA_XID + xid_length, XIDDATASIZE - xid_length, 0); diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 8e6426e3aa4bb..bfeb5e0c11d3f 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -8426,34 +8426,41 @@ my_bool translog_is_file(uint file_no) static uint32 translog_first_file(TRANSLOG_ADDRESS horizon, int is_protected) { - uint min_file= 0, max_file; + uint min_file= 1, max_file; DBUG_ENTER("translog_first_file"); if (!is_protected) mysql_mutex_lock(&log_descriptor.purger_lock); - if (log_descriptor.min_file_number && - translog_is_file(log_descriptor.min_file_number)) + if (log_descriptor.min_file_number) { - DBUG_PRINT("info", ("cached %lu", - (ulong) log_descriptor.min_file_number)); - if (!is_protected) - mysql_mutex_unlock(&log_descriptor.purger_lock); - DBUG_RETURN(log_descriptor.min_file_number); + min_file= log_descriptor.min_file_number; + if (translog_is_file(log_descriptor.min_file_number)) + { + DBUG_PRINT("info", ("cached %lu", + (ulong) log_descriptor.min_file_number)); + if (!is_protected) + mysql_mutex_unlock(&log_descriptor.purger_lock); + DBUG_RETURN(log_descriptor.min_file_number); + } } max_file= LSN_FILE_NO(horizon); + if (!translog_is_file(max_file)) + { + if (!is_protected) + mysql_mutex_unlock(&log_descriptor.purger_lock); + DBUG_RETURN(max_file); /* For compatibility */ + } /* binary search for last file */ - while (min_file != max_file && min_file != (max_file - 1)) + while (min_file < max_file) { uint test= (min_file + max_file) / 2; DBUG_PRINT("info", ("min_file: %u test: %u max_file: %u", min_file, test, max_file)); - if (test == max_file) - test--; if (translog_is_file(test)) max_file= test; else - min_file= test; + min_file= test+1; } log_descriptor.min_file_number= max_file; if (!is_protected) @@ -8722,9 +8729,9 @@ my_bool translog_purge(TRANSLOG_ADDRESS low) /** @brief Purges files by stored min need file in case of - "ondemend" purge type + "one demand" purge type - @note This function do real work only if it is "ondemend" purge type + @note This function do real work only if it is "one demand" purge type and translog_purge() was called at least once and last time without errors @@ -8763,13 +8770,14 @@ my_bool translog_purge_at_flush() min_file= translog_first_file(translog_get_horizon(), 1); DBUG_ASSERT(min_file != 0); /* log is already started */ - for(i= min_file; i < log_descriptor.min_need_file && rc == 0; i++) + for(i= min_file; i < log_descriptor.min_need_file ; i++) { char path[FN_REFLEN], *file_name; DBUG_PRINT("info", ("purge file %lu\n", (ulong) i)); file_name= translog_filename_by_fileno(i, path); - rc= MY_TEST(mysql_file_delete(key_file_translog, + rc|= MY_TEST(mysql_file_delete(key_file_translog, file_name, MYF(MY_WME))); + DBUG_ASSERT(rc == 0); } mysql_mutex_unlock(&log_descriptor.purger_lock); diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 8b3a159f7a275..1373f9dd43d92 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -3068,8 +3068,7 @@ pfs_start_table_io_wait_v1(PSI_table_locker_state *state, PFS_table_share *share= pfs_table->m_share; wait->m_thread_internal_id= pfs_thread->m_thread_internal_id; - if (wait->m_class == NULL || wait->m_class->m_type != PFS_CLASS_TABLE_LOCK) - wait->m_class= &global_table_io_class; + wait->m_class= &global_table_io_class; wait->m_timer_start= timer_start; wait->m_timer_end= 0; wait->m_object_instance_addr= pfs_table->m_identity;