Bug #30276 table with a dynamic attribute and ROW_FORMAT=FIXED should warn DYNAMIC anyhow
Submitted: 7 Aug 2007 14:59 Modified: 7 Oct 2009 10:14
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Linux
Assigned to: Martin Skold CPU Architecture:Any

[7 Aug 2007 14:59] Jonathan Miller
Description:
- if one declares a table with a dynamic attribute and then says
ROW_FORMAT=FIXED, one will get a warning and table with be DYNAMIC anyhow,
but any unspecified columns (with column_format) will default to FIXED.

+ CREATE TABLE t1
+ (pk1 INT NOT NULL PRIMARY KEY, b INT COLUMN_FORMAT DYNAMIC)ROW_FORMAT=FIXED
+ ENGINE=NDB;
+ -- t1 --
+ Version: 6
+ Fragment type: 5
+ K Value: 6
+ Min load factor: 78
+ Max load factor: 80
+ Temporary table: no
+ Number of attributes: 2
+ Number of primary keys: 1
+ Length of frm data: 256
+ Row Checksum: 1
+ Row GCI: 1
+ SingleUserMode: 0
+ ForceVarPart: 0
+ TableStatus: Retrieved
+ -- Attributes --
+ pk1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
+ b Int NULL AT=FIXED ST=MEMORY DYNAMIC
+
+ -- Indexes --
+ PRIMARY KEY(pk1) - UniqueHashIndex
+ PRIMARY(pk1) - OrderedIndex

How to repeat:
See above
[8 Aug 2007 12:03] 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/32247

ChangeSet@1.2607, 2007-08-08 14:02:52+02:00, mskold@mysql.com +13 -0
  Various bug fixes (bug#30276).
  Added support for new syntax:
  ALTER TABLE ... [ONLINE [ONLY] | OFFLINE [ONLY]];
  CREATE INDEX ... [ONLINE [ONLY] | OFFLINE [ONLY]];
  DROP INDEX ... [ONLINE [ONLY] | OFFLINE [ONLY]];
[8 Aug 2007 17:36] 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/32266

ChangeSet@1.2563, 2007-08-08 11:35:51-06:00, malff@weblab.(none) +1 -0
  Bug#30276 (table with a dynamic attribute and ROW_FORMAT=FIXED should warn
  DYNAMIC anyhow)
  
  NOT A FULL PATCH -- Syntax change proposal, for discussion
  
  This patch introduces an extended 'ONLINE' syntax, for the following
  statements:
  - ALTER ONLINE TABLE
  - CREATE ONLINE INDEX
  - DROP ONLINE INDEX
[7 Oct 2007 14:44] Jon Stephens
Here's what I get when I repeat Jeb's example using a telco-6.2.7 built 2007-10-06:

flundra:/usr/local/mysql/bin # ./ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @127.0.0.1  (mysql-5.1.22 ndb-6.2.7, Nodegroup: 0, Master)
id=2    @127.0.0.1  (mysql-5.1.22 ndb-6.2.7, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=3    @127.0.0.1  (mysql-5.1.22 ndb-6.2.7)

[mysqld(API)]   2 node(s)
id=4    @127.0.0.1  (mysql-5.1.22 ndb-6.2.7)
id=5 (not connected, accepting connect from any host)

flundra:/usr/local/mysql/bin # ./mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.22-ndb-6.2.7-debug Source distribution

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

mysql> use ndb;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> CREATE TABLE n1 (
    ->     pk1 INT NOT NULL PRIMARY KEY,
    ->     b INT COLUMN_FORMAT DYNAMIC
    -> )   ROW_FORMAT=FIXED
    ->     ENGINE=NDB;
Query OK, 0 rows affected, 1 warning (1.92 sec)

mysql> show warnings;
+---------+------+--------------------------------------------------------+
| Level   | Code | Message                                                |
+---------+------+--------------------------------------------------------+
| Warning | 1475 | Row format FIXED incompatible with dynamic attribute b |
+---------+------+--------------------------------------------------------+
1 row in set (0.00 sec)

mysql> exit
Bye

flundra:/usr/local/mysql/bin # ./ndb_desc -d ndb n1
-- n1 --
Version: 2
Fragment type: 5
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 256
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 0
TableStatus: Retrieved
-- Attributes --
pk1 Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
b Int NULL AT=FIXED ST=MEMORY DYNAMIC

-- Indexes --
PRIMARY KEY(pk1) - UniqueHashIndex
PRIMARY(pk1) - OrderedIndex

NDBT_ProgramExit: 0 - OK

This looks to me like exactly the same behaviour that Jeb reported.

I discussed the patches shown above with Martin on 2007-10-05; he informs me that the ONLY keyword addition was not pushed into the tree.

So what is it exactly that I'm supposed to be documenting here?

Thanks!
[23 Oct 2008 3:30] Martin Skold
Re-open, not correct behavior.
[7 Oct 2009 7:38] Martin Skold
The warning is new, before one did not get the warning in this specific case.
[7 Oct 2009 10:14] Jon Stephens
Documented bugfix in the NDB-6.2.5 and 6.3.2 changelogs as follows:

        When creating an NDB table with a column that has COLUMN_FORMAT
        = DYNAMIC, but using ROW_FORMAT=FIXED, the table is DYNAMIC, but
        any columns for which the row format is unspecified default to
        FIXED. Now in such cases, the server issues the warning Row
        format FIXED incompatible with dynamic attribute column_name.

Closed.