Bug #55802 Unconvenient default settings for InitialLogFileGroup, InitialTablespace
Submitted: 6 Aug 2010 13:45 Modified: 6 Aug 2010 14:02
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-5.1-telco-7.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: all?, mysql-cluster-7.1

[6 Aug 2010 13:45] Hartmut Holzgraefe
Description:
Looking at storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
the default log group and tablespace names are "DEFAULT-LG" and
"DEFAULT-TS" with a dash. 

The manual [1] says "DEFAULT_LG" and "DEFAULT_TS" (with an underscore 
instead of a dash though), and these forms have the advantage that
they can be used without having to quote them with backticks in
SQL statements (e.g `DEFAULT-LG`, as otherwise the dash would 
be interpreted as a minus)

[1] http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-ndbd-definition.html#id3360980

How to repeat:
Set up an initial log group and table space using config.ini,
without specifying log group or table space names:

  InitialLogFileGroup = undo_buffer_size=128M; undo1.log:32M;
  InitialTablespace = data1.dat: 256M;

Start the cluster and try to create a table using the
default table space name 'DEFAULT-TS':

  CREATE TABLE t1 
  (     
    id INT PRIMARY KEY
  ) 
  TABLESPACE DEFAULT-TS STORAGE DISK     
  ENGINE NDBCLUSTER
  ;

Without putting DEFAULT-TS into backticks this will
fail with:
 
  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 'DEFAULT-TS STORAGE DISK     ENGINE NDBCLUSTER' at line 1

Suggested fix:
Change defaults to names using underscores:

=== modified file 'storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp'
--- storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2010-06-24 21:42:03 +0000
+++ storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2010-08-06 13:43:27 +0000
@@ -338,7 +338,7 @@
   {
     key = "undo_buffer_size=";
     group.size = 64*1024*1024;
-    group.name = "DEFAULT-LG";
+    group.name = "DEFAULT_LG";
     group.type = type;
     filetype = DictTabInfo::Undofile;
   }
@@ -346,7 +346,7 @@
   {
     key = "extent_size=";
     group.size = 1024*1024;
-    group.name = "DEFAULT-TS";
+    group.name = "DEFAULT_TS";
     group.type = type;
     filetype = DictTabInfo::Datafile;
   }