Bug #58034 Build of generic sources fails with freebsd 8.1 and ndbcluster engine
Submitted: 7 Nov 2010 4:57 Modified: 30 Nov 2010 12:37
Reporter: Robert Du Gaue Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql-5.1-telco-7.1 OS:FreeBSD (8.1)
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: Contribution mysql-cluster-gpl-7.1.8

[7 Nov 2010 4:57] Robert Du Gaue
Description:
Appears some mis-defined #if Win32 are causing build to fail

g++ -DHAVE_CONFIG_H -DNDEBUG   -I. -I../../../../../include  -I. -I../../../../../include  -I../../../../../storage/ndb/include -I../../../../../include  -I../../../../../mysys -I../../../../../storage/ndb/include  -I../../../../../storage/ndb/include/util  -I../../../../../storage/ndb/include/portlib  -I../../../../../storage/ndb/include/logger     -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -DMYSQLD_NET_RETRY_COUNT=1000000 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
mv -f .deps/main.Tpo .deps/main.Po
g++ -DHAVE_CONFIG_H -DNDEBUG   -I. -I../../../../../include  -I. -I../../../../../include  -I../../../../../storage/ndb/include -I../../../../../include  -I../../../../../mysys -I../../../../../storage/ndb/include  -I../../../../../storage/ndb/include/util  -I../../../../../storage/ndb/include/portlib  -I../../../../../storage/ndb/include/logger     -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -DMYSQLD_NET_RETRY_COUNT=1000000 -MT CPCD.o -MD -MP -MF .deps/CPCD.Tpo -c -o CPCD.o CPCD.cpp
mv -f .deps/CPCD.Tpo .deps/CPCD.Po
g++ -DHAVE_CONFIG_H -DNDEBUG   -I. -I../../../../../include  -I. -I../../../../../include  -I../../../../../storage/ndb/include -I../../../../../include  -I../../../../../mysys -I../../../../../storage/ndb/include  -I../../../../../storage/ndb/include/util  -I../../../../../storage/ndb/include/portlib  -I../../../../../storage/ndb/include/logger     -O3    -fno-implicit-templates -fno-exceptions -fno-rtti -DMYSQLD_NET_RETRY_COUNT=1000000 -MT Process.o -MD -MP -MF .deps/Process.Tpo -c -o Process.o Process.cpp
Process.cpp: In member function 'void CPCD::Process::do_exec()':
Process.cpp:408: error: 'S_IRUSR' was not declared in this scope
Process.cpp:408: error: 'S_IWUSR' was not declared in this scope
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8/storage/ndb/src/cw/cpcd.
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8/storage/ndb/src/cw.
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8/storage/ndb/src.
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8/storage/ndb.
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8/storage.
*** Error code 1

Stop in /root/mysql-cluster-gpl-7.1.8.

How to repeat:
Downloaded version mysql-cluster-gpl-7.1.8.

Extracted.

./configure --with-plugins=all --with-system-type=freebsd --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static

make all
[7 Nov 2010 20:32] Robert Du Gaue
Fixed by editing Process.cpp from:

#include <ndb_global.h>

#ifdef _WIN32
#include <process.h>
#include <sys/stat.h>
#include <io.h>
#endif

to:

#include <ndb_global.h>
#include <sys/stat.h>

#ifdef _WIN32
#include <process.h>
#include <io.h>
#endif
[9 Nov 2010 14:26] Magnus Blåudd
Suggested patch is OK to workaround compile problem.
[30 Nov 2010 7:49] 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/125446
[30 Nov 2010 9:47] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.21 (revid:magnus.blaudd@oracle.com-20101130082521-wtgg5rv1tszos2z5) (version source revid:magnus.blaudd@oracle.com-20101130074755-z0wg3dkk5oklnhan) (merge vers: 5.1.51-ndb-7.0.21) (pib:23)
[30 Nov 2010 9:59] Magnus Blåudd
Pushed to 7.0.21 and 7.1.10
[30 Nov 2010 12:37] Jon Stephens
Documented in the NDB-7.0.21 and 7.1.10 changelogs as follows:

        MySQL Cluster failed to compile correctly on FreeBSD 8.1 due to
        misplaced #include statements.

Closed.