summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2010-09-16 12:51:08 +0200
committerMagne Mahre <magne.mahre@sun.com>2010-09-16 12:51:08 +0200
commitebd207baa84278759675bd97d8864d4cac94c6ed (patch)
tree6236b12ed86b7ebb5a24f286a5356d021475b9f8 /sql/sql_table.cc
parent0c91b53d10ad74fd26a2e3ba565d117539d8983c (diff)
downloadmariadb-git-ebd207baa84278759675bd97d8864d4cac94c6ed.tar.gz
Bug #54606 innodb fast alter table + pack_keys=0 prevents
adding new indexes A fast alter table requires that the existing (old) table and indices are unchanged (i.e only new indices can be added). To verify this, the layout and flags of the old table/indices are compared for equality with the new. The PACK_KEYS option is a no-op in InnoDB, but the flag exists, and is used in the table compare. We need to check this (table) option flag before deciding whether an index should be packed or not. If the table has explicitly set PACK_KEYS to 0, the created indices should not be marked as packed/packable.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index d3ac2bf0f95..7a7446c7f79 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3325,6 +3325,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 ||