[MDEV-18791] Wrong error upon creating Aria table with long index on BLOB Created: 2019-03-02  Updated: 2021-03-12  Resolved: 2020-02-02

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table, Data types, Storage Engine - Aria
Affects Version/s: 10.4
Fix Version/s: 10.4.13

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sachin Setiya (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-21057 CREATE UNIQUE INDEX USING HASH malfun... Closed
Problem/Incident
is caused by MDEV-371 Unique indexes for blobs Closed
Relates
relates to MDEV-20001 Potential dangerous regression: INSER... Closed
relates to MDEV-23530 ERROR 1071: Specified key was too lon... Open

 Description   

CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;

10.4 3b47587f

mysqltest: At line 1: query 'CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria' failed: 1904: Key/Index cannot be defined on a virtual generated column



 Comments   
Comment by Sachin Setiya (Inactive) [ 2019-06-02 ]

http://lists.askmonty.org/pipermail/commits/2019-June/013832.html

Comment by Michael Widenius [ 2019-08-07 ]

The suggested bug fix is wrong:

  • It would change errors to "Aria Storage engine does not support long unique keys" that should not be changed.

Please ensure that the patch doesn't change this:

MariaDB [test]> create or replace table t1 (a varchar(251), b int generated always as (length(a)), key (b)) engine=aria;
ERROR 1904 (HY000): Key/Index cannot be defined on a virtual generated column

Adding an error handler is usually not the correct way to fix the issue. The correct way would be that when MariaDB decides to use a virtual hash column for unique handling, it should check if the storage engine supports indexes on virtual columns and give an error if this is not the case.

Comment by Sachin Setiya (Inactive) [ 2019-08-08 ]

Hi monty ,
This commit addresses all the issues
http://lists.askmonty.org/pipermail/commits/2019-August/013924.html

Comment by Sergei Golubchik [ 2019-08-21 ]

ok to push

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