summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-05-29 16:22:24 +0200
committerTatiana A. Nurnberg <azundris@mysql.com>2009-05-29 16:22:24 +0200
commit7b4c697953aaca070f06f1a6130b435831d764e3 (patch)
tree6a00f250ba87396c404577b4be2a14dc85efa7ee /sql/sql_table.cc
parent981ff94d801cfca8479dce5e6fdf6f14c75f47b7 (diff)
downloadmariadb-git-7b4c697953aaca070f06f1a6130b435831d764e3.tar.gz
Bug#39200: optimize table does not recognize ROW_FORMAT=COMPRESSED
When doing ALTER TABLE, we forgot to point out that we actually have ROW_FORMAT information (from the original table), so we dropped to "sensible defaults". This affects both ALTER TABLE and OPTIMIZE TABLE which may fall back on ALTER TABLE for InnoDB. We now flag that we do indeed know the row-type, thereby preserving compression-type etc. No .test in 5.1 since we'd need a reasonable new plugin from InnoDB to show this properly; in higher versions, maria can demonstrate this.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5397128855a..d5317995948 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5314,7 +5314,7 @@ compare_tables(TABLE *table,
create_info->used_fields & HA_CREATE_USED_ENGINE ||
create_info->used_fields & HA_CREATE_USED_CHARSET ||
create_info->used_fields & HA_CREATE_USED_DEFAULT_CHARSET ||
- create_info->used_fields & HA_CREATE_USED_ROW_FORMAT ||
+ (table->s->row_type != create_info->row_type) ||
create_info->used_fields & HA_CREATE_USED_PACK_KEYS ||
create_info->used_fields & HA_CREATE_USED_MAX_ROWS ||
(alter_info->flags & (ALTER_RECREATE | ALTER_FOREIGN_KEY)) ||
@@ -6307,7 +6307,10 @@ view_err:
}
if (create_info->row_type == ROW_TYPE_NOT_USED)
+ {
create_info->row_type= table->s->row_type;
+ create_info->used_fields |= HA_CREATE_USED_ROW_FORMAT;
+ }
DBUG_PRINT("info", ("old type: %s new type: %s",
ha_resolve_storage_engine_name(old_db_type),