Details
Description
create table x (id int auto_increment primary key, name varchar(2048) collate utf8_general_ci, unique key u(name)); |
insert into x values (1,'test'); |
update x set name = "Test" where id=1 |
|
Duplicate entry 'Test' for key 'u |
A smaller varchar length ~200 will not generate an error.
Suspected MDEV-371 regression.
source: https://www.reddit.com/r/mariadb/comments/wu83pe/change_case_with_unique_constraint/
Attachments
Issue Links
- is caused by
-
MDEV-371 Unique indexes for blobs
-
- Closed
-
- is duplicated by
-
MDEV-34052 long uniques false positive when a row value changes letter case
-
- Closed
-
- relates to
-
MDEV-27653 long uniques don't work with unicode collations
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Summary | update case insensitive unique key with insensitive change of value - duplicate key | update case insensitive (large) unique key with insensitive change of value - duplicate key |
Component/s | Server [ 13907 ] | |
Component/s | Storage Engine - InnoDB [ 10129 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Assignee | Marko Mäkelä [ marko ] | Oleksandr Byelkin [ sanja ] |
Labels | not-10.3 | not-10.3 regression-10.4 |
Priority | Major [ 3 ] | Critical [ 2 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link |
This issue relates to |
Labels | not-10.3 regression-10.4 | not-10.3 |
Fix Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.8 [ 26121 ] |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] |
Remote Link | This issue links to "SO user hit this (Web Link)" [ 36813 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Sergei Golubchik [ serg ] |
Link |
This issue is duplicated by |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | In Testing [ 10301 ] |
issue.field.resolutiondate | 2024-05-05 20:36:09.0 | 2024-05-05 20:36:08.942 |
Fix Version/s | 10.5.25 [ 29626 ] | |
Fix Version/s | 10.6.18 [ 29627 ] | |
Fix Version/s | 10.11.8 [ 29630 ] | |
Fix Version/s | 11.0.6 [ 29628 ] | |
Fix Version/s | 11.1.5 [ 29629 ] | |
Fix Version/s | 11.2.4 [ 29631 ] | |
Fix Version/s | 11.4.2 [ 29633 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Testing [ 10301 ] | Closed [ 6 ] |
Here is a little simpler test case, not involving InnoDB at all:
I disabled
MDEV-371with the following:diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6e8a4795f21..f8f3eefc114 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2441,6 +2441,8 @@ static inline void make_long_hash_field_name(LEX_CSTRING *buf, uint num)
static Create_field * add_hash_field(THD * thd, List<Create_field> *create_list,
KEY *key_info)
{
+ my_error(ER_TOO_LONG_KEY, MYF(0), 1000);
+ return nullptr;
List_iterator<Create_field> it(*create_list);
Create_field *dup_field, *cf= new (thd->mem_root) Create_field();
With
MDEV-371disabled, the error ER_TOO_LONG_KEY would be output for anything longer than varchar(333). For shorter values, no duplicate key error will be flagged.