Bug #34047 Tablespaces: CREATE TABLE preserves, ALTER TABLE destroys
Submitted: 24 Jan 2008 23:06 Modified: 3 May 2011 0:38
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug OS:Linux (SUSE 10 / 64-bit)
Assigned to: CPU Architecture:Any

[24 Jan 2008 23:06] Peter Gulutzan
Description:
If I create a MyISAM table with a tablespace,
the tablespace information is preserved.

If I create a Falcon table with a tablespace,
the tablespace information is preserved.

If I alter a Falcon table to a MyISAM table,
the tablespace information is destroyed.

Either CREATE is wrong or ALTER is wrong.
I'd prefer to say that ALTER is wrong.

How to repeat:
mysql> create tablespace ta add datafile 'ta' engine=falcon;
Query OK, 0 rows affected (0.01 sec)

mysql> create table t_1 (s1 int) tablespace ta engine=falcon;
Query OK, 0 rows affected (0.37 sec)

mysql> show create table t_1;
+-------+---------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                        |
+-------+---------------------------------------------------------------------------------------------------------------------+
| t_1   | CREATE TABLE `t_1` (
  `s1` int(11) DEFAULT NULL
) /*!50100 TABLESPACE `ta` */ ENGINE=Falcon DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> create table t_2 (s1 int) tablespace ta engine=myisam;
Query OK, 0 rows affected (0.01 sec)

mysql> show create table t_2;
+-------+---------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                        |
+-------+---------------------------------------------------------------------------------------------------------------------+
| t_2   | CREATE TABLE `t_2` (
  `s1` int(11) DEFAULT NULL
) /*!50100 TABLESPACE `ta` */ ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter table t_1 engine=myisam;
Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table t_1;
+-------+-----------------------------------------------------------------------------------------+
| Table | Create Table                                                                            |
+-------+-----------------------------------------------------------------------------------------+
| t_1   | CREATE TABLE `t_1` (
  `s1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
[25 Jan 2008 9:47] Sveta Smirnova
Thank you for the report.

Verified as described.
[3 May 2011 0:38] Paul DuBois
Documented in 5.5.12, 5.6.3 changelogs, in changelog entry for Bug#60111.