Commit a42b9003 authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: more of testcase Maria-fication

- Adjust paths to MyRocks tests
- s/@@dbug/@@debug_dbug/
- etc
parent ece3ab37
...@@ -64,7 +64,7 @@ insert into mtr.test_suppressions values ...@@ -64,7 +64,7 @@ insert into mtr.test_suppressions values
('Checksum mismatch in value of key-value pair for index'), ('Checksum mismatch in value of key-value pair for index'),
('Data with incorrect checksum'); ('Data with incorrect checksum');
# 1. Start with mismatch in key checksum of the PK. # 1. Start with mismatch in key checksum of the PK.
set session debug= "+d,myrocks_simulate_bad_pk_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_pk_checksum1";
set session rocksdb_verify_checksums=off; set session rocksdb_verify_checksums=off;
select * from t3; select * from t3;
pk a b pk a b
...@@ -76,9 +76,9 @@ select * from t3; ...@@ -76,9 +76,9 @@ select * from t3;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
select * from t4; select * from t4;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
set session debug= "-d,myrocks_simulate_bad_pk_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_pk_checksum1";
# 2. Continue with mismatch in pk value checksum. # 2. Continue with mismatch in pk value checksum.
set session debug= "+d,myrocks_simulate_bad_pk_checksum2"; set session debug_dbug= "+d,myrocks_simulate_bad_pk_checksum2";
set session rocksdb_verify_checksums=off; set session rocksdb_verify_checksums=off;
select * from t3; select * from t3;
pk a b pk a b
...@@ -90,7 +90,7 @@ select * from t3; ...@@ -90,7 +90,7 @@ select * from t3;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
select * from t4; select * from t4;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
set session debug= "-d,myrocks_simulate_bad_pk_checksum2"; set session debug_dbug= "-d,myrocks_simulate_bad_pk_checksum2";
# 3. Check if we catch checksum mismatches for secondary indexes # 3. Check if we catch checksum mismatches for secondary indexes
explain explain
select * from t3 force index(a) where a<4; select * from t3 force index(a) where a<4;
...@@ -101,12 +101,12 @@ pk a b ...@@ -101,12 +101,12 @@ pk a b
1 1 1 1 1 1
2 2 3 2 2 3
3 3 3 3 3 3
set session debug= "+d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_key_checksum1";
select * from t3 force index(a) where a<4; select * from t3 force index(a) where a<4;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
select * from t4 force index(a) where a<1000000; select * from t4 force index(a) where a<1000000;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
set session debug= "-d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_key_checksum1";
# 4. The same for index-only reads? # 4. The same for index-only reads?
explain explain
select a from t3 force index(a) where a<4; select a from t3 force index(a) where a<4;
...@@ -117,12 +117,12 @@ a ...@@ -117,12 +117,12 @@ a
1 1
2 2
3 3
set session debug= "+d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_key_checksum1";
select a from t3 force index(a) where a<4; select a from t3 force index(a) where a<4;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
select a from t4 force index(a) where a<1000000; select a from t4 force index(a) where a<1000000;
ERROR HY000: Internal error: Record checksum mismatch ERROR HY000: Internal error: Record checksum mismatch
set session debug= "-d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_key_checksum1";
set @@global.rocksdb_store_checksums=@save_rocksdb_store_checksums; set @@global.rocksdb_store_checksums=@save_rocksdb_store_checksums;
set @@global.rocksdb_verify_checksums=@save_rocksdb_verify_checksums; set @@global.rocksdb_verify_checksums=@save_rocksdb_verify_checksums;
set @@global.rocksdb_checksums_pct=@save_rocksdb_checksums_pct; set @@global.rocksdb_checksums_pct=@save_rocksdb_checksums_pct;
......
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con1;
CREATE TABLE t1 (id1 INT NOT NULL, id2 INT NOT NULL, id3 VARCHAR(32), CREATE TABLE t1 (id1 INT NOT NULL, id2 INT NOT NULL, id3 VARCHAR(32),
id4 INT, id5 VARCHAR(32), id4 INT, id5 VARCHAR(32),
value1 INT, value2 INT, value3 VARCHAR(32), value1 INT, value2 INT, value3 VARCHAR(32),
...@@ -67,8 +70,10 @@ ERROR 23000: Duplicate entry '10-10-10' for key 'id2_2' ...@@ -67,8 +70,10 @@ ERROR 23000: Duplicate entry '10-10-10' for key 'id2_2'
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
13 13
connection con1;
BEGIN; BEGIN;
INSERT INTO t1 VALUES (30, 31, 32, 33, 34, 30, 30, 30); INSERT INTO t1 VALUES (30, 31, 32, 33, 34, 30, 30, 30);
connection con2;
BEGIN; BEGIN;
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
...@@ -116,14 +121,19 @@ UPDATE t1 SET id5=34 WHERE id1=38; ...@@ -116,14 +121,19 @@ UPDATE t1 SET id5=34 WHERE id1=38;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.id5 ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.id5
# NULL values are unique # NULL values are unique
UPDATE t1 SET id5=NULL WHERE value1 > 37; UPDATE t1 SET id5=NULL WHERE value1 > 37;
connection con1;
COMMIT; COMMIT;
connection con2;
COMMIT; COMMIT;
connection con2;
BEGIN; BEGIN;
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
17 17
connection con1;
BEGIN; BEGIN;
INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40); INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40);
connection con2;
# When transaction is pending, fail on lock acquisition # When transaction is pending, fail on lock acquisition
INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40); INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.PRIMARY ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.PRIMARY
...@@ -132,7 +142,9 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on ...@@ -132,7 +142,9 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
17 17
connection con1;
COMMIT; COMMIT;
connection con2;
# When transaction is committed, fail on duplicate key # When transaction is committed, fail on duplicate key
INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40); INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40);
Got one of the listed errors Got one of the listed errors
...@@ -159,4 +171,7 @@ id1 id2 id3 id4 id5 value1 value2 value3 ...@@ -159,4 +171,7 @@ id1 id2 id3 id4 id5 value1 value2 value3
3 3 3 3 3 4 1 1 3 3 3 3 3 4 1 1
2 2 2 2 2 3 1 1 2 2 2 2 2 3 1 1
1 1 1 1 1 2 0 0 1 1 1 1 1 2 0 0
disconnect con1;
disconnect con2;
connection default;
DROP TABLE t1; DROP TABLE t1;
--source include/have_rocksdb.inc --source include/have_rocksdb.inc
let tmpl_ddl= suite/rocksdb/t/bloomfilter_table_def.tmpl; let tmpl_ddl= ../storage/rocksdb/mysql-test/rocksdb/t/bloomfilter_table_def.tmpl;
let ddl= $MYSQL_TMP_DIR/bloomfilter_create.sql; let ddl= $MYSQL_TMP_DIR/bloomfilter_create.sql;
DELIMITER //; DELIMITER //;
...@@ -19,18 +19,18 @@ DELIMITER ;// ...@@ -19,18 +19,18 @@ DELIMITER ;//
#BF is sometimes invoked and useful #BF is sometimes invoked and useful
--exec sed s/##CF##//g $tmpl_ddl > $ddl --exec sed s/##CF##//g $tmpl_ddl > $ddl
--source $ddl --source $ddl
--source suite/rocksdb/t/bloomfilter_load_select.inc --source t/bloomfilter_load_select.inc
#BF is always invoked but not useful at all #BF is always invoked but not useful at all
--exec sed s/##CF##/" COMMENT 'cf_short_prefix'"/g $tmpl_ddl > $ddl --exec sed s/##CF##/" COMMENT 'cf_short_prefix'"/g $tmpl_ddl > $ddl
--source $ddl --source $ddl
--source suite/rocksdb/t/bloomfilter_load_select.inc --source t/bloomfilter_load_select.inc
#BF is most of the time invoked and useful #BF is most of the time invoked and useful
--exec sed s/##CF##/" COMMENT 'cf_long_prefix'"/g $tmpl_ddl > $ddl --exec sed s/##CF##/" COMMENT 'cf_long_prefix'"/g $tmpl_ddl > $ddl
--source $ddl --source $ddl
--source suite/rocksdb/t/bloomfilter_load_select.inc --source t/bloomfilter_load_select.inc
# BUG: Prev() with prefix lookup should not use prefix bloom filter # BUG: Prev() with prefix lookup should not use prefix bloom filter
create table r1 (id1 bigint, id2 bigint, id3 bigint, v1 int, v2 text, primary key (id1, id2, id3)) engine=rocksdb DEFAULT CHARSET=latin1 collate latin1_bin; create table r1 (id1 bigint, id2 bigint, id3 bigint, v1 int, v2 text, primary key (id1, id2, id3)) engine=rocksdb DEFAULT CHARSET=latin1 collate latin1_bin;
......
# loading some data (larger than write buf size) to cause compaction # loading some data (larger than write buf size) to cause compaction
--exec perl suite/rocksdb/t/gen_insert.pl t1 > $MYSQL_TMP_DIR/insert_t1.sql --exec perl ../storage/rocksdb/mysql-test/rocksdb/t/gen_insert.pl t1 > $MYSQL_TMP_DIR/insert_t1.sql
--exec perl suite/rocksdb/t/gen_insert.pl t2 > $MYSQL_TMP_DIR/insert_t2.sql --exec perl ../storage/rocksdb/mysql-test/rocksdb/t/gen_insert.pl t2 > $MYSQL_TMP_DIR/insert_t2.sql
--disable_query_log --disable_query_log
--source $MYSQL_TMP_DIR/insert_t1.sql --source $MYSQL_TMP_DIR/insert_t1.sql
--source $MYSQL_TMP_DIR/insert_t2.sql --source $MYSQL_TMP_DIR/insert_t2.sql
......
...@@ -37,7 +37,8 @@ let $wait_condition = select count(*) = 0 ...@@ -37,7 +37,8 @@ let $wait_condition = select count(*) = 0
--source include/wait_condition.inc --source include/wait_condition.inc
--enable_query_log --enable_query_log
--exec bash suite/rocksdb/t/sst_count_rows.sh $MYSQLTEST_VARDIR $MYSQL_SST_DUMP $no_more_deletes let $MYSQL_SST_DUMP=../storage/rocksdb/sst_dump
--exec bash ../storage/rocksdb/mysql-test/rocksdb/t/sst_count_rows.sh $MYSQLTEST_VARDIR $MYSQL_SST_DUMP $no_more_deletes
eval SET GLOBAL rocksdb_compaction_sequential_deletes= $save_rocksdb_compaction_sequential_deletes; eval SET GLOBAL rocksdb_compaction_sequential_deletes= $save_rocksdb_compaction_sequential_deletes;
eval SET GLOBAL rocksdb_compaction_sequential_deletes_file_size= $save_rocksdb_compaction_sequential_deletes_file_size; eval SET GLOBAL rocksdb_compaction_sequential_deletes_file_size= $save_rocksdb_compaction_sequential_deletes_file_size;
eval SET GLOBAL rocksdb_compaction_sequential_deletes_window= $save_rocksdb_compaction_sequential_deletes_window; eval SET GLOBAL rocksdb_compaction_sequential_deletes_window= $save_rocksdb_compaction_sequential_deletes_window;
...@@ -105,6 +105,6 @@ let $wait_condition = select count(*) = 0 ...@@ -105,6 +105,6 @@ let $wait_condition = select count(*) = 0
# Check that space is reclaimed # Check that space is reclaimed
--exec du -c $MYSQLTEST_VARDIR/mysqld.1/data/.rocksdb/*.sst |grep total |sed 's/[\t]total/ after/' >> $output --exec du -c $MYSQLTEST_VARDIR/mysqld.1/data/.rocksdb/*.sst |grep total |sed 's/[\t]total/ after/' >> $output
--exec perl suite/rocksdb/t/drop_table2_check.pl $output --exec perl ../storage/rocksdb/mysql-test/rocksdb/t/drop_table2_check.pl $output
# Cleanup # Cleanup
...@@ -57,7 +57,7 @@ while ($i<10000) ...@@ -57,7 +57,7 @@ while ($i<10000)
--enable_query_log --enable_query_log
check table t4; check table t4;
--exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t4" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 > $MYSQL_TMP_DIR/rocksdb_checksums.log --exec grep "^[0-9-]* [0-9:]* [0-9]* \[Note\] CHECKTABLE t4" $MYSQLTEST_VARDIR/log/mysqld.1.err | cut -d] -f2 > $MYSQL_TMP_DIR/rocksdb_checksums.log
--exec perl suite/rocksdb/t/rocksdb_checksums.pl $MYSQL_TMP_DIR/rocksdb_checksums.log 10000 5 --exec perl ../storage/rocksdb/mysql-test/rocksdb/t/rocksdb_checksums.pl $MYSQL_TMP_DIR/rocksdb_checksums.log 10000 5
--remove_file $MYSQL_TMP_DIR/rocksdb_checksums.log --remove_file $MYSQL_TMP_DIR/rocksdb_checksums.log
set session rocksdb_checksums_pct=100; set session rocksdb_checksums_pct=100;
...@@ -70,7 +70,7 @@ insert into mtr.test_suppressions values ...@@ -70,7 +70,7 @@ insert into mtr.test_suppressions values
('Data with incorrect checksum'); ('Data with incorrect checksum');
--echo # 1. Start with mismatch in key checksum of the PK. --echo # 1. Start with mismatch in key checksum of the PK.
set session debug= "+d,myrocks_simulate_bad_pk_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_pk_checksum1";
set session rocksdb_verify_checksums=off; set session rocksdb_verify_checksums=off;
select * from t3; select * from t3;
set session rocksdb_verify_checksums=on; set session rocksdb_verify_checksums=on;
...@@ -78,10 +78,10 @@ set session rocksdb_verify_checksums=on; ...@@ -78,10 +78,10 @@ set session rocksdb_verify_checksums=on;
select * from t3; select * from t3;
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select * from t4; select * from t4;
set session debug= "-d,myrocks_simulate_bad_pk_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_pk_checksum1";
--echo # 2. Continue with mismatch in pk value checksum. --echo # 2. Continue with mismatch in pk value checksum.
set session debug= "+d,myrocks_simulate_bad_pk_checksum2"; set session debug_dbug= "+d,myrocks_simulate_bad_pk_checksum2";
set session rocksdb_verify_checksums=off; set session rocksdb_verify_checksums=off;
select * from t3; select * from t3;
set session rocksdb_verify_checksums=on; set session rocksdb_verify_checksums=on;
...@@ -89,7 +89,7 @@ set session rocksdb_verify_checksums=on; ...@@ -89,7 +89,7 @@ set session rocksdb_verify_checksums=on;
select * from t3; select * from t3;
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select * from t4; select * from t4;
set session debug= "-d,myrocks_simulate_bad_pk_checksum2"; set session debug_dbug= "-d,myrocks_simulate_bad_pk_checksum2";
--echo # 3. Check if we catch checksum mismatches for secondary indexes --echo # 3. Check if we catch checksum mismatches for secondary indexes
--replace_column 9 # --replace_column 9 #
...@@ -97,12 +97,12 @@ explain ...@@ -97,12 +97,12 @@ explain
select * from t3 force index(a) where a<4; select * from t3 force index(a) where a<4;
select * from t3 force index(a) where a<4; select * from t3 force index(a) where a<4;
set session debug= "+d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_key_checksum1";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select * from t3 force index(a) where a<4; select * from t3 force index(a) where a<4;
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select * from t4 force index(a) where a<1000000; select * from t4 force index(a) where a<1000000;
set session debug= "-d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_key_checksum1";
--echo # 4. The same for index-only reads? --echo # 4. The same for index-only reads?
--replace_column 9 # --replace_column 9 #
...@@ -110,12 +110,12 @@ explain ...@@ -110,12 +110,12 @@ explain
select a from t3 force index(a) where a<4; select a from t3 force index(a) where a<4;
select a from t3 force index(a) where a<4; select a from t3 force index(a) where a<4;
set session debug= "+d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "+d,myrocks_simulate_bad_key_checksum1";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select a from t3 force index(a) where a<4; select a from t3 force index(a) where a<4;
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
select a from t4 force index(a) where a<1000000; select a from t4 force index(a) where a<1000000;
set session debug= "-d,myrocks_simulate_bad_key_checksum1"; set session debug_dbug= "-d,myrocks_simulate_bad_key_checksum1";
set @@global.rocksdb_store_checksums=@save_rocksdb_store_checksums; set @@global.rocksdb_store_checksums=@save_rocksdb_store_checksums;
set @@global.rocksdb_verify_checksums=@save_rocksdb_verify_checksums; set @@global.rocksdb_verify_checksums=@save_rocksdb_verify_checksums;
......
--source include/have_rocksdb.inc --source include/have_rocksdb.inc
let ddl= $MYSQL_TMP_DIR/unique_sec_rev_cf.sql; let ddl= $MYSQL_TMP_DIR/unique_sec_rev_cf.sql;
--exec sed s/##CF##/" COMMENT 'rev:cf'"/g suite/rocksdb/t/unique_sec.inc > $ddl --exec sed s/##CF##/" COMMENT 'rev:cf'"/g ../storage/rocksdb/mysql-test/rocksdb/t/unique_sec.inc > $ddl
--source $ddl --source $ddl
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment