Skip to content
Permalink
Browse files

Post-merge fixes

  • Loading branch information...
spetrunia committed Jun 16, 2019
1 parent e9e5e7f commit 9c75b3d2831e6822d3d122b8e4554ff77400bc62
@@ -8774,7 +8774,6 @@ int ha_rocksdb::check(THD *const thd, HA_CHECK_OPT *const check_opt) {
}
// NO_LINT_DEBUG
sql_print_verbose_info("CHECKTABLE %s: ... %lld index entries checked "
"CHECKTABLE %s: ... %lld index entries checked "
"(%lld had checksums)",
table_name, rows, checksums);

Large diffs are not rendered by default.

@@ -0,0 +1,22 @@
# Common test pattern for options that control direct i/o
#
# Required input:
# $io_option - name and assignment to enable on server command line

--perl
use Cwd 'abs_path';

open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/data_in_shm.inc") or die;
my $real_path= abs_path($ENV{'MYSQLTEST_VARDIR'});
my $in_shm= index($real_path, "/dev/shm") != -1;
print FILE "let \$DATA_IN_SHM= $in_shm;\n";
close FILE;
EOF

--source $MYSQL_TMP_DIR/data_in_shm.inc
--remove_file $MYSQL_TMP_DIR/data_in_shm.inc

