From 8784a7f1040039905ed2da34ea4059b54a8783b4 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Sun, 29 Sep 2019 22:39:25 -0700 Subject: [PATCH] Fix more tests - #8 Summary: 1. Disable more tests that were missed last time due to missing features 2. handler_basic.test : move FLUSH STATS *after* CREATE TABLE as CREATE TABLE also calls handler::write_row for innodb, not surprisingly. 3. Account for explain select format differences. 4. rocksdb.test: disable portion of test that use partition, sort the result for better stability 5. consistent_snapshot_mixed_engines: 8.0 now properly supports cross-engine snapshots (it calls the callback for each engine to create snasphot) so rebaseline for the behavioral differences - now innodb and rocksdb can share the same snapshot. 6. rpl_rocksdb_snapshot: rebaseline for binlog position change and don't use master_auto_position with master_log_pos. 7. rpl_crash_safe_wal_corrupt/rpl_gtid_crash_safe_wal_corrupt : Enable idempotent_recovery. Note they still need a missing patch to work completely. 8. rpl_gtid_rocksdb_sys_header: need to set rpl_allow_error=1 as the test is expecting binlog corruption 9. delete singledelete_idempotent_table as we don't have rbr_idempotent_table anymore. Reviewed By: lth Differential Revision: D17676018 fbshipit-source-id: 2ab5dbf8264 --- mysql-test/collections/disabled_rocksdb.def | 37 +++++- mysql-test/include/sync_slave_sql.inc | 2 +- .../suite/rocksdb/r/handler_basic.result | 2 +- mysql-test/suite/rocksdb/t/handler_basic.test | 2 +- ...lbinlog_gtid_skip_empty_trans_rocksdb.test | 4 - mysql-test/suite/rocksdb/t/rocksdb.test | 124 ++++++++++-------- mysql-test/suite/rocksdb/t/rocksdb_icp.test | 2 +- .../consistent_snapshot_mixed_engines.result | 8 +- .../rocksdb_rpl/r/rpl_rocksdb_snapshot.result | 20 +-- .../rpl_rocksdb_snapshot_without_gtid.result | 2 +- .../r/singledelete_idempotent_table.result | 25 ---- .../t/consistent_snapshot_mixed_engines.test | 6 +- .../t/rpl_crash_safe_wal_corrupt.cnf | 1 + .../t/rpl_gtid_crash_safe_wal_corrupt.cnf | 1 + .../t/rpl_gtid_rocksdb_sys_header.test | 1 + .../t/rpl_rocksdb_schema_change-master.opt | 2 +- .../t/rpl_rocksdb_schema_change-slave.opt | 2 +- .../rocksdb_rpl/t/rpl_rocksdb_snapshot.test | 2 +- .../t/singledelete_idempotent_table.cnf | 15 --- .../t/singledelete_idempotent_table.test | 43 ------ 20 files changed, 123 insertions(+), 178 deletions(-) delete mode 100644 mysql-test/suite/rocksdb_rpl/r/singledelete_idempotent_table.result delete mode 100644 mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.cnf delete mode 100644 mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.test diff --git a/mysql-test/collections/disabled_rocksdb.def b/mysql-test/collections/disabled_rocksdb.def index e27b6a23259e..62e841202db0 100644 --- a/mysql-test/collections/disabled_rocksdb.def +++ b/mysql-test/collections/disabled_rocksdb.def @@ -22,10 +22,12 @@ rocksdb.ttl_secondary_with_partitions : partition feature is missing in 8.0 rocksdb.issue495 : partition feature is missing in 8.0 rocksdb.rocksdb_parts : partition feature is missing in 8.0 rocksdb.get_error_message : partition feature is missing in 8.0 +rocksdb.autoinc_crash_safe_partition : partition feature is missing in 8.0 # Missing authentication plugin rocksdb.rocksdb_deadlock_stress : authentication plugin is missing in 8.0 rocksdb.rocksdb_deadlock_stress_rc : authentication plugin is missing in 8.0 +rocksdb.rocksdb_deadlock_stress_rr : authentication plugin is missing in 8.0 rocksdb.allow_no_pk_concurrent_insert : authentication plugin is missing in 8.0 rocksdb.rqg_examples : authentication plugin is missing in 8.0 rocksdb.rqg_runtime : authentication plugin is missing in 8.0 @@ -33,19 +35,34 @@ rocksdb.rqg_transactions : authentication plugin is missing in 8.0 # Missing features # disable_testcase BUG#888001 -rocksdb.explicit_snapshot : missing patch +rocksdb.explicit_snapshot : missing patch 0b671a35cc7 SQL to create and manage explicit snapshots rocksdb.create_no_primary_key_table : missing patch rocksdb.rocksdb_qcache : missing patch rocksdb.skip_core_dump_on_error : missing patch -rocksdb.optimize_myrocks_replace_into_base : missing patch -rocksdb.optimize_myrocks_replace_into_lock : missing patch -rocksdb_rpl.optimize_myrocks_replace_into : missing patch -rocksdb.mysqlbinlog_blind_replace : missing patch rocksdb.gap_lock_issue254 : missing patch rocksdb.gap_lock_raise_error : missing patch rocksdb_rpl.rpl_mts_dependency_unique_key_conflicts : missing patch rocksdb.innodb_i_s_tables_disabled : missing patch rocksdb.force_shutdown: missing 5354b969fa6 Extending SHUTDOWN query to support read_only/aborting +rocksdb_rpl.rpl_rocksdb_schema_change : missing 031b5cec711 Use column names while applying row changes on slave +rocksdb_rpl.rpl_gtid_rocksdb_sys_header: missing 00861dd66bf make gtid enabled slave with less durable settings crash safe +rocksdb_rpl.rocksdb_slave_check_before_image_consistency : missing d8c69f9f5a9 [replication] Check before image consistency before applying row events +rocksdb_rpl.rpl_no_unique_check_on_lag : missing d80175902ee Disable unique checks when replica is lagging +rocksdb_rpl.rpl_no_unique_check_on_lag_mts : missing d80175902ee Disable unique checks when replica is lagging +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 + +# Blind replace +rocksdb.optimize_myrocks_replace_into_base : missing patch f14c64cf950 Optimize replace into to do a blind write +rocksdb.optimize_myrocks_replace_into_lock : missing patch f14c64cf950 Optimize replace into to do a blind write +rocksdb_rpl.optimize_myrocks_replace_into : missing patch f14c64cf950 Optimize replace into to do a blind write +rocksdb.mysqlbinlog_blind_replace : missing patch f14c64cf950 Optimize replace into to do a blind write + +# Recovery +rocksdb_rpl.rpl_ttl_ignore_idempotent_errors : missing 92a364f86100 Ignore idempotent error in TTL tables +rocksdb_rpl.rpl_gtid_crash_safe_wal_corrupt : missing 00861dd66bf make gtid enabled slave with less durable settings crash safe +rocksdb_rpl.rpl_crash_safe_wal_corrupt : missing 00861dd66bf make gtid enabled slave with less durable settings crash safe # Schema Validation rocksdb.validate_datadic : redesign the testcase around schema validation @@ -69,4 +86,12 @@ rocksdb.lock_wait_timeout_stats : table_statistics missing rocksdb.rpl_row_stats : table_statistics missing rocksdb.table_stats : table_statistics missing rocksdb.bytes_written : table_statistics missing -rocksdb.deadlock_statsh : table_statistics missing +rocksdb.deadlock_stats : table_statistics missing + +# Detached session +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 + diff --git a/mysql-test/include/sync_slave_sql.inc b/mysql-test/include/sync_slave_sql.inc index f696f45d8ef4..74d8d6afc80f 100644 --- a/mysql-test/include/sync_slave_sql.inc +++ b/mysql-test/include/sync_slave_sql.inc @@ -151,7 +151,7 @@ if ($_sss_result < 0) --echo ERROR: timeout='$_sss_slave_timeout' --echo ERROR: result='$_sss_result' --echo ERROR: error type: $error_type - --die Error in sync_with_master.inc + --die Error in sync_slave_sql.inc } --let $include_filename= sync_slave_sql.inc diff --git a/mysql-test/suite/rocksdb/r/handler_basic.result b/mysql-test/suite/rocksdb/r/handler_basic.result index f2e2a8316b7f..a80eb6ea571d 100644 --- a/mysql-test/suite/rocksdb/r/handler_basic.result +++ b/mysql-test/suite/rocksdb/r/handler_basic.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t1; -FLUSH STATUS; CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(100), b INT, INDEX b(b)) ENGINE=rocksdb; +FLUSH STATUS; INSERT INTO t1 (id,a,b) VALUES (1,'foobar',100),(2,'z',0),(3,'bar',50); SHOW SESSION STATUS LIKE 'Handler_write%'; Variable_name Value diff --git a/mysql-test/suite/rocksdb/t/handler_basic.test b/mysql-test/suite/rocksdb/t/handler_basic.test index 7b1652c759be..4add97fafbac 100644 --- a/mysql-test/suite/rocksdb/t/handler_basic.test +++ b/mysql-test/suite/rocksdb/t/handler_basic.test @@ -8,9 +8,9 @@ DROP TABLE IF EXISTS t1; --enable_warnings -FLUSH STATUS; CREATE TABLE t1 (id INT PRIMARY KEY, a VARCHAR(100), b INT, INDEX b(b)) ENGINE=rocksdb; +FLUSH STATUS; INSERT INTO t1 (id,a,b) VALUES (1,'foobar',100),(2,'z',0),(3,'bar',50); SHOW SESSION STATUS LIKE 'Handler_write%'; diff --git a/mysql-test/suite/rocksdb/t/mysqlbinlog_gtid_skip_empty_trans_rocksdb.test b/mysql-test/suite/rocksdb/t/mysqlbinlog_gtid_skip_empty_trans_rocksdb.test index 0c04b60427eb..acf5177ba70d 100644 --- a/mysql-test/suite/rocksdb/t/mysqlbinlog_gtid_skip_empty_trans_rocksdb.test +++ b/mysql-test/suite/rocksdb/t/mysqlbinlog_gtid_skip_empty_trans_rocksdb.test @@ -3,10 +3,6 @@ ################################################################################ # Test the --skip-empty-trans option for mysqlbinlog with rocksdb ################################################################################ ---disable_warnings ---source include/have_gtid.inc ---enable_warnings - reset master; set timestamp=1000000000; let $storage_engine=rocksdb; diff --git a/mysql-test/suite/rocksdb/t/rocksdb.test b/mysql-test/suite/rocksdb/t/rocksdb.test index df194f9f9307..f5c1e44bf3a1 100644 --- a/mysql-test/suite/rocksdb/t/rocksdb.test +++ b/mysql-test/suite/rocksdb/t/rocksdb.test @@ -38,23 +38,23 @@ create table t1 ( insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4); -set @var1=(select variable_value - from performance_schema.global_status +set @var1=(select variable_value + from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); --echo # Do an update that doesn't change the key 'a'. update t1 set b=3334341 where a=2; -set @var2=(select variable_value - from performance_schema.global_status +set @var2=(select variable_value + from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); --echo # The following should produce 1 select @var2 - @var1; --echo # 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 performance_schema.global_status +set @var3=(select variable_value + from performance_schema.global_status where variable_name='rocksdb_number_keys_written'); --echo # We have 'updated' column to the same value, so the following must return 0: select @var3 - @var2; @@ -80,7 +80,7 @@ select * from t2; select * from t1; explain select * from t2 where a='no-such-key'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t2 where a='abc'; select * from t2 where a='abc'; @@ -188,7 +188,7 @@ insert into t8 values ('five', 'funf'); --echo # Delete by PK ---replace_column 9 # +--replace_column 10 # 11 # explain delete from t8 where a='three'; delete from t8 where a='three'; @@ -263,7 +263,7 @@ INSERT INTO t11 VALUES (1),(4); select * from t10; select * from t11; ---replace_column 9 # +--replace_column 10 # 11 # EXPLAIN SELECT * FROM t10, t11 WHERE i=j; SELECT * FROM t10, t11 WHERE i=j; @@ -278,6 +278,8 @@ INSERT INTO t12 VALUES (2),(1); SELECT * FROM t12 ORDER BY pk; DROP TABLE t12; +# Disable until partition support is added +--disable_testcase BUG#888001 --echo # --echo # MDEV-3964: Assertion `!pk_descr' fails in ha_rocksdb::open on adding partitions ... --echo # @@ -286,6 +288,7 @@ create table t14 (pk int primary key) engine=RocksDB partition by hash(pk) parti #alter table t14 add partition partitions 2; # ^^ works, but causes weird warnings in error log. drop table t14; +--enable_testcase --echo # --echo # MDEV-3960: Server crashes on running DISCARD TABLESPACE on a RocksDB table @@ -539,18 +542,18 @@ insert into t30 values ('row1', 'row1-key', 'row1-data'); insert into t30 values ('row2', 'row2-key', 'row2-data'); insert into t30 values ('row3', 'row3-key', 'row3-data'); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1='row2-key'; select * from t30 where key1='row2-key'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1='row1'; --echo # This will produce nothing: select * from t30 where key1='row1'; ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t30; select key1 from t30; @@ -575,37 +578,37 @@ insert into t30 values ('row4', 'row4-key', 'row4-data'), ('row5', 'row5-key', 'row5-data'); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1 <='row3-key'; select * from t30 where key1 <='row3-key'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1 between 'row2-key' and 'row4-key'; select * from t30 where key1 between 'row2-key' and 'row4-key'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1 in ('row2-key','row4-key'); select * from t30 where key1 in ('row2-key','row4-key'); ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t30 where key1 in ('row2-key','row4-key'); select key1 from t30 where key1 in ('row2-key','row4-key'); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where key1 > 'row1-key' and key1 < 'row4-key'; select * from t30 where key1 > 'row1-key' and key1 < 'row4-key'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 order by key1 limit 3; select * from t30 order by key1 limit 3; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 order by key1 desc limit 3; select * from t30 order by key1 desc limit 3; @@ -613,22 +616,22 @@ select * from t30 order by key1 desc limit 3; --echo # --echo # Range scans on primary key --echo # ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where pk <='row3'; select * from t30 where pk <='row3'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where pk between 'row2' and 'row4'; select * from t30 where pk between 'row2' and 'row4'; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 where pk in ('row2','row4'); select * from t30 where pk in ('row2','row4'); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t30 order by pk limit 3; select * from t30 order by pk limit 3; @@ -871,7 +874,7 @@ insert into t1 values (1,1,1); insert into t1 values (2,2,2); insert into t1 values (-5,-5,-5); --echo # INT column uses index-only: ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t1 where key1=2; select key1 from t1 where key1=2; @@ -882,7 +885,7 @@ drop table t1; create table t2 (pk int primary key, key1 int unsigned, col1 int, key(key1)) engine=rocksdb; insert into t2 values (1,1,1), (2,2,2); --echo # INT UNSIGNED column uses index-only: ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t2 where key1=2; select key1 from t2 where key1=2; @@ -892,7 +895,7 @@ drop table t2; create table t3 (pk bigint primary key, key1 bigint, col1 int, key(key1)) engine=rocksdb; insert into t3 values (1,1,1), (2,2,2); --echo # BIGINT uses index-only: ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t3 where key1=2; select key1 from t3 where key1=2; @@ -908,7 +911,7 @@ create table t1 ( key (key1) ) engine=rocksdb; insert into t1 values(1, 'one',11), (2,'two',22); ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t1 where key1='one'; --echo # The following will produce no rows. This looks like a bug, @@ -916,7 +919,7 @@ select key1 from t1 where key1='one'; --echo # with \0 character (and not space). Comparison does not ignore --echo # the tail of \0. select key1 from t1 where key1='one'; ---replace_column 9 # +--replace_column 10 # 11 # explain select hex(key1) from t1 where key1='one\0\0\0\0\0\0\0'; select hex(key1) from t1 where key1='one\0\0\0\0\0\0\0'; @@ -930,7 +933,7 @@ create table t2 ( key (key1) ) engine=rocksdb; insert into t2 values(1, 'one',11), (2,'two',22); ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t2 where key1='one'; select key1 from t2 where key1='one'; @@ -944,7 +947,7 @@ create table t3 ( key (key1) ) engine=rocksdb; insert into t3 values(1, 'one',11), (2,'two',22); ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t3 where key1='one'; select key1 from t3 where key1='one'; @@ -959,14 +962,14 @@ create table t4 ( ) engine=rocksdb; insert into t4 values(1, 'one'), (2,'two'),(3,'threee'),(55,'fifty-five'); ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t4 where key1='two'; select key1 from t4 where key1='two'; select key1 from t4 where key1='fifty-five'; ---replace_column 9 # +--replace_column 10 # 11 # explain select key1 from t4 where key1 between 's' and 'u'; select key1 from t4 where key1 between 's' and 'u'; @@ -1198,7 +1201,7 @@ drop table t1; create table t1 (i int primary key auto_increment) engine=RocksDB; insert into t1 values (null),(null); ---replace_column 7 # +--replace_column 7 # 12 # show table status like 't1'; drop table t1; @@ -1247,10 +1250,12 @@ drop table t0, t1; --replace_column 2 # show status where variable_name like 'rocksdb%' and variable_name not like '%num_get_for_update%'; -select VARIABLE_NAME from INFORMATION_SCHEMA.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; +--sorted_result +select UPPER(VARIABLE_NAME) from performance_schema.global_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; --echo # RocksDB-SE's status variables are global internally --echo # 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%'; +--sorted_result +select UPPER(VARIABLE_NAME) from performance_schema.session_status where VARIABLE_NAME LIKE 'rocksdb%' and VARIABLE_NAME NOT LIKE '%num_get_for_update%'; --echo # @@ -1306,12 +1311,12 @@ create table t1 ( insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where col1=2; select * from t1 where col1=2; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where col2=3; select * from t1 where col2=3; @@ -1333,7 +1338,7 @@ create table t1 ( ) engine=rocksdb; insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where col1=2; select * from t1 where col1=2; @@ -1386,18 +1391,18 @@ create table t1 ( insert into t1 select A.a, B.a, 31, 1234 from t0 A, t0 B; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where id1=30 and value1=30 for update; -set @var1=(select variable_value - from performance_schema.global_status +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; -set @var2=(select variable_value - from performance_schema.global_status +set @var2=(select variable_value + from performance_schema.global_status where variable_name='rocksdb_number_keys_read'); --echo # The following must return true (before the fix, the difference was 70): select if((@var2 - @var1) < 30, 1, @var2-@var1); @@ -1410,7 +1415,7 @@ drop table t0,t1; create table t1 (id int primary key, value int) engine=rocksdb; insert into t1 values (1,1),(2,2),(3,3); --echo # The following must not use 'Using filesort': ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 ORDER BY id; drop table t1; @@ -1434,7 +1439,7 @@ select date_add('2015-01-01 12:34:56', interval a day), a from t0; select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # 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'; @@ -1452,7 +1457,7 @@ create table t2 ( ) engine=rocksdb; insert into t2 select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # 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'; @@ -1475,7 +1480,7 @@ select date_add('2015-01-01', interval a day), a from t0; select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2015-01-01' and '2015-01-05'; @@ -1493,7 +1498,7 @@ create table t2 ( ) engine=rocksdb; insert into t2 select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # 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'; @@ -1518,7 +1523,7 @@ select date_add('2015-01-01 12:34:56', interval a day), a from t0; select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # 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'; @@ -1536,7 +1541,7 @@ create table t2 ( ) engine=rocksdb; insert into t2 select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # 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'; @@ -1563,7 +1568,7 @@ select date_add('2015-01-01 09:00:00', interval a minute), a from t0; select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # explain select kp1,kp2 from t1 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; @@ -1581,7 +1586,7 @@ create table t2 ( ) engine=rocksdb; insert into t2 select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # explain select kp1,kp2 from t2 force index (kp1) where kp1 between '09:01:00' and '09:05:00'; @@ -1607,7 +1612,7 @@ insert into t1 (kp1,kp2) select 2015+a, a from t0; select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # explain select kp1,kp2 from t1 force index (kp1) where kp1 between '2016' and '2020'; @@ -1625,7 +1630,7 @@ create table t2 ( ) engine=rocksdb; insert into t2 select * from t1; --echo # This must show 'Using index' ---replace_column 9 # +--replace_column 10 # 11 # explain select kp1,kp2 from t2 force index (kp1) where kp1 between '2016' and '2020'; @@ -1670,9 +1675,9 @@ create table t1 (a int, b text, c varchar(400), Primary Key(a), Key(b(1255))) en set global rocksdb_large_prefix=0; insert into t1 values (1, '1abcde', '1abcde'), (2, '2abcde', '2abcde'), (3, '3abcde', '3abcde'); select * from t1; ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where b like '1%'; ---replace_column 9 # +--replace_column 10 # 11 # explain select b, a from t1 where b like '1%'; update t1 set b= '12345' where b = '2abcde'; select * from t1; @@ -1850,6 +1855,8 @@ COMMIT; UNLOCK TABLES; DROP TABLE t1; +# Disable until partition support is added +--disable_testcase BUG#888001 --echo # --echo # Issue#213 Crash on LOCK TABLES + partitions --echo # @@ -1861,6 +1868,7 @@ truncate t1; INSERT INTO t1 VALUES(X'042000200020',X'042000200020'),(X'200400200020',X'200400200020'); UNLOCK TABLES; DROP TABLE t1; +--enable_testcase --echo # --echo # Issue#250: MyRocks/Innodb different output from query with order by on table with index and decimal type @@ -1878,7 +1886,7 @@ 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; ---replace_column 9 # +--replace_column 10 # 11 # explain SELECT * FROM t1 force index(idx) WHERE c1 <> '1' ORDER BY c1 DESC; drop table t1; @@ -1903,11 +1911,13 @@ DROP TABLE t1; # value is 4 while MyRocks will show it as 3. CREATE TABLE t1(a INT AUTO_INCREMENT KEY); INSERT INTO t1 VALUES(0),(-1),(0); +--replace_column 12 # SHOW TABLE STATUS LIKE 't1'; SELECT * FROM t1; DROP TABLE t1; CREATE TABLE t1(a INT AUTO_INCREMENT KEY); INSERT INTO t1 VALUES(0),(10),(0); +--replace_column 12 # SHOW TABLE STATUS LIKE 't1'; SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/rocksdb/t/rocksdb_icp.test b/mysql-test/suite/rocksdb/t/rocksdb_icp.test index 175476974df5..0365fc5f4bb8 100644 --- a/mysql-test/suite/rocksdb/t/rocksdb_icp.test +++ b/mysql-test/suite/rocksdb/t/rocksdb_icp.test @@ -30,7 +30,7 @@ let $save_query= set @count_diff =(select (value - @count) from information_schema.rocksdb_perf_context where table_schema=database() and table_name='t1' and stat_type='INTERNAL_KEY_SKIPPED_COUNT'); ---replace_column 9 # +--replace_column 10 # 11 # explain select * from t1 where key1=1; diff --git a/mysql-test/suite/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result b/mysql-test/suite/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result index 31777c45c68a..fb851cdee42e 100644 --- a/mysql-test/suite/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result +++ b/mysql-test/suite/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result @@ -16,7 +16,7 @@ select * from r1; id value START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 1115 uuid:1-5 +master-bin.000001 1350 uuid:1-5 connection con2; insert into i1 values (2,2); insert into r1 values (2,2); @@ -24,7 +24,6 @@ connection con1; select * from i1; id value 1 1 -2 2 select * from r1; id value 1 1 @@ -35,13 +34,12 @@ connection con1; select * from i1; id value 1 1 -2 2 select * from r1; id value 1 1 START TRANSACTION WITH CONSISTENT INNODB SNAPSHOT; File Position Gtid_executed -master-bin.000001 2015 uuid:1-9 +master-bin.000001 2458 uuid:1-9 connection con2; insert into r1 values (4,4); connection con1; @@ -50,7 +48,6 @@ id value 1 1 2 2 3 2 -4 4 connection con2; insert into r1 values (5,5); connection con1; @@ -59,7 +56,6 @@ id value 1 1 2 2 3 2 -4 4 drop table i1; drop table r1; connection default; diff --git a/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot.result b/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot.result index f5e861feddce..e5372438a49f 100644 --- a/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot.result +++ b/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot.result @@ -30,7 +30,7 @@ ROLLBACK; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 531 UUID:1-2 +master-bin.000001 629 UUID:1-2 # Switch to connection con2 INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); @@ -50,16 +50,16 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; INSERT INTO t1 VALUES(1); START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 1510 UUID:1-7 +master-bin.000001 1840 UUID:1-7 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 1510 UUID:1-7 +master-bin.000001 1840 UUID:1-7 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 1510 UUID:1-7 +master-bin.000001 1840 UUID:1-7 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 1510 UUID:1-7 +master-bin.000001 1840 UUID:1-7 # Switch to connection con2 INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); @@ -80,7 +80,7 @@ LOAD DATA INFILE '/tmp/rpl_rocksdb_snapshot.out.file' INTO TAB SELECT * FROM t1; a 1 -CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=binlog_pos; +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=binlog_pos,master_auto_position=0; Warnings: Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. Note 1760 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. @@ -134,16 +134,16 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; INSERT INTO t1 VALUES(1); START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 3688 UUID:1-18 +master-bin.000001 4534 UUID:1-18 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 3688 UUID:1-18 +master-bin.000001 4534 UUID:1-18 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 3688 UUID:1-18 +master-bin.000001 4534 UUID:1-18 START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000001 3688 UUID:1-18 +master-bin.000001 4534 UUID:1-18 # Switch to connection con2 INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); diff --git a/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result b/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result index 57c1d0822c99..f7f4b7ec4a6b 100644 --- a/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result +++ b/mysql-test/suite/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result @@ -10,6 +10,6 @@ insert into t1 values(2); FLUSH LOGS; START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; File Position Gtid_executed -master-bin.000003 120 +master-bin.000003 155 drop table t1; include/rpl_end.inc diff --git a/mysql-test/suite/rocksdb_rpl/r/singledelete_idempotent_table.result b/mysql-test/suite/rocksdb_rpl/r/singledelete_idempotent_table.result deleted file mode 100644 index 609d4a8821a3..000000000000 --- a/mysql-test/suite/rocksdb_rpl/r/singledelete_idempotent_table.result +++ /dev/null @@ -1,25 +0,0 @@ -include/master-slave.inc -Warnings: -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] -drop table if exists r1; -create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb; -insert into r1 values (1, 1000); -set sql_log_bin=0; -delete from r1 where id1=1 and id2=1000; -set sql_log_bin=1; -set global rocksdb_force_flush_memtable_now=1; -insert into r1 values (1, 1000); -delete r1 from r1 force index (i) where id2=1000; -select id1,id2 from r1 force index (primary); -id1 id2 -select id2 from r1 force index (i); -id2 -set global rocksdb_compact_cf='default'; -select id1,id2 from r1 force index (primary); -id1 id2 -select id2 from r1 force index (i); -id2 -drop table r1; -include/rpl_end.inc diff --git a/mysql-test/suite/rocksdb_rpl/t/consistent_snapshot_mixed_engines.test b/mysql-test/suite/rocksdb_rpl/t/consistent_snapshot_mixed_engines.test index ff42abe322db..72d1f28c15c7 100644 --- a/mysql-test/suite/rocksdb_rpl/t/consistent_snapshot_mixed_engines.test +++ b/mysql-test/suite/rocksdb_rpl/t/consistent_snapshot_mixed_engines.test @@ -32,7 +32,7 @@ connection con1; select * from i1; select * from r1; -# This takes RocksDB snapshot only but both InnoDB participates in transaction. +# Both Rocksdb/InnoDB participate in snapshot -- replace_result $uuid uuid START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; @@ -41,7 +41,6 @@ insert into i1 values (2,2); insert into r1 values (2,2); connection con1; -# takes InnoDB snapshot here so changes after that not visible select * from i1; select * from r1; @@ -53,7 +52,7 @@ connection con1; select * from i1; select * from r1; -# RocksDB also partipates in transaction +# Both Rocksdb/InnoDB participate in snapshot -- replace_result $uuid uuid START TRANSACTION WITH CONSISTENT INNODB SNAPSHOT; @@ -61,7 +60,6 @@ connection con2; insert into r1 values (4,4); connection con1; -# takes RocksDB snapshot here so changes after that are not visible select * from r1; connection con2; diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_crash_safe_wal_corrupt.cnf b/mysql-test/suite/rocksdb_rpl/t/rpl_crash_safe_wal_corrupt.cnf index bbffb0ec1161..c2612700ba4d 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_crash_safe_wal_corrupt.cnf +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_crash_safe_wal_corrupt.cnf @@ -11,3 +11,4 @@ relay_log_info_repository=TABLE log_slave_updates rocksdb_enable_2pc=OFF rocksdb_wal_recovery_mode=2 +slave_use_idempotent_for_recovery=Yes diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_crash_safe_wal_corrupt.cnf b/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_crash_safe_wal_corrupt.cnf index 457665f9e76e..d1477dbac34f 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_crash_safe_wal_corrupt.cnf +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_crash_safe_wal_corrupt.cnf @@ -16,3 +16,4 @@ gtid_mode=ON enforce_gtid_consistency=ON rocksdb_enable_2pc=OFF rocksdb_wal_recovery_mode=2 +slave_use_idempotent_for_recovery=Yes diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_rocksdb_sys_header.test b/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_rocksdb_sys_header.test index aae8404f57c1..d0f59665ad75 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_rocksdb_sys_header.test +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_gtid_rocksdb_sys_header.test @@ -22,6 +22,7 @@ insert into t1 values(2); connection slave; disable_warnings; +--let $rpl_allow_error=1 source include/start_slave.inc; enable_warnings; connection master; diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-master.opt b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-master.opt index 6962156f75fd..9224346639a1 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-master.opt +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-master.opt @@ -1,6 +1,6 @@ --gtid_mode=ON --enforce_gtid_consistency --log_slave_updates ---slave_type_conversion=ALL_NON_LOSSY +--slave_type_conversions=ALL_NON_LOSSY --slave_parallel_workers=8 --log_column_names diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-slave.opt b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-slave.opt index 6962156f75fd..9224346639a1 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-slave.opt +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_schema_change-slave.opt @@ -1,6 +1,6 @@ --gtid_mode=ON --enforce_gtid_consistency --log_slave_updates ---slave_type_conversion=ALL_NON_LOSSY +--slave_type_conversions=ALL_NON_LOSSY --slave_parallel_workers=8 --log_column_names diff --git a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_snapshot.test b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_snapshot.test index 200f1cb314e0..d3bcddcb5852 100644 --- a/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_snapshot.test +++ b/mysql-test/suite/rocksdb_rpl/t/rpl_rocksdb_snapshot.test @@ -122,7 +122,7 @@ eval LOAD DATA INFILE '$outfile' INTO TABLE t1; SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT $binlog_pos binlog_pos -eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$MASTER_MYPORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=$binlog_pos; +eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$MASTER_MYPORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=$binlog_pos,master_auto_position=0; --source include/start_slave.inc connection master; diff --git a/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.cnf b/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.cnf deleted file mode 100644 index ad4894f5b383..000000000000 --- a/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.cnf +++ /dev/null @@ -1,15 +0,0 @@ -!include suite/rpl/my.cnf - -[mysqld.1] -log_slave_updates -gtid_mode=ON -enforce_gtid_consistency=ON - -[mysqld.2] -relay_log_recovery=1 -relay_log_info_repository=FILE -log_slave_updates -gtid_mode=ON -enforce_gtid_consistency=ON -rbr_idempotent_tables='r1' - diff --git a/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.test b/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.test deleted file mode 100644 index 2bd8f0b0151c..000000000000 --- a/mysql-test/suite/rocksdb_rpl/t/singledelete_idempotent_table.test +++ /dev/null @@ -1,43 +0,0 @@ - ---source include/have_binlog_format_row.inc ---source include/have_rocksdb.inc ---source include/master-slave.inc ---source include/not_valgrind.inc - -# This is a test case for issue#655 -- SingleDelete on Primary Key may -# cause extra rows than Secondary Keys - -connection master; ---disable_warnings -drop table if exists r1; ---enable_warnings -create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb; -insert into r1 values (1, 1000); -set sql_log_bin=0; -delete from r1 where id1=1 and id2=1000; -set sql_log_bin=1; - -sync_slave_with_master; -connection slave; -set global rocksdb_force_flush_memtable_now=1; - -connection master; -# same key insert on slave. Since slave sets rbr_idempotent_tables, the insert -# is converted to update with the same key. MyRocks should call SD and Put for the key -insert into r1 values (1, 1000); -sync_slave_with_master; - -connection slave; -delete r1 from r1 force index (i) where id2=1000; -select id1,id2 from r1 force index (primary); -select id2 from r1 force index (i); -set global rocksdb_compact_cf='default'; -select id1,id2 from r1 force index (primary); -select id2 from r1 force index (i); - -connection master; -drop table r1; - ---source include/rpl_end.inc - -