← Back to team overview

maria-developers team mailing list archive

[Branch ~maria-captains/maria/5.1] Rev 2706: Fix for bug 39200.

 

------------------------------------------------------------
revno: 2706
committer: Michael Widenius <monty@xxxxxxxxx>
branch nick: mysql-5.1-maria-lp
timestamp: Tue 2009-06-02 12:58:27 +0300
message:
  Fix for bug 39200.
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'
--- mysql-test/suite/maria/r/maria3.result	2009-02-19 09:01:25 +0000
+++ mysql-test/suite/maria/r/maria3.result	2009-06-02 09:58:27 +0000
@@ -123,7 +123,7 @@
 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,48 @@
   `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 (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'
--- mysql-test/suite/maria/t/maria3.test	2009-02-19 09:01:25 +0000
+++ mysql-test/suite/maria/t/maria3.test	2009-06-02 09:58:27 +0000
@@ -109,6 +109,30 @@
 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;
+
+#
+# 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'
--- sql/sql_table.cc	2009-04-25 10:05:32 +0000
+++ sql/sql_table.cc	2009-06-02 09:58:27 +0000
@@ -5323,7 +5323,7 @@
       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 ||
       create_info->used_fields & HA_CREATE_USED_PACK_KEYS ||
@@ -6305,7 +6305,10 @@
   }
 
   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),



--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1

Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.