if ($DATA_IN_SHM)
{
--skip DATADIR is in /dev/shm, possibly due to --mem
}
@@ -78,7 +78,7 @@ set global rocksdb_force_flush_memtable_now=1;
explain
select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 index NULL PRIMARY 122 NULL 1 NULL
1 SIMPLE t5 index NULL PRIMARY 122 NULL 1
select * from t5 order by id1 desc,id2 desc, id3 desc, id4 desc limit 1;
id1 id2 id3 id4 id5 value value2
1000 2000 2000 10000 10000 1000 aaabbbccc
@@ -1,45 +1,64 @@
set debug_sync='RESET';
set global rocksdb_debug_ttl_read_filter_ts = -10;
connect conn1, localhost, root,,;
connection default;
CREATE TABLE t1 (id INT, value INT, KEY (id), KEY (value)) ENGINE=ROCKSDB;
CREATE TABLE t2 (id INT, value INT) ENGINE=ROCKSDB;
CREATE TABLE t3 (id INT, kp1 INT, PRIMARY KEY (id), KEY(kp1)) ENGINE=ROCKSDB COMMENT='ttl_duration=1';
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT * FROM t1;
connection conn1;
set debug_sync='rocksdb.check_flags_rmi SIGNAL parked WAIT_FOR go';
SELECT value FROM t1 WHERE value = 3;
connection default;
set debug_sync='now WAIT_FOR parked';
KILL QUERY $conn1_id;
set debug_sync='now SIGNAL go';
connection conn1;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
connection conn1;
set debug_sync='rocksdb.check_flags_rmi_scan SIGNAL parked WAIT_FOR go';
SELECT DISTINCT(id) FROM t1 WHERE value = 5 AND id IN (1, 3, 5);
connection default;
set debug_sync='now WAIT_FOR parked';
KILL QUERY $conn1_id;
set debug_sync='now SIGNAL go';
connection conn1;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
connection conn1;
set debug_sync='rocksdb.check_flags_inwd SIGNAL parked WAIT_FOR go';
SELECT value FROM t1 WHERE value > 3;
connection default;
set debug_sync='now WAIT_FOR parked';
KILL QUERY $conn1_id;
set debug_sync='now SIGNAL go';
connection conn1;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
connection conn1;
set debug_sync='rocksdb.check_flags_rnwd SIGNAL parked WAIT_FOR go';
SELECT id FROM t2;
connection default;
set debug_sync='now WAIT_FOR parked';
KILL QUERY $conn1_id;
set debug_sync='now SIGNAL go';
connection conn1;
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
connection conn1;
set debug_sync='rocksdb.check_flags_ser SIGNAL parked WAIT_FOR go';
SELECT kp1 FROM t3 ORDER BY kp1;
connection default;
set debug_sync='now WAIT_FOR parked';
KILL QUERY $conn1_id;
set debug_sync='now SIGNAL go';
connection conn1;
ERROR 70100: Query execution was interrupted
connection default;
disconnect conn1;
set debug_sync='RESET';
set global rocksdb_debug_ttl_read_filter_ts = DEFAULT;
DROP TABLE t1;
@@ -5,7 +5,7 @@ connection con1;
CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=ROCKSDB;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
connection con2;
select * from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE
@@ -18,7 +18,7 @@ STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 0
connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
@@ -69,7 +69,7 @@ id value value2
5 5 5
6 6 6
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
connection con2;
INSERT INTO r1 values (7,7,7);
connection con1;
@@ -107,12 +107,12 @@ id value value2
7 7 7
8 8 8
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
connection con2;
INSERT INTO r1 values (9,9,9);
connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
connection con2;
INSERT INTO r1 values (10,10,10);
connection con1;
@@ -129,7 +129,7 @@ id value value2
9 9 9
10 10 10
START TRANSACTION WITH CONSISTENT SNAPSHOT;
ERROR: 50048
ERROR: 4062
INSERT INTO r1 values (11,11,11);
ERROR: 0
SELECT * FROM r1;
@@ -1,5 +1,4 @@
set @prior_lock_wait_timeout = @@rocksdb_lock_wait_timeout; set @prior_deadlock_detect = @@rocksdb_deadlock_detect;;
set global rocksdb_deadlock_detect = on; set global rocksdb_lock_wait_timeout = 100000;;
set @prior_lock_wait_timeout = @@rocksdb_lock_wait_timeout; set @prior_deadlock_detect = @@rocksdb_deadlock_detect; set global rocksdb_deadlock_detect = on; set global rocksdb_lock_wait_timeout = 100000;;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection default;
@@ -2,9 +2,9 @@ CREATE TABLE t1 (a INT, b CHAR(8), KEY ab(a, b)) ENGINE=rocksdb DEFAULT CHARSET
INSERT INTO t1 (a,b) VALUES (76,'bar');
INSERT INTO t1 (a,b) VALUES (35,'foo');
INSERT INTO t1 (a,b) VALUES (77,'baz');
SET debug="+d,dbug.rocksdb.HA_EXTRA_KEYREAD";
SET debug_dbug="+d,dbug.rocksdb.HA_EXTRA_KEYREAD";
SELECT b FROM t1 FORCE INDEX(ab) WHERE a=35;
b
foo
SET debug="-d,dbug.rocksdb.HA_EXTRA_KEYREAD";
SET debug_dbug="-d,dbug.rocksdb.HA_EXTRA_KEYREAD";
DROP TABLE t1;
@@ -43,6 +43,8 @@ a b
5 e
6 f
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1' for key 'a'
INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10;
SELECT a,b FROM t1;
a b
@@ -79,6 +81,8 @@ a b
5 e
6 f
INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z');
Warnings:
Warning 1062 Duplicate entry '1-a' for key 'a'
INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a);
SELECT a,b FROM t1;
a b
@@ -7,11 +7,11 @@ PRIMARY KEY (`a`,`b`),
KEY `d` (`d`)
) ENGINE=ROCKSDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='ttl_duration=1000;ttl_col=u';
INSERT INTO t1 VALUES (100, 'aaabbb', UNIX_TIMESTAMP(), 200);
EXPLAIN SELECT COUNT(*) FROM t1;
EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(d);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL d 9 NULL # Using index
1 SIMPLE t1 index NULL d 11 NULL # Using index
# segfault here without the fix
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 FORCE INDEX(d);
COUNT(*)
1
DROP TABLE t1;

0 comments on commit 9c75b3d

Please sign in to comment.
You can’t perform that action at this time.