Commit 0ab7cb23 authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: More of testcase Maria-fication

parent a42b9003
--loose-enable-rocksdb --loose-enable-rocksdb_global_info --loose-enable-rocksdb_ddl --loose-enable-rocksdb_cf_options --loose-enable_rocksdb_perf_context --loose-enable-rocksdb_index_file_map --loose-enable-rocksdb_dbstats
--loose-enable-rocksdb
--loose-enable-rocksdb_global_info
--loose-enable-rocksdb_ddl
--loose-enable-rocksdb_cf_options
--loose-enable_rocksdb_perf_context
--loose-enable_rocksdb_perf_context_global
--loose-enable-rocksdb_index_file_map
--loose-enable-rocksdb_dbstats
......@@ -5,7 +5,7 @@ drop table if exists t1, t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
# First, make the server to create a dataset in the old format:
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t1 (
pk1 decimal(32,16),
pk2 decimal(32,16),
......@@ -29,7 +29,7 @@ where TABLE_SCHEMA=database() AND table_name='t1';
table_name index_name kv_format_version
t1 PRIMARY 10
flush tables;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
# Check that the new server reads the data in the old format:
select * from t1 order by pk1,pk2,pk3 limit 5;
pk1 pk2 pk3 a
......
drop table if exists t1,t2;
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
#
# Issue 257: Sort order for varchars is different between
# MyISAM/InnoDB vs MyRocks
......@@ -112,11 +112,11 @@ pk length(a) rtrim(a)
1 301 a
2 301 b
drop table t1;
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
#
# Check backwards compatibility:
#
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
# Create the tables in the old format
create table t1 (
pk varchar(64) collate latin1_bin,
......@@ -154,7 +154,7 @@ t1 PRIMARY 10
t2 PRIMARY 10
t2 col1 10
flush tables;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
select pk, hex(pk), col1 from t1;
pk hex(pk) col1
a 61 a
......@@ -177,13 +177,13 @@ drop table t1,t2;
#
# General upgrade tests to see that they work.
#
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
id int primary key,
col1 varchar(64) collate latin1_swedish_ci,
unique key (col1)
) engine=rocksdb;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
insert into t2 values (1, 'a');
insert into t2 values (2, 'b');
insert into t2 values (3, 'c');
......@@ -204,13 +204,13 @@ c
insert into t2 values (4, 'c ');
ERROR 23000: Duplicate entry 'c ' for key 'col1'
drop table t2;
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
id int primary key,
col1 varchar(64) collate latin1_bin,
unique key (col1)
) engine=rocksdb;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
insert into t2 values (1, 'a');
insert into t2 values (2, 'b');
insert into t2 values (3, 'c');
......@@ -235,7 +235,7 @@ drop table t2;
# Check what happens when one tries to 'upgrade' to the new data format
# and causes a unique key violation:
#
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
pk int not null primary key,
col1 varchar(64) collate latin1_bin,
......@@ -248,7 +248,7 @@ select * from t2;
pk col1 col2
1 a a-space
2 a a
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
alter table t2 engine=rocksdb;
ERROR 23000: Duplicate entry 'a' for key 'col1'
drop table t2;
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),
id4 INT, id5 VARCHAR(32),
value1 INT, value2 INT, value3 VARCHAR(32),
......@@ -67,8 +70,10 @@ ERROR 23000: Duplicate entry '10-10-10' for key 'id2_2'
SELECT COUNT(*) FROM t1;
COUNT(*)
13
connection con1;
BEGIN;
INSERT INTO t1 VALUES (30, 31, 32, 33, 34, 30, 30, 30);
connection con2;
BEGIN;
SELECT COUNT(*) FROM t1;
COUNT(*)
......@@ -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
# NULL values are unique
UPDATE t1 SET id5=NULL WHERE value1 > 37;
connection con1;
COMMIT;
connection con2;
COMMIT;
connection con2;
BEGIN;
SELECT COUNT(*) FROM t1;
COUNT(*)
17
connection con1;
BEGIN;
INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40);
connection con2;
# When transaction is pending, fail on lock acquisition
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
......@@ -132,7 +142,9 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on
SELECT COUNT(*) FROM t1;
COUNT(*)
17
connection con1;
COMMIT;
connection con2;
# When transaction is committed, fail on duplicate key
INSERT INTO t1 VALUES (40, 40, 40, 40, 40, 40, 40, 40);
Got one of the listed errors
......@@ -159,6 +171,9 @@ id1 id2 id3 id4 id5 value1 value2 value3
38 31 32 NULL 38 37 37 37
39 31 32 NULL 39 37 37 37
40 40 40 40 40 40 40 40
disconnect con1;
disconnect con2;
connection default;
DROP TABLE t1;
#
# Issue #88: Creating unique index over column with duplicate values succeeds
......
--source include/have_rocksdb.inc
--source include/have_partition.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
......
......@@ -109,7 +109,7 @@ let $wait_condition = select count(*) = 0
# Get list of all indices needing to be dropped
# Check total compacted-away rows for all indices
# Check that all indices have been successfully dropped
--exec perl suite/rocksdb/t/drop_table_compactions.pl $MYSQLTEST_VARDIR/log/mysqld.1.err
--exec perl ../storage/rocksdb/mysql-test/rocksdb/t/drop_table_compactions.pl $MYSQLTEST_VARDIR/log/mysqld.1.err
# Cleanup
drop table t1;
--loose-enable-innodb_trx
--loose-enable-innodb_file_status
--loose-enable-innodb_locks
--loose-enable-innodb_lock_waits
--loose-enable-innodb_cmp
--loose-enable-innodb_cmp_reset
--loose-enable-innodb_cmp_per_index
--loose-enable-innodb_cmp_per_index_reset
--loose-enable-innodb_cmpmem
--loose-enable-innodb_cmpmem_reset
--loose-enable-innodb_metrics
--loose-enable-innodb_ft_default_stopword
--loose-enable-innodb_ft_deleted
--loose-enable-innodb_ft_being_deleted
--loose-enable-innodb_ft_index_cache
--loose-enable-innodb_ft_index_table
--loose-enable-innodb_ft_config
--loose-enable-innodb_buffer_pool_stats
--loose-enable-innodb_buffer_page
--loose-enable-innodb_buffer_page_lru
--loose-enable-innodb_sys_tables
--loose-enable-innodb_sys_tablestats
--loose-enable-innodb_sys_indexes
--loose-enable-innodb_sys_columns
--loose-enable-innodb_sys_fields
--loose-enable-innodb_sys_foreign
--loose-enable-innodb_sys_foreign_cols
--loose-enable-innodb_sys_tablespaces
--loose-enable-innodb_sys_datafiles
--loose-enable-innodb_sys_docstore_fields
......@@ -4,7 +4,7 @@
# is turned off and attempting to access them doesn't crash.
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FILE_STATUS;
#Not in MariaDB: SELECT * FROM INFORMATION_SCHEMA.INNODB_FILE_STATUS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP;
......@@ -32,4 +32,4 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DOCSTORE_FIELDS;
#Not in MariaDB: SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DOCSTORE_FIELDS;
......@@ -12,7 +12,7 @@ create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
--echo # First, make the server to create a dataset in the old format:
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t1 (
pk1 decimal(32,16),
pk2 decimal(32,16),
......@@ -40,7 +40,7 @@ where TABLE_SCHEMA=database() AND table_name='t1';
flush tables;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
--source include/restart_mysqld.inc
--echo # Check that the new server reads the data in the old format:
......
......@@ -9,18 +9,18 @@ drop table if exists t1,t2;
--enable_warnings
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
--let $character_set_collate=CHARACTER SET utf8 COLLATE utf8_general_ci
--source type_varchar_endspace.inc
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
--echo #
--echo # Check backwards compatibility:
--echo #
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
--echo # Create the tables in the old format
......@@ -53,7 +53,7 @@ from information_schema.ROCKSDB_DDL
where TABLE_SCHEMA=database() AND table_name in ('t1','t2');
flush tables;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
select pk, hex(pk), col1 from t1;
select pk, col1, hex(col1), col2 from t2;
......@@ -69,13 +69,13 @@ drop table t1,t2;
--echo #
--echo # General upgrade tests to see that they work.
--echo #
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
id int primary key,
col1 varchar(64) collate latin1_swedish_ci,
unique key (col1)
) engine=rocksdb;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
insert into t2 values (1, 'a');
insert into t2 values (2, 'b');
......@@ -91,13 +91,13 @@ select col1 from t2;
insert into t2 values (4, 'c ');
drop table t2;
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
id int primary key,
col1 varchar(64) collate latin1_bin,
unique key (col1)
) engine=rocksdb;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
insert into t2 values (1, 'a');
insert into t2 values (2, 'b');
......@@ -117,7 +117,7 @@ drop table t2;
--echo # Check what happens when one tries to 'upgrade' to the new data format
--echo # and causes a unique key violation:
--echo #
set session debug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '+d,MYROCKS_FORMAT_VERSION_INITIAL';
create table t2 (
pk int not null primary key,
col1 varchar(64) collate latin1_bin,
......@@ -129,7 +129,7 @@ insert into t2 values (1, 'a ', 'a-space');
insert into t2 values (2, 'a', 'a');
select * from t2;
set session debug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
set session debug_dbug= '-d,MYROCKS_FORMAT_VERSION_INITIAL';
--error ER_DUP_ENTRY
alter table t2 engine=rocksdb;
......
--source include/have_rocksdb.inc
--source include/have_partition.inc
let ddl= $MYSQL_TMP_DIR/unique_sec.sql;
--exec sed s/##CF##//g suite/rocksdb/t/unique_sec.inc > $ddl
--exec sed s/##CF##//g ../storage/rocksdb/mysql-test/rocksdb/t/unique_sec.inc > $ddl
--source $ddl
--echo #
......
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