Bug #62858 CREATE LOGFILE GROUP / CREATE TABLESPACE accept only bytes as unit
Submitted: 21 Oct 2011 9:59 Modified: 7 Apr 2014 9:05
Reporter: Rene' Cannao' Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.5.15-ndb-7.2.1 OS:Linux
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: disk data, log file, ndb

[21 Oct 2011 9:59] Rene' Cannao'
Description:
CREATE LOGFILE GROUP and CREATE TABLESPACE accept only bytes as unit .
Doesn't accept M or G as specified in http://dev.mysql.com/doc/refman/5.5/en/create-logfile-group.html :
"You may optionally follow either or both of these with a one-letter abbreviation for an order of magnitude, similar to those used in my.cnf. Generally, this is one of the letters M (for megabytes) or G (for gigabytes)."
and http://dev.mysql.com/doc/refman/5.5/en/create-tablespace.html :
"you may optionally follow the number with a one-letter abbreviation for an order of magnitude, similar to those used in my.cnf. Generally, this is one of the letters M (for megabytes) or G (for gigabytes)."

Probably also ALTER LOGFILE GROUP and ALTER TABLESPACE are affected (didn't had the time to try).

This bug is specific to 7.2.1 . Worked fine on 7.2.0 .

Binary used: mysql-cluster-gpl-7.2.1-linux2.6-x86_64.tar.gz

How to repeat:
mysql> CREATE LOGFILE GROUP lg_1 ADD UNDOFILE 'undo_1.log' INITIAL_SIZE 128M UNDO_BUFFER_SIZE 8M ENGINE NDBCLUSTER;
ERROR 1064 (42000): 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 '128M UNDO_BUFFER_SIZE 8M ENGINE NDBCLUSTER' at line 1
mysql> CREATE LOGFILE GROUP lg_1 ADD UNDOFILE 'undo_1.log' INITIAL_SIZE 134217728 UNDO_BUFFER_SIZE 8M ENGINE NDBCLUSTER;
ERROR 1064 (42000): 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 '8M ENGINE NDBCLUSTER' at line 1
mysql> CREATE LOGFILE GROUP lg_1 ADD UNDOFILE 'undo_1.log' INITIAL_SIZE 134217728 UNDO_BUFFER_SIZE 8388608 ENGINE NDBCLUSTER;
Query OK, 0 rows affected (1.69 sec)

mysql> CREATE TABLESPACE ts_1 ADD DATAFILE 'data_1.dat' USE LOGFILE GROUP lg_1 INITIAL_SIZE 1G ENGINE NDBCLUSTER;
ERROR 1064 (42000): 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 '1G ENGINE NDBCLUSTER' at line 1
mysql> CREATE TABLESPACE ts_1 ADD DATAFILE 'data_1.dat' USE LOGFILE GROUP lg_1 INITIAL_SIZE 1073741824 ENGINE NDBCLUSTER;
Query OK, 0 rows affected (10.42 sec)

Suggested fix:
Allow to specify units other than bytes.
[21 Oct 2011 10:41] Rene' Cannao'
ALTER TABLESPACE fails too:

mysql> ALTER TABLESPACE ts_1 ADD DATAFILE 'data_2.dat' INITIAL_SIZE 2G ENGINE NDBCLUSTER;
ERROR 1064 (42000): 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 '2G ENGINE NDBCLUSTER' at line 1
mysql> ALTER TABLESPACE ts_1 ADD DATAFILE 'data_2.dat' INITIAL_SIZE 2147483648 ENGINE NDBCLUSTER;
Query OK, 0 rows affected (24.28 sec)
[11 Jan 2013 21:00] MySQL Verification Team
Thank you for the report.

Verified as described.
[7 Apr 2014 9:05] Magnus Blåudd
Fixed in 7.2.14 and 7.3.3
[7 Apr 2014 9:05] Magnus Blåudd
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/