Commit c12a1bb9 authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: more testcase fixes

rocksdb.lock: LOCK TABLE t1 LOW_PRIORITY WRITE does not produce a
  warining in MariaDB

rocksdb.unique_check:
- MariaDB's mtr prints connection actions
- New (but temporary) ER_LOCK_WAIT_TIMEOUT text

rocksdb.allow_pk_no_concurrent_insert:
- Fix path

rocksdb.locking_issues
- Fix path
- The test still fails but for a different reason now
parent c82f5738
...@@ -5,8 +5,6 @@ DROP TABLE IF EXISTS t1, t2, t3; ...@@ -5,8 +5,6 @@ DROP TABLE IF EXISTS t1, t2, t3;
CREATE TABLE t1 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb; CREATE TABLE t1 (id INT, id2 INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=rocksdb;
INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3); INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3);
LOCK TABLE t1 LOW_PRIORITY WRITE; LOCK TABLE t1 LOW_PRIORITY WRITE;
Warnings:
Warning 1287 'LOW_PRIORITY WRITE' is deprecated and will be removed in a future release. Please use WRITE instead
SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2; SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2;
id2 COUNT(DISTINCT id) id2 COUNT(DISTINCT id)
1 1 1 1
......
connect con1, localhost, root,,;
connect con2, localhost, root,,;
connect con3, localhost, root,,;
connection default;
set debug_sync='RESET'; set debug_sync='RESET';
drop table if exists t1; drop table if exists t1;
create table t1 (id int, value int, primary key (id)) engine=rocksdb; create table t1 (id int, value int, primary key (id)) engine=rocksdb;
create table t2 (id int, id2 int, value int, primary key (id), unique key (id2)) engine=rocksdb; create table t2 (id int, id2 int, value int, primary key (id), unique key (id2)) engine=rocksdb;
connection con1;
begin; begin;
insert into t1 values (1,1); insert into t1 values (1,1);
connection con2;
set session rocksdb_lock_wait_timeout=50; set session rocksdb_lock_wait_timeout=50;
begin; begin;
insert into t1 values (1,2); insert into t1 values (1,2);
connection con1;
commit; commit;
connection con2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit; commit;
select * from t1; select * from t1;
id value id value
1 1 1 1
truncate table t1; truncate table t1;
connection con1;
begin; begin;
insert into t2 values (1,1,1); insert into t2 values (1,1,1);
connection con2;
begin; begin;
insert into t2 values (2,1,2); insert into t2 values (2,1,2);
connection con1;
commit; commit;
connection con2;
ERROR 23000: Duplicate entry '1' for key 'id2' ERROR 23000: Duplicate entry '1' for key 'id2'
commit; commit;
select * from t2; select * from t2;
id id2 value id id2 value
1 1 1 1 1 1
truncate table t2; truncate table t2;
connection con1;
begin; begin;
insert into t1 values (1,1); insert into t1 values (1,1);
connection con2;
begin; begin;
insert into t1 values (1,2); insert into t1 values (1,2);
connection con1;
rollback; rollback;
connection con2;
commit; commit;
select * from t1; select * from t1;
id value id value
1 2 1 2
truncate table t1; truncate table t1;
connection con1;
begin; begin;
insert into t2 values (1,1,1); insert into t2 values (1,1,1);
connection con2;
begin; begin;
insert into t2 values (2,1,2); insert into t2 values (2,1,2);
connection con1;
rollback; rollback;
connection con2;
commit; commit;
select * from t2; select * from t2;
id id2 value id id2 value
2 1 2 2 1 2
truncate table t2; truncate table t2;
connection con1;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go1'; set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go1';
insert into t1 values (1,1); insert into t1 values (1,1);
connection con2;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go2'; set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go2';
insert into t2 values (1,1,1); insert into t2 values (1,1,1);
connection default;
set debug_sync='now WAIT_FOR parked1'; set debug_sync='now WAIT_FOR parked1';
set debug_sync='now WAIT_FOR parked2'; set debug_sync='now WAIT_FOR parked2';
connection con3;
set session rocksdb_lock_wait_timeout=1; set session rocksdb_lock_wait_timeout=1;
insert into t1 values (1,2); insert into t1 values (1,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
insert into t2 values (2,1,2); insert into t2 values (2,1,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction: Timeout on index: test.t2.id2 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
set debug_sync='now SIGNAL go1'; set debug_sync='now SIGNAL go1';
set debug_sync='now SIGNAL go2'; set debug_sync='now SIGNAL go2';
connection con1;
connection con2;
connection default;
insert into t1 values (1,2); insert into t1 values (1,2);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
insert into t2 values (2,1,2); insert into t2 values (2,1,2);
...@@ -68,5 +96,9 @@ id value ...@@ -68,5 +96,9 @@ id value
select * from t2; select * from t2;
id id2 value id id2 value
1 1 1 1 1 1
connection default;
set debug_sync='RESET'; set debug_sync='RESET';
disconnect con1;
disconnect con2;
disconnect con3;
drop table t1, t2; drop table t1, t2;
...@@ -15,7 +15,7 @@ drop table if exists t1; ...@@ -15,7 +15,7 @@ drop table if exists t1;
# create the actual table # create the actual table
CREATE TABLE t1 (a INT) ENGINE=rocksdb; CREATE TABLE t1 (a INT) ENGINE=rocksdb;
let $exec = python suite/rocksdb/t/rocksdb_concurrent_insert.py root 127.0.0.1 $MASTER_MYPORT test t1 100 4; let $exec = python ../storage/rocksdb/mysql-test/rocksdb/t/rocksdb_concurrent_insert.py root 127.0.0.1 $MASTER_MYPORT test t1 100 4;
exec $exec; exec $exec;
SELECT COUNT(*) from t1; SELECT COUNT(*) from t1;
......
--source include/have_rocksdb.inc --source include/have_rocksdb.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case1_1.inc --source include/locking_issues_case1_1.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case1_1.inc --source include/locking_issues_case1_1.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case1_2.inc --source include/locking_issues_case1_2.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case1_2.inc --source include/locking_issues_case1_2.inc
let $lock_scanned_rows=0; let $lock_scanned_rows=0;
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case2.inc --source include/locking_issues_case2.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case2.inc --source include/locking_issues_case2.inc
# Rerun the case2 tests with rocksdb_lock_scanned_rows on # Rerun the case2 tests with rocksdb_lock_scanned_rows on
let $lock_scanned_rows=1; let $lock_scanned_rows=1;
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case2.inc --source include/locking_issues_case2.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case2.inc --source include/locking_issues_case2.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case3.inc --source include/locking_issues_case3.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case3.inc --source include/locking_issues_case3.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case4.inc --source include/locking_issues_case4.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case4.inc --source include/locking_issues_case4.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case5.inc --source include/locking_issues_case5.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case5.inc --source include/locking_issues_case5.inc
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case6.inc --source include/locking_issues_case6.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case6.inc --source include/locking_issues_case6.inc
let $lock_scanned_rows=0; let $lock_scanned_rows=0;
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case7.inc --source include/locking_issues_case7.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case7.inc --source include/locking_issues_case7.inc
# Rerun the case7 tests with rocksdb_lock_scanned_rows on # Rerun the case7 tests with rocksdb_lock_scanned_rows on
let $lock_scanned_rows=1; let $lock_scanned_rows=1;
let $isolation_level = REPEATABLE READ; let $isolation_level = REPEATABLE READ;
--source suite/rocksdb/include/locking_issues_case7.inc --source include/locking_issues_case7.inc
let $isolation_level = READ COMMITTED; let $isolation_level = READ COMMITTED;
--source suite/rocksdb/include/locking_issues_case7.inc --source include/locking_issues_case7.inc
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