mirror of
https://github.com/MariaDB/server.git
synced 2025-08-12 05:21:37 +02:00

let's disallow UPDATE IGNORE in READ COMMITTED with the table has UNIQUE constraint that is USING HASH or is WITHOUT OVERLAPS This rarely-used combination should not block a release, with be fixed in MDEV-37233
179 lines
4.3 KiB
Text
179 lines
4.3 KiB
Text
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
|
|
#
|
|
# MDEV-371 Unique indexes for blobs
|
|
#
|
|
|
|
create table t1(a blob unique) engine= InnoDB;
|
|
insert into t1 values('RUC');
|
|
--error ER_DUP_ENTRY
|
|
insert into t1 values ('RUC');
|
|
drop table t1;
|
|
|
|
create table t1 (a blob unique , c int unique) engine=innodb;
|
|
show create table t1;
|
|
drop table t1;
|
|
|
|
--echo #test for concurrent insert of long unique in innodb
|
|
create table t1(a blob unique) engine= InnoDB;
|
|
show create table t1;
|
|
connect ('con1', localhost, root,,);
|
|
connect ('con2', localhost, root,,);
|
|
|
|
--connection con1
|
|
set innodb_lock_wait_timeout= 2;
|
|
set transaction isolation level READ UNCOMMITTED;
|
|
start transaction;
|
|
insert into t1 values('RUC');
|
|
--connection con2
|
|
set innodb_lock_wait_timeout= 2;
|
|
set transaction isolation level READ UNCOMMITTED;
|
|
start transaction;
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
insert into t1 values ('RUC');
|
|
|
|
--connection con1
|
|
commit;
|
|
set transaction isolation level READ COMMITTED;
|
|
start transaction;
|
|
insert into t1 values('RC');
|
|
--connection con2
|
|
commit;
|
|
set transaction isolation level READ COMMITTED;
|
|
start transaction;
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
insert into t1 values ('RC');
|
|
commit;
|
|
|
|
--connection con1
|
|
commit;
|
|
set transaction isolation level REPEATABLE READ;
|
|
start transaction;
|
|
insert into t1 values('RR');
|
|
--connection con2
|
|
commit;
|
|
set transaction isolation level REPEATABLE READ;
|
|
start transaction;
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
insert into t1 values ('RR');
|
|
|
|
--connection con1
|
|
commit;
|
|
set transaction isolation level SERIALIZABLE;
|
|
start transaction;
|
|
insert into t1 values('S');
|
|
--connection con2
|
|
commit;
|
|
set transaction isolation level SERIALIZABLE;
|
|
start transaction;
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
insert into t1 values ('S');
|
|
commit;
|
|
|
|
--connection con1
|
|
commit;
|
|
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
create table t1(a blob unique) engine=Innodb;
|
|
|
|
--connection con1
|
|
set transaction isolation level READ UNCOMMITTED;
|
|
start transaction;
|
|
insert into t1 values('RUC');
|
|
--connection con2
|
|
set transaction isolation level READ UNCOMMITTED;
|
|
start transaction;
|
|
--send insert into t1 values ('RUC');
|
|
--connection con1
|
|
rollback;
|
|
--connection con2
|
|
--reap
|
|
commit;
|
|
|
|
--connection con1
|
|
set transaction isolation level READ COMMITTED;
|
|
start transaction;
|
|
insert into t1 values('RC');
|
|
--connection con2
|
|
set transaction isolation level READ COMMITTED;
|
|
start transaction;
|
|
--send insert into t1 values ('RC');
|
|
--connection con1
|
|
rollback;
|
|
--connection con2
|
|
--reap
|
|
commit;
|
|
|
|
--connection con1
|
|
set transaction isolation level REPEATABLE READ;
|
|
start transaction;
|
|
insert into t1 values('RR');
|
|
--connection con2
|
|
set transaction isolation level REPEATABLE READ;
|
|
start transaction;
|
|
--send insert into t1 values ('RR');
|
|
--connection con1
|
|
rollback;
|
|
--connection con2
|
|
--reap
|
|
commit;
|
|
|
|
--connection con1
|
|
set transaction isolation level SERIALIZABLE;
|
|
start transaction;
|
|
insert into t1 values('S');
|
|
--connection con2
|
|
set transaction isolation level SERIALIZABLE;
|
|
start transaction;
|
|
--send insert into t1 values ('S');
|
|
--connection con1
|
|
rollback;
|
|
--connection con2
|
|
--reap
|
|
commit;
|
|
|
|
connection default;
|
|
drop table t1;
|
|
disconnect con1;
|
|
disconnect con2;
|
|
|
|
--echo # MDEV-20131 Assertion `!pk->has_virtual()' failed
|
|
|
|
--error ER_TOO_LONG_KEY
|
|
create table t1 (a text, primary key(a(1871))) engine=innodb;
|
|
|
|
--echo # End of 10.4 tests
|
|
|
|
--echo #
|
|
--echo # MDEV-37268 ER_NOT_KEYFILE or assertion failure upon REPLACE into table with unique hash under READ-COMMITTED
|
|
--echo #
|
|
create table t1 (id int not null primary key, f varchar(100), unique(f) using hash) engine=innodb;
|
|
insert t1 values (1,'x');
|
|
set transaction isolation level read committed;
|
|
replace t1 values (2,'x');
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
create table t1 (id int, f longtext, primary key (id), unique(f)) engine=innodb partition by key (id) partitions 9;
|
|
insert t1 (id) values (1),(2);
|
|
set transaction isolation level read committed;
|
|
--error ER_NOT_SUPPORTED_YET
|
|
update ignore t1 set f = 'x';
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
--echo #
|
|
--echo # MDEV-37310 Non-debug failing assertion node->pcur->rel_pos == BTR_PCUR_ON upon violating long unique under READ-COMMITTED
|
|
--echo #
|
|
create table t1 (id int, f blob, unique(id,f)) engine=innodb partition by key(id) partitions 2;
|
|
insert t1 values (1,'foo'),(2,'foo');
|
|
set transaction isolation level read committed;
|
|
--error ER_NOT_SUPPORTED_YET
|
|
update ignore t1 set id = 2;
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
--echo # End of 10.6 tests
|