Bug #40548 Build break on SunStudio, Sparc & X86
Submitted: 6 Nov 2008 12:43 Modified: 7 Nov 2008 18:21
Reporter: Ole John Aske Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.1.29-ndb-6.4.0 OS:Solaris
Assigned to: Ole John Aske CPU Architecture:Any

[6 Nov 2008 12:43] Ole John Aske
Description:
Build on SunStudio12 has been broken by usage of non standard C++ features.
These problems are also reported by Pushbuild2 on the Telco-6.4 branch:

----------------

2.
=== modified file 'storage/ndb/include/ndbinfo.h'
--- storage/ndb/include/ndbinfo.h       2008-10-08 10:52:32 +0000
+++ storage/ndb/include/ndbinfo.h       2008-10-15 11:52:11 +0000
@@ -39,7 +39,7 @@

 struct ndbinfo_table {
   NDBINFO_TABLE_MEMBERS
-  struct ndbinfo_column col[];
+  struct ndbinfo_column col[0];
 };

Arrays with 'flexible size' is only allowed as function argument. It was not possible to
get this through the compiler without defining it as '[0]'. However, this is non-standard C++ code and requires the addition of '-features=zla' to compile.

3. opt_ndb_connectstring and opt_ndb_constrbuf_len 'defined twice' when linking mysqld:
   Handling of OPT_NDB_MGMD , OPT_NODED_ID and OPT_NDB_CONNECTSTRING
   was added to ndb_opts.c. This duplicates code - and declaration - found in mysqld.cc.

A fix to this problem may be to declare these variables extern in mysqld.cc. However, I am not sure if this may break other code (At least it compiles & links)

=== modified file 'sql/mysqld.cc'
--- sql/mysqld.cc       2008-10-03 12:02:23 +0000
+++ sql/mysqld.cc       2008-10-16 12:12:28 +0000
@@ -412,9 +412,11 @@

 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 const char *opt_ndbcluster_connectstring= 0;
-const char *opt_ndb_connectstring= 0;
+extern const char *opt_ndb_connectstring;
 char opt_ndb_constrbuf[1024]= {0};
-unsigned opt_ndb_constrbuf_len= 0;
+extern unsigned opt_ndb_constrbuf_len;
 my_bool        opt_ndb_shm;
 ulong opt_ndb_cache_check_time, opt_ndb_wait_connected;
 ulong opt_ndb_cluster_connection_pool;

4: Syntax error compiling APIService.cpp - explicit call of SocketServer::Session c'tor not allowed:

=== modified file 'storage/ndb/src/cw/cpcd/APIService.cpp'
--- storage/ndb/src/cw/cpcd/APIService.cpp      2008-09-17 13:23:21 +0000
+++ storage/ndb/src/cw/cpcd/APIService.cpp      2008-10-15 13:47:41 +0000
@@ -151,8 +151,8 @@
 }

 CPCDAPISession::CPCDAPISession(FILE * f, CPCD & cpcd)
-  : SocketServer::Session::Session(my_socket_create_invalid())
+ : SocketServer::Session(my_socket_create_invalid())
 ,  m_cpcd(cpcd)
 {
   m_input = new FileInputStream(f);
   m_parser = new Parser<CPCDAPISession>(commands, *m_input, true, true, true);

How to repeat:
Try to compile the code, Look pushbuild2 compile logs. for 'Sol10'

Suggested fix:
See above diff for the involved files
[7 Nov 2008 8:52] 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/58148

3054 Olav Sandstaa	2008-11-07
      Fix on bug#40548, Telco 6.4, SunStudio build break
[7 Nov 2008 10:32] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:ole.john.aske@sun.com-20081107085222-lwe54i5760turhal) (version source revid:ole.john.aske@sun.com-20081107085222-lwe54i5760turhal) (pib:5)
[7 Nov 2008 18:21] Jon Stephens
This effects no release versions and carries with it no user-facing changes; closed without further action.