[MDEV-22719] Long unique keys are not created when individual key_part->length < max_key_length but SUM(key_parts->length) > max_key_length Created: 2020-05-26  Updated: 2020-06-07  Resolved: 2020-06-07

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4, 10.5
Fix Version/s: 10.5.4, 10.4.14

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


 Description   

--source include/have_innodb.inc
CREATE TABLE t1 (a int, b VARCHAR(1000), UNIQUE (a,b)) ENGINE=MyISAM;
show index from t1;
 
# Cleanup
DROP TABLE t1;

CREATE TABLE t1 (a int, b VARCHAR(1000), UNIQUE (a,b)) ENGINE=MyISAM;
main.xyz 'innodb'                 [ fail ]
        Test ended at 2020-05-26 18:39:24
 
CURRENT_TEST: main.mdev_21834
mysqltest: At line 2: query 'CREATE TABLE t1 (a int, b VARCHAR(1000), UNIQUE (a,b)) ENGINE=MyISAM' failed: 1071: Specified key was too long; max key length is 1000 bytes
 

If I increase the varchar size > 1000 (will create HASH index) or < 997(Will create BTREE index)



 Comments   
Comment by Sachin Setiya (Inactive) [ 2020-06-03 ]

Patch Branch bb-10.5-sachin bb-10.4-sachin2

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