diff options
Diffstat (limited to 'storage/rocksdb/mysql-test/rocksdb/r/unique_check.result')
-rw-r--r-- | storage/rocksdb/mysql-test/rocksdb/r/unique_check.result | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/unique_check.result b/storage/rocksdb/mysql-test/rocksdb/r/unique_check.result new file mode 100644 index 00000000000..db9b119043a --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb/r/unique_check.result @@ -0,0 +1,117 @@ +connect con1, localhost, root,,; +connect con2, localhost, root,,; +connect con3, localhost, root,,; +connection default; +set debug_sync='RESET'; +drop table if exists t1; +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; +connection con1; +begin; +insert into t1 values (1,1); +connection con2; +set session rocksdb_lock_wait_timeout=50; +begin; +insert into t1 values (1,2); +connection con1; +commit; +connection con2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +commit; +select * from t1; +id value +1 1 +truncate table t1; +connection con1; +begin; +insert into t2 values (1,1,1); +connection con2; +begin; +insert into t2 values (2,1,2); +connection con1; +commit; +connection con2; +ERROR 23000: Duplicate entry '1' for key 'id2' +commit; +select * from t2; +id id2 value +1 1 1 +truncate table t2; +connection con1; +begin; +insert into t1 values (1,1); +connection con2; +begin; +insert into t1 values (1,2); +connection con1; +rollback; +connection con2; +commit; +select * from t1; +id value +1 2 +truncate table t1; +connection con1; +begin; +insert into t2 values (1,1,1); +connection con2; +begin; +insert into t2 values (2,1,2); +connection con1; +rollback; +connection con2; +commit; +select * from t2; +id id2 value +2 1 2 +truncate table t2; +connection con1; +set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go'; +insert into t1 values (1,1); +connection default; +set debug_sync='now WAIT_FOR parked1'; +connection con2; +set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go'; +insert into t2 values (1,1,1); +connection default; +set debug_sync='now WAIT_FOR parked2'; +connection con3; +set session rocksdb_lock_wait_timeout=1; +insert into t1 values (1,2); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +insert into t2 values (2,1,2); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +set debug_sync='now SIGNAL go'; +connection con1; +connection con2; +connection default; +insert into t1 values (1,2); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +insert into t2 values (2,1,2); +ERROR 23000: Duplicate entry '1' for key 'id2' +select * from t1; +id value +1 1 +select * from t2; +id id2 value +1 1 1 +connection default; +set debug_sync='RESET'; +disconnect con1; +disconnect con2; +disconnect con3; +drop table t1, t2; +connection default; +drop table if exists t1,t2,t3; +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 t3 (id int, value int) engine=rocksdb; +SET @old_val = @@session.unique_checks; +set @@session.unique_checks = FALSE; +insert into t1 values (1, 1), (1, 2); +insert into t2 values (1, 1, 1), (1, 2, 1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +insert into t3 values (1, 1), (1, 1); +set @@session.unique_checks = @old_val; +drop table t1, t2, t3; |