Commit a89d01fb authored by Sergei Petrunia's avatar Sergei Petrunia

Trivial updates to get a few rocksdb.* testcases to pass

parent f2952485
if ($rpl_inited)
{
if (!$allow_rpl_inited)
{
--die ERROR IN TEST: This script does not support replication
}
}
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart:$_mysqld_option" > $_expect_file_name
# Turn on reconnect
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--disable_reconnect
......@@ -241,7 +241,7 @@ a b
2 b
EXPLAIN SELECT * FROM t1 WHERE a = 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const a a 5 const 1 NULL
1 SIMPLE t1 const a a 5 const 1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(8)) ENGINE=rocksdb;
SHOW CREATE TABLE t1;
......
......@@ -20,7 +20,7 @@ set @tmp1=@@rocksdb_verify_row_debug_checksums;
set rocksdb_verify_row_debug_checksums=1;
set session debug_dbug= "+d,myrocks_simulate_bad_row_read1";
select * from t1 where pk=1;
ERROR HY000: Got error 199 'Found data corruption.' from ROCKSDB
ERROR HY000: Got error 200 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read1";
set rocksdb_verify_row_debug_checksums=@tmp1;
select * from t1 where pk=1;
......@@ -28,11 +28,11 @@ pk col1
1 1
set session debug_dbug= "+d,myrocks_simulate_bad_row_read2";
select * from t1 where pk=1;
ERROR HY000: Got error 199 'Found data corruption.' from ROCKSDB
ERROR HY000: Got error 200 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read2";
set session debug_dbug= "+d,myrocks_simulate_bad_row_read3";
select * from t1 where pk=1;
ERROR HY000: Got error 199 'Found data corruption.' from ROCKSDB
ERROR HY000: Got error 200 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_row_read3";
insert into t1 values(4,'0123456789');
select * from t1;
......@@ -56,7 +56,7 @@ pk col1
ABCD 1
set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1";
select * from t2;
ERROR HY000: Got error 199 'Found data corruption.' from ROCKSDB
ERROR HY000: Got error 200 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1";
drop table t2;
create table t2 (
......@@ -69,6 +69,6 @@ pk col1
ABCD 1
set session debug_dbug= "+d,myrocks_simulate_bad_pk_read1";
select * from t2;
ERROR HY000: Got error 199 'Found data corruption.' from ROCKSDB
ERROR HY000: Got error 200 'Found data corruption.' from ROCKSDB
set session debug_dbug= "-d,myrocks_simulate_bad_pk_read1";
drop table t2;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (b INT PRIMARY KEY);
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, FOREIGN KEY (b) REFERENCES t1(b));
ERROR 42000: This version of MySQL doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
ERROR 42000: This version of MariaDB doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
CREATE TABLE t2 (a INT NOT NULL, bforeign INT NOT NULL);
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, foreignkey INT NOT NULL);
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, bforeign INT not null, FOREIGN KEY (bforeign) REFERENCES t1(b));
ERROR 42000: This version of MySQL doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
ERROR 42000: This version of MariaDB doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL);
ALTER TABLE t2 ADD FOREIGN KEY (b) REFERENCES t1(b);
ERROR 42000: This version of MySQL doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
ERROR 42000: This version of MariaDB doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL);
ALTER TABLE t2 ADD bforeign INT NOT NULL;
......@@ -20,6 +20,6 @@ ALTER TABLE t2 ADD foreignkey INT NOT NULL;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL);
ALTER TABLE t2 ADD bforeign INT NOT NULL, ADD FOREIGN KEY (bforeign) REFERENCES t1(b);
ERROR 42000: This version of MySQL doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
ERROR 42000: This version of MariaDB doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
DROP TABLE t2;
DROP TABLE t1;
......@@ -31,7 +31,7 @@ test.t1 analyze status OK
set global rocksdb_force_flush_memtable_now=1;
explain select * from t1 where key1 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref key1 key1 5 const # NULL
1 SIMPLE t1 ref key1 key1 5 const #
explain select key1,key2 from t1 where key1 = 1 or key2 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL # Using union(key1,key2); Using where
......
......@@ -94,7 +94,7 @@ drop table t1, t2;
CREATE TABLE t1 (c1 INT NOT NULL, c2 CHAR(5)) PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t1 VALUES(1,'a');
RENAME TABLE t1 TO db3.t3;
ERROR HY000: Error on rename of './test/t1' to './db3/t3' (errno: -1 - Unknown error -1)
ERROR HY000: Error on rename of './test/t1' to './db3/t3' (errno: -1 "Internal error < 0 (Not system error)")
SELECT * FROM t1;
c1 c2
1 a
......
......@@ -171,11 +171,14 @@ SELECT * FROM t1;
a b
998 5
DROP TABLE t1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
CREATE TABLE t1 (
a int PRIMARY KEY
) ENGINE=rocksdb
COMMENT='ttl_duration=5;';
INSERT INTO t1 values (1);
connection con1;
# Creating Snapshot (start transaction)
BEGIN;
SELECT * FROM t1;
......@@ -185,11 +188,13 @@ SELECT * FROM t1;
a
1
# Switching to connection 2
connection con2;
set global rocksdb_force_flush_memtable_now=1;
set global rocksdb_compact_cf='default';
SELECT * FROM t1;
a
# Switching to connection 1
connection con1;
SELECT * FROM t1;
a
1
......@@ -201,6 +206,10 @@ COMMIT;
SELECT * FROM t1;
a
DROP TABLE t1;
disconnect con1;
disconnect con2;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
set global rocksdb_force_flush_memtable_now=1;
set global rocksdb_compact_cf='default';
CREATE TABLE t1 (
......@@ -208,11 +217,13 @@ a int PRIMARY KEY
) ENGINE=rocksdb
COMMENT='ttl_duration=1;';
# On Connection 1
connection con1;
# Creating Snapshot (start transaction)
BEGIN;
SELECT * FROM t1;
a
# On Connection 2
connection con2;
set global rocksdb_debug_ttl_rec_ts = -2;
INSERT INTO t1 values (1);
INSERT INTO t1 values (3);
......@@ -222,9 +233,11 @@ set global rocksdb_debug_ttl_rec_ts = 0;
set global rocksdb_force_flush_memtable_now=1;
set global rocksdb_compact_cf='default';
# On Connection 1
connection con1;
SELECT * FROM t1;
a
# On Connection 2
connection con2;
SELECT * FROM t1;
a
set global rocksdb_enable_ttl_read_filtering=0;
......@@ -235,4 +248,7 @@ a
5
7
set global rocksdb_enable_ttl_read_filtering=1;
disconnect con2;
disconnect con1;
connection default;
DROP TABLE t1;
......@@ -144,16 +144,16 @@ set global rocksdb_debug_ttl_rec_ts = 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL DEFAULT '0',
`c2` int(11) NOT NULL DEFAULT '0',
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`name` varchar(25) NOT NULL,
`event` date DEFAULT NULL,
PRIMARY KEY (`c2`,`c1`) COMMENT 'custom_p0_cfname=foo;custom_p1_cfname=bar;custom_p2_cfname=baz;'
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COMMENT='custom_p0_ttl_duration=9999;custom_p2_ttl_duration=5;'
/*!50100 PARTITION BY LIST (c1)
(PARTITION custom_p0 VALUES IN (1,2,3) ENGINE = ROCKSDB,
PARTITION custom_p1 VALUES IN (4,5,6) ENGINE = ROCKSDB,
PARTITION custom_p2 VALUES IN (7,8,9) ENGINE = ROCKSDB) */
PARTITION BY LIST (`c1`)
(PARTITION `custom_p0` VALUES IN (1,2,3) ENGINE = ROCKSDB,
PARTITION `custom_p1` VALUES IN (4,5,6) ENGINE = ROCKSDB,
PARTITION `custom_p2` VALUES IN (7,8,9) ENGINE = ROCKSDB)
set global rocksdb_debug_ttl_snapshot_ts = 100;
set global rocksdb_force_flush_memtable_now=1;
set @@global.rocksdb_compact_cf = 'baz';
......
--source include/have_rocksdb.inc
--source include/have_partition.inc
--let pk_cf=rev:cf1
--let data_order_desc=0
......
--source include/have_rocksdb.inc
--source include/have_partition.inc
--let pk_cf=rev:cf1
--let data_order_desc=1
......
--source include/have_rocksdb.inc
--source include/have_partition.inc
--let pk_cf=cf1
--let data_order_desc=1
......
......@@ -70,3 +70,6 @@ col_opt_null : : MDEV-12474 - Fails in fulltest
col_opt_unsigned : MDEV-12474 - Fails in fulltest
col_opt_zerofill : MDEV-12474 - Fails in fulltest
type_float : MDEV-12474 - Fails in fulltest
native_procedure : Not supported in MariaDB
--source include/have_debug.inc
--source include/have_rocksdb.inc
--source include/have_partition.inc
#
# Create a table with multiple partitions, but in the comment don't specify
......
......@@ -34,11 +34,11 @@ DROP TABLE t1;
# Now create the same table in the old format to show that they can be read
# and handled correctly
set session debug= '+d,MYROCKS_LEGACY_VARBINARY_FORMAT';
set session debug_dbug= '+d,MYROCKS_LEGACY_VARBINARY_FORMAT';
CREATE TABLE t1(
vb VARBINARY(64) primary key
) ENGINE=rocksdb;
set session debug= '-d,MYROCKS_LEGACY_VARBINARY_FORMAT';
set session debug_dbug= '-d,MYROCKS_LEGACY_VARBINARY_FORMAT';
INSERT INTO t1 values(0x00);
INSERT INTO t1 values(0x0000);
......@@ -98,11 +98,11 @@ DROP TABLE t1;
# Now create the same table in the old format to show that they can be read
# and handled correctly
set session debug= '+d,MYROCKS_LEGACY_VARBINARY_FORMAT';
set session debug_dbug= '+d,MYROCKS_LEGACY_VARBINARY_FORMAT';
CREATE TABLE t1(
vc VARCHAR(64) collate 'binary' primary key
) ENGINE=rocksdb;
set session debug= '-d,MYROCKS_LEGACY_VARBINARY_FORMAT';
set session debug_dbug= '-d,MYROCKS_LEGACY_VARBINARY_FORMAT';
INSERT INTO t1 values('a');
INSERT INTO t1 values('aa');
......
......@@ -5,7 +5,6 @@ SET GLOBAL rocksdb_write_disable_wal=false;
SET GLOBAL rocksdb_write_ignore_missing_column_families=true;
create table aaa (id int primary key, i int) engine rocksdb;
set @save_rocksdb_flush_log_at_trx_commit= @@global.rocksdb_flush_log_at_trx_commit;
set @save_rocksdb_flush_log_at_trx_commit=@@global.rocksdb_flush_log_at_trx_commit;
SET GLOBAL rocksdb_flush_log_at_trx_commit=0;
sleep 30;
......
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