Bug #46720 Behaviour of STORAGE DISK keywords does not follow manual
Submitted: 14 Aug 2009 11:47 Modified: 16 Aug 2009 5:23
Reporter: Andrew Chapman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.1.37 OS:Any
Assigned to: CPU Architecture:Any

[14 Aug 2009 11:47] Andrew Chapman
Description:
The manual says that the STORAGE keyword in table syntax is ignored except for the nbd engine. This doesn't happen.

It would be very useful if this worked properly as it would mean you can use the same create script for an InnoDB development database and a live ndb clustered database.

Possibly connected: MySQL Query Browser 1.2.17 doesn't not recognise DISK or MEMORY as a keyword.

How to repeat:
In command line or query browser

CREATE  TABLE IF NOT EXISTS `example`.`images` (
  `image_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
  `image_blob` MEDIUMBLOB NULL STORAGE DISK
)
TABLESPACE blah
ENGINE = InnoDB;

OR

CREATE  TABLE IF NOT EXISTS `example`.`images` (
  `image_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
  `image_blob` MEDIUMBLOB NULL STORAGE DISK
)
TABLESPACE blah
ENGINE = ndb;

Give the same result:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STORAGE DISK
)
TABLESPACE blah
ENGINE = innodb' at line 3
[14 Aug 2009 12:43] Andrew Chapman
Slightly overenthusiastic on the submit button there.
The error with ENGINE=ndb is of course

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STORAGE DISK
)
TABLESPACE blah
ENGINE = ndb' at line 3
[14 Aug 2009 16:45] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Our manual says at http://dev.mysql.com/doc/refman/5.1/en/create-table.html: "For NDB tables, beginning with MySQL Cluster NDB 6.2.5 and MySQL Cluster NDB 6.3.2, it is also possible to specify whether the column is stored on disk or in memory by using a STORAGE clause. "

You are not using special cluster distribution, so it is expected what this feature is not included. Please use one of Cluster packages available at http://dev.mysql.com/downloads/cluster/7.0.html
[14 Aug 2009 17:22] Andrew Chapman
I took the end of the section you quoted:

"The STORAGE clause has no effect on tables using storage engines other than NDB."

to mean that the STORAGE clause had no effect (i.e. was ignored) in the same way that foreign key constraints are ignored by NDB.

If it's not a bug, it would be a very useful feature if this behaviour (i.e. ignoring rather than throwing an error) was implemented.
[16 Aug 2009 5:23] Sveta Smirnova
Thank you for the feedback.

> If it's not a bug, it would be a very useful feature if this behaviour (i.e. ignoring
rather than throwing an error) was implemented.

This feature is implemented in current MySQL Cluster NDB versions. You use MySQL Community or MySQL Enterprise version. This feature doesn't make sense for these versions as they are not supposed to be production servers for MySQL Cluster installation. If you need this feature please switch to MySQL Cluster NDB.