Commit 9c75b3d2 authored by Sergei Petrunia's avatar Sergei Petrunia

Post-merge fixes

parent e9e5e7fc
......@@ -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);
......
This diff is collapsed.
# 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
......
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;
......
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;
......@@ -6,25 +6,31 @@ rocksdb_rollback_on_timeout ON
create table t1 (a int unsigned not null primary key) engine = rocksdb;
insert into t1 values (1);
commit;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con2;
begin work;
insert into t1 values (5);
insert into t1 values (6);
update t1 set a = a + 1 where a = 1;
connection con1;
begin work;
insert into t1 values (7);
insert into t1 values (8);
update t1 set a = a + 1 where a = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.PRIMARY
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
a
1
commit;
connection con2;
select * from t1;
a
2
5
6
commit;
connection default;
select * from t1;
a
2
......@@ -34,15 +40,17 @@ SET @@global.rocksdb_rollback_on_timeout = 0;
show variables like 'rocksdb_rollback_on_timeout';
Variable_name Value
rocksdb_rollback_on_timeout OFF
connection con2;
begin work;
insert into t1 values (9);
insert into t1 values (10);
update t1 set a = a + 1 where a = 2;
connection con1;
begin work;
insert into t1 values (11);
insert into t1 values (12);
update t1 set a = a + 1 where a = 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t1.PRIMARY
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
a
2
......@@ -51,6 +59,7 @@ a
11
12
commit;
connection con2;
select * from t1;
a
3
......@@ -59,6 +68,7 @@ a
9
10
commit;
connection default;
select * from t1;
a
3
......@@ -70,3 +80,5 @@ a
12
SET @@global.rocksdb_rollback_on_timeout = DEFAULT;
drop table t1;
disconnect con1;
disconnect con2;
......@@ -25,10 +25,10 @@ connection conn2;
set debug_sync='now WAIT_FOR parked';
affected rows: 0
SHOW PROCESSLIST;
Id User Host db Command Time State Info Rows examined Rows sent Tid Srv_Id
### ### ### ### Query ### debug sync point: rocksdb.ttl_rows_examined SELECT * FROM t_re 1 ### ### ###
### ### ### ### Query ### init SHOW PROCESSLIST 0 ### ### ###
### ### ### ### Sleep ### NULL 0 ### ### ###
Id User Host db Command Time State Info Progress
### ### ### ### Query ### debug sync point: rocksdb.ttl_rows_examined SELECT * FROM t_re 0.000
### ### ### ### Query ### init SHOW PROCESSLIST 0.000
### ### ### ### Sleep ### NULL 0.000
affected rows: 3
set debug_sync='now SIGNAL go';
affected rows: 0
......
......@@ -35,11 +35,12 @@ select case when variable_value-@c > 0 then 'true' else 'false' end from informa
# BF len 20
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
set @tmp_force_index_for_range=@@optimizer_force_index_for_range;
set optimizer_force_index_for_range=on;
# MariaDB: no support for optimizer_force_index_for_range:
#set @tmp_force_index_for_range=@@optimizer_force_index_for_range;
#set optimizer_force_index_for_range=on;
select id1, id2, link_type, visibility, data, time, version from linktable FORCE INDEX(`id1_type2`) where id1 = 100 and link_type = 1 and time >= 0 and time <= 9223372036854775807 order by time desc;
select case when variable_value-@c > 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
set global optimizer_force_index_for_range=@tmp_force_index_for_range;
#set global optimizer_force_index_for_range=@tmp_force_index_for_range;
# BF len 13
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
......
......@@ -59,6 +59,8 @@ let $ID = `SELECT connection_id()`;
SELECT * FROM t1;
--disable_parsing
# MariaDB: no support for $RPC_PROTOCOL
if (`SELECT $RPC_PROTOCOL > 0`) {
# for --rpc_protocol mode wait for the background detached session to
# go away
......@@ -74,6 +76,9 @@ if (`SELECT $RPC_PROTOCOL = 0`) {
# returns to earlier levels
--source include/wait_until_count_sessions.inc
}
--enable_parsing
# MariaDB:
--source include/wait_until_count_sessions.inc
# Note: in MariaDB, session count will be decremented *before*
# myrocks::rocksdb_close_connection is called. This causes a race condition:
......
......@@ -25,6 +25,15 @@ create_no_primary_key_table: MariaDB doesn't have --block_create_no_primary_key
explicit_snapshot: MariaDB doesn't support Shared/Explicit snapshots
percona_nonflushing_analyze_debug : Requires Percona Server's Non-flushing ANALYZE feature
com_rpc_tx : Requires connection attributes and detached sessions
mysqlbinlog_blind_replace: requires @@enable_blind_replace support
optimize_myrocks_replace_into_base: requires @@enable_blind_replace support
optimize_myrocks_replace_into_lock: requires @@enable_blind_replace support
rocksdb.skip_core_dump_on_error: requires @@binlog_error_action support
bypass_select_basic_bloom : Query bypass is not supported
bypass_select_basic : Query bypass is not supported
rocksdb_read_free_rpl : Read-Free replication is not supported
rocksdb_read_free_rpl_stress : Read-Free replication is not supported
##
## Tests that do not fit MariaDB's test environment. Upstream seems to test
......@@ -60,7 +69,6 @@ ddl_high_priority: Needs fractional @@lock_wait_timeout
deadlock_tracking : Needs SHOW ENGINE ROCKSDB TRANSACTION STATUS
bytes_written: Needs I_S.TABLE_STATISTICS.IO_WRITE_BYTES
trx_info_rpl : MariaRocks: @@rpl_skip_tx_api doesn't work, yet.
rpl_read_free: MDEV-10976
lock_wait_timeout_stats: MDEV-13404
rpl_row_triggers : Requires read-free slave.
......
......@@ -6,10 +6,10 @@ 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;
SET debug="-d,dbug.rocksdb.HA_EXTRA_KEYREAD";
SET debug_dbug="-d,dbug.rocksdb.HA_EXTRA_KEYREAD";
DROP TABLE t1;
......@@ -11,7 +11,7 @@ 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);
--replace_column 9 #
EXPLAIN SELECT COUNT(*) FROM t1;
EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(d);
--echo # segfault here without the fix
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 FORCE INDEX(d);
DROP TABLE t1;
--source include/have_rocksdb.inc
--source include/have_partition.inc
#
# TRUNCATE PARTITION
......
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