From a0d052b0841fd76ea18f465848eec27263a077db Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Mon, 7 Oct 2019 16:14:46 -0700 Subject: [PATCH] Fix more tests - #9 Summary: 1. Disable group_min_max: we need to port over infinite loop fix 2. Disable blind_delete_rc/blind_delete_rr - missing rocksdb_read_free_rpl patch 3. Disable rocksdb.persistent_cache - this is a strange crash that only happens when other tests are running and requires further investigation 4. Lower number of rows in deadlock/drop_table as 8.0 debug can lead to timeout. Filed a task to investigate why the performance is different between 8.0 and 5.6. Also turn off binlog to make the test slightly faster and align with 5.6 5. rocksdb.information_schema: need to move create table before select * from information_schema.rocksdb_global_info to write out max_index. Also due to missing a few tables in mysql database (such as slave_gtid_info, etc) the index ids are also different. 6. rocksdb.rocksdb: account for different in rocksdb_number_keys_written when binlog is enabled by default in 8.0. Disabled partition related tests with disable_testcase (tracked in a separate task). Also disabled a packing related test that is tracked by a separate task. 7. rocksdb.drop_table: reduce max to avoid test timeout (filed a separate task for investigation). Also fix a bug in myrocksdb shutdown to properly abort the compaction at shutdown when rocksdb_Debug_manual_compaction_delay is set. 8. rebaseline rpl_gtid_crash_safe because the .inc file in mysql side has changed Reviewed By: lloyd Differential Revision: D17802248 --- mysql-test/collections/disabled_rocksdb.def | 4 + mysql-test/suite/rocksdb/r/deadlock.result | 16 +- mysql-test/suite/rocksdb/r/drop_table.result | 8 +- .../suite/rocksdb/r/information_schema.result | 12 +- ...inlog_gtid_skip_empty_trans_rocksdb.result | 67 +-- .../suite/rocksdb/r/read_only_tx.result | 10 +- mysql-test/suite/rocksdb/r/rocksdb.result | 500 ++++++++++-------- .../suite/rocksdb/t/deadlock-master.opt | 1 + mysql-test/suite/rocksdb/t/deadlock.test | 16 +- mysql-test/suite/rocksdb/t/drop_table.test | 3 +- .../suite/rocksdb/t/information_schema.test | 11 +- .../suite/rocksdb/t/read_only_tx-master.opt | 2 +- mysql-test/suite/rocksdb/t/rocksdb.test | 4 +- .../rocksdb_rpl/r/rpl_gtid_crash_safe.result | 445 ++++++++-------- ..._force_compute_memtable_stats_basic.result | 1 + ...db_force_compute_memtable_stats_basic.test | 2 + storage/rocksdb/ha_rocksdb.cc | 18 +- 17 files changed, 620 insertions(+), 500 deletions(-) create mode 100644 mysql-test/suite/rocksdb/t/deadlock-master.opt diff --git a/mysql-test/collections/disabled_rocksdb.def b/mysql-test/collections/disabled_rocksdb.def index 62e841202db0..bdf51052b8ee 100644 --- a/mysql-test/collections/disabled_rocksdb.def +++ b/mysql-test/collections/disabled_rocksdb.def @@ -52,6 +52,7 @@ rocksdb_rpl.rpl_no_unique_check_on_lag_mts : missing d80175902ee Disable unique rocksdb.percona_nonflushing_analyze_debug : missing dbc7c09e252 Fix bug 1704195 / 87065 / TDB-83 (Stop ANALYZE TABLE from flushing table definition cache) rocksdb.2pc_group_commit : missing 37c7ed00ce9 write/sync redo log before flushing binlog cache to file rocksdb.slow_query_log : missing 91d708f9efb Add support for reporting keys/deletes skipped in the extra slow query log +rocksdb.group_min_max : missing infinite loop fix # Blind replace rocksdb.optimize_myrocks_replace_into_base : missing patch f14c64cf950 Optimize replace into to do a blind write @@ -76,6 +77,8 @@ rocksdb_rpl.rpl_skip_trx_api_binlog_format : rpl_skip_tx_api missing # rocksdb_read_free_rpl rocksdb.rocksdb_read_free_rpl : rocksdb_read_free_rpl missing rocksdb.rocksdb_read_free_rpl_stress : rocksdb_read_free_rpl missing +rocksdb.blind_delete_rc : rocksdb_read_free_rpl missing +rocksdb.blind_delete_rr : rocksdb_read_free_rpl missing # i_s.table_statistics rocksdb.show_table_status : table_statistics missing @@ -94,4 +97,5 @@ rocksdb.com_rpc_tx : detached session is missing in 8.0 # Misc bugs rocksdb.bloomfilter3 : query plan is different between 8.0 and 5.6 rocksdb.issue884 : query plan is different between 8.0 and 5.6 +rocksdb.persistent_cache : only repros with other tests running diff --git a/mysql-test/suite/rocksdb/r/deadlock.result b/mysql-test/suite/rocksdb/r/deadlock.result index 3e2f5709ca05..a7d936a51aa2 100644 --- a/mysql-test/suite/rocksdb/r/deadlock.result +++ b/mysql-test/suite/rocksdb/r/deadlock.result @@ -11,27 +11,27 @@ SET @save = @@global.rocksdb_lock_wait_timeout; SET GLOBAL rocksdb_lock_wait_timeout = 60; SELECT count from t1; count -50000 +5000 SELECT count from t1; count -100000 +10000 SELECT count from t1; count -150000 +15000 SELECT count from t1; count -200000 +20000 SELECT count from t1rev; count -50000 +5000 SELECT count from t1rev; count -100000 +10000 SELECT count from t1rev; count -150000 +15000 SELECT count from t1rev; count -200000 +20000 SET GLOBAL rocksdb_lock_wait_timeout = @save; DROP DATABASE mysqlslap; diff --git a/mysql-test/suite/rocksdb/r/drop_table.result b/mysql-test/suite/rocksdb/r/drop_table.result index b6183eff2630..db293ce02270 100644 --- a/mysql-test/suite/rocksdb/r/drop_table.result +++ b/mysql-test/suite/rocksdb/r/drop_table.result @@ -9,6 +9,7 @@ call mtr.add_suppression("LibRocksDB"); set global rocksdb_compact_cf = 'cf1'; set global rocksdb_compact_cf = 'rev:cf2'; set global rocksdb_signal_drop_index_thread = 1; +# restart CREATE TABLE t1 ( a int not null, b int not null, @@ -38,6 +39,7 @@ DELETE FROM t2; DELETE FROM t3; DELETE FROM t4; drop table t2; +# restart DELETE FROM t1; DELETE FROM t4; drop table t3; @@ -47,14 +49,16 @@ SET GLOBAL rocksdb_max_manual_compactions = 2; SET GLOBAL rocksdb_debug_manual_compaction_delay = 3600; SET GLOBAL rocksdb_compact_cf='cf1'; SET GLOBAL rocksdb_compact_cf='rev:cf2'; -select * from information_schema.global_status where variable_name='rocksdb_manual_compactions_running'; +select * from performance_schema.global_status where variable_name='rocksdb_manual_compactions_running'; VARIABLE_NAME VARIABLE_VALUE -ROCKSDB_MANUAL_COMPACTIONS_RUNNING 1 +rocksdb_manual_compactions_running 1 SET GLOBAL rocksdb_compact_cf='cf1'; ERROR HY000: Internal error: Can't schedule more manual compactions. Increase rocksdb_max_manual_compactions or stop issuing more manual compactions. SET GLOBAL rocksdb_compact_cf='rev:cf2'; ERROR HY000: Internal error: Can't schedule more manual compactions. Increase rocksdb_max_manual_compactions or stop issuing more manual compactions. +# restart drop table t4; +# restart CREATE TABLE t5 ( a int not null, b int not null, diff --git a/mysql-test/suite/rocksdb/r/information_schema.result b/mysql-test/suite/rocksdb/r/information_schema.result index f8304407fcba..739f8d4cc9f2 100644 --- a/mysql-test/suite/rocksdb/r/information_schema.result +++ b/mysql-test/suite/rocksdb/r/information_schema.result @@ -1,6 +1,9 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; +select VALUE into @keysIn from INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS where CF_NAME = 'default' and LEVEL = 'Sum' and TYPE = 'KeyIn'; +CREATE TABLE t1 (i1 INT, i2 INT, PRIMARY KEY (i1)) ENGINE = ROCKSDB; +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3); select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; TYPE NAME VALUE MAX_INDEX_ID MAX_INDEX_ID max_index_id @@ -9,14 +12,11 @@ CF_FLAGS 1 __system__ [0] select count(*) from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; count(*) 3 -select VALUE into @keysIn from INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS where CF_NAME = 'default' and LEVEL = 'Sum' and TYPE = 'KeyIn'; -CREATE TABLE t1 (i1 INT, i2 INT, PRIMARY KEY (i1)) ENGINE = ROCKSDB; -INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3); set global rocksdb_force_flush_memtable_now = true; select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; TYPE NAME VALUE -BINLOG FILE master-bin.000001 -BINLOG POS 1066 +BINLOG FILE binlog.000001 +BINLOG POS 1278 BINLOG GTID uuid:5 MAX_INDEX_ID MAX_INDEX_ID max_index_id CF_FLAGS 0 default [0] @@ -67,7 +67,7 @@ SHOW GLOBAL VARIABLES LIKE 'ROCKSDB_PAUSE_BACKGROUND_WORK'; Variable_name Value rocksdb_pause_background_work ON DROP TABLE t3; -cf_id:0,index_id:267 +cf_id:0,index_id:263 SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK=0; SHOW GLOBAL VARIABLES LIKE 'ROCKSDB_PAUSE_BACKGROUND_WORK'; Variable_name Value diff --git a/mysql-test/suite/rocksdb/r/mysqlbinlog_gtid_skip_empty_trans_rocksdb.result b/mysql-test/suite/rocksdb/r/mysqlbinlog_gtid_skip_empty_trans_rocksdb.result index 835361eea352..8e2572b1d734 100644 --- a/mysql-test/suite/rocksdb/r/mysqlbinlog_gtid_skip_empty_trans_rocksdb.result +++ b/mysql-test/suite/rocksdb/r/mysqlbinlog_gtid_skip_empty_trans_rocksdb.result @@ -4,10 +4,10 @@ set SESSION binlog_format = 'ROW'; create database test2; create database test3; use test; -create table t1 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t1(a int primary key, b char(8)) ENGINE = rocksdb; insert into t1 values(1, 'a'); insert into t1 values(2, 'b'); -create table t2 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t2(a int primary key, b char(8)) ENGINE = rocksdb; start transaction; insert into t2 values(1, 'a'); insert into t2 values(2, 'b'); @@ -15,10 +15,10 @@ insert into t2 values(3, 'c'); insert into t2 values(4, 'd'); commit; use test2; -create table t1 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t1(a int primary key, b char(8)) ENGINE = rocksdb; insert into t1 values(1, 'a'); insert into t1 values(2, 'b'); -create table t2 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t2(a int primary key, b char(8)) ENGINE = rocksdb; start transaction; insert into t2 values(1, 'a'); insert into t2 values(2, 'b'); @@ -26,10 +26,10 @@ insert into t2 values(3, 'c'); insert into t2 values(4, 'd'); commit; use test3; -create table t1 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t1(a int primary key, b char(8)) ENGINE = rocksdb; insert into t1 values(1, 'a'); insert into t1 values(2, 'b'); -create table t2 (a int primary key, b char(8)) ENGINE=rocksdb; +create table t2(a int primary key, b char(8)) ENGINE = rocksdb; start transaction; insert into t2 values(1, 'a'); insert into t2 values(2, 'b'); @@ -37,45 +37,50 @@ insert into t2 values(3, 'c'); insert into t2 values(4, 'd'); commit; FLUSH LOGS; -==== Output of mysqlbinlog with --short-form --skip-empty-trans, --database and --skip-gtids options ==== +include/mysqlbinlog.inc /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; -/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET TIMESTAMP=1000000000/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; +SET TIMESTAMP=#/*!*/; +SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1073741824/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; -/*!\C latin1 *//*!*/; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +/*!\C utf8mb4 *//*!*/; +SET @@session.character_set_client=255,@@session.collation_connection=255,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; +/*!80011 SET @@session.default_collation_for_utf8mb4=255*//*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; create database test2 /*!*/; use `test2`/*!*/; -SET TIMESTAMP=1000000000/*!*/; -create table t1 (a int primary key, b char(8)) ENGINE=rocksdb +SET TIMESTAMP=#/*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; +create table t1(a int primary key, b char(8)) ENGINE = rocksdb /*!*/; -SET TIMESTAMP=1000000000/*!*/; +SET TIMESTAMP=#/*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; BEGIN /*!*/; COMMIT/*!*/; -SET TIMESTAMP=1000000000/*!*/; +SET TIMESTAMP=#/*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; BEGIN /*!*/; COMMIT/*!*/; -SET TIMESTAMP=1000000000/*!*/; -create table t2 (a int primary key, b char(8)) ENGINE=rocksdb +SET TIMESTAMP=#/*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; +create table t2(a int primary key, b char(8)) ENGINE = rocksdb /*!*/; -SET TIMESTAMP=1000000000/*!*/; +SET TIMESTAMP=#/*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; BEGIN /*!*/; COMMIT/*!*/; DELIMITER ; # End of log file -ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use test2; @@ -87,26 +92,26 @@ insert into t2 values(7, 'g'); insert into t2 values(8, 'h'); commit; FLUSH LOGS; -==== Output of mysqlbinlog with --short-form --skip-empty-trans, --database and --skip-gtids options ==== -==== DB changed in the middle of the transaction, which belongs to the selected database +include/mysqlbinlog.inc /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; -/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET TIMESTAMP=1000000000/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; +SET TIMESTAMP=#/*!*/; +SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1073741824/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; -/*!\C latin1 *//*!*/; -SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +/*!\C utf8mb4 *//*!*/; +SET @@session.character_set_client=255,@@session.collation_connection=255,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; +/*!80011 SET @@session.default_collation_for_utf8mb4=255*//*!*/; +/*!80013 SET @@session.sql_require_primary_key=0*//*!*/; BEGIN /*!*/; +ROLLBACK /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file -ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use test; @@ -118,15 +123,13 @@ insert into t2 values(11, 'k'); insert into t2 values(12, 'l'); commit; FLUSH LOGS; -==== Output of mysqlbinlog with --short-form --skip-empty-trans, --database and --skip-gtids options ==== -==== DB changed in the middle of the transaction, which belongs to the non-selected database +include/mysqlbinlog.inc /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; -/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; +ROLLBACK /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file -ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use test; diff --git a/mysql-test/suite/rocksdb/r/read_only_tx.result b/mysql-test/suite/rocksdb/r/read_only_tx.result index d7d69bb3af81..8e8f4f5d1659 100644 --- a/mysql-test/suite/rocksdb/r/read_only_tx.result +++ b/mysql-test/suite/rocksdb/r/read_only_tx.result @@ -1,15 +1,15 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (id INT, value int, PRIMARY KEY (id), INDEX (value)) ENGINE=RocksDB; INSERT INTO t1 VALUES (1,1); -select variable_value into @p from information_schema.global_status where variable_name='rocksdb_number_sst_entry_put'; -select variable_value into @s from information_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete'; +select variable_value into @p from performance_schema.global_status where variable_name='rocksdb_number_sst_entry_put'; +select variable_value into @s from performance_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete'; START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 734 uuid:1-3 -select case when variable_value-@p < 1000 then 'true' else variable_value-@p end from information_schema.global_status where variable_name='rocksdb_number_sst_entry_put'; +binlog.000001 870 uuid:1-3 +select case when variable_value-@p < 1000 then 'true' else variable_value-@p end from performance_schema.global_status where variable_name='rocksdb_number_sst_entry_put'; case when variable_value-@p < 1000 then 'true' else variable_value-@p end true -select case when variable_value-@s < 100 then 'true' else variable_value-@s end from information_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete'; +select case when variable_value-@s < 100 then 'true' else variable_value-@s end from performance_schema.global_status where variable_name='rocksdb_number_sst_entry_singledelete'; case when variable_value-@s < 100 then 'true' else variable_value-@s end true SELECT * FROM t1; diff --git a/mysql-test/suite/rocksdb/r/rocksdb.result b/mysql-test/suite/rocksdb/r/rocksdb.result index 73c4e54b8602..2df81e84d24f 100644 --- a/mysql-test/suite/rocksdb/r/rocksdb.result +++ b/mysql-test/suite/rocksdb/r/rocksdb.result @@ -19,22 +19,22 @@ key(a) ) engine=rocksdb; insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4); -set @var1=(select variable_value -from information_schema.global_status +set @var1=(select variable_value +from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); # Do an update that doesn't change the key 'a'. update t1 set b=3334341 where a=2; -set @var2=(select variable_value -from information_schema.global_status +set @var2=(select variable_value +from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); -# The following should produce 1 +# The following should produce 2 when binlog is enabled select @var2 - @var1; @var2 - @var1 -1 +2 # Do an update that sets the key to the same value update t1 set a=pk where a=3; -set @var3=(select variable_value -from information_schema.global_status +set @var3=(select variable_value +from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); # We have 'updated' column to the same value, so the following must return 0: select @var3 - @var2; @@ -70,11 +70,15 @@ a b 1 1 2 2 explain select * from t2 where a='no-such-key'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 /* select#1 */ select NULL AS `a`,NULL AS `b` from `test`.`t2` where multiple equal('no-such-key', NULL) explain select * from t2 where a='abc'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 const PRIMARY PRIMARY 12 const # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 12 const # # NULL +Warnings: +Note 1003 /* select#1 */ select 'abc' AS `a`,'def' AS `b` from `test`.`t2` where 1 select * from t2 where a='abc'; a b abc def @@ -189,8 +193,10 @@ insert into t8 values ('five', 'funf'); # Delete by PK explain delete from t8 where a='three'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t8 range PRIMARY PRIMARY 12 const # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 DELETE t8 NULL range PRIMARY PRIMARY 12 const # # Using where +Warnings: +Note 1003 delete from `test`.`t8` where (`test`.`t8`.`a` = 'three') delete from t8 where a='three'; select * from t8; a col1 @@ -279,9 +285,11 @@ j 4 EXPLAIN SELECT * FROM t10, t11 WHERE i=j; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 index PRIMARY PRIMARY 4 NULL # Using index -1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t10.i # Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t10 NULL index PRIMARY PRIMARY 4 NULL # # Using index +1 SIMPLE t11 NULL eq_ref PRIMARY PRIMARY 4 test.t10.i # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t10`.`i` AS `i`,`test`.`t11`.`j` AS `j` from `test`.`t10` join `test`.`t11` where (`test`.`t11`.`j` = `test`.`t10`.`i`) SELECT * FROM t10, t11 WHERE i=j; i j 1 1 @@ -297,11 +305,6 @@ pk 2 DROP TABLE t12; # -# MDEV-3964: Assertion `!pk_descr' fails in ha_rocksdb::open on adding partitions ... -# -create table t14 (pk int primary key) engine=RocksDB partition by hash(pk) partitions 2; -drop table t14; -# # MDEV-3960: Server crashes on running DISCARD TABLESPACE on a RocksDB table # create table t9 (i int primary key) engine=rocksdb; @@ -521,22 +524,28 @@ insert into t30 values ('row2', 'row2-key', 'row2-data'); insert into t30 values ('row3', 'row3-key', 'row3-data'); explain select * from t30 where key1='row2-key'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 ref key1 key1 18 const # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL ref key1 key1 18 const # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`key1` = 'row2-key') select * from t30 where key1='row2-key'; pk key1 col1 row2 row2-key row2-data explain select * from t30 where key1='row1'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 ref key1 key1 18 const # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL ref key1 key1 18 const # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`key1` = 'row1') # This will produce nothing: select * from t30 where key1='row1'; pk key1 col1 explain select key1 from t30; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 index NULL key1 18 NULL # Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL index NULL key1 18 NULL # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`key1` AS `key1` from `test`.`t30` select key1 from t30; key1 row1-key @@ -565,8 +574,10 @@ insert into t30 values ('row5', 'row5-key', 'row5-data'); explain select * from t30 where key1 <='row3-key'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range key1 key1 18 NULL # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range key1 key1 18 NULL # # Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`key1` <= 'row3-key') select * from t30 where key1 <='row3-key'; pk key1 col1 row1 row1-key row1-data @@ -574,8 +585,10 @@ row2 row2-key row2-data row3 row3-key row3-data explain select * from t30 where key1 between 'row2-key' and 'row4-key'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range key1 key1 18 NULL # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range key1 key1 18 NULL # # Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`key1` between 'row2-key' and 'row4-key') select * from t30 where key1 between 'row2-key' and 'row4-key'; pk key1 col1 row2 row2-key row2-data @@ -583,32 +596,40 @@ row3 row3-key row3-data row4 row4-key row4-data explain select * from t30 where key1 in ('row2-key','row4-key'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range key1 key1 18 NULL # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range key1 key1 18 NULL # # Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`key1` in ('row2-key','row4-key')) select * from t30 where key1 in ('row2-key','row4-key'); pk key1 col1 row2 row2-key row2-data row4 row4-key row4-data explain select key1 from t30 where key1 in ('row2-key','row4-key'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range key1 key1 18 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range key1 key1 18 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`key1` AS `key1` from `test`.`t30` where (`test`.`t30`.`key1` in ('row2-key','row4-key')) select key1 from t30 where key1 in ('row2-key','row4-key'); key1 row2-key row4-key explain select * from t30 where key1 > 'row1-key' and key1 < 'row4-key'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range key1 key1 18 NULL # Using index condition +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range key1 key1 18 NULL # # Using index condition +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where ((`test`.`t30`.`key1` > 'row1-key') and (`test`.`t30`.`key1` < 'row4-key')) select * from t30 where key1 > 'row1-key' and key1 < 'row4-key'; pk key1 col1 row2 row2-key row2-data row3 row3-key row3-data explain select * from t30 order by key1 limit 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 index NULL key1 18 NULL # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL index NULL key1 18 NULL # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` order by `test`.`t30`.`key1` limit 3 select * from t30 order by key1 limit 3; pk key1 col1 row1 row1-key row1-data @@ -616,8 +637,10 @@ row2 row2-key row2-data row3 row3-key row3-data explain select * from t30 order by key1 desc limit 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 index NULL key1 18 NULL # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL index NULL key1 18 NULL # # Backward index scan +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` order by `test`.`t30`.`key1` desc limit 3 select * from t30 order by key1 desc limit 3; pk key1 col1 row5 row5-key row5-data @@ -628,8 +651,10 @@ row3 row3-key row3-data # explain select * from t30 where pk <='row3'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range PRIMARY PRIMARY 18 NULL # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range PRIMARY PRIMARY 18 NULL # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`pk` <= 'row3') select * from t30 where pk <='row3'; pk key1 col1 row1 row1-key row1-data @@ -637,8 +662,10 @@ row2 row2-key row2-data row3 row3-key row3-data explain select * from t30 where pk between 'row2' and 'row4'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range PRIMARY PRIMARY 18 NULL # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range PRIMARY PRIMARY 18 NULL # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`pk` between 'row2' and 'row4') select * from t30 where pk between 'row2' and 'row4'; pk key1 col1 row2 row2-key row2-data @@ -646,16 +673,20 @@ row3 row3-key row3-data row4 row4-key row4-data explain select * from t30 where pk in ('row2','row4'); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 range PRIMARY PRIMARY 18 NULL # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL range PRIMARY PRIMARY 18 NULL # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` where (`test`.`t30`.`pk` in ('row2','row4')) select * from t30 where pk in ('row2','row4'); pk key1 col1 row2 row2-key row2-data row4 row4-key row4-data explain select * from t30 order by pk limit 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t30 index NULL PRIMARY 18 NULL # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t30 NULL index NULL PRIMARY 18 NULL # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t30`.`pk` AS `pk`,`test`.`t30`.`key1` AS `key1`,`test`.`t30`.`col1` AS `col1` from `test`.`t30` order by `test`.`t30`.`pk` limit 3 select * from t30 order by pk limit 3; pk key1 col1 row1 row1-key row1-data @@ -1070,8 +1101,10 @@ insert into t1 values (-5,-5,-5); # INT column uses index-only: explain select key1 from t1 where key1=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1 key1 5 const # Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref key1 key1 5 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`key1` AS `key1` from `test`.`t1` where (`test`.`t1`.`key1` = 2) select key1 from t1 where key1=2; key1 2 @@ -1084,8 +1117,10 @@ insert into t2 values (1,1,1), (2,2,2); # INT UNSIGNED column uses index-only: explain select key1 from t2 where key1=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref key1 key1 5 const # Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref key1 key1 5 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`key1` AS `key1` from `test`.`t2` where (`test`.`t2`.`key1` = 2) select key1 from t2 where key1=2; key1 2 @@ -1095,8 +1130,10 @@ insert into t3 values (1,1,1), (2,2,2); # BIGINT uses index-only: explain select key1 from t3 where key1=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ref key1 key1 9 const # Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 NULL ref key1 key1 9 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`key1` AS `key1` from `test`.`t3` where (`test`.`t3`.`key1` = 2) select key1 from t3 where key1=2; key1 2 @@ -1113,8 +1150,10 @@ key (key1) insert into t1 values(1, 'one',11), (2,'two',22); explain select key1 from t1 where key1='one'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1 key1 11 const # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref key1 key1 11 const # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`key1` AS `key1` from `test`.`t1` where (`test`.`t1`.`key1` = 'one') # The following will produce no rows. This looks like a bug, # but it is actually correct behavior. Binary strings are end-padded # with \0 character (and not space). Comparison does not ignore @@ -1123,8 +1162,10 @@ select key1 from t1 where key1='one'; key1 explain select hex(key1) from t1 where key1='one\0\0\0\0\0\0\0'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1 key1 11 const # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref key1 key1 11 const # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`key1`) AS `hex(key1)` from `test`.`t1` where (`test`.`t1`.`key1` = 'one\0\0\0\0\0\0\0') select hex(key1) from t1 where key1='one\0\0\0\0\0\0\0'; hex(key1) 6F6E6500000000000000 @@ -1138,8 +1179,10 @@ key (key1) insert into t2 values(1, 'one',11), (2,'two',22); explain select key1 from t2 where key1='one'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref key1 key1 11 const # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref key1 key1 11 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`key1` AS `key1` from `test`.`t2` where (`test`.`t2`.`key1` = 'one') select key1 from t2 where key1='one'; key1 one @@ -1150,11 +1193,15 @@ key1 char(10) collate utf8_bin, col1 int, key (key1) ) engine=rocksdb; +Warnings: +Warning 3778 'utf8_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. insert into t3 values(1, 'one',11), (2,'two',22); explain select key1 from t3 where key1='one'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ref key1 key1 31 const # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t3 NULL ref key1 key1 31 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`key1` AS `key1` from `test`.`t3` where (`test`.`t3`.`key1` = 'one') select key1 from t3 where key1='one'; key1 one @@ -1168,8 +1215,10 @@ key(key1) insert into t4 values(1, 'one'), (2,'two'),(3,'threee'),(55,'fifty-five'); explain select key1 from t4 where key1='two'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t4 ref key1 key1 13 const # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL ref key1 key1 13 const # # Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`key1` AS `key1` from `test`.`t4` where (`test`.`t4`.`key1` = 'two') select key1 from t4 where key1='two'; key1 two @@ -1178,8 +1227,10 @@ key1 fifty-five explain select key1 from t4 where key1 between 's' and 'u'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t4 range key1 key1 13 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL range key1 key1 13 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`key1` AS `key1` from `test`.`t4` where (`test`.`t4`.`key1` between 's' and 'u') select key1 from t4 where key1 between 's' and 'u'; key1 threee @@ -1220,6 +1271,9 @@ DROP TABLE t1; # MDEV-4304: RocksDB: Index-only scan by a field with utf8_bin collation returns garbage symbols # CREATE TABLE t1 (pk INT PRIMARY KEY, c1 CHAR(1), c2 CHAR(1), KEY(c1)) ENGINE=RocksDB CHARSET utf8 COLLATE utf8_bin; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. INSERT INTO t1 VALUES (1,'h','h'); SELECT * FROM t1; pk c1 c2 @@ -1333,6 +1387,8 @@ drop table t1; # CREATE TABLE t1 (pk INT PRIMARY KEY, a SMALLINT, b INT, KEY (a)) ENGINE=RocksDB; INSERT IGNORE INTO t1 VALUES (1, 157, 0), (2, 1898, -504403), (1, -14659, 0); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' SELECT * FROM t1; pk a b 1 157 0 @@ -1351,7 +1407,9 @@ DROP TABLE t1; # CREATE TABLE t1 (pk INT PRIMARY KEY, a int) ENGINE=RocksDB; set @a=-1; -insert into t1 select (@a:=@a+1), 1234 from information_schema.session_variables limit 100; +insert into t1 select (@a:=@a+1), 1234 from performance_schema.session_variables limit 100; +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Please set variables in separate statements instead. set @tmp1= @@rocksdb_max_row_locks; set rocksdb_max_row_locks= 20; update t1 set a=a+10; @@ -1395,6 +1453,7 @@ create table t1 (i int primary key auto_increment) engine=RocksDB; insert into t1 values (null); insert into t1 values (null); SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK = @ORIG_PAUSE_BACKGROUND_WORK; +# restart SET @ORIG_PAUSE_BACKGROUND_WORK = @@ROCKSDB_PAUSE_BACKGROUND_WORK; SET GLOBAL ROCKSDB_PAUSE_BACKGROUND_WORK = 1; insert into t1 values (null); @@ -1411,7 +1470,7 @@ create table t1 (i int primary key auto_increment) engine=RocksDB; insert into t1 values (null),(null); show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 ROCKSDB 10 Fixed 1000 0 # 0 0 0 3 NULL NULL NULL latin1_swedish_ci NULL +t1 ROCKSDB 10 Fixed 1000 0 # 0 0 0 3 # NULL NULL latin1_swedish_ci NULL drop table t1; # # Fix Issue #4: Crash when using pseudo-unique keys @@ -1448,8 +1507,14 @@ set autocommit=0; begin; set @a:=0; insert into t1 select @a:=@a+1, @a from t0 A, t0 B, t0 C, t0 D where D.a<4; +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Please set variables in separate statements instead. insert into t1 select @a:=@a+1, @a from t0 A, t0 B, t0 C, t0 D where D.a<4; +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Please set variables in separate statements instead. insert into t1 select @a:=@a+1, @a from t0 A, t0 B, t0 C, t0 D where D.a<4; +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Please set variables in separate statements instead. rollback; select count(*) from t1; count(*) @@ -1462,6 +1527,8 @@ drop table t0, t1; # show status where variable_name like 'rocksdb%' and variable_name not like '%num_get_for_update%'; Variable_name Value +Rocksdb_git_date # +Rocksdb_git_hash # rocksdb_rows_deleted # rocksdb_rows_inserted # rocksdb_rows_read # @@ -1520,8 +1587,6 @@ rocksdb_get_hit_l0 # rocksdb_get_hit_l1 # rocksdb_get_hit_l2_and_up # rocksdb_getupdatessince_calls # -rocksdb_git_date # -rocksdb_git_hash # rocksdb_iter_bytes_read # rocksdb_manual_compactions_processed # rocksdb_manual_compactions_running # @@ -1576,27 +1641,10 @@ rocksdb_write_other # rocksdb_write_self # rocksdb_write_timedout # rocksdb_write_wal # -select VARIABLE_NAME from INFORMATION_SCHEMA.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; -VARIABLE_NAME -ROCKSDB_ROWS_DELETED -ROCKSDB_ROWS_INSERTED -ROCKSDB_ROWS_READ -ROCKSDB_ROWS_UPDATED -ROCKSDB_ROWS_DELETED_BLIND -ROCKSDB_ROWS_EXPIRED -ROCKSDB_ROWS_FILTERED -ROCKSDB_SYSTEM_ROWS_DELETED -ROCKSDB_SYSTEM_ROWS_INSERTED -ROCKSDB_SYSTEM_ROWS_READ -ROCKSDB_SYSTEM_ROWS_UPDATED -ROCKSDB_MEMTABLE_TOTAL -ROCKSDB_MEMTABLE_UNFLUSHED -ROCKSDB_QUERIES_POINT -ROCKSDB_QUERIES_RANGE -ROCKSDB_TABLE_INDEX_STATS_SUCCESS -ROCKSDB_TABLE_INDEX_STATS_FAILURE -ROCKSDB_TABLE_INDEX_STATS_REQ_QUEUE_LENGTH -ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS +select UPPER(VARIABLE_NAME) from performance_schema.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; +UPPER(VARIABLE_NAME) +ROCKSDB_BLOCK_CACHECOMPRESSED_HIT +ROCKSDB_BLOCK_CACHECOMPRESSED_MISS ROCKSDB_BLOCK_CACHE_ADD ROCKSDB_BLOCK_CACHE_ADD_FAILURES ROCKSDB_BLOCK_CACHE_BYTES_READ @@ -1617,8 +1665,6 @@ ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT ROCKSDB_BLOCK_CACHE_INDEX_HIT ROCKSDB_BLOCK_CACHE_INDEX_MISS ROCKSDB_BLOCK_CACHE_MISS -ROCKSDB_BLOCK_CACHECOMPRESSED_HIT -ROCKSDB_BLOCK_CACHECOMPRESSED_MISS ROCKSDB_BLOOM_FILTER_FULL_POSITIVE ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED @@ -1626,16 +1672,17 @@ ROCKSDB_BLOOM_FILTER_PREFIX_USEFUL ROCKSDB_BLOOM_FILTER_USEFUL ROCKSDB_BYTES_READ ROCKSDB_BYTES_WRITTEN -ROCKSDB_COMPACT_READ_BYTES -ROCKSDB_COMPACT_WRITE_BYTES ROCKSDB_COMPACTION_KEY_DROP_NEW ROCKSDB_COMPACTION_KEY_DROP_OBSOLETE ROCKSDB_COMPACTION_KEY_DROP_USER +ROCKSDB_COMPACT_READ_BYTES +ROCKSDB_COMPACT_WRITE_BYTES +ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS ROCKSDB_FLUSH_WRITE_BYTES +ROCKSDB_GETUPDATESSINCE_CALLS ROCKSDB_GET_HIT_L0 ROCKSDB_GET_HIT_L1 ROCKSDB_GET_HIT_L2_AND_UP -ROCKSDB_GETUPDATESSINCE_CALLS ROCKSDB_GIT_DATE ROCKSDB_GIT_HASH ROCKSDB_ITER_BYTES_READ @@ -1643,10 +1690,11 @@ ROCKSDB_MANUAL_COMPACTIONS_PROCESSED ROCKSDB_MANUAL_COMPACTIONS_RUNNING ROCKSDB_MEMTABLE_HIT ROCKSDB_MEMTABLE_MISS +ROCKSDB_MEMTABLE_TOTAL +ROCKSDB_MEMTABLE_UNFLUSHED ROCKSDB_NO_FILE_CLOSES ROCKSDB_NO_FILE_ERRORS ROCKSDB_NO_FILE_OPENS -ROCKSDB_NUM_ITERATORS ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED ROCKSDB_NUMBER_DB_NEXT ROCKSDB_NUMBER_DB_NEXT_FOUND @@ -1671,20 +1719,37 @@ ROCKSDB_NUMBER_SST_ENTRY_SINGLEDELETE ROCKSDB_NUMBER_SUPERVERSION_ACQUIRES ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS ROCKSDB_NUMBER_SUPERVERSION_RELEASES +ROCKSDB_NUM_ITERATORS +ROCKSDB_QUERIES_POINT +ROCKSDB_QUERIES_RANGE +ROCKSDB_ROWS_DELETED +ROCKSDB_ROWS_DELETED_BLIND +ROCKSDB_ROWS_EXPIRED +ROCKSDB_ROWS_FILTERED +ROCKSDB_ROWS_INSERTED +ROCKSDB_ROWS_READ +ROCKSDB_ROWS_UPDATED ROCKSDB_ROW_LOCK_DEADLOCKS ROCKSDB_ROW_LOCK_WAIT_TIMEOUTS ROCKSDB_SNAPSHOT_CONFLICT_ERRORS ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_SLOWDOWNS -ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_STOPS +ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_STOPS -ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS -ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS -ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS ROCKSDB_STALL_MEMTABLE_LIMIT_SLOWDOWNS -ROCKSDB_STALL_TOTAL_STOPS -ROCKSDB_STALL_TOTAL_SLOWDOWNS +ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS ROCKSDB_STALL_MICROS +ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS +ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS +ROCKSDB_STALL_TOTAL_SLOWDOWNS +ROCKSDB_STALL_TOTAL_STOPS +ROCKSDB_SYSTEM_ROWS_DELETED +ROCKSDB_SYSTEM_ROWS_INSERTED +ROCKSDB_SYSTEM_ROWS_READ +ROCKSDB_SYSTEM_ROWS_UPDATED +ROCKSDB_TABLE_INDEX_STATS_FAILURE +ROCKSDB_TABLE_INDEX_STATS_REQ_QUEUE_LENGTH +ROCKSDB_TABLE_INDEX_STATS_SUCCESS ROCKSDB_WAL_BYTES ROCKSDB_WAL_GROUP_SYNCS ROCKSDB_WAL_SYNCED @@ -1694,27 +1759,10 @@ ROCKSDB_WRITE_TIMEDOUT ROCKSDB_WRITE_WAL # RocksDB-SE's status variables are global internally # but they are shown as both session and global, like InnoDB's status vars. -select VARIABLE_NAME from INFORMATION_SCHEMA.session_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; -VARIABLE_NAME -ROCKSDB_ROWS_DELETED -ROCKSDB_ROWS_INSERTED -ROCKSDB_ROWS_READ -ROCKSDB_ROWS_UPDATED -ROCKSDB_ROWS_DELETED_BLIND -ROCKSDB_ROWS_EXPIRED -ROCKSDB_ROWS_FILTERED -ROCKSDB_SYSTEM_ROWS_DELETED -ROCKSDB_SYSTEM_ROWS_INSERTED -ROCKSDB_SYSTEM_ROWS_READ -ROCKSDB_SYSTEM_ROWS_UPDATED -ROCKSDB_MEMTABLE_TOTAL -ROCKSDB_MEMTABLE_UNFLUSHED -ROCKSDB_QUERIES_POINT -ROCKSDB_QUERIES_RANGE -ROCKSDB_TABLE_INDEX_STATS_SUCCESS -ROCKSDB_TABLE_INDEX_STATS_FAILURE -ROCKSDB_TABLE_INDEX_STATS_REQ_QUEUE_LENGTH -ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS +select UPPER(VARIABLE_NAME) from performance_schema.session_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; +UPPER(VARIABLE_NAME) +ROCKSDB_BLOCK_CACHECOMPRESSED_HIT +ROCKSDB_BLOCK_CACHECOMPRESSED_MISS ROCKSDB_BLOCK_CACHE_ADD ROCKSDB_BLOCK_CACHE_ADD_FAILURES ROCKSDB_BLOCK_CACHE_BYTES_READ @@ -1735,8 +1783,6 @@ ROCKSDB_BLOCK_CACHE_INDEX_BYTES_INSERT ROCKSDB_BLOCK_CACHE_INDEX_HIT ROCKSDB_BLOCK_CACHE_INDEX_MISS ROCKSDB_BLOCK_CACHE_MISS -ROCKSDB_BLOCK_CACHECOMPRESSED_HIT -ROCKSDB_BLOCK_CACHECOMPRESSED_MISS ROCKSDB_BLOOM_FILTER_FULL_POSITIVE ROCKSDB_BLOOM_FILTER_FULL_TRUE_POSITIVE ROCKSDB_BLOOM_FILTER_PREFIX_CHECKED @@ -1744,16 +1790,17 @@ ROCKSDB_BLOOM_FILTER_PREFIX_USEFUL ROCKSDB_BLOOM_FILTER_USEFUL ROCKSDB_BYTES_READ ROCKSDB_BYTES_WRITTEN -ROCKSDB_COMPACT_READ_BYTES -ROCKSDB_COMPACT_WRITE_BYTES ROCKSDB_COMPACTION_KEY_DROP_NEW ROCKSDB_COMPACTION_KEY_DROP_OBSOLETE ROCKSDB_COMPACTION_KEY_DROP_USER +ROCKSDB_COMPACT_READ_BYTES +ROCKSDB_COMPACT_WRITE_BYTES +ROCKSDB_COVERED_SECONDARY_KEY_LOOKUPS ROCKSDB_FLUSH_WRITE_BYTES +ROCKSDB_GETUPDATESSINCE_CALLS ROCKSDB_GET_HIT_L0 ROCKSDB_GET_HIT_L1 ROCKSDB_GET_HIT_L2_AND_UP -ROCKSDB_GETUPDATESSINCE_CALLS ROCKSDB_GIT_DATE ROCKSDB_GIT_HASH ROCKSDB_ITER_BYTES_READ @@ -1761,10 +1808,11 @@ ROCKSDB_MANUAL_COMPACTIONS_PROCESSED ROCKSDB_MANUAL_COMPACTIONS_RUNNING ROCKSDB_MEMTABLE_HIT ROCKSDB_MEMTABLE_MISS +ROCKSDB_MEMTABLE_TOTAL +ROCKSDB_MEMTABLE_UNFLUSHED ROCKSDB_NO_FILE_CLOSES ROCKSDB_NO_FILE_ERRORS ROCKSDB_NO_FILE_OPENS -ROCKSDB_NUM_ITERATORS ROCKSDB_NUMBER_BLOCK_NOT_COMPRESSED ROCKSDB_NUMBER_DB_NEXT ROCKSDB_NUMBER_DB_NEXT_FOUND @@ -1789,20 +1837,37 @@ ROCKSDB_NUMBER_SST_ENTRY_SINGLEDELETE ROCKSDB_NUMBER_SUPERVERSION_ACQUIRES ROCKSDB_NUMBER_SUPERVERSION_CLEANUPS ROCKSDB_NUMBER_SUPERVERSION_RELEASES +ROCKSDB_NUM_ITERATORS +ROCKSDB_QUERIES_POINT +ROCKSDB_QUERIES_RANGE +ROCKSDB_ROWS_DELETED +ROCKSDB_ROWS_DELETED_BLIND +ROCKSDB_ROWS_EXPIRED +ROCKSDB_ROWS_FILTERED +ROCKSDB_ROWS_INSERTED +ROCKSDB_ROWS_READ +ROCKSDB_ROWS_UPDATED ROCKSDB_ROW_LOCK_DEADLOCKS ROCKSDB_ROW_LOCK_WAIT_TIMEOUTS ROCKSDB_SNAPSHOT_CONFLICT_ERRORS ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_SLOWDOWNS -ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS ROCKSDB_STALL_L0_FILE_COUNT_LIMIT_STOPS +ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_SLOWDOWNS ROCKSDB_STALL_LOCKED_L0_FILE_COUNT_LIMIT_STOPS -ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS -ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS -ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS ROCKSDB_STALL_MEMTABLE_LIMIT_SLOWDOWNS -ROCKSDB_STALL_TOTAL_STOPS -ROCKSDB_STALL_TOTAL_SLOWDOWNS +ROCKSDB_STALL_MEMTABLE_LIMIT_STOPS ROCKSDB_STALL_MICROS +ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_SLOWDOWNS +ROCKSDB_STALL_PENDING_COMPACTION_LIMIT_STOPS +ROCKSDB_STALL_TOTAL_SLOWDOWNS +ROCKSDB_STALL_TOTAL_STOPS +ROCKSDB_SYSTEM_ROWS_DELETED +ROCKSDB_SYSTEM_ROWS_INSERTED +ROCKSDB_SYSTEM_ROWS_READ +ROCKSDB_SYSTEM_ROWS_UPDATED +ROCKSDB_TABLE_INDEX_STATS_FAILURE +ROCKSDB_TABLE_INDEX_STATS_REQ_QUEUE_LENGTH +ROCKSDB_TABLE_INDEX_STATS_SUCCESS ROCKSDB_WAL_BYTES ROCKSDB_WAL_GROUP_SYNCS ROCKSDB_WAL_SYNCED @@ -1859,15 +1924,19 @@ key(col2) comment 'cf4' insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); explain select * from t1 where col1=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref col1 col1 5 const # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref col1 col1 5 const # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`col1` AS `col1`,`test`.`t1`.`col2` AS `col2` from `test`.`t1` where (`test`.`t1`.`col1` = 2) select * from t1 where col1=2; pk col1 col2 2 2 2 explain select * from t1 where col2=3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref col2 col2 5 const # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref col2 col2 5 const # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`col1` AS `col1`,`test`.`t1`.`col2` AS `col2` from `test`.`t1` where (`test`.`t1`.`col2` = 3) select * from t1 where col2=3; pk col1 col2 3 3 3 @@ -1889,8 +1958,10 @@ primary key (pk) comment 'cf5' insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); explain select * from t1 where col1=2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref col1 col1 5 const # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref col1 col1 5 const # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`col1` AS `col1`,`test`.`t1`.`col2` AS `col2` from `test`.`t1` where (`test`.`t1`.`col1` = 2) select * from t1 where col1=2; pk col1 col2 2 2 2 @@ -1936,15 +2007,17 @@ key(id2) insert into t1 select A.a, B.a, 31, 1234 from t0 A, t0 B; explain select * from t1 where id1=30 and value1=30 for update; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 4 const # Using where -set @var1=(select variable_value -from information_schema.global_status +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref PRIMARY PRIMARY 4 const # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t1`.`id2` AS `id2`,`test`.`t1`.`value1` AS `value1`,`test`.`t1`.`value2` AS `value2` from `test`.`t1` where ((`test`.`t1`.`value1` = 30) and (`test`.`t1`.`id1` = 30)) +set @var1=(select variable_value +from performance_schema.global_status where variable_name='rocksdb_number_keys_read'); select * from t1 where id1=3 and value1=3 for update; id1 id2 value1 value2 -set @var2=(select variable_value -from information_schema.global_status +set @var2=(select variable_value +from performance_schema.global_status where variable_name='rocksdb_number_keys_read'); # The following must return true (before the fix, the difference was 70): select if((@var2 - @var1) < 30, 1, @var2-@var1); @@ -1958,8 +2031,10 @@ create table t1 (id int primary key, value int) engine=rocksdb; insert into t1 values (1,1),(2,2),(3,3); # The following must not use 'Using filesort': explain select * from t1 ORDER BY id; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL PRIMARY 4 NULL # NULL +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL PRIMARY 4 NULL # # NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`value` AS `value` from `test`.`t1` order by `test`.`t1`.`id` drop table t1; # # Issue #26: Index-only scans for DATETIME and TIMESTAMP @@ -1992,8 +2067,10 @@ pk kp1 kp2 col1 explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range kp1 kp1 6 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range kp1 kp1 6 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2` from `test`.`t1` FORCE INDEX (`kp1`) where (`test`.`t1`.`kp1` between '2015-01-01 00:00:00' and '2015-01-05 23:59:59') select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; kp1 kp2 @@ -2015,8 +2092,10 @@ insert into t2 select * from t1; explain select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range kp1 kp1 5 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range kp1 kp1 5 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`kp1` AS `kp1`,`test`.`t2`.`kp2` AS `kp2` from `test`.`t2` FORCE INDEX (`kp1`) where (`test`.`t2`.`kp1` between '2015-01-01 00:00:00' and '2015-01-05 23:59:59') select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; kp1 kp2 @@ -2052,8 +2131,10 @@ pk kp1 kp2 col1 explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01' and '2015-01-05'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range kp1 kp1 4 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range kp1 kp1 4 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2` from `test`.`t1` FORCE INDEX (`kp1`) where (`test`.`t1`.`kp1` between '2015-01-01' and '2015-01-05') select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01' and '2015-01-05'; kp1 kp2 @@ -2075,8 +2156,10 @@ insert into t2 select * from t1; explain select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range kp1 kp1 3 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range kp1 kp1 3 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`kp1` AS `kp1`,`test`.`t2`.`kp2` AS `kp2` from `test`.`t2` FORCE INDEX (`kp1`) where (`test`.`t2`.`kp1` between '2015-01-01 00:00:00' and '2015-01-05 23:59:59') select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; kp1 kp2 @@ -2114,8 +2197,10 @@ pk kp1 kp2 col1 explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range kp1 kp1 5 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range kp1 kp1 5 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2` from `test`.`t1` FORCE INDEX (`kp1`) where (`test`.`t1`.`kp1` between '2015-01-01 00:00:00' and '2015-01-05 23:59:59') select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; kp1 kp2 @@ -2137,8 +2222,10 @@ insert into t2 select * from t1; explain select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range kp1 kp1 4 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range kp1 kp1 4 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`kp1` AS `kp1`,`test`.`t2`.`kp2` AS `kp2` from `test`.`t2` FORCE INDEX (`kp1`) where (`test`.`t2`.`kp1` between '2015-01-01 00:00:00' and '2015-01-05 23:59:59') select kp1,kp2 from t2 force index (kp1) where kp1 between '2015-01-01 00:00:00' and '2015-01-05 23:59:59'; kp1 kp2 @@ -2176,8 +2263,10 @@ pk kp1 kp2 col1 explain select kp1,kp2 from t1 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range kp1 kp1 4 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range kp1 kp1 4 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2` from `test`.`t1` FORCE INDEX (`kp1`) where (`test`.`t1`.`kp1` between '09:01:00' and '09:05:00') select kp1,kp2 from t1 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; kp1 kp2 @@ -2199,8 +2288,10 @@ insert into t2 select * from t1; explain select kp1,kp2 from t2 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range kp1 kp1 3 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range kp1 kp1 3 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`kp1` AS `kp1`,`test`.`t2`.`kp2` AS `kp2` from `test`.`t2` FORCE INDEX (`kp1`) where (`test`.`t2`.`kp1` between '09:01:00' and '09:05:00') select kp1,kp2 from t2 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; kp1 kp2 @@ -2237,8 +2328,10 @@ pk kp1 kp2 col1 explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2016' and '2020'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range kp1 kp1 2 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range kp1 kp1 2 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`kp1` AS `kp1`,`test`.`t1`.`kp2` AS `kp2` from `test`.`t1` FORCE INDEX (`kp1`) where (`test`.`t1`.`kp1` between 2016 and 2020) select kp1,kp2 from t1 force index (kp1) where kp1 between '2016' and '2020'; kp1 kp2 @@ -2260,8 +2353,10 @@ insert into t2 select * from t1; explain select kp1,kp2 from t2 force index (kp1) where kp1 between '2016' and '2020'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range kp1 kp1 1 NULL # Using where; Using index +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range kp1 kp1 1 NULL # # Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`kp1` AS `kp1`,`test`.`t2`.`kp2` AS `kp2` from `test`.`t2` FORCE INDEX (`kp1`) where (`test`.`t2`.`kp1` between 2016 and 2020) select kp1,kp2 from t2 force index (kp1) where kp1 between '2016' and '2020'; kp1 kp2 @@ -2299,6 +2394,8 @@ drop table t1; #Index on blob column SET @old_mode = @@sql_mode; SET sql_mode = 'strict_all_tables'; +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(c, b(255))) engine=rocksdb; drop table t1; set global rocksdb_large_prefix=1; @@ -2311,11 +2408,15 @@ a b c 2 2abcde 2abcde 3 3abcde 3abcde explain select * from t1 where b like '1%'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 1258 NULL # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range b b 1258 NULL # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`b` like '1%') explain select b, a from t1 where b like '1%'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range b b 1258 NULL # Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range b b 1258 NULL # # Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`b` like '1%') update t1 set b= '12345' where b = '2abcde'; select * from t1; a b c @@ -2370,8 +2471,10 @@ INSERT INTO t2 VALUES (1,1,1,1,1,1,1); SELECT * FROM t2 WHERE c1 > 4294967295 ORDER BY c1,c6; c1 c2 c3 c4 c5 c6 c7 EXPLAIN SELECT * FROM t2 WHERE c1 > 4294967295 ORDER BY c1,c6; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 50 Using where +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 50 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`c3` AS `c3`,`test`.`t2`.`c4` AS `c4`,`test`.`t2`.`c5` AS `c5`,`test`.`t2`.`c6` AS `c6`,`test`.`t2`.`c7` AS `c7` from `test`.`t2` where (`test`.`t2`.`c1` > 4294967295) order by `test`.`t2`.`c1`,`test`.`t2`.`c6` drop table t2; # # Issue #135: register transaction was not being called for statement @@ -2539,47 +2642,10 @@ COMMIT; UNLOCK TABLES; DROP TABLE t1; # -# Issue#213 Crash on LOCK TABLES + partitions -# -CREATE TABLE t1(a INT,b INT,KEY (b)) engine=rocksdb PARTITION BY HASH(a) PARTITIONS 2; -INSERT INTO t1(a)VALUES (20010101101010.999949); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 -lock tables t1 write,t1 as t0 write,t1 as t2 write; -SELECT a FROM t1 ORDER BY a; -a -2147483647 -truncate t1; -INSERT INTO t1 VALUES(X'042000200020',X'042000200020'),(X'200400200020',X'200400200020'); -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 -Warning 1264 Out of range value for column 'b' at row 1 -Warning 1264 Out of range value for column 'a' at row 2 -Warning 1264 Out of range value for column 'b' at row 2 -UNLOCK TABLES; -DROP TABLE t1; -# # Issue#250: MyRocks/Innodb different output from query with order by on table with index and decimal type # (the test was changed to use VARCHAR, because DECIMAL now supports index-only, and this issue # needs a datype that doesn't support index-inly) # -CREATE TABLE t1( -c1 varchar(10) character set utf8 collate utf8_general_ci NOT NULL, -c2 varchar(10) character set utf8 collate utf8_general_ci, -c3 INT, -INDEX idx(c1,c2) -); -INSERT INTO t1 VALUES ('c1-val1','c2-val1',5); -INSERT INTO t1 VALUES ('c1-val2','c2-val3',6); -INSERT INTO t1 VALUES ('c1-val3','c2-val3',7); -SELECT * FROM t1 force index(idx) WHERE c1 <> 'c1-val2' ORDER BY c1 DESC; -c1 c2 c3 -c1-val3 c2-val3 7 -c1-val1 c2-val1 5 -explain SELECT * FROM t1 force index(idx) WHERE c1 <> '1' ORDER BY c1 DESC; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range idx idx 32 NULL # Using where -drop table t1; # # Issue#267: MyRocks issue with no matching min/max row and count(*) # @@ -2597,7 +2663,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY); INSERT INTO t1 VALUES(0),(-1),(0); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 3 NULL NULL NULL latin1_swedish_ci NULL +t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 3 # NULL NULL latin1_swedish_ci NULL SELECT * FROM t1; a -1 @@ -2608,7 +2674,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY); INSERT INTO t1 VALUES(0),(10),(0); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 12 NULL NULL NULL latin1_swedish_ci NULL +t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 12 # NULL NULL latin1_swedish_ci NULL SELECT * FROM t1; a 1 diff --git a/mysql-test/suite/rocksdb/t/deadlock-master.opt b/mysql-test/suite/rocksdb/t/deadlock-master.opt new file mode 100644 index 000000000000..789275fa25e2 --- /dev/null +++ b/mysql-test/suite/rocksdb/t/deadlock-master.opt @@ -0,0 +1 @@ +--skip-log-bin diff --git a/mysql-test/suite/rocksdb/t/deadlock.test b/mysql-test/suite/rocksdb/t/deadlock.test index 3be7fda9952a..3de97b8c3fcf 100644 --- a/mysql-test/suite/rocksdb/t/deadlock.test +++ b/mysql-test/suite/rocksdb/t/deadlock.test @@ -19,23 +19,23 @@ CREATE TABLE t1rev(id1 BIGINT, id2 BIGINT, count INT, PRIMARY KEY(id1, id2) COMM SET @save = @@global.rocksdb_lock_wait_timeout; SET GLOBAL rocksdb_lock_wait_timeout = 60; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="INSERT INTO t1 VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="INSERT INTO t1 VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" SELECT count from t1; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1 WHERE id1=1 AND id2=1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1 SET count=count+1 WHERE id1=1 AND id2=1" SELECT count from t1; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1 WHERE id2=1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1 SET count=count+1 WHERE id2=1" SELECT count from t1; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1 SET count=count+1" SELECT count from t1; # Same tests on a table with reverse orderings ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="INSERT INTO t1rev VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="INSERT INTO t1rev VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" SELECT count from t1rev; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1 WHERE id1=1 AND id2=1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1rev SET count=count+1 WHERE id1=1 AND id2=1" SELECT count from t1rev; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1 WHERE id2=1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1rev SET count=count+1 WHERE id2=1" SELECT count from t1rev; ---exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1" +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=5000 --query="UPDATE t1rev SET count=count+1" SELECT count from t1rev; SET GLOBAL rocksdb_lock_wait_timeout = @save; diff --git a/mysql-test/suite/rocksdb/t/drop_table.test b/mysql-test/suite/rocksdb/t/drop_table.test index 2f3496bb4ad7..c52df629f7fd 100644 --- a/mysql-test/suite/rocksdb/t/drop_table.test +++ b/mysql-test/suite/rocksdb/t/drop_table.test @@ -70,7 +70,7 @@ let $table = t4; drop table t3; # Insert enough data to trigger compactions that eliminate t2 and t3 -let $max = 50000; +let $max = 5000; let $table = t1; --source drop_table_repopulate_table.inc let $table = t4; @@ -101,6 +101,7 @@ SET GLOBAL rocksdb_compact_cf='cf1'; SET GLOBAL rocksdb_compact_cf='rev:cf2'; connection default; +--let $shutdown_server_timeout= 500 --source include/restart_mysqld.inc drop table t4; diff --git a/mysql-test/suite/rocksdb/t/information_schema.test b/mysql-test/suite/rocksdb/t/information_schema.test index 2ae0b40fc4a7..1175a07a7790 100644 --- a/mysql-test/suite/rocksdb/t/information_schema.test +++ b/mysql-test/suite/rocksdb/t/information_schema.test @@ -7,16 +7,17 @@ DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; --enable_warnings ---let $max_index_id = query_get_value(SELECT * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO where type = 'MAX_INDEX_ID', VALUE, 1) ---replace_result $max_index_id max_index_id -select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; -select count(*) from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; - select VALUE into @keysIn from INFORMATION_SCHEMA.ROCKSDB_COMPACTION_STATS where CF_NAME = 'default' and LEVEL = 'Sum' and TYPE = 'KeyIn'; CREATE TABLE t1 (i1 INT, i2 INT, PRIMARY KEY (i1)) ENGINE = ROCKSDB; INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3); +# This needs to happen *after* creating a table +--let $max_index_id = query_get_value(SELECT * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO where type = 'MAX_INDEX_ID', VALUE, 1) +--replace_result $max_index_id max_index_id +select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; +select count(*) from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO; + set global rocksdb_force_flush_memtable_now = true; --let $MASTER_UUID = query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) --let $max_index_id = query_get_value(SELECT * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO where type = 'MAX_INDEX_ID', VALUE, 1) diff --git a/mysql-test/suite/rocksdb/t/read_only_tx-master.opt b/mysql-test/suite/rocksdb/t/read_only_tx-master.opt index 52f4895dc2f3..3aa8c020b0e8 100644 --- a/mysql-test/suite/rocksdb/t/read_only_tx-master.opt +++ b/mysql-test/suite/rocksdb/t/read_only_tx-master.opt @@ -1 +1 @@ ---rocksdb_default_cf_options=write_buffer_size=16k --log-bin --binlog_format=row --gtid_mode=ON --enforce_gtid_consistency --log-slave-updates +--rocksdb_default_cf_options=write_buffer_size=16k --binlog_format=row --gtid_mode=ON --enforce_gtid_consistency --log-slave-updates diff --git a/mysql-test/suite/rocksdb/t/rocksdb.test b/mysql-test/suite/rocksdb/t/rocksdb.test index f5c1e44bf3a1..015f4e608ef7 100644 --- a/mysql-test/suite/rocksdb/t/rocksdb.test +++ b/mysql-test/suite/rocksdb/t/rocksdb.test @@ -48,7 +48,7 @@ update t1 set b=3334341 where a=2; set @var2=(select variable_value from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); ---echo # The following should produce 1 +--echo # The following should produce 2 when binlog is enabled select @var2 - @var1; --echo # Do an update that sets the key to the same value @@ -1876,6 +1876,7 @@ DROP TABLE t1; --echo # needs a datype that doesn't support index-inly) --echo # +--disable_testcase BUG#888003 CREATE TABLE t1( c1 varchar(10) character set utf8 collate utf8_general_ci NOT NULL, c2 varchar(10) character set utf8 collate utf8_general_ci, @@ -1889,6 +1890,7 @@ SELECT * FROM t1 force index(idx) WHERE c1 <> 'c1-val2' ORDER BY c1 DESC; --replace_column 10 # 11 # explain SELECT * FROM t1 force index(idx) WHERE c1 <> '1' ORDER BY c1 DESC; drop table t1; +--enable_testcase --echo # --echo # Issue#267: MyRocks issue with no matching min/max row and count(*) diff --git a/mysql-test/suite/rocksdb_rpl/r/rpl_gtid_crash_safe.result b/mysql-test/suite/rocksdb_rpl/r/rpl_gtid_crash_safe.result index 352ceff236c2..b63171182ff7 100644 --- a/mysql-test/suite/rocksdb_rpl/r/rpl_gtid_crash_safe.result +++ b/mysql-test/suite/rocksdb_rpl/r/rpl_gtid_crash_safe.result @@ -4,358 +4,377 @@ Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] call mtr.add_suppression("Recovery from master pos"); -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 mtr uuid:1 -2 test uuid:4 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-4 +[connection slave] SET GLOBAL debug = '+d,crash_before_update_pos'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 mtr uuid:1 -2 test uuid:4 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-4 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 mtr uuid:1 -2 test uuid:7 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-7 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_after_update_pos_before_apply'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_before_writing_xid'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-4 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 -3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,half_binlogged_transaction'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_commit_before'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_commit_after_log'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-4 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 -3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_commit_after_prepare'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_reset.inc -create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; -insert into t1 values(1); -insert into t1 values(2); -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 +[connection master] +CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=ROCKSDB; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES(2); +include/sync_slave_sql_with_master.inc +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +[connection slave] SET GLOBAL debug = '+d,crash_commit_after'; -insert into t1 values(3); +[connection master] +INSERT INTO t1 VALUES(3); +[connection slave] include/rpl_reconnect.inc SET GLOBAL debug = ``; -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:3 -use test; -select * from t1; +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-3 +SELECT * FROM t1; a 1 2 -change master to master_auto_position = 1; +CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc -rename table t1 to test1; -use test; -select * from test1; +[connection master] +RENAME TABLE t1 TO test1; +include/sync_slave_sql_with_master.inc +SELECT * FROM test1; a 1 2 3 -use test; -select * from test1; +[connection master] +SELECT * FROM test1; a 1 2 3 -drop table test1; +DROP TABLE test1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc -change master to master_auto_position = 0; +CHANGE MASTER TO MASTER_AUTO_POSITION = 0; include/start_slave.inc -use mysql; -select * from slave_gtid_info; -Id Database_name Last_gtid -1 test uuid:6 +SELECT @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 include/rpl_end.inc diff --git a/mysql-test/suite/rocksdb_sys_vars/r/rocksdb_force_compute_memtable_stats_basic.result b/mysql-test/suite/rocksdb_sys_vars/r/rocksdb_force_compute_memtable_stats_basic.result index 90fd829e7c39..075d0e2614f9 100644 --- a/mysql-test/suite/rocksdb_sys_vars/r/rocksdb_force_compute_memtable_stats_basic.result +++ b/mysql-test/suite/rocksdb_sys_vars/r/rocksdb_force_compute_memtable_stats_basic.result @@ -4,6 +4,7 @@ INSERT INTO t (a,b) VALUES (1,'bar'),(2,'foo'); SET @ORIG_FORCE_COMPUTE_MEMTABLE_STATS = @@rocksdb_force_compute_memtable_stats; set global rocksdb_force_flush_memtable_now = true; INSERT INTO t (a,b) VALUES (3,'dead'),(4,'beef'),(5,'a'),(6,'bbb'),(7,'c'),(8,'d'); +SET information_schema_stats_expiry = 0; set global rocksdb_force_compute_memtable_stats=0; SELECT TABLE_ROWS INTO @ROWS_EXCLUDE_MEMTABLE FROM information_schema.TABLES WHERE table_name = 't'; set global rocksdb_force_compute_memtable_stats=1; diff --git a/mysql-test/suite/rocksdb_sys_vars/t/rocksdb_force_compute_memtable_stats_basic.test b/mysql-test/suite/rocksdb_sys_vars/t/rocksdb_force_compute_memtable_stats_basic.test index 318ae1ee5984..5a4a5318fac1 100644 --- a/mysql-test/suite/rocksdb_sys_vars/t/rocksdb_force_compute_memtable_stats_basic.test +++ b/mysql-test/suite/rocksdb_sys_vars/t/rocksdb_force_compute_memtable_stats_basic.test @@ -11,6 +11,8 @@ set global rocksdb_force_flush_memtable_now = true; INSERT INTO t (a,b) VALUES (3,'dead'),(4,'beef'),(5,'a'),(6,'bbb'),(7,'c'),(8,'d'); +SET information_schema_stats_expiry = 0; + set global rocksdb_force_compute_memtable_stats=0; SELECT TABLE_ROWS INTO @ROWS_EXCLUDE_MEMTABLE FROM information_schema.TABLES WHERE table_name = 't'; diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 65e7d928b704..2e45757aea36 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -5723,6 +5723,8 @@ static int rocksdb_done_func(void *const p) { rdb_mc_thread.signal(true); // Wait for the background thread to finish. + // NO_LINT_DEBUG + sql_print_information("Waiting for MyRocks background to finish"); auto err = rdb_bg_thread.join(); if (err != 0) { // We'll log the message and continue because we're shutting down and @@ -5733,6 +5735,8 @@ static int rocksdb_done_func(void *const p) { } // Wait for the drop index thread to finish. + // NO_LINT_DEBUG + sql_print_information("Waiting for MyRocks drop index thread to finish"); err = rdb_drop_idx_thread.join(); if (err != 0) { // NO_LINT_DEBUG @@ -5740,6 +5744,8 @@ static int rocksdb_done_func(void *const p) { } // Wait for the index stats calculation thread to finish. + // NO_LINT_DEBUG + sql_print_information("Waiting for MyRocks index stats thread to finish"); err = rdb_is_thread.join(); if (err != 0) { // NO_LINT_DEBUG @@ -5749,6 +5755,8 @@ static int rocksdb_done_func(void *const p) { } // Wait for the manual compaction thread to finish. + // NO_LINT_DEBUG + sql_print_information("Waiting for MyRocks compaction thread to finish"); err = rdb_mc_thread.join(); if (err != 0) { // NO_LINT_DEBUG @@ -14071,7 +14079,15 @@ void Rdb_manual_compaction_thread::run() { mcr.cf->GetName().c_str()); rocksdb_manual_compactions_running++; if (rocksdb_debug_manual_compaction_delay > 0) { - my_sleep(rocksdb_debug_manual_compaction_delay * 1000000); + uint32 delay = rocksdb_debug_manual_compaction_delay; + for (uint32 i = 0; i < delay; ++i) { + // Sleep in 1s increments so that shutdown/abort can happen properly + my_sleep(1000000); + if (m_killed) { + // Let it run through to the end to simplify abort processing + break; + } + } } DBUG_EXECUTE_IF("rocksdb_manual_compaction", {