Bug #24667 After ALTER TABLE operation ndb_dd table becomes regular ndb
Submitted: 28 Nov 2006 19:55 Modified: 27 Apr 2007 14:20
Reporter: Serge Kozlov
Status: Closed
Category:Server: ClusterDD Severity:S2 (Serious)
Version:5.1.14-bk OS:Linux (Linux FC4)
Assigned to: Martin Skold Target Version:

[28 Nov 2006 19:55] Serge Kozlov
Description:
Change of column specification removes tablespace from ndb table.

How to repeat:
mysql> use test;
Database changed
mysql> create logfile group lg1 add undofile 'undofile.dat' initial_size 20M un
do_buffer_size 1M engine=ndb;
Query OK, 0 rows affected (9.73 sec)

mysql> create tablespace ts1 add datafile 'datafile.dat' use logfile group lg1
initial_size 10M engine=ndb;
Query OK, 0 rows affected (5.52 sec)

mysql> create table t1 (a int not null primary key, b varchar(500)) tablespace
ts1 storage disk engine=ndb;
Query OK, 0 rows affected (3.79 sec)

mysql> show create table t1;
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------------+
| Table | Create Table
                              |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) NOT NULL,
  `b` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`a`)
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=lati
n1 |
+-------+-----------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------------+
1 row in set (0.05 sec)

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

mysql>
[28 Nov 2006 21:15] Serge Kozlov
before last "show create table t1" missed following line:

mysql> alter table t1 change b b varchar(400);
Query OK, 0 rows affected (2.74 sec)
Records: 0  Duplicates: 0  Warnings: 0
[19 Dec 2006 15:54] 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/17165

ChangeSet@1.2367, 2006-12-19 15:53:46+01:00, mskold@mysql.com +7 -0
  bug#24667  After ALTER TABLE operation ndb_dd table becomes regular ndb: copy tablespace
from old table in copying alter table
[19 Dec 2006 23:21] 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/17187

ChangeSet@1.2368, 2006-12-19 23:20:43+01:00, mskold@mysql.com +10 -0
  bug#24667  After ALTER TABLE operation ndb_dd table becomes regular ndb: ALTER TABLE
must specify STORAGE explicitely to change it, + post review changes
[20 Dec 2006 15:15] 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/17216

ChangeSet@1.2373, 2006-12-20 15:15:26+01:00, mskold@mysql.com +6 -0
  ndb_dd_ddl.test, ndb_dd_ddl.result, ha_ndbcluster.cc:
    bug#24667  After ALTER TABLE operation ndb_dd table becomes regular ndb: disallowed
TABLESPACE declaration for STORAGE MEMORY
  Makefile:
    Rename: storage/ndb/ndbapi-examples/mgmapi_logevent_dual/Makefile ->
storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
  mgmapi_logevent2.cpp:
    Rename: storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp ->
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent2.cpp
  Makefile:
    Rename mgmapi_logevent_dual to mgmapi_logevent2
  mgmapi_logevent2.cpp:
    Rename: storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent2.cpp ->
storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2.cpp
[2 Jan 2007 10:06] 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/17507

ChangeSet@1.2371, 2007-01-02 10:05:58+01:00, mskold@mysql.com +1 -0
  bug#24667  After ALTER TABLE operation ndb_dd table becomes regular ndb: removed use of
environment variable NDB_DEFAULT_DISK
[24 Jan 2007 2:55] Tomas Ulin
pushed to 5.1.15
[25 Jan 2007 8:28] 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.15 changelog.
[5 Apr 2007 14:05] Hartmut Holzgraefe
This one also only fixed the SHOW CREATE TABLE symptoms,
row attributes in ndb_desc change from ST=DISK to ST=MEMOY

diff of ndb_desc output before and after ALTER TABLE

--- n1  2007-04-05 14:02:52.000000000 +0200
+++ n2  2007-04-05 14:03:41.000000000 +0200
@@ -1,5 +1,5 @@
 -- t1 --
-Version: 7
+Version: 16777221
 Fragment type: 5
 K Value: 6
 Min load factor: 78
@@ -7,13 +7,13 @@
 Temporary table: no
 Number of attributes: 2
 Number of primary keys: 1
-Length of frm data: 254
+Length of frm data: 256
 Row Checksum: 1
 Row GCI: 1
 TableStatus: Retrieved
 -- Attributes -- 
 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-b Longvarchar(500;latin1_swedish_ci) NULL AT=FIXED ST=DISK
+b Longvarchar(400;latin1_swedish_ci) NULL AT=MEDIUM_VAR ST=MEMORY
[26 Apr 2007 12:56] 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/25489

ChangeSet@1.2462, 2007-04-26 13:12:43+02:00, tomas@whalegate.ndb.mysql.com +1 -0
  Bug #24667  	After ALTER TABLE operation ndb_dd table becomes regular ndb
[26 Apr 2007 13:35] Bugs System
Pushed into 5.1.18-beta
[27 Apr 2007 14:20] 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 fix in 5.1.18 changelog, noted that this replaces incomplete fix made in
5.1.15.
[28 Apr 2007 21:35] Bugs System
Pushed into 5.1.18-beta