#At file:///misc/mysql/forest/39200k/60-39200k/ based on
revid:davi.arnaut@stripped
3324 Tatiana A. Nurnberg 2009-05-29 [merge]
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.
@ mysql-test/suite/maria/r/maria3.result
test updated and extended after clearing with monty.
@ mysql-test/suite/maria/t/maria3.test
test updated and extended after clearing with monty.
@ sql/sql_table.cc
In mysql_alter_table() flag that we have row-type info
from old table. In compare_tables(), change whether row
type has actually changed, rather than rely on the flag
(which will always be set now).
modified:
mysql-test/suite/maria/r/maria3.result
mysql-test/suite/maria/t/maria3.test
sql/sql_table.cc
=== modified file 'mysql-test/suite/maria/r/maria3.result'
--- a/mysql-test/suite/maria/r/maria3.result 2009-02-23 14:53:18 +0000
+++ b/mysql-test/suite/maria/r/maria3.result 2009-05-29 14:59:42 +0000
@@ -123,7 +123,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=PAGE TRANSACTIONAL=0
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=DYNAMIC TRANSACTIONAL=0
alter table t1 row_format=DYNAMIC;
show create table t1;
Table Create Table
@@ -151,6 +151,27 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=DYNAMIC
drop table t1;
+create table t1 (a int) transactional=0 row_format=FIXED;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=FIXED TRANSACTIONAL=0
+alter table t1 transactional=1;
+Warnings:
+Note 1478 Row format set to PAGE because of TRANSACTIONAL=1 option
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=PAGE TRANSACTIONAL=1
+alter table t1 transactional=0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=FIXED TRANSACTIONAL=0
+drop table t1;
create table `t1` (
t1_name varchar(255) default null,
t1_id int(10) unsigned not null auto_increment,
=== modified file 'mysql-test/suite/maria/t/maria3.test'
--- a/mysql-test/suite/maria/t/maria3.test 2009-02-13 16:30:54 +0000
+++ b/mysql-test/suite/maria/t/maria3.test 2009-05-29 14:59:42 +0000
@@ -109,6 +109,18 @@ alter table t1 row_format=DYNAMIC;
show create table t1;
drop table t1;
+#
+# MySQL Bug#39200: optimize table does not recognize ROW_FORMAT=COMPRESSED
+#
+
+create table t1 (a int) transactional=0 row_format=FIXED;
+show create table t1;
+alter table t1 transactional=1;
+show create table t1;
+alter table t1 transactional=0;
+show create table t1;
+drop table t1;
+
# CHECK TABLE was reporting
# "Size of datafile is: 0 Should be: 16384"
#
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2009-05-25 10:10:18 +0000
+++ b/sql/sql_table.cc 2009-05-29 14:59:42 +0000
@@ -5417,7 +5417,7 @@ compare_tables(THD *thd,
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_PAGE_CHECKSUM ||
create_info->used_fields & HA_CREATE_USED_TRANSACTIONAL ||
(alter_info->flags & (ALTER_RECREATE | ALTER_FOREIGN_KEY)) ||
@@ -6903,7 +6903,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),
Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090529145942-3hnkpua84p3agi6i.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (azundris:3324) Bug#39200 | Tatiana A. Nurnberg | 29 May 2009 |