MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:October 29 2007 12:42pm
Subject:bk commit into 5.1 tree (anozdrin:1.2599) BUG#27610
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of alik. When alik does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-29 15:42:49+03:00, anozdrin@station. +3 -0
  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@stripped, 2007-10-29 15:42:47+03:00, anozdrin@station. +49 -0
    Add a test case for BUG#27610: ALTER TABLE ROW_FORMAT=... does not
    rebuild the table.

  mysql-test/r/innodb_mysql.result@stripped, 2007-10-29 15:42:47+03:00, anozdrin@station. +34 -0
    Update result file.

  sql/sql_table.cc@stripped, 2007-10-29 15:42:47+03:00, anozdrin@station. +1 -0
    Rebuild a table if ROW_FORMAT was specified in ALTER TABLE.

diff -Nrup a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
--- a/mysql-test/include/mix1.inc	2007-10-19 02:57:40 +04:00
+++ b/mysql-test/include/mix1.inc	2007-10-29 15:42:47 +03:00
@@ -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 -Nrup a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
--- a/mysql-test/r/innodb_mysql.result	2007-10-19 02:57:40 +04:00
+++ b/mysql-test/r/innodb_mysql.result	2007-10-29 15:42:47 +03:00
@@ -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,
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc	2007-10-25 05:01:04 +04:00
+++ b/sql/sql_table.cc	2007-10-29 15:42:47 +03:00
@@ -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 ||
Thread
bk commit into 5.1 tree (anozdrin:1.2599) BUG#27610Alexander Nozdrin29 Oct