mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for bug #28125: ERROR 2013 when adding index.
Problem: we may break a multibyte char sequence using a key reduced to maximum allowed length for a storage engine (that leads to failed assertion in the innodb code, see also #17530). Fix: align truncated key length to multibyte char boundary.
This commit is contained in:

parent
261acdbbea
commit
100faf97c4
@ -418,7 +418,7 @@ DROP TABLE t1,t2;
|
||||
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
|
||||
character set utf8 collate utf8_general_ci;
|
||||
Warnings:
|
||||
Warning 1071 Specified key was too long; max key length is 765 bytes
|
||||
Warning 1071 Specified key was too long; max key length is 767 bytes
|
||||
insert into t1 values('aaa');
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
|
||||
@ -735,4 +735,16 @@ COUNT(*)
|
||||
3072
|
||||
set @@sort_buffer_size=default;
|
||||
DROP TABLE t1,t2;
|
||||
create table t1(a text) engine=innodb default charset=utf8;
|
||||
insert into t1 values('aaa');
|
||||
alter table t1 add index(a(1024));
|
||||
Warnings:
|
||||
Warning 1071 Specified key was too long; max key length is 767 bytes
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text,
|
||||
KEY `a` (`a`(255))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user