Bug #25875 Newly created table through CREATE TABLE .. LIKE has no ndb_dd attributes
Submitted: 26 Jan 2007 16:54 Modified: 10 Apr 2007 12:02
Reporter: Serge Kozlov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.1.15-bk OS:Linux (Linux FC4 64bit)
Assigned to: justin he CPU Architecture:Any

[26 Jan 2007 16:54] Serge Kozlov
Description:
CREATE TABLE .. LIKE query doesn't copy ndb_dd attributes (TABLESPACE ... STORAGE DISK) into newly creating table and therefore one becomes regular ndb.

How to repeat:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.15-beta-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table t1 (a int not null primary key, b varchar(1)) tablespace ts
1 storage disk engine=ndb;
Query OK, 0 rows affected (1.54 sec)

mysql> create table t2 like t1;
Query OK, 0 rows affected (1.39 sec)

mysql> show create table t1;
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------+
| Table | Create Table

                            |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`a`)
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=lati
n1 |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------+
1 row in set (0.01 sec)

mysql> show create table t2;
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------+
| Table | Create Table
                                                                    |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `a` int(11) NOT NULL,
  `b` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql>
[13 Mar 2007 8:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/21777

ChangeSet@1.2444, 2007-03-13 15:56:08+08:00, Justin.He@dev3-240.dev.cn.tlan +1 -0
  Bug#25875, Newly created table through CREATE TABLE .. LIKE has no ndb_dd attributes
[7 Apr 2007 7:00] Bugs System
Pushed into 5.1.18-beta
[10 Apr 2007 12:02] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.18 changelog.