Bug #25880 Adding new column to ndb_dd table moves data for non-indexed fields in memory
Submitted: 26 Jan 2007 20:13 Modified: 23 Mar 2007 10:34
Reporter: Serge Kozlov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S2 (Serious)
Version:5.1.15-bk OS:Linux (Linux FC4 64bit)
Assigned to: justin he CPU Architecture:Any

[26 Jan 2007 20:13] Serge Kozlov
Description:
Adding new column to ndb_dd table moves data from tablespace in memory.

How to repeat:
1. Create ndb_dd table and put one row:

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

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

mysql> use test;
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.73 sec)

mysql> insert into t1(a,b) values(1,'a');
Query OK, 1 row affected (0.02 sec)

2. Make sure that tha data of column 'b' is on disk:

$ ./builds/bin/ndb_select_all --disk -d test t1
a       b       DISK_REF
1       a       [ m_file_no: 0 m_page: 2 m_page_idx: 0 ]
1 rows returned

NDBT_ProgramExit: 0 - OK

3. Add new column to table:

mysql> alter table t1 add column c varchar(1) default 'c';
Query OK, 1 row affected (2.87 sec)
Records: 1  Duplicates: 0  Warnings: 0

4. Repeat step 2 (now data for column b and c is in memory):

$ ./builds/bin/ndb_select_all --disk -d test t1
a       b       c
1       a       c
1 rows returned

NDBT_ProgramExit: 0 - OK
[5 Mar 2007 10:38] 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/21113

ChangeSet@1.2440, 2007-03-05 13:30:28+08:00, Justin.He@dev3-240.dev.cn.tlan +1 -0
  BUG#25880, Adding new column to ndb_dd table moves data for non_indexed fields in memory
  correct the inconsistency between columns' storage type with table's storage_media & tablespace
[23 Mar 2007 10:34] 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.17 changelog.