mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-11995 ALTER TABLE proceeds despite reporting ER_TOO_LONG_KEY error
automatic shortening of a too-long non-unique key should be not a warning, but a note. It's a normal optimization, doesn't affect correctness, and should never be converted to an error, no matter how strict sql_mode is.
This commit is contained in:
13
mysql-test/suite/innodb/r/alter_table.result
Normal file
13
mysql-test/suite/innodb/r/alter_table.result
Normal file
@@ -0,0 +1,13 @@
|
||||
set @@sql_mode=strict_trans_tables;
|
||||
create table t1(a text not null) row_format=dynamic engine=innodb;
|
||||
create index idx1 on t1(a(3073));
|
||||
Warnings:
|
||||
Note 1071 Specified key was too long; max key length is 3072 bytes
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text NOT NULL,
|
||||
KEY `idx1` (`a`(3072))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
drop table t1;
|
||||
set @@sql_mode=default;
|
||||
@@ -2543,11 +2543,11 @@ Warning 1071 Specified key was too long; max key length is 767 bytes
|
||||
create table t3 (col1 text, index(col1(768)))
|
||||
character set = latin1 engine = innodb;
|
||||
Warnings:
|
||||
Warning 1071 Specified key was too long; max key length is 767 bytes
|
||||
Note 1071 Specified key was too long; max key length is 767 bytes
|
||||
create table t4 (col1 blob, index(col1(768)))
|
||||
character set = latin1 engine = innodb;
|
||||
Warnings:
|
||||
Warning 1071 Specified key was too long; max key length is 767 bytes
|
||||
Note 1071 Specified key was too long; max key length is 767 bytes
|
||||
SET GLOBAL innodb_large_prefix=default;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
|
||||
10
mysql-test/suite/innodb/t/alter_table.test
Normal file
10
mysql-test/suite/innodb/t/alter_table.test
Normal file
@@ -0,0 +1,10 @@
|
||||
--source include/have_innodb.inc
|
||||
#
|
||||
# MDEV-11995 ALTER TABLE proceeds despite reporting ER_TOO_LONG_KEY error
|
||||
#
|
||||
set @@sql_mode=strict_trans_tables;
|
||||
create table t1(a text not null) row_format=dynamic engine=innodb;
|
||||
create index idx1 on t1(a(3073));
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
set @@sql_mode=default;
|
||||
Reference in New Issue
Block a user