diff options
author | Georgi Kodinov <joro@sun.com> | 2009-09-18 16:01:18 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-09-18 16:01:18 +0300 |
commit | faacd36a128da1623132e904e6e1ab84bbc61df7 (patch) | |
tree | 5ec69f44c0fb8391a6b8b9e19ab20bf83cec6aba /sql/sql_table.cc | |
parent | 7079338e0ed8f5ef52c77fd81ad23bbb8fd8c86a (diff) | |
download | mariadb-git-faacd36a128da1623132e904e6e1ab84bbc61df7.tar.gz |
Bug#46760: Fast ALTER TABLE no longer works for InnoDB
Despite copying the value of the old table's row type
we don't always have to mark row type as being specified.
Innodb uses this to check if it can do fast ALTER TABLE
or not.
Fixed by correctly flagging the presence of row_type
only when it's actually changed.
Added a test case for 39200.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 41e76211dd8..9d929c0d1a3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6656,9 +6656,19 @@ view_err: goto err; } + /* + If this is an ALTER TABLE and no explicit row type specified reuse + the table's row type. + Note : this is the same as if the row type was specified explicitly. + */ if (create_info->row_type == ROW_TYPE_NOT_USED) { + /* ALTER TABLE without explicit row type */ create_info->row_type= table->s->row_type; + } + else + { + /* ALTER TABLE with specific row type */ create_info->used_fields |= HA_CREATE_USED_ROW_FORMAT; } |