diff options
author | unknown <anozdrin/alik@station.> | 2007-10-29 15:42:49 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@station.> | 2007-10-29 15:42:49 +0300 |
commit | 7c92f118e4fbfa5e96a9261ef18c59e74e650ce7 (patch) | |
tree | 8fd899a09ded497bfa095ea19850a1f21c0ae1f1 /mysql-test | |
parent | 35ca78a0d449e9c8260a5a9d1d1ade0c6e8fbb80 (diff) | |
download | mariadb-git-7c92f118e4fbfa5e96a9261ef18c59e74e650ce7.tar.gz |
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.
mysql-test/include/mix1.inc:
Add a test case for BUG#27610: ALTER TABLE ROW_FORMAT=... does not
rebuild the table.
mysql-test/r/innodb_mysql.result:
Update result file.
sql/sql_table.cc:
Rebuild a table if ROW_FORMAT was specified in ALTER TABLE.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/mix1.inc | 49 | ||||
-rw-r--r-- | mysql-test/r/innodb_mysql.result | 34 |
2 files changed, 83 insertions, 0 deletions
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index aee5613ff35..df9d79157af 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -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 diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 3a6758b38f4..2a0f9a930b8 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1287,6 +1287,40 @@ a b 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` ( `k` int(11) NOT NULL auto_increment, |