Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
11.8.3
-
None
-
None
Description
I'm aware it's an edge case, but I'm not sure the difference is intentional.
The example doesn't use on duplicate key update, but the original use case does.
It'd be nice if on duplicate key always checked primary first.
It'd be even nicer if there was a way to avoid abusing inserts for multi-row per-row updates.
drop table test; |
drop table test2; |
|
|
create table test ( |
id int(11) not null, |
a int(11) not null, |
b varchar(255) not null default '', |
primary key (id), |
unique key b (b) |
) default charset=utf8mb3; |
|
|
create table test2 ( |
id int(11) not null, |
a int(11) not null, |
b varchar(255) not null default '', |
primary key (id), |
unique key b (b) |
) default charset=utf8mb4; |
|
|
insert into test (a, id) values (1,1); |
insert into test (a, id) values (1,1); |
|
|
# ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY' |
|
|
insert into test2 (a, id) values (1,1); |
insert into test2 (a, id) values (1,1); |
|
|
# ERROR 1062 (23000): Duplicate entry '' for key 'b' |