mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Long Index is only allowed for unique keys not normal index.
This commit is contained in:
@ -512,4 +512,34 @@ while ($count)
|
||||
--eval $insert_data_2
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# non-unique long indexes are automatically shortened
|
||||
#
|
||||
create table t1(a blob , key(a));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1(a blob);
|
||||
alter table t1 add index(a);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1(a text, key(a));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
create table t1(a varchar(4000));
|
||||
alter table t1 add index(a);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# somewhat inconsistently, the following is an error
|
||||
#
|
||||
create table t1 (pk int, a int, b int, primary key(pk), key(pk,a));
|
||||
--error ER_TOO_LONG_KEY
|
||||
alter table t1 modify a text;
|
||||
--error ER_TOO_LONG_KEY
|
||||
alter table t1 modify a varchar(1000);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
set @@GLOBAL.max_allowed_packet= @allowed_packet;
|
||||
|
Reference in New Issue
Block a user