[MDEV-23264] Unique blobs allow duplicate values upon UPDATE Created: 2020-07-22  Updated: 2022-11-21  Resolved: 2022-11-07

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-371 Unique indexes for blobs Closed
Relates
relates to MDEV-23265 Assertion `!expl_lock || expl_lock->t... Confirmed
relates to MDEV-29199 Unique hash key is ignored upon INSER... Closed
relates to MDEV-29949 Unique blobs allow duplicate values u... Open

 Description   

CREATE TABLE t1 (f TEXT UNIQUE);
INSERT INTO t1 VALUES (NULL),(NULL);
UPDATE t1 SET f = '';
SELECT * FROM t1;
DROP TABLE t1;

10.4 de20872331

MariaDB [test]> UPDATE t1 SET f = '';
Query OK, 2 rows affected (0.116 sec)
Rows matched: 2  Changed: 2  Warnings: 0
 
MariaDB [test]> SELECT * FROM t1;
+------+
| f    |
+------+
|      |
|      |
+------+
2 rows in set (0.000 sec)

Reproducible on 10.4, 10.5.

INSERT of empty values returns ER_DUP_ENTRY as expected.
UPDATE from non-NULL values and UPDATE to non-empty values also returns ER_DUP_ENTRY.



 Comments   
Comment by Sachin Setiya (Inactive) [ 2020-09-14 ]

Patch branch bb-10.4-sachin

Comment by Oleksandr Byelkin [ 2022-06-23 ]

The patch is OK, I cherry-picked in to 10.4 and now the buildbot is testing it

Generated at Thu Feb 08 09:21:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.