Commit 7a33f5d2 authored by Michael Widenius's avatar Michael Widenius

Fix for bug 39200.

mysql-test/suite/maria/r/maria3.result:
  Merged fix from bug #39200.
mysql-test/suite/maria/t/maria3.test:
  Merged maria3.test
sql/sql_table.cc:
  Bug fix for 39200
parent 54a04b00
...@@ -123,7 +123,7 @@ show create table t1; ...@@ -123,7 +123,7 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `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; alter table t1 row_format=DYNAMIC;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -151,6 +151,48 @@ t1 CREATE TABLE `t1` ( ...@@ -151,6 +151,48 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=DYNAMIC ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 ROW_FORMAT=DYNAMIC
drop table t1; 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 (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` ( create table `t1` (
t1_name varchar(255) default null, t1_name varchar(255) default null,
t1_id int(10) unsigned not null auto_increment, t1_id int(10) unsigned not null auto_increment,
......
...@@ -109,6 +109,30 @@ alter table t1 row_format=DYNAMIC; ...@@ -109,6 +109,30 @@ alter table t1 row_format=DYNAMIC;
show create table t1; show create table t1;
drop 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;
#
# 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 # CHECK TABLE was reporting
# "Size of datafile is: 0 Should be: 16384" # "Size of datafile is: 0 Should be: 16384"
# #
......
...@@ -5323,7 +5323,7 @@ compare_tables(TABLE *table, ...@@ -5323,7 +5323,7 @@ compare_tables(TABLE *table,
create_info->used_fields & HA_CREATE_USED_ENGINE || create_info->used_fields & HA_CREATE_USED_ENGINE ||
create_info->used_fields & HA_CREATE_USED_CHARSET || create_info->used_fields & HA_CREATE_USED_CHARSET ||
create_info->used_fields & HA_CREATE_USED_DEFAULT_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_PAGE_CHECKSUM ||
create_info->used_fields & HA_CREATE_USED_TRANSACTIONAL || create_info->used_fields & HA_CREATE_USED_TRANSACTIONAL ||
create_info->used_fields & HA_CREATE_USED_PACK_KEYS || create_info->used_fields & HA_CREATE_USED_PACK_KEYS ||
...@@ -6305,7 +6305,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -6305,7 +6305,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
if (create_info->row_type == ROW_TYPE_NOT_USED) if (create_info->row_type == ROW_TYPE_NOT_USED)
{
create_info->row_type= table->s->row_type; 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", DBUG_PRINT("info", ("old type: %s new type: %s",
ha_resolve_storage_engine_name(old_db_type), ha_resolve_storage_engine_name(old_db_type),
......
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