mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.5' into 10.6
This commit is contained in:
@ -676,6 +676,59 @@ SELECT * FROM t1;
|
||||
a b c
|
||||
3 2 2
|
||||
DROP TABLE t1;
|
||||
# MDEV-30046 wrong row targeted with "insert ... on duplicate" and
|
||||
# "replace", leading to data corruption
|
||||
create table t (s blob, n int, unique (s)) engine=innodb;
|
||||
insert into t values ('Hrecvx_0004ln-00',1), ('Hrecvx_0004mm-00',1);
|
||||
replace into t values ('Hrecvx_0004mm-00',2);
|
||||
select * from t;
|
||||
s n
|
||||
Hrecvx_0004ln-00 1
|
||||
Hrecvx_0004mm-00 2
|
||||
drop table t;
|
||||
create table t (s blob, n int, unique (s)) engine=innodb;
|
||||
insert into t values ('Hrecvx_0004ln-00',1), ('Hrecvx_0004mm-00',1);
|
||||
insert into t values ('Hrecvx_0004mm-00',2)
|
||||
on duplicate key update n = values (n);
|
||||
select * from t;
|
||||
s n
|
||||
Hrecvx_0004ln-00 1
|
||||
Hrecvx_0004mm-00 2
|
||||
drop table t;
|
||||
#
|
||||
# MDEV-29345 update case insensitive (large) unique key with insensitive change of value - duplicate key
|
||||
#
|
||||
create table t1 (a int, b text, unique (b));
|
||||
insert ignore t1 values (1, 'a'), (2, 'A');
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry 'A' for key 'b'
|
||||
select * from t1;
|
||||
a b
|
||||
1 a
|
||||
update t1 set b='A' where a=1;
|
||||
select * from t1;
|
||||
a b
|
||||
1 A
|
||||
drop table t1;
|
||||
create table t1 (a int, b blob, unique (b));
|
||||
insert t1 values (1, 'a'), (2, 'A');
|
||||
select * from t1;
|
||||
a b
|
||||
1 a
|
||||
2 A
|
||||
update t1 set b='A' where a=1;
|
||||
ERROR 23000: Duplicate entry 'A' for key 'b'
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-25102 UNIQUE USING HASH error after ALTER ... DISABLE KEYS
|
||||
#
|
||||
create table t1 (i int, unique key (i) using hash);
|
||||
alter table t1 disable keys;
|
||||
insert into t1 values (1),(2);
|
||||
insert into t1 values (1);
|
||||
ERROR 23000: Duplicate entry '1' for key 'i'
|
||||
alter table t1 enable keys;
|
||||
insert into t1 values (2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'i'
|
||||
drop table t1;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user