Commit 72c5af0e authored by Magne Mahre's avatar Magne Mahre

Merge from 5.1-bugteam

parents 5bebedfe fc8fba96
......@@ -2653,3 +2653,13 @@ COMMIT;
COMMIT;
DROP TABLE t1;
DROP FUNCTION f1;
#
# Bug#54606 innodb fast alter table + pack_keys=0
# prevents adding new indexes
#
CREATE TABLE t1 (a INT, b CHAR(9), c INT, key(b))
ENGINE=InnoDB
PACK_KEYS=0;
CREATE INDEX a ON t1 (a);
CREATE INDEX c on t1 (c);
DROP TABLE t1;
......@@ -830,3 +830,16 @@ connection default;
COMMIT;
DROP TABLE t1;
DROP FUNCTION f1;
--echo #
--echo # Bug#54606 innodb fast alter table + pack_keys=0
--echo # prevents adding new indexes
--echo #
CREATE TABLE t1 (a INT, b CHAR(9), c INT, key(b))
ENGINE=InnoDB
PACK_KEYS=0;
CREATE INDEX a ON t1 (a);
CREATE INDEX c on t1 (c);
DROP TABLE t1;
......@@ -3536,6 +3536,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_part_info->length=(uint16) length;
/* Use packed keys for long strings on the first column */
if (!((*db_options) & HA_OPTION_NO_PACK_KEYS) &&
!((create_info->table_options & HA_OPTION_NO_PACK_KEYS)) &&
(length >= KEY_DEFAULT_PACK_LENGTH &&
(sql_field->sql_type == MYSQL_TYPE_STRING ||
sql_field->sql_type == MYSQL_TYPE_VARCHAR ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment