Commit ee25b4f5 authored by anozdrin/alik@station's avatar anozdrin/alik@station

Fix for BUG#27610: ALTER TABLE ROW_FORMAT=... does not

rebuild the table.

The problem was that ROW_FORMAT clause in ALTER TABLE did not trigger
table reconstruction.

The fix is to rebuild a table if ROW_FORMAT is specified.
parent 2bc41b7e
......@@ -1019,6 +1019,55 @@ SELECT * FROM t1 ORDER BY b DESC, a ASC;
DROP TABLE t1;
###########################################################################
--echo
--echo #
--echo # Bug#27610: ALTER TABLE ROW_FORMAT=... does not rebuild the table.
--echo #
--echo
--echo # - prepare;
--echo
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo
CREATE TABLE t1(c INT)
ENGINE = InnoDB
ROW_FORMAT = COMPACT;
--echo
--echo # - initial check;
--echo
SELECT table_schema, table_name, row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = 't1';
--echo
--echo # - change ROW_FORMAT and check;
--echo
ALTER TABLE t1 ROW_FORMAT = REDUNDANT;
--echo
SELECT table_schema, table_name, row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = 't1';
--echo
--echo # - that's it, cleanup.
--echo
DROP TABLE t1;
###########################################################################
--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
......
......@@ -1286,6 +1286,40 @@ a b
2 2
3 2
1 1
DROP TABLE t1;
#
# Bug#27610: ALTER TABLE ROW_FORMAT=... does not rebuild the table.
#
# - prepare;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c INT)
ENGINE = InnoDB
ROW_FORMAT = COMPACT;
# - initial check;
SELECT table_schema, table_name, row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = 't1';
table_schema table_name row_format
test t1 Compact
# - change ROW_FORMAT and check;
ALTER TABLE t1 ROW_FORMAT = REDUNDANT;
SELECT table_schema, table_name, row_format
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = DATABASE() AND table_name = 't1';
table_schema table_name row_format
test t1 Redundant
# - that's it, cleanup.
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE `t2` (
......
......@@ -4985,6 +4985,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 ||
(alter_info->flags & (ALTER_RECREATE | ALTER_FOREIGN_KEY)) ||
order_num ||
!table->s->mysql_version ||
......
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