summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tulin@build.mysql.com>2004-05-10 17:40:57 +0200
committerunknown <tulin@build.mysql.com>2004-05-10 17:40:57 +0200
commit806a06fdbdc19edd596a0b4c5ef54b1c546f5b20 (patch)
tree808e79a60bd6ef6a37714172df3a6b1f8c06b1b3
parent572899e0362f08755a82603a36a27628fb88a5d0 (diff)
parent5edb391973f235890e3e6eb771e7d0fa3102b24a (diff)
downloadmariadb-git-806a06fdbdc19edd596a0b4c5ef54b1c546f5b20.tar.gz
merge resolve
extra/perror.c: Auto merged ndb/include/debugger/SignalLoggerManager.hpp: Auto merged ndb/include/ndb_version.h: Auto merged ndb/src/common/portlib/unix/NdbMem.c: Auto merged ndb/src/common/portlib/unix/NdbThread.c: Auto merged ndb/src/common/util/Parser.cpp: Auto merged ndb/src/common/util/getarg.c: Auto merged ndb/src/common/util/version.c: Auto merged ndb/src/kernel/blocks/backup/restore/Restore.cpp: Auto merged ndb/src/kernel/blocks/dbutil/DbUtil.cpp: Auto merged ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: Auto merged ndb/src/kernel/ndb-main/Main.cpp: Auto merged ndb/src/mgmapi/test/keso.c: Auto merged ndb/src/mgmclient/test_cpcd/test_cpcd.cpp: Auto merged BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--extra/Makefile.am2
-rw-r--r--extra/perror.c24
-rw-r--r--ndb/Defs.mk23
-rw-r--r--ndb/Epilogue.mk2
-rw-r--r--ndb/examples/ndbapi_async_example/ndbapi_async.cpp12
-rw-r--r--ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp12
-rw-r--r--ndb/include/debugger/SignalLoggerManager.hpp1
-rw-r--r--ndb/include/kernel/LogLevel.hpp3
-rw-r--r--ndb/include/kernel/signaldata/BuildIndx.hpp1
-rw-r--r--ndb/include/kernel/signaldata/SignalData.hpp4
-rw-r--r--ndb/include/kernel/signaldata/SignalDataPrint.hpp2
-rw-r--r--ndb/include/logger/FileLogHandler.hpp4
-rw-r--r--ndb/include/logger/LogHandler.hpp1
-rw-r--r--ndb/include/logger/Logger.hpp2
-rw-r--r--ndb/include/mgmcommon/MgmtErrorReporter.hpp2
-rw-r--r--ndb/include/ndb_global.h72
-rw-r--r--ndb/include/ndb_types.h3
-rw-r--r--ndb/include/ndb_version.h3
-rw-r--r--ndb/include/ndbapi/Ndb.hpp6
-rw-r--r--ndb/include/ndbapi/NdbConnection.hpp3
-rw-r--r--ndb/include/ndbapi/NdbError.hpp58
-rw-r--r--ndb/include/ndbapi/NdbEventOperation.hpp6
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp17
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp17
-rw-r--r--ndb/include/ndbapi/NdbReceiver.hpp2
-rw-r--r--ndb/include/ndbapi/NdbScanOperation.hpp19
-rw-r--r--ndb/include/ndbapi/NdbSchemaOp.hpp4
-rw-r--r--ndb/include/ndbapi/ndberror.h98
-rw-r--r--ndb/include/newtonapi/dba.h4
-rw-r--r--ndb/include/newtonapi/defs/pcn_types.h3
-rw-r--r--ndb/include/portlib/NdbConstant.hpp28
-rw-r--r--ndb/include/portlib/NdbMem.h3
-rw-r--r--ndb/include/portlib/NdbTCP.h37
-rw-r--r--ndb/include/portlib/NdbUnistd.h39
-rw-r--r--ndb/include/transporter/TransporterDefinitions.hpp2
-rw-r--r--ndb/include/util/BaseString.hpp4
-rw-r--r--ndb/include/util/Bitmask.hpp5
-rw-r--r--ndb/include/util/File.hpp17
-rw-r--r--ndb/include/util/InputStream.hpp2
-rw-r--r--ndb/include/util/NdbAutoPtr.hpp2
-rw-r--r--ndb/include/util/NdbString.h48
-rw-r--r--ndb/include/util/OutputStream.hpp2
-rw-r--r--ndb/include/util/Properties.hpp5
-rw-r--r--ndb/include/util/SimpleProperties.hpp3
-rw-r--r--ndb/include/util/UtilBuffer.hpp4
-rw-r--r--ndb/include/util/Vector.hpp3
-rw-r--r--ndb/include/util/getarg.h2
-rw-r--r--ndb/include/util/socket_io.h3
-rw-r--r--ndb/include/util/uucode.h2
-rw-r--r--ndb/src/client/odbc/common/Ctx.cpp6
-rw-r--r--ndb/src/client/odbc/common/DataField.cpp8
-rw-r--r--ndb/src/client/odbc/common/DataType.cpp1
-rw-r--r--ndb/src/client/odbc/common/OdbcData.cpp4
-rw-r--r--ndb/src/common/debugger/DebuggerNames.cpp6
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp6
-rw-r--r--ndb/src/common/debugger/SignalLoggerManager.cpp8
-rw-r--r--ndb/src/common/debugger/signaldata/CloseComReqConf.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/ContinueB.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp1
-rw-r--r--ndb/src/common/debugger/signaldata/SystemError.cpp1
-rw-r--r--ndb/src/common/editline/editline_internal.h5
-rw-r--r--ndb/src/common/editline/editline_win32.c3
-rw-r--r--ndb/src/common/editline/test/testit.c6
-rw-r--r--ndb/src/common/logger/FileLogHandler.cpp18
-rw-r--r--ndb/src/common/logger/LogHandler.cpp3
-rw-r--r--ndb/src/common/logger/LogHandlerList.cpp2
-rw-r--r--ndb/src/common/logger/Logger.cpp8
-rw-r--r--ndb/src/common/logger/SysLogHandler.cpp1
-rw-r--r--ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp5
-rw-r--r--ndb/src/common/logger/loggertest/LoggerUnitTest.cpp4
-rw-r--r--ndb/src/common/mgmcommon/Config.hpp2
-rw-r--r--ndb/src/common/mgmcommon/ConfigRetriever.cpp10
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.cpp7
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.hpp3
-rw-r--r--ndb/src/common/mgmcommon/LocalConfig.hpp4
-rw-r--r--ndb/src/common/mgmcommon/NdbConfig.c3
-rw-r--r--ndb/src/common/mgmcommon/printConfig/printConfig.cpp3
-rw-r--r--ndb/src/common/portlib/memtest/memtest.c3
-rw-r--r--ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp10
-rw-r--r--ndb/src/common/portlib/mmstest/mmslist.cpp4
-rw-r--r--ndb/src/common/portlib/mmstest/mmstest.cpp4
-rw-r--r--ndb/src/common/portlib/ose/NdbCondition.c1
-rw-r--r--ndb/src/common/portlib/ose/NdbMem.c2
-rw-r--r--ndb/src/common/portlib/ose/NdbMutex.c1
-rw-r--r--ndb/src/common/portlib/ose/NdbOut.cpp7
-rw-r--r--ndb/src/common/portlib/ose/NdbThread.c1
-rw-r--r--ndb/src/common/portlib/test/NdbPortLibTest.cpp7
-rw-r--r--ndb/src/common/portlib/unix/NdbCondition.c12
-rw-r--r--ndb/src/common/portlib/unix/NdbDaemon.c22
-rw-r--r--ndb/src/common/portlib/unix/NdbEnv.c6
-rw-r--r--ndb/src/common/portlib/unix/NdbMem.c9
-rw-r--r--ndb/src/common/portlib/unix/NdbMutex.c7
-rw-r--r--ndb/src/common/portlib/unix/NdbThread.c10
-rw-r--r--ndb/src/common/portlib/win32/NdbCondition.c1
-rw-r--r--ndb/src/common/portlib/win32/NdbMem.c2
-rw-r--r--ndb/src/common/portlib/win32/NdbMutex.c1
-rw-r--r--ndb/src/common/portlib/win32/NdbThread.c1
-rw-r--r--ndb/src/common/transporter/OSE_Receiver.cpp1
-rw-r--r--ndb/src/common/transporter/OSE_Transporter.cpp2
-rw-r--r--ndb/src/common/transporter/Packer.cpp4
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.cpp9
-rw-r--r--ndb/src/common/transporter/SHM_Buffer.hpp5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.cpp5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.unix.cpp5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.win32.cpp4
-rw-r--r--ndb/src/common/transporter/SendBuffer.hpp3
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.cpp6
-rw-r--r--ndb/src/common/transporter/Transporter.cpp1
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp5
-rw-r--r--ndb/src/common/transporter/basictest/basicTransporterTest.cpp5
-rw-r--r--ndb/src/common/transporter/buddy.cpp3
-rw-r--r--ndb/src/common/transporter/buddy.hpp3
-rw-r--r--ndb/src/common/transporter/failoverSCI/failoverSCI.cpp9
-rw-r--r--ndb/src/common/transporter/perftest/perfTransporterTest.cpp5
-rw-r--r--ndb/src/common/transporter/priotest/prioTransporterTest.cpp4
-rw-r--r--ndb/src/common/util/Base64.cpp3
-rw-r--r--ndb/src/common/util/BaseString.cpp8
-rw-r--r--ndb/src/common/util/File.cpp46
-rw-r--r--ndb/src/common/util/InputStream.cpp4
-rw-r--r--ndb/src/common/util/Makefile10
-rw-r--r--ndb/src/common/util/NdbErrHnd.cpp1
-rw-r--r--ndb/src/common/util/NdbOut.cpp8
-rw-r--r--ndb/src/common/util/NdbSqlUtil.cpp1
-rw-r--r--ndb/src/common/util/OutputStream.cpp3
-rw-r--r--ndb/src/common/util/Parser.cpp5
-rw-r--r--ndb/src/common/util/Properties.cpp7
-rw-r--r--ndb/src/common/util/SimpleProperties.cpp4
-rw-r--r--ndb/src/common/util/SocketServer.cpp6
-rw-r--r--ndb/src/common/util/filetest/FileUnitTest.cpp1
-rw-r--r--ndb/src/common/util/getarg.c10
-rw-r--r--ndb/src/common/util/new.cpp3
-rw-r--r--ndb/src/common/util/random.c10
-rw-r--r--ndb/src/common/util/socket_io.cpp6
-rw-r--r--ndb/src/common/util/strdup.c2
-rw-r--r--ndb/src/common/util/strlcat.c7
-rw-r--r--ndb/src/common/util/strlcpy.c5
-rw-r--r--ndb/src/common/util/testProperties/testProperties.cpp3
-rw-r--r--ndb/src/common/util/testSimpleProperties/sp_test.cpp4
-rw-r--r--ndb/src/common/util/uucode.c3
-rw-r--r--ndb/src/common/util/version.c4
-rw-r--r--ndb/src/cw/cpcc-win32/C++/StdAfx.h5
-rw-r--r--ndb/src/cw/cpcd/APIService.cpp1
-rw-r--r--ndb/src/cw/cpcd/CPCD.cpp5
-rw-r--r--ndb/src/cw/cpcd/Monitor.cpp3
-rw-r--r--ndb/src/cw/cpcd/Process.cpp43
-rw-r--r--ndb/src/cw/cpcd/common.hpp2
-rw-r--r--ndb/src/cw/test/socketclient/socketClientTest.cpp3
-rw-r--r--ndb/src/cw/util/ClientInterface.hpp4
-rw-r--r--ndb/src/kernel/blocks/backup/FsBuffer.hpp5
-rw-r--r--ndb/src/kernel/blocks/backup/read.cpp4
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Makefile6
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.cpp2
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.hpp5
-rw-r--r--ndb/src/kernel/blocks/backup/restore/main.cpp1
-rw-r--r--ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp7
-rw-r--r--ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp7
-rw-r--r--ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp7
-rw-r--r--ndb/src/kernel/blocks/dbtux/Dbtux.hpp3
-rw-r--r--ndb/src/kernel/blocks/dbutil/DbUtil.cpp4
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp9
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Filename.cpp6
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Filename.hpp2
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp1
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp1
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp3
-rw-r--r--ndb/src/kernel/error/ErrorReporter.cpp5
-rw-r--r--ndb/src/kernel/error/ErrorReporter.hpp3
-rw-r--r--ndb/src/kernel/ndb-main/Main.cpp4
-rw-r--r--ndb/src/kernel/vm/ArrayPool.hpp4
-rw-r--r--ndb/src/kernel/vm/ClusterConfiguration.cpp5
-rw-r--r--ndb/src/kernel/vm/Configuration.cpp1
-rw-r--r--ndb/src/kernel/vm/DLHashTable.hpp3
-rw-r--r--ndb/src/kernel/vm/DLHashTable2.hpp5
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp3
-rw-r--r--ndb/src/kernel/vm/GlobalData.hpp3
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp4
-rw-r--r--ndb/src/kernel/vm/TransporterCallback.cpp3
-rw-r--r--ndb/src/kernel/vm/VMSignal.hpp7
-rw-r--r--ndb/src/kernel/vm/al_test/arrayListTest.cpp4
-rw-r--r--ndb/src/kernel/vm/al_test/arrayPoolTest.cpp5
-rw-r--r--ndb/src/kernel/vm/al_test/main.cpp4
-rw-r--r--ndb/src/kernel/vm/testCopy/rr.cpp5
-rw-r--r--ndb/src/kernel/vm/testCopy/testCopy.cpp4
-rw-r--r--ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp6
-rw-r--r--ndb/src/kernel/vm/testLongSig/testLongSig.cpp3
-rw-r--r--ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp5
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp8
-rw-r--r--ndb/src/mgmapi/test/keso.c5
-rw-r--r--ndb/src/mgmapi/test/mgmSrvApi.cpp4
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp9
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.hpp4
-rw-r--r--ndb/src/mgmclient/CpcClient.cpp6
-rw-r--r--ndb/src/mgmclient/main.cpp4
-rw-r--r--ndb/src/mgmclient/test_cpcd/test_cpcd.cpp3
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.hpp4
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.hpp1
-rw-r--r--ndb/src/mgmsrv/NodeLogLevel.hpp3
-rw-r--r--ndb/src/mgmsrv/NodeLogLevelList.cpp4
-rw-r--r--ndb/src/mgmsrv/convertStrToInt.cpp4
-rw-r--r--ndb/src/mgmsrv/mkconfig/mkconfig.cpp9
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp8
-rw-r--r--ndb/src/ndbapi/DictCache.cpp2
-rw-r--r--ndb/src/ndbapi/Makefile2
-rw-r--r--ndb/src/ndbapi/Ndb.cpp11
-rw-r--r--ndb/src/ndbapi/NdbConnectionScan.cpp11
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp1
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp1
-rw-r--r--ndb/src/ndbapi/NdbErrorOut.cpp (renamed from ndb/include/portlib/NdbStdio.h)39
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.cpp13
-rw-r--r--ndb/src/ndbapi/NdbOperation.cpp1
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp9
-rw-r--r--ndb/src/ndbapi/NdbPoolImpl.cpp2
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp2
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp25
-rw-r--r--ndb/src/ndbapi/NdbScanReceiver.hpp1
-rw-r--r--ndb/src/ndbapi/NdbUtil.hpp3
-rw-r--r--ndb/src/ndbapi/Ndberror.cpp578
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp1
-rw-r--r--ndb/src/ndbapi/ObjectMap.hpp4
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp5
-rw-r--r--ndb/src/ndbapi/ndberror.c590
-rw-r--r--ndb/src/ndbapi/signal-sender/SignalSender.cpp1
-rw-r--r--ndb/src/ndbapi/signal-sender/SignalSender.hpp2
-rw-r--r--ndb/src/newtonapi/dba_error.cpp4
-rw-r--r--ndb/src/newtonapi/dba_internal.hpp5
-rw-r--r--ndb/src/rep/RepApiService.cpp2
-rw-r--r--ndb/src/rep/RepComponents.hpp1
-rw-r--r--ndb/src/rep/RepMain.cpp3
-rw-r--r--ndb/src/rep/Requestor.cpp1
-rw-r--r--ndb/src/rep/Requestor.hpp3
-rw-r--r--ndb/src/rep/adapters/AppNDB.hpp4
-rw-r--r--ndb/src/rep/adapters/ExtNDB.cpp1
-rw-r--r--ndb/src/rep/adapters/ExtNDB.hpp3
-rw-r--r--ndb/src/rep/dbug_hack.cpp6
-rw-r--r--ndb/src/rep/rep_version.hpp2
-rw-r--r--ndb/src/rep/repapi/repapi.cpp7
-rw-r--r--ndb/src/rep/state/Interval.cpp2
-rw-r--r--ndb/src/rep/storage/GCIBuffer.cpp3
-rw-r--r--ndb/src/rep/storage/GCIBuffer.hpp2
-rw-r--r--ndb/src/rep/storage/GCIContainer.hpp1
-rw-r--r--ndb/src/rep/storage/LogRecord.hpp3
-rw-r--r--ndb/src/rep/storage/NodeGroupInfo.hpp2
-rw-r--r--ndb/src/rep/transfer/TransPS.cpp1
-rw-r--r--ndb/src/rep/transfer/TransPS.hpp2
-rw-r--r--ndb/src/rep/transfer/TransSS.cpp1
-rw-r--r--ndb/src/rep/transfer/TransSS.hpp2
-rw-r--r--ndb/test/include/NDBT_Stats.hpp4
-rw-r--r--ndb/test/include/NDBT_Table.hpp4
-rw-r--r--ndb/test/include/NDBT_Test.hpp1
-rw-r--r--ndb/test/include/NdbTimer.hpp1
-rw-r--r--ndb/test/ndbapi/acid2/acid2.cpp1
-rw-r--r--ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp3
-rw-r--r--ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp4
-rw-r--r--ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp4
-rw-r--r--ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp4
-rw-r--r--ndb/test/ndbapi/bulk_copy/bulk_copy.cpp1
-rw-r--r--ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp2
-rw-r--r--ndb/test/ndbapi/create_tab/create_tab.cpp2
-rw-r--r--ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp2
-rw-r--r--ndb/test/ndbapi/flexAsynch/flexAsynch.cpp2
-rw-r--r--ndb/test/ndbapi/flexBench/flexBench.cpp4
-rw-r--r--ndb/test/ndbapi/flexHammer/flexHammer.cpp2
-rw-r--r--ndb/test/ndbapi/flexScan/flexScan.cpp3
-rw-r--r--ndb/test/ndbapi/flexTT/flexTT.cpp7
-rw-r--r--ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp4
-rw-r--r--ndb/test/ndbapi/indexTest/index.cpp5
-rw-r--r--ndb/test/ndbapi/indexTest2/index2.cpp5
-rw-r--r--ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp5
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/macros.h3
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp2
-rw-r--r--ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp5
-rw-r--r--ndb/test/ndbapi/lmc-bench/include/testDefinitions.h22
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c6
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c2
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/macros.h3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp1
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp2
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c5
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c3
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp4
-rw-r--r--ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c3
-rw-r--r--ndb/test/ndbapi/restarter/restarter.cpp2
-rw-r--r--ndb/test/ndbapi/restarter2/restarter2.cpp2
-rw-r--r--ndb/test/ndbapi/restarts/restarts.cpp2
-rw-r--r--ndb/test/ndbapi/ronja/benchronja/benchronja.cpp7
-rw-r--r--ndb/test/ndbapi/telco/msa.cpp5
-rw-r--r--ndb/test/ndbapi/testBlobs/testBlobs.cpp9
-rw-r--r--ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp6
-rw-r--r--ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp2
-rw-r--r--ndb/test/ndbapi/testOIBasic/testOIBasic.cpp9
-rw-r--r--ndb/test/ndbapi/vw_test/bcd.h3
-rw-r--r--ndb/test/ndbapi/vw_test/cdrserver.cpp12
-rw-r--r--ndb/test/ndbapi/vw_test/size.cpp2
-rw-r--r--ndb/test/newtonapi/basic_test/basic/basic.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/common.cpp4
-rw-r--r--ndb/test/newtonapi/basic_test/common.hpp3
-rw-r--r--ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp1
-rw-r--r--ndb/test/newtonapi/basic_test/too_basic.cpp10
-rw-r--r--ndb/test/newtonapi/perf_test/perf.cpp9
-rw-r--r--ndb/test/odbc/driver/testOdbcDriver.cpp9
-rw-r--r--ndb/test/run-test/main.cpp2
-rw-r--r--ndb/test/run-test/run-test.hpp2
-rw-r--r--ndb/test/src/HugoCalculator.cpp2
-rw-r--r--ndb/test/src/NDBT_Error.cpp4
-rw-r--r--ndb/test/src/NDBT_ResultRow.cpp4
-rw-r--r--ndb/test/src/NDBT_ReturnCodes.cpp6
-rw-r--r--ndb/test/src/NDBT_Table.cpp2
-rw-r--r--ndb/test/src/NDBT_Tables.cpp1
-rw-r--r--ndb/test/src/NdbBackup.cpp1
-rw-r--r--ndb/test/src/NdbConfig.cpp1
-rw-r--r--ndb/test/src/NdbGrep.cpp1
-rw-r--r--ndb/test/src/NdbRestarter.cpp1
-rw-r--r--ndb/test/tools/hugoCalculator/hugoCalculator.cpp4
-rw-r--r--ndb/test/tools/hugoFill/hugoFill.cpp2
-rw-r--r--ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp4
-rw-r--r--ndb/test/tools/hugoPkDelete/hugoPkDel.cpp4
-rw-r--r--ndb/test/tools/hugoPkRead/hugoPkRead.cpp4
-rw-r--r--ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp3
-rw-r--r--ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp4
-rw-r--r--ndb/test/tools/hugoScanRead/hugoScanRead.cpp4
-rw-r--r--ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp4
-rw-r--r--ndb/test/tools/restart/restart.cpp5
-rw-r--r--ndb/test/tools/waiter/waiter.cpp1
-rw-r--r--ndb/tools/copy_tab/copy_tab.cpp2
-rw-r--r--ndb/tools/cpcc/cpcc.cpp2
-rw-r--r--ndb/tools/create_index/create_index.cpp2
-rw-r--r--ndb/tools/delete_all/delete_all.cpp2
-rw-r--r--ndb/tools/drop_index/drop_index.cpp2
-rw-r--r--ndb/tools/drop_tab/drop_tab.cpp2
-rw-r--r--ndb/tools/list_tables/listTables.cpp3
-rw-r--r--ndb/tools/select_all/select_all.cpp4
-rw-r--r--ndb/tools/select_count/select_count.cpp4
-rw-r--r--ndb/tools/transproxy/transproxy.cpp9
-rw-r--r--ndb/tools/verify_index/verify_index.cpp3
343 files changed, 1360 insertions, 1766 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index a8379b3d338..35ea9b2f778 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -163,6 +163,7 @@ tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
+tulin@build.mysql.com
ulli@morbus.(none)
venu@hundin.mysql.fi
venu@myvenu.com
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 0276355ef65..df29a3a6ab7 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
+INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
../dbug/libdbug.a ../strings/libmystrings.a
bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \
diff --git a/extra/perror.c b/extra/perror.c
index 10b2442de20..1d3d7c70fac 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -23,15 +23,27 @@
#include <m_string.h>
#include <errno.h>
#include <my_getopt.h>
+#ifdef HAVE_NDBCLUSTER_DB
+#include "../ndb/src/ndbapi/ndberror.c"
+#endif
static my_bool verbose, print_all_codes;
+#ifdef HAVE_NDBCLUSTER_DB
+static my_bool ndb_code;
+static char ndb_string[1024];
+#endif
+
static struct my_option my_long_options[] =
{
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_NDBCLUSTER_DB
+ {"ndb", 0, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code,
+ (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+#endif
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
(gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
@@ -199,7 +211,17 @@ int main(int argc,char *argv[])
{
found=0;
code=atoi(*argv);
- msg = strerror(code);
+#ifdef HAVE_NDBCLUSTER_DB
+ if (ndb_code)
+ {
+ if (ndb_error_string(code, ndb_string, 1024) < 0)
+ msg= 0;
+ else
+ msg= ndb_string;
+ }
+ else
+#endif
+ msg = strerror(code);
if (msg)
{
found=1;
diff --git a/ndb/Defs.mk b/ndb/Defs.mk
index d5a21c64ca9..8ac9e28b721 100644
--- a/ndb/Defs.mk
+++ b/ndb/Defs.mk
@@ -21,57 +21,34 @@ LIBPREFIX := lib
fixpath = $1
ar_rcs = $(AR_RCS) $1 $2
#check-odbc = $(findstring sqlext.h, $(wildcard /usr/include/sqlext.h) $(wildcard /usr/local/include/sqlext.h))
-CCFLAGS_TOP += -DHAVE_STRCASECMP
-
endif
ifeq ($(NDB_OS), WIN32)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCPY := Y
-NDB_STRLCAT := Y
SHLIBEXT := dll
endif
ifeq ($(NDB_OS), LINUX)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), SOLARIS)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), HPUX)
-CCFLAGS_TOP += -DHAVE_STRDUP
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := sl
endif
ifeq ($(NDB_OS), MACOSX)
-CCFLAGS_TOP += -DHAVE_STRLCAT
-CCFLAGS_TOP += -DHAVE_STRLCAT
-CCFLAGS_TOP += -DHAVE_STRLCPY
CCFLAGS_TOP += -DNDBOUT_UINTPTR
SHLIBEXT := dylib
endif
ifeq ($(NDB_OS), OSE)
-NDB_STRDUP := Y
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
ifeq ($(NDB_OS), SOFTOSE)
-NDB_STRDUP := Y
-NDB_STRLCAT := Y
-NDB_STRLCPY := Y
SHLIBEXT := so
endif
diff --git a/ndb/Epilogue.mk b/ndb/Epilogue.mk
index dc78a66a1f8..bcdc54a87f1 100644
--- a/ndb/Epilogue.mk
+++ b/ndb/Epilogue.mk
@@ -227,7 +227,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \
BIN_TARGET_LIBS += logger general portlib
endif
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include)
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include)
ifeq ($(NDB_SCI), Y)
BIN_TARGET_LIBS += sisci
diff --git a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
index 685c853c5d5..7abebcc832d 100644
--- a/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
+++ b/ndb/examples/ndbapi_async_example/ndbapi_async.cpp
@@ -63,20 +63,12 @@
*/
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbScanFilter.hpp>
#include <iostream> // Used for cout
-#ifdef SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#if defined LINUX || defined MACOSX
-#include <time.h>
-#include <unistd.h>
-#endif
-
/**
* Helper sleep function
*/
diff --git a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
index 186afdb9471..7c3a66326c6 100644
--- a/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
+++ b/ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
@@ -85,21 +85,13 @@
*/
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbScanFilter.hpp>
// Used for cout
#include <iostream>
-#ifdef SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
-#if defined LINUX || defined MACOSX
-#include <time.h>
-#include <unistd.h>
-#endif
-
/**
* Helper sleep function
*/
diff --git a/ndb/include/debugger/SignalLoggerManager.hpp b/ndb/include/debugger/SignalLoggerManager.hpp
index f213c711f3a..742bf7d294e 100644
--- a/ndb/include/debugger/SignalLoggerManager.hpp
+++ b/ndb/include/debugger/SignalLoggerManager.hpp
@@ -24,7 +24,6 @@
#define SignalLoggerManager_H
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <TransporterDefinitions.hpp>
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 0902f3e488b..3363dc2befd 100644
--- a/ndb/include/kernel/LogLevel.hpp
+++ b/ndb/include/kernel/LogLevel.hpp
@@ -17,8 +17,7 @@
#ifndef _LOG_LEVEL_HPP
#define _LOG_LEVEL_HPP
-#include <ndb_types.h>
-#include <assert.h>
+#include <ndb_global.h>
/**
*
diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp
index 9cf1123cc61..29dfaeb79a6 100644
--- a/ndb/include/kernel/signaldata/BuildIndx.hpp
+++ b/ndb/include/kernel/signaldata/BuildIndx.hpp
@@ -19,7 +19,6 @@
#include "SignalData.hpp"
#include <NodeBitmask.hpp>
-#include <NdbString.h>
#include <signaldata/DictTabInfo.hpp>
/**
diff --git a/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp
index 071bd9b9104..511e7d30c21 100644
--- a/ndb/include/kernel/signaldata/SignalData.hpp
+++ b/ndb/include/kernel/signaldata/SignalData.hpp
@@ -17,11 +17,9 @@
#ifndef SIGNAL_DATA_H
#define SIGNAL_DATA_H
+#include <ndb_global.h>
#include <ndb_limits.h>
#include <kernel_types.h>
-#include <NdbStdio.h>
-#include <NdbConstant.hpp>
-#include <stdlib.h>
#ifndef NDB_ASSERT
#ifdef VM_TRACE
diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp
index 588e2893214..17ab07acd4e 100644
--- a/ndb/include/kernel/signaldata/SignalDataPrint.hpp
+++ b/ndb/include/kernel/signaldata/SignalDataPrint.hpp
@@ -17,8 +17,8 @@
#ifndef SIGNAL_DATA_PRINT_H
#define SIGNAL_DATA_PRINT_H
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <NdbStdio.h>
/**
* Typedef for a Signal Data Print Function
diff --git a/ndb/include/logger/FileLogHandler.hpp b/ndb/include/logger/FileLogHandler.hpp
index ae69a2f5418..08e46c11844 100644
--- a/ndb/include/logger/FileLogHandler.hpp
+++ b/ndb/include/logger/FileLogHandler.hpp
@@ -19,7 +19,7 @@
#include "LogHandler.hpp"
-class File;
+class File_class;
/**
* Logs messages to a file. The log file will be archived depending on
@@ -104,7 +104,7 @@ private:
int m_maxNoFiles;
long m_maxFileSize;
unsigned int m_maxLogEntries;
- File* m_pLogFile;
+ File_class* m_pLogFile;
};
#endif
diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp
index 8c5c9298f69..8f76783e6b0 100644
--- a/ndb/include/logger/LogHandler.hpp
+++ b/ndb/include/logger/LogHandler.hpp
@@ -19,7 +19,6 @@
#include "Logger.hpp"
-#include <NdbStdio.h> // Defines NULL
/**
* This class is the base class for all log handlers. A log handler is
diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp
index 2d12a5b8a6e..d4937c11744 100644
--- a/ndb/include/logger/Logger.hpp
+++ b/ndb/include/logger/Logger.hpp
@@ -17,8 +17,8 @@
#ifndef Logger_H
#define Logger_H
+#include <ndb_global.h>
#include <BaseString.hpp>
-#include <stdarg.h>
class LogHandler;
class LogHandlerList;
diff --git a/ndb/include/mgmcommon/MgmtErrorReporter.hpp b/ndb/include/mgmcommon/MgmtErrorReporter.hpp
index acc44b14d8e..925d9e6407a 100644
--- a/ndb/include/mgmcommon/MgmtErrorReporter.hpp
+++ b/ndb/include/mgmcommon/MgmtErrorReporter.hpp
@@ -22,8 +22,8 @@
//******************************************************************************
+#include <ndb_global.h> // exit
#include <NdbOut.hpp>
-#include <stdlib.h> // exit
#define REPORT_WARNING(message) \
ndbout << "WARNING: " << message << endl
diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h
new file mode 100644
index 00000000000..028f1fdeea4
--- /dev/null
+++ b/ndb/include/ndb_global.h
@@ -0,0 +1,72 @@
+
+#ifndef NDBGLOBAL_H
+#define NDBGLOBAL_H
+
+#include <my_global.h>
+#include <m_string.h>
+#include <m_ctype.h>
+#include <ndb_types.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <time.h>
+#include <fcntl.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#ifndef NDB_MACOSX
+#include <sys/mman.h>
+#endif
+
+#ifdef NDB_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+
+#define DIR_SEPARATOR "\\"
+#define PATH_MAX 256
+
+#pragma warning(disable: 4503 4786)
+#else
+
+#define DIR_SEPARATOR "/"
+
+#endif
+
+#ifdef NDB_VC98
+#define STATIC_CONST(x) enum { x }
+#else
+#define STATIC_CONST(x) static const Uint32 x
+#endif
+
+#ifdef __cplusplus
+#include <new>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <assert.h>
+
+#ifndef HAVE_STRDUP
+extern char * strdup(const char *s);
+#endif
+
+#ifndef HAVE_STRLCPY
+extern size_t strlcpy (char *dst, const char *src, size_t dst_sz);
+#endif
+
+#ifndef HAVE_STRLCAT
+extern size_t strlcat (char *dst, const char *src, size_t dst_sz);
+#endif
+
+#ifndef HAVE_STRCASECMP
+extern int strcasecmp(const char *s1, const char *s2);
+extern int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h
index 40d73b0f230..166368b99c5 100644
--- a/ndb/include/ndb_types.h
+++ b/ndb/include/ndb_types.h
@@ -21,9 +21,6 @@
#ifndef SYS_TYPES_H
#define SYS_TYPES_H
-#include <sys/types.h>
-#include <stddef.h>
-
typedef char Int8;
typedef unsigned char Uint8;
typedef short Int16;
diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h
index ad60cab8cdb..9bb6af59590 100644
--- a/ndb/include/ndb_version.h
+++ b/ndb/include/ndb_version.h
@@ -17,9 +17,6 @@
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
-#include <stdio.h>
-#include <string.h>
-
#include <version.h>
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 59bdd212919..fd6e827ceb4 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -860,9 +860,9 @@
#include <ndb_types.h>
#include <ndbapi_limits.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include <NdbError.hpp>
-#include "NdbDictionary.hpp"
+#include <NdbDictionary.hpp>
class NdbObjectIdMap;
class NdbOperation;
@@ -1673,7 +1673,7 @@ private:
*/
struct StartTransactionNodeSelectionData {
StartTransactionNodeSelectionData():
- fragment2PrimaryNodeMap(NULL) {};
+ fragment2PrimaryNodeMap(0) {};
Uint32 kValue;
Uint32 hashValueMask;
Uint32 hashpointerValue;
diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp
index a1532bb2f0e..c775dd5e33d 100644
--- a/ndb/include/ndbapi/NdbConnection.hpp
+++ b/ndb/include/ndbapi/NdbConnection.hpp
@@ -18,9 +18,8 @@
#define NdbConnection_H
#include <ndb_types.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include <NdbError.hpp>
-#include <stdlib.h>
class NdbConnection;
class NdbOperation;
diff --git a/ndb/include/ndbapi/NdbError.hpp b/ndb/include/ndbapi/NdbError.hpp
index b08dd1041b2..8cde2a8cf38 100644
--- a/ndb/include/ndbapi/NdbError.hpp
+++ b/ndb/include/ndbapi/NdbError.hpp
@@ -17,6 +17,8 @@
#ifndef NDB_ERROR_HPP
#define NDB_ERROR_HPP
+#include <ndberror.h>
+
/**
* @struct NdbError
* @brief Contains error information
@@ -51,7 +53,7 @@ struct NdbError {
* The error code indicate success<br>
* (Includes classification: NdbError::NoError)
*/
- Success = 0,
+ Success = ndberror_st_success,
/**
* The error code indicates a temporary error.
@@ -61,7 +63,7 @@ struct NdbError {
* NdbError::OverloadError, NdbError::NodeShutdown
* and NdbError::TimeoutExpired.)
*/
- TemporaryError = 1,
+ TemporaryError = ndberror_st_temporary,
/**
* The error code indicates a permanent error.<br>
@@ -71,14 +73,14 @@ struct NdbError {
* NdbError::UserDefinedError, NdbError::InternalError, and,
* NdbError::FunctionNotImplemented.)
*/
- PermanentError = 2,
+ PermanentError = ndberror_st_permanent,
/**
* The result/status is unknown.<br>
* (Includes classifications: NdbError::UnknownResultError, and
* NdbError::UnknownErrorCode.)
*/
- UnknownResult = 3
+ UnknownResult = ndberror_st_unknown
};
/**
@@ -88,85 +90,85 @@ struct NdbError {
/**
* Success. No error occurred.
*/
- NoError = 0,
+ NoError = ndberror_cl_none,
/**
* Error in application program.
*/
- ApplicationError = 1,
+ ApplicationError = ndberror_cl_application,
/**
* Read operation failed due to missing record.
*/
- NoDataFound = 2,
+ NoDataFound = ndberror_cl_no_data_found,
/**
* E.g. inserting a tuple with a primary key already existing
* in the table.
*/
- ConstraintViolation = 3,
+ ConstraintViolation = ndberror_cl_constraint_violation,
/**
* Error in creating table or usage of table.
*/
- SchemaError = 4,
+ SchemaError = ndberror_cl_schema_error,
/**
* Error occurred in interpreted program.
*/
- UserDefinedError = 5,
+ UserDefinedError = ndberror_cl_user_defined,
/**
* E.g. insufficient memory for data or indexes.
*/
- InsufficientSpace = 6,
+ InsufficientSpace = ndberror_cl_insufficient_space,
/**
* E.g. too many active transactions.
*/
- TemporaryResourceError = 7,
+ TemporaryResourceError = ndberror_cl_temporary_resource,
/**
* Temporary failures which are probably inflicted by a node
* recovery in progress. Examples: information sent between
* application and NDB lost, distribution change.
*/
- NodeRecoveryError = 8,
+ NodeRecoveryError = ndberror_cl_node_recovery,
/**
* E.g. out of log file space.
*/
- OverloadError = 9,
+ OverloadError = ndberror_cl_overload,
/**
* Timeouts, often inflicted by deadlocks in NDB.
*/
- TimeoutExpired = 10,
+ TimeoutExpired = ndberror_cl_timeout_expired,
/**
* Is is unknown whether the transaction was committed or not.
*/
- UnknownResultError = 11,
+ UnknownResultError = ndberror_cl_unknown_result,
/**
* A serious error in NDB has occurred.
*/
- InternalError = 12,
+ InternalError = ndberror_cl_internal_error,
/**
* A function used is not yet implemented.
*/
- FunctionNotImplemented = 13,
+ FunctionNotImplemented = ndberror_cl_function_not_implemented,
/**
* Error handler could not determine correct error code.
*/
- UnknownErrorCode = 14,
+ UnknownErrorCode = ndberror_cl_unknown_error_code,
/**
* Node shutdown
*/
- NodeShutdown = 15
+ NodeShutdown = ndberror_cl_node_shutdown
};
/**
@@ -204,6 +206,22 @@ struct NdbError {
message = 0;
details = 0;
}
+ NdbError(const ndberror_struct & ndberror){
+ status = (NdbError::Status) ndberror.status;
+ classification = (NdbError::Classification) ndberror.classification;
+ code = ndberror.code;
+ message = ndberror.message;
+ details = ndberror.details;
+ }
+ operator ndberror_struct() const {
+ ndberror_struct ndberror;
+ ndberror.status = (ndberror_status_enum) status;
+ ndberror.classification = (ndberror_classification_enum) classification;
+ ndberror.code = code;
+ ndberror.message = message;
+ ndberror.details = details;
+ return ndberror;
+ }
};
class NdbOut& operator <<(class NdbOut&, const NdbError &);
diff --git a/ndb/include/ndbapi/NdbEventOperation.hpp b/ndb/include/ndbapi/NdbEventOperation.hpp
index 911b00b02c4..056e9a58c74 100644
--- a/ndb/include/ndbapi/NdbEventOperation.hpp
+++ b/ndb/include/ndbapi/NdbEventOperation.hpp
@@ -157,8 +157,8 @@ public:
* the attribute, or a NULL pointer
* (indicating error).
*/
- NdbRecAttr *getValue(const char *anAttrName, char *aValue = NULL);
- NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = NULL);
+ NdbRecAttr *getValue(const char *anAttrName, char *aValue = 0);
+ NdbRecAttr *getPreValue(const char *anAttrName, char *aValue = 0);
/**
* Retrieves event resultset if available, inserted into the NdbRecAttrs
@@ -172,7 +172,7 @@ public:
* overflow and *pOverRun will indicate the number of events that have
* overwritten.
*/
- int next(int *pOverRun=NULL);
+ int next(int *pOverRun=0);
/**
* In the current implementation a nodefailiure may cause loss of events,
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 4f5f4597937..3c515fe84ef 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -17,14 +17,11 @@
#ifndef NdbOperation_H
#define NdbOperation_H
-#include <stdlib.h>
-#include <assert.h>
-
#include <ndb_types.h>
-#include "AttrType.hpp"
-#include "NdbError.hpp"
-#include "NdbReceiver.hpp"
-#include <stdlib.h>
+
+#include <AttrType.hpp>
+#include <NdbError.hpp>
+#include <NdbReceiver.hpp>
class Ndb;
class NdbApiSignal;
@@ -480,8 +477,8 @@ public:
* the attribute, or a NULL pointer
* (indicating error).
*/
- NdbRecAttr* getValue(const char* anAttrName, char* aValue = NULL);
- NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = NULL);
+ NdbRecAttr* getValue(const char* anAttrName, char* aValue = 0);
+ NdbRecAttr* getValue(Uint32 anAttrId, char* aValue = 0);
/**
* Define an attribute to set or update in query.
@@ -925,7 +922,7 @@ protected:
virtual int equal_impl(const NdbColumnImpl* anAttrObject,
const char* aValue,
Uint32 len);
- NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = NULL);
+ NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp
index a5595096bf6..7eeff88671d 100644
--- a/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -17,9 +17,6 @@
#ifndef NdbRecAttr_H
#define NdbRecAttr_H
-#include <stdlib.h>
-
-#include <ndb_types.h>
#include <NdbDictionary.hpp>
#include "AttrType.hpp"
@@ -427,9 +424,9 @@ inline
void
NdbRecAttr::release()
{
- if (theStorageX != NULL) {
+ if (theStorageX != 0) {
delete [] theStorageX;
- theStorageX = NULL;
+ theStorageX = 0;
}
}
@@ -437,10 +434,10 @@ inline
void
NdbRecAttr::init()
{
- theStorageX = NULL;
- theValue = NULL;
- theRef = NULL;
- theNext = NULL;
+ theStorageX = 0;
+ theValue = 0;
+ theRef = 0;
+ theNext = 0;
theAttrId = 0xFFFF;
theNULLind = -1;
}
@@ -470,7 +467,7 @@ inline
bool
NdbRecAttr::copyoutRequired() const
{
- return theRef != theValue && theValue != NULL;
+ return theRef != theValue && theValue != 0;
}
inline
diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp
index 952803f8e70..bc11207a112 100644
--- a/ndb/include/ndbapi/NdbReceiver.hpp
+++ b/ndb/include/ndbapi/NdbReceiver.hpp
@@ -18,7 +18,7 @@
#define NdbReceiver_H
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface
-#include <stdlib.h>
+#include <ndb_types.h>
class Ndb;
class NdbReceiver
diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp
index e041c79d96f..f83669fb616 100644
--- a/ndb/include/ndbapi/NdbScanOperation.hpp
+++ b/ndb/include/ndbapi/NdbScanOperation.hpp
@@ -172,25 +172,6 @@ SetValueRec::SetValueRec() :
{
}
-inline
-SetValueRec::~SetValueRec()
-{
- if ((stype == SET_STRING_ATTR1) ||
- (stype == SET_INT32_ATTR1) ||
- (stype == SET_UINT32_ATTR1) ||
- (stype == SET_INT64_ATTR1) ||
- (stype == SET_UINT64_ATTR1) ||
- (stype == SET_FLOAT_ATTR1) ||
- (stype == SET_DOUBLE_ATTR1))
- free(anAttrName);
-
- if ((stype == SET_STRING_ATTR1) ||
- (stype == SET_STRING_ATTR2))
- free(stringStruct.aStringValue);
- if (next) delete next;
- next = 0;
-}
-
class SetValueRecList {
public:
SetValueRecList();
diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/include/ndbapi/NdbSchemaOp.hpp
index 90837bbc66b..c3a3827a6b4 100644
--- a/ndb/include/ndbapi/NdbSchemaOp.hpp
+++ b/ndb/include/ndbapi/NdbSchemaOp.hpp
@@ -18,11 +18,9 @@
#define NdbSchemaOp_H
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
-#include <ndb_types.h>
+#include "NdbDictionary.hpp"
#include "AttrType.hpp"
#include "NdbSchemaCon.hpp"
-#include <stdlib.h>
-#include "NdbDictionary.hpp"
class NdbApiSignal;
class Ndb;
diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h
new file mode 100644
index 00000000000..5c2d85b82a6
--- /dev/null
+++ b/ndb/include/ndbapi/ndberror.h
@@ -0,0 +1,98 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef NDBERROR_H
+#define NDBERROR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ ndberror_st_success = 0,
+ ndberror_st_temporary = 1,
+ ndberror_st_permanent = 2,
+ ndberror_st_unknown = 3
+} ndberror_status_enum;
+
+typedef enum
+{
+ ndberror_cl_none = 0,
+ ndberror_cl_application = 1,
+ ndberror_cl_no_data_found = 2,
+ ndberror_cl_constraint_violation = 3,
+ ndberror_cl_schema_error = 4,
+ ndberror_cl_user_defined = 5,
+ ndberror_cl_insufficient_space = 6,
+ ndberror_cl_temporary_resource = 7,
+ ndberror_cl_node_recovery = 8,
+ ndberror_cl_overload = 9,
+ ndberror_cl_timeout_expired = 10,
+ ndberror_cl_unknown_result = 11,
+ ndberror_cl_internal_error = 12,
+ ndberror_cl_function_not_implemented = 13,
+ ndberror_cl_unknown_error_code = 14,
+ ndberror_cl_node_shutdown = 15
+} ndberror_classification_enum;
+
+
+typedef struct {
+
+ /**
+ * Error status.
+ */
+ ndberror_status_enum status;
+
+ /**
+ * Error type
+ */
+ ndberror_classification_enum classification;
+
+ /**
+ * Error code
+ */
+ int code;
+
+ /**
+ * Error message
+ */
+ const char * message;
+
+ /**
+ * The detailed description. This is extra information regarding the
+ * error which is not included in the error message.
+ *
+ * @note Is NULL when no details specified
+ */
+ char * details;
+
+} ndberror_struct;
+
+
+typedef ndberror_status_enum ndberror_status;
+typedef ndberror_classification_enum ndberror_classification;
+
+const char *ndberror_status_message(ndberror_status);
+const char *ndberror_classification_message(ndberror_classification);
+void ndberror_update(ndberror_struct *);
+int ndb_error_string(int err_no, char *str, unsigned int size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndb/include/newtonapi/dba.h b/ndb/include/newtonapi/dba.h
index eb5b3f9b5c2..4cfc0ec8eb9 100644
--- a/ndb/include/newtonapi/dba.h
+++ b/ndb/include/newtonapi/dba.h
@@ -102,11 +102,9 @@
/* --- Include files ---- */
+#include <ndb_global.h>
#include <defs/pcn_types.h>
-#include <stdio.h>
-
-
/* --- Types and definitions --- */
/**
diff --git a/ndb/include/newtonapi/defs/pcn_types.h b/ndb/include/newtonapi/defs/pcn_types.h
index a823846d7be..1c5de22e518 100644
--- a/ndb/include/newtonapi/defs/pcn_types.h
+++ b/ndb/include/newtonapi/defs/pcn_types.h
@@ -17,8 +17,7 @@
#ifndef PCN_TYPES_H
#define PCN_TYPES_H
-#include <stddef.h>
-#include <NdbUnistd.h>
+#include <ndb_global.h>
#ifdef NDB_MACOSX
typedef unsigned int Size_t;
diff --git a/ndb/include/portlib/NdbConstant.hpp b/ndb/include/portlib/NdbConstant.hpp
deleted file mode 100644
index bd45209d2b5..00000000000
--- a/ndb/include/portlib/NdbConstant.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef NDB_CONSTANT_HPP
-#define NDB_CONSTANT_HPP
-
-#include <ndb_types.h>
-
-#ifdef NDB_VC98
-#define STATIC_CONST(x) enum { x }
-#else
-#define STATIC_CONST(x) static const Uint32 x
-#endif
-
-#endif
diff --git a/ndb/include/portlib/NdbMem.h b/ndb/include/portlib/NdbMem.h
index 38ad3f60448..0f2de80200e 100644
--- a/ndb/include/portlib/NdbMem.h
+++ b/ndb/include/portlib/NdbMem.h
@@ -17,8 +17,7 @@
#ifndef NDB_MEM_H
#define NDB_MEM_H
-#include <stddef.h>
-
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h
index 6e2f18b61b2..e7538b1ed7f 100644
--- a/ndb/include/portlib/NdbTCP.h
+++ b/ndb/include/portlib/NdbTCP.h
@@ -17,6 +17,8 @@
#ifndef NDB_TCP_H
#define NDB_TCP_H
+#include <ndb_global.h>
+
#if defined NDB_OSE || defined NDB_SOFTOSE
/**
* Include files needed
@@ -24,7 +26,6 @@
#include "inet.h"
#include <netdb.h>
-#include <errno.h>
#define NDB_NONBLOCK FNDELAY
#define NDB_SOCKET_TYPE int
@@ -40,45 +41,15 @@ typedef int socklen_t;
#endif
-#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X
-/**
- * Include files needed
- */
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
-#include <netdb.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#define NDB_NONBLOCK O_NONBLOCK
-#define NDB_SOCKET_TYPE int
-#define NDB_INVALID_SOCKET -1
-#define NDB_CLOSE_SOCKET(x) close(x)
-
-#define InetErrno errno
-
-#endif
-
-#if defined NDB_LINUX || defined NDB_MACOSX
+#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X || NDB_LINUX || defined NDB_MACOSX
/**
* Include files needed
*/
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
-#include <unistd.h>
#include <netdb.h>
-#include <errno.h>
-#include <fcntl.h>
#define NDB_NONBLOCK O_NONBLOCK
#define NDB_SOCKET_TYPE int
@@ -89,14 +60,12 @@ typedef int socklen_t;
#endif
-
#ifdef NDB_WIN32
/**
* Include files needed
*/
#include <winsock2.h>
#include <ws2tcpip.h>
-#include <errno.h>
#define InetErrno WSAGetLastError()
#define EWOULDBLOCK WSAEWOULDBLOCK
diff --git a/ndb/include/portlib/NdbUnistd.h b/ndb/include/portlib/NdbUnistd.h
deleted file mode 100644
index 42f67e2aeb3..00000000000
--- a/ndb/include/portlib/NdbUnistd.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef NDB_UNISTD_H
-#define NDB_UNISTD_H
-
-#ifdef NDB_WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#include <limits.h>
-
-#define DIR_SEPARATOR "\\"
-#define PATH_MAX 256
-
-#pragma warning(disable: 4503 4786)
-
-#else
-#include <unistd.h>
-#include <limits.h>
-
-#define DIR_SEPARATOR "/"
-
-#endif
-
-#endif
diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp
index 5bbf7c79491..cb859e310db 100644
--- a/ndb/include/transporter/TransporterDefinitions.hpp
+++ b/ndb/include/transporter/TransporterDefinitions.hpp
@@ -17,8 +17,8 @@
#ifndef TransporterDefinitions_H
#define TransporterDefinitions_H
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <string.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index a88bd97ffc5..75a1c291594 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -17,9 +17,7 @@
#ifndef __UTIL_BASESTRING_HPP_INCLUDED__
#define __UTIL_BASESTRING_HPP_INCLUDED__
-#include <ctype.h>
-#include <stdlib.h>
-
+#include <ndb_global.h>
#include <Vector.hpp>
/**
diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp
index 1f95d62bcb6..ed981743512 100644
--- a/ndb/include/util/Bitmask.hpp
+++ b/ndb/include/util/Bitmask.hpp
@@ -17,12 +17,9 @@
#ifndef NDB_BITMASK_H
#define NDB_BITMASK_H
-#include <ndb_types.h>
-#include <NdbConstant.hpp>
+#include <ndb_global.h>
#ifndef NDB_ASSERT
-#include <stdio.h>
-#include <stdlib.h>
#define NDB_ASSERT(x, s) \
do { if (!(x)) { printf("%s\n", s); abort(); } } while (0)
#endif
diff --git a/ndb/include/util/File.hpp b/ndb/include/util/File.hpp
index fe3d2642b18..3ed0ad7a6f9 100644
--- a/ndb/include/util/File.hpp
+++ b/ndb/include/util/File.hpp
@@ -17,8 +17,7 @@
#ifndef FILE_H
#define FILE_H
-#include <NdbStdio.h>
-#include <NdbConstant.hpp>
+#include <ndb_global.h>
/**
* This class provides a file abstraction . It has operations
@@ -26,7 +25,7 @@
*
* @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $
*/
-class File
+class File_class
{
public:
/**
@@ -65,7 +64,7 @@ public:
/**
* Default constructor.
*/
- File();
+ File_class();
/**
* Creates a new File with the specified filename and file mode.
@@ -76,12 +75,12 @@ public:
* @param aFileName a filename.
* @param mode the mode which the file should be opened/created with, default "r".
*/
- File(const char* aFileName, const char* mode = "r");
+ File_class(const char* aFileName, const char* mode = "r");
/**
* Destructor.
*/
- ~File();
+ ~File_class();
/**
* Opens/creates the file. If open() fails then 'errno' and perror()
@@ -198,9 +197,9 @@ private:
char m_fileName[MAX_FILE_NAME_SIZE];
const char* m_fileMode;
/* Prohibit */
- File(const File& aCopy);
- File operator = (const File&);
- bool operator == (const File&);
+ File_class (const File_class& aCopy);
+ File_class operator = (const File_class&);
+ bool operator == (const File_class&);
};
#endif
diff --git a/ndb/include/util/InputStream.hpp b/ndb/include/util/InputStream.hpp
index 6b4cf262db4..b2a56b1e433 100644
--- a/ndb/include/util/InputStream.hpp
+++ b/ndb/include/util/InputStream.hpp
@@ -17,7 +17,7 @@
#ifndef INPUT_STREAM_HPP
#define INPUT_STREAM_HPP
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
/**
diff --git a/ndb/include/util/NdbAutoPtr.hpp b/ndb/include/util/NdbAutoPtr.hpp
index 2078714d98d..c01650ffc7e 100644
--- a/ndb/include/util/NdbAutoPtr.hpp
+++ b/ndb/include/util/NdbAutoPtr.hpp
@@ -17,7 +17,7 @@
#ifndef __NDB_AUTO_PTR_HPP
#define __NDB_AUTO_PTR_HPP
-#include <stdlib.h>
+#include <ndb_global.h>
template<typename T>
class NdbAutoPtr {
diff --git a/ndb/include/util/NdbString.h b/ndb/include/util/NdbString.h
deleted file mode 100644
index 97646f813ac..00000000000
--- a/ndb/include/util/NdbString.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifndef __NDBSTRING_H_INCLUDED__
-#define __NDBSTRING_H_INCLUDED__
-
-#include <sys/types.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef HAVE_STRDUP
-extern char * strdup(const char *s);
-#endif
-
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#ifndef HAVE_STRLCAT
-extern size_t strlcat (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#ifndef HAVE_STRCASECMP
-extern int strcasecmp(const char *s1, const char *s2);
-extern int strncasecmp(const char *s1, const char *s2, size_t n);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__NDBSTRING_H_INCLUDED__ */
diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp
index 9d33ead7eb9..c7e009d4537 100644
--- a/ndb/include/util/OutputStream.hpp
+++ b/ndb/include/util/OutputStream.hpp
@@ -17,7 +17,7 @@
#ifndef OUTPUT_STREAM_HPP
#define OUTPUT_STREAM_HPP
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
/**
diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp
index dbdc5f2b480..ff5d1338c79 100644
--- a/ndb/include/util/Properties.hpp
+++ b/ndb/include/util/Properties.hpp
@@ -17,10 +17,7 @@
#ifndef PROPERTIES_HPP
#define PROPERTIES_HPP
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include <BaseString.hpp>
#include <UtilBuffer.hpp>
diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp
index 37e28ea91d8..d5ebb16bb09 100644
--- a/ndb/include/util/SimpleProperties.hpp
+++ b/ndb/include/util/SimpleProperties.hpp
@@ -17,8 +17,7 @@
#ifndef SIMPLE_PROPERTIES_HPP
#define SIMPLE_PROPERTIES_HPP
-#include <ndb_types.h>
-#include <stddef.h> // offsetof
+#include <ndb_global.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp
index 97821ee3f9b..b357fa0fdf2 100644
--- a/ndb/include/util/UtilBuffer.hpp
+++ b/ndb/include/util/UtilBuffer.hpp
@@ -17,9 +17,7 @@
#ifndef __BUFFER_HPP_INCLUDED__
#define __BUFFER_HPP_INCLUDED__
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
+#include <ndb_global.h>
/* This class represents a buffer of binary data, where you can append
* data at the end, and later read the entire bunch.
diff --git a/ndb/include/util/Vector.hpp b/ndb/include/util/Vector.hpp
index a717dfecd7e..f60817dab67 100644
--- a/ndb/include/util/Vector.hpp
+++ b/ndb/include/util/Vector.hpp
@@ -17,9 +17,8 @@
#ifndef NDB_VECTOR_HPP
#define NDB_VECTOR_HPP
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbMutex.h>
-#include <string.h>
template<class T>
struct Vector {
diff --git a/ndb/include/util/getarg.h b/ndb/include/util/getarg.h
index 713cf6e4b32..03ed25f6828 100644
--- a/ndb/include/util/getarg.h
+++ b/ndb/include/util/getarg.h
@@ -52,7 +52,7 @@
#ifndef __GETARG_H__
#define __GETARG_H__
-#include <stddef.h>
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/util/socket_io.h b/ndb/include/util/socket_io.h
index bbd1bf115ae..a0e6c4e369d 100644
--- a/ndb/include/util/socket_io.h
+++ b/ndb/include/util/socket_io.h
@@ -17,8 +17,9 @@
#ifndef _SOCKET_IO_H
#define _SOCKET_IO_H
+#include <ndb_global.h>
+
#include <NdbTCP.h>
-#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/include/util/uucode.h b/ndb/include/util/uucode.h
index 138a79fa3ae..f5569d033a5 100644
--- a/ndb/include/util/uucode.h
+++ b/ndb/include/util/uucode.h
@@ -17,7 +17,7 @@
#ifndef UUCODE_H
#define UUCODE_H
-#include <stdio.h>
+#include <ndb_global.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/client/odbc/common/Ctx.cpp
index 85edbd1a63f..44689657788 100644
--- a/ndb/src/client/odbc/common/Ctx.cpp
+++ b/ndb/src/client/odbc/common/Ctx.cpp
@@ -14,11 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbUnistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include <common/common.hpp>
#include "DiagArea.hpp"
diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/client/odbc/common/DataField.cpp
index 5853f90c08f..dfd4137ffd9 100644
--- a/ndb/src/client/odbc/common/DataField.cpp
+++ b/ndb/src/client/odbc/common/DataField.cpp
@@ -14,14 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-#include <math.h>
+#include <ndb_global.h>
#include "DataField.hpp"
-#include <time.h>
#ifndef INT_MAX
#define INT_MAX (2147483647)
diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/client/odbc/common/DataType.cpp
index 62bd622b9b5..9c9629f1d24 100644
--- a/ndb/src/client/odbc/common/DataType.cpp
+++ b/ndb/src/client/odbc/common/DataType.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "DataType.hpp"
-#include <NdbStdio.h>
// SqlType
diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/client/odbc/common/OdbcData.cpp
index d2402c7e0ab..2e1bd768aec 100644
--- a/ndb/src/client/odbc/common/OdbcData.cpp
+++ b/ndb/src/client/odbc/common/OdbcData.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <new>
-#include <string.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
#include "OdbcData.hpp"
OdbcData::OdbcData() :
diff --git a/ndb/src/common/debugger/DebuggerNames.cpp b/ndb/src/common/debugger/DebuggerNames.cpp
index fdee978ab54..ebe94a6059f 100644
--- a/ndb/src/common/debugger/DebuggerNames.cpp
+++ b/ndb/src/common/debugger/DebuggerNames.cpp
@@ -14,16 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "DebuggerNames.hpp"
#include <BlockNumbers.h>
#include <GlobalSignalNumbers.h>
#include <signaldata/SignalDataPrint.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <string.h>
-
static const char * localSignalNames[MAX_GSN+1];
static SignalDataPrintFunction localPrintFunctions[MAX_GSN+1];
static const char * localBlockNames[NO_OF_BLOCKS];
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index 12f01890c54..dd957d67383 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "EventLogger.hpp"
#include <NdbConfig.h>
@@ -22,10 +24,6 @@
#include <GrepEvent.hpp>
#include <NodeState.hpp>
#include <version.h>
-#include <NdbStdio.h>
-
-#include <string.h>
-#include <ctype.h>
//
// PUBLIC
diff --git a/ndb/src/common/debugger/SignalLoggerManager.cpp b/ndb/src/common/debugger/SignalLoggerManager.cpp
index ae6edd5ed71..3839a348222 100644
--- a/ndb/src/common/debugger/SignalLoggerManager.cpp
+++ b/ndb/src/common/debugger/SignalLoggerManager.cpp
@@ -14,15 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SignalLoggerManager.hpp"
#include <LongSignal.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <NdbString.h>
-
#include <DebuggerNames.hpp>
SignalLoggerManager::SignalLoggerManager()
diff --git a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
index 11ee0948c17..84410a2b2db 100644
--- a/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
+++ b/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/CloseComReqConf.hpp>
diff --git a/ndb/src/common/debugger/signaldata/ContinueB.cpp b/ndb/src/common/debugger/signaldata/ContinueB.cpp
index 054909d961e..1be6da86cb1 100644
--- a/ndb/src/common/debugger/signaldata/ContinueB.cpp
+++ b/ndb/src/common/debugger/signaldata/ContinueB.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/DihContinueB.hpp>
diff --git a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
index f3b4b97f0fd..2e900de8f70 100644
--- a/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
+++ b/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/PrepFailReqRef.hpp>
diff --git a/ndb/src/common/debugger/signaldata/SystemError.cpp b/ndb/src/common/debugger/signaldata/SystemError.cpp
index 5ed7dc6b18d..549c34710a0 100644
--- a/ndb/src/common/debugger/signaldata/SystemError.cpp
+++ b/ndb/src/common/debugger/signaldata/SystemError.cpp
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <kernel_types.h>
#include <BlockNumbers.h>
#include <signaldata/SystemError.hpp>
diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h
index 93c13e55edc..5ed2b32a873 100644
--- a/ndb/src/common/editline/editline_internal.h
+++ b/ndb/src/common/editline/editline_internal.h
@@ -19,9 +19,8 @@
** Internal header file for editline library.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
+
#if defined(SYS_UNIX)
#include "unix.h"
#endif /* defined(SYS_UNIX) */
diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/common/editline/editline_win32.c
index feef0108523..5083edb7fae 100644
--- a/ndb/src/common/editline/editline_win32.c
+++ b/ndb/src/common/editline/editline_win32.c
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <malloc.h>
+#include <ndb_global.h>
char* readline(const char* prompt)
diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c
index 9a7dfb7bbdf..4058f8ae660 100644
--- a/ndb/src/common/editline/test/testit.c
+++ b/ndb/src/common/editline/test/testit.c
@@ -20,11 +20,7 @@
** A "micro-shell" to test editline library.
** If given any arguments, commands aren't executed.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <NdbString.h>
+#include <ndb_global.h>
#include <editline/editline.h>
int
diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp
index f3d547b4fe7..d13dd7b2a78 100644
--- a/ndb/src/common/logger/FileLogHandler.cpp
+++ b/ndb/src/common/logger/FileLogHandler.cpp
@@ -14,16 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "FileLogHandler.hpp"
+#include <FileLogHandler.hpp>
#include <File.hpp>
-#include <NdbStdio.h>
-#include <sys/param.h>
-
-#include <errno.h>
-#include <string.h>
-
//
// PUBLIC
//
@@ -35,7 +29,7 @@ FileLogHandler::FileLogHandler() :
m_maxLogEntries(MAX_LOG_ENTRIES)
{
- m_pLogFile = new File("logger.log", "a+");
+ m_pLogFile = new File_class("logger.log", "a+");
}
FileLogHandler::FileLogHandler(const char* aFileName,
@@ -47,7 +41,7 @@ FileLogHandler::FileLogHandler(const char* aFileName,
m_maxFileSize(maxFileSize),
m_maxLogEntries(maxLogEntries)
{
- m_pLogFile = new File(aFileName, "a+");
+ m_pLogFile = new File_class(aFileName, "a+");
}
FileLogHandler::~FileLogHandler()
@@ -166,10 +160,10 @@ FileLogHandler::createNewFile()
::snprintf(newName, sizeof(newName),
"%s.%d", m_pLogFile->getName(), fileNo++);
- } while (File::exists(newName));
+ } while (File_class::exists(newName));
m_pLogFile->close();
- if (!File::rename(m_pLogFile->getName(), newName))
+ if (!File_class::rename(m_pLogFile->getName(), newName))
{
setErrorCode(errno);
rc = false;
@@ -201,7 +195,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
close();
if(m_pLogFile)
delete m_pLogFile;
- m_pLogFile = new File(filename.c_str(), "a+");
+ m_pLogFile = new File_class(filename.c_str(), "a+");
open();
return true;
};
diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp
index d1445555e87..83d479c82fd 100644
--- a/ndb/src/common/logger/LogHandler.cpp
+++ b/ndb/src/common/logger/LogHandler.cpp
@@ -17,9 +17,6 @@
#include "LogHandler.hpp"
#include <NdbTick.h>
-#include <NdbString.h>
-
-#include <time.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/LogHandlerList.cpp b/ndb/src/common/logger/LogHandlerList.cpp
index f020ad23e56..62495d7566b 100644
--- a/ndb/src/common/logger/LogHandlerList.cpp
+++ b/ndb/src/common/logger/LogHandlerList.cpp
@@ -17,8 +17,6 @@
#include "LogHandlerList.hpp"
#include <LogHandler.hpp>
-#include <NdbStdio.h>
-#include <ndb_types.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp
index 6eaafd91854..9c9f1eece18 100644
--- a/ndb/src/common/logger/Logger.cpp
+++ b/ndb/src/common/logger/Logger.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
+#include <ndb_global.h>
#include "Logger.hpp"
@@ -27,12 +27,6 @@
#include <SysLogHandler.hpp>
#endif
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <NdbString.h>
-
-#include <assert.h>
-
//
// PUBLIC
//
diff --git a/ndb/src/common/logger/SysLogHandler.cpp b/ndb/src/common/logger/SysLogHandler.cpp
index f3511bf5638..a300c487eb9 100644
--- a/ndb/src/common/logger/SysLogHandler.cpp
+++ b/ndb/src/common/logger/SysLogHandler.cpp
@@ -17,7 +17,6 @@
#include "SysLogHandler.hpp"
#include <syslog.h>
-#include <NdbString.h>
//
// PUBLIC
diff --git a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
index 22f67d15659..44ee11717b4 100644
--- a/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
+++ b/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "LogHandlerListUnitTest.hpp"
#include <ConsoleLogHandler.hpp>
@@ -22,9 +24,6 @@
#include <NdbOut.hpp>
-#include <stdio.h>
-#include <assert.h>
-
typedef bool (*TESTFUNC)(const char*);
typedef struct
{
diff --git a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
index 4b0241a0b03..017dcb79c1f 100644
--- a/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
+++ b/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
@@ -25,12 +25,8 @@
#endif
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbMain.h>
-#include <string.h>
-#include <assert.h>
-
typedef bool (*TESTFUNC)(const char*);
typedef struct
{
diff --git a/ndb/src/common/mgmcommon/Config.hpp b/ndb/src/common/mgmcommon/Config.hpp
index 1314abe004a..284256d9ed6 100644
--- a/ndb/src/common/mgmcommon/Config.hpp
+++ b/ndb/src/common/mgmcommon/Config.hpp
@@ -23,9 +23,7 @@
#include <kernel_types.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <ndb_limits.h>
-#include <NdbConstant.hpp>
#include <Properties.hpp>
/**
diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
index a3f26454df6..ef6861ef291 100644
--- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp
+++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
@@ -14,6 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+#include <ndb_version.h>
+#include <sys/stat.h>
+
#include <ConfigRetriever.hpp>
#include "LocalConfig.hpp"
@@ -21,21 +25,15 @@
#include <NdbOut.hpp>
#include <NdbTCP.h>
-#include <string.h>
-#include <NdbStdio.h>
#include <NdbEnv.h>
#include "MgmtErrorReporter.hpp"
#include <uucode.h>
#include <Properties.hpp>
-#include <stdio.h>
-#include <NdbString.h>
-#include <sys/stat.h>
#include <socket_io.h>
#include <NdbConfig.h>
-#include <ndb_version.h>
//****************************************************************************
//****************************************************************************
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
index 33652fa472c..62c4bd28857 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
@@ -14,16 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "InitConfigFileParser.hpp"
-#include <string.h>
-#include <errno.h>
#include "Config.hpp"
#include "MgmtErrorReporter.hpp"
#include <NdbOut.hpp>
#include "ConfigInfo.hpp"
-#include <stdarg.h>
-#include <ctype.h>
-#include <NdbString.h>
const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file
static void trim(char *);
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
index 1e85067396c..f4f27abb055 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
@@ -17,7 +17,8 @@
#ifndef InitConfigFileParser_H
#define InitConfigFileParser_H
-#include <stdio.h>
+#include <ndb_global.h>
+
#include <Properties.hpp>
class Config;
diff --git a/ndb/src/common/mgmcommon/LocalConfig.hpp b/ndb/src/common/mgmcommon/LocalConfig.hpp
index ec7b572e92d..eb676bf9bed 100644
--- a/ndb/src/common/mgmcommon/LocalConfig.hpp
+++ b/ndb/src/common/mgmcommon/LocalConfig.hpp
@@ -17,10 +17,8 @@
#ifndef LocalConfig_H
#define LocalConfig_H
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
//****************************************************************************
// Description: The class LocalConfig corresponds to the information possible
diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c
index b12d9fcfaf9..827ef34a840 100644
--- a/ndb/src/common/mgmcommon/NdbConfig.c
+++ b/ndb/src/common/mgmcommon/NdbConfig.c
@@ -14,10 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbConfig.h>
#include <NdbEnv.h>
-#include <stdlib.h>
-#include <string.h>
const char*
NdbConfig_HomePath(char* buf, int buflen){
diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
index 7260a84ce7a..daa287cc44d 100644
--- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
+++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
@@ -15,10 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <ConfigRetriever.hpp>
#include <Properties.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
void usage(const char * prg){
diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c
index d23235b7aa2..fb525c2f19f 100644
--- a/ndb/src/common/portlib/memtest/memtest.c
+++ b/ndb/src/common/portlib/memtest/memtest.c
@@ -16,8 +16,7 @@
-#include <stdio.h>
-#include <unistd.h>
+#include <ndb_global.h>
#include <sys/time.h>
#include <sys/mman.h>
long long getMilli();
diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
index 9e396cd98ee..f5d0c6a0a4c 100644
--- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
+++ b/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
@@ -17,6 +17,9 @@
+#include <ndb_global.h>
+#include <sys/mman.h>
+
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbMutex.h>
@@ -27,13 +30,6 @@
#include <NdbHost.h>
#include <NdbMain.h>
#include <getarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
struct ThreadData
{
diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmstest/mmslist.cpp
index bd00211445c..05538785293 100644
--- a/ndb/src/common/portlib/mmstest/mmslist.cpp
+++ b/ndb/src/common/portlib/mmstest/mmslist.cpp
@@ -14,14 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_common.h>
+
#include <NdbOut.hpp>
#include <NdbMain.h>
#include <ose.h>
#include <mms.sig>
#include <mms_err.h>
-#include <string.h>
-#include <stdio.h>
#include <NdbOut.hpp>
/**
diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest/mmstest.cpp
index 6ebb5064aaf..9cc7d810985 100644
--- a/ndb/src/common/portlib/mmstest/mmstest.cpp
+++ b/ndb/src/common/portlib/mmstest/mmstest.cpp
@@ -14,13 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include "NdbThread.h"
#include <NdbMem.h>
#include <NdbMain.h>
-#include <stdlib.h>
-
NDB_COMMAND(ndbmem, "ndbmem", "ndbmem", "Test the ndbmem functionality", 4096){
ndbout << "Starting test of NdbMem" << endl;
diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/ose/NdbCondition.c
index 2ab6e49006b..73a2dbc5d66 100644
--- a/ndb/src/common/portlib/ose/NdbCondition.c
+++ b/ndb/src/common/portlib/ose/NdbCondition.c
@@ -17,7 +17,6 @@
#include "NdbCondition.h"
#include <pthread.h>
-#include <assert.h>
#include <sys/types.h>
#include <malloc.h>
diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/ose/NdbMem.c
index 6d922e4c073..0e38024bbb4 100644
--- a/ndb/src/common/portlib/ose/NdbMem.c
+++ b/ndb/src/common/portlib/ose/NdbMem.c
@@ -17,7 +17,6 @@
#include "NdbMem.h"
-#include <assert.h>
#if defined NDB_OSE
#include <ose.h>
@@ -134,7 +133,6 @@ int NdbMem_MemUnlockAll(){
}
#else
-#include <assert.h>
#include <stdlib.h>
diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/ose/NdbMutex.c
index 859ddefd536..253c0e412ff 100644
--- a/ndb/src/common/portlib/ose/NdbMutex.c
+++ b/ndb/src/common/portlib/ose/NdbMutex.c
@@ -19,7 +19,6 @@
#include <pthread.h>
#include <stdlib.h>
-#include <assert.h>
NdbMutex* NdbMutex_Create(void)
diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/ose/NdbOut.cpp
index 0ee12249ff5..eb81bc9d971 100644
--- a/ndb/src/common/portlib/ose/NdbOut.cpp
+++ b/ndb/src/common/portlib/ose/NdbOut.cpp
@@ -14,12 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbOut.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include <NdbUnistd.h>
-#include <string.h>
+#include <ndb_global.h>
+#include "NdbOut.hpp"
#if defined NDB_SOFTOSE
#include <dbgprintf.h>
diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/ose/NdbThread.c
index 41a5f181c40..e46903a5cce 100644
--- a/ndb/src/common/portlib/ose/NdbThread.c
+++ b/ndb/src/common/portlib/ose/NdbThread.c
@@ -18,7 +18,6 @@
#include "NdbThread.h"
#include <pthread.h>
#include <malloc.h>
-#include <assert.h>
#include <string.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/test/NdbPortLibTest.cpp
index 8a5c8f4a878..55b9ccec5f2 100644
--- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp
+++ b/ndb/src/common/portlib/test/NdbPortLibTest.cpp
@@ -20,7 +20,7 @@
* TODO - Add tests for NdbMem
*/
-
+#include <ndb_global.h>
#include "NdbOut.hpp"
#include "NdbThread.h"
@@ -32,11 +32,6 @@
#include "NdbHost.h"
#include "NdbMain.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
int TestHasFailed;
int verbose = 0;
diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/unix/NdbCondition.c
index 35b80821052..024c6b433f3 100644
--- a/ndb/src/common/portlib/unix/NdbCondition.c
+++ b/ndb/src/common/portlib/unix/NdbCondition.c
@@ -15,16 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbCondition.h>
-#include <pthread.h>
-#include <assert.h>
-#include <sys/types.h>
-#if defined NDB_MACOSX
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
+#include <ndb_global.h>
+#include <NdbCondition.h>
+#include <NdbThread.h>
#include <NdbMutex.h>
struct NdbCondition
diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/unix/NdbDaemon.c
index fc114266c9d..fbe684598f2 100644
--- a/ndb/src/common/portlib/unix/NdbDaemon.c
+++ b/ndb/src/common/portlib/unix/NdbDaemon.c
@@ -14,28 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "NdbDaemon.h"
-#include <assert.h>
-
-#ifdef NDB_LINUX
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#endif
-
-#ifdef NDB_SOLARIS
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#endif
#define NdbDaemon_ErrorSize 500
#if defined(NDB_LINUX) || defined(NDB_SOLARIS)
diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/unix/NdbEnv.c
index b01e3b239ca..d294e0b52ca 100644
--- a/ndb/src/common/portlib/unix/NdbEnv.c
+++ b/ndb/src/common/portlib/unix/NdbEnv.c
@@ -15,9 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbEnv.h"
-#include <string.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
+#include <NdbEnv.h>
const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
{
diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/unix/NdbMem.c
index 5366b187ba6..aa3663e064f 100644
--- a/ndb/src/common/portlib/unix/NdbMem.c
+++ b/ndb/src/common/portlib/unix/NdbMem.c
@@ -15,14 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbMem.h"
+#include <ndb_global.h>
-#include <assert.h>
-#include <assert.h>
-#include <stdlib.h>
-#ifndef NDB_MACOSX
-#include <sys/mman.h>
-#endif
+#include <NdbMem.h>
void NdbMem_Create()
{
diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/unix/NdbMutex.c
index 3cadc0667e7..50f314d2683 100644
--- a/ndb/src/common/portlib/unix/NdbMutex.c
+++ b/ndb/src/common/portlib/unix/NdbMutex.c
@@ -15,11 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbMutex.h"
+#include <ndb_global.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <assert.h>
+#include <NdbThread.h>
+#include <NdbMutex.h>
NdbMutex* NdbMutex_Create(void)
{
diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c
index 599bc9f3215..dbb3da03eab 100644
--- a/ndb/src/common/portlib/unix/NdbThread.c
+++ b/ndb/src/common/portlib/unix/NdbThread.c
@@ -15,16 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "NdbThread.h"
#include <pthread.h>
-#ifdef NDB_MACOSX
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include <assert.h>
-#include <string.h>
-#include <NdbStdio.h>
#define MAX_THREAD_NAME 16
diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c
index 12b508cf33b..77869b673de 100644
--- a/ndb/src/common/portlib/win32/NdbCondition.c
+++ b/ndb/src/common/portlib/win32/NdbCondition.c
@@ -18,7 +18,6 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
-#include <assert.h>
#include <sys/types.h>
#include "NdbCondition.h"
diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c
index 274dc31353f..ab7123b0a29 100644
--- a/ndb/src/common/portlib/win32/NdbMem.c
+++ b/ndb/src/common/portlib/win32/NdbMem.c
@@ -16,8 +16,6 @@
#include <windows.h>
-#include <assert.h>
-#include <NdbStdio.h>
#include "NdbMem.h"
diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c
index c93384d91db..e797024d5bb 100644
--- a/ndb/src/common/portlib/win32/NdbMutex.c
+++ b/ndb/src/common/portlib/win32/NdbMutex.c
@@ -19,7 +19,6 @@
#include <ws2tcpip.h>
#include <windows.h>
#include <time.h>
-#include <assert.h>
#include "NdbMutex.h"
diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c
index ae3c74be70d..1f052f034e8 100644
--- a/ndb/src/common/portlib/win32/NdbThread.c
+++ b/ndb/src/common/portlib/win32/NdbThread.c
@@ -17,7 +17,6 @@
#include <windows.h>
#include <process.h>
-#include <assert.h>
#include "NdbThread.h"
diff --git a/ndb/src/common/transporter/OSE_Receiver.cpp b/ndb/src/common/transporter/OSE_Receiver.cpp
index 558dee92d8d..b7d47b2f88c 100644
--- a/ndb/src/common/transporter/OSE_Receiver.cpp
+++ b/ndb/src/common/transporter/OSE_Receiver.cpp
@@ -20,7 +20,6 @@
#include "TransporterCallback.hpp"
#include <TransporterRegistry.hpp>
#include "TransporterInternalDefinitions.hpp"
-#include <NdbStdio.h>
OSE_Receiver::OSE_Receiver(TransporterRegistry * tr,
int _recBufSize,
diff --git a/ndb/src/common/transporter/OSE_Transporter.cpp b/ndb/src/common/transporter/OSE_Transporter.cpp
index a7a5ed81ce2..c9b0f777319 100644
--- a/ndb/src/common/transporter/OSE_Transporter.cpp
+++ b/ndb/src/common/transporter/OSE_Transporter.cpp
@@ -23,11 +23,9 @@
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <NdbHost.h>
#include <NdbOut.hpp>
#include <time.h>
-#include <assert.h>
OSE_Transporter::OSE_Transporter(int _prioASignalSize,
int _prioBSignalSize,
diff --git a/ndb/src/common/transporter/Packer.cpp b/ndb/src/common/transporter/Packer.cpp
index 77bd66d1ba9..fa72af12dac 100644
--- a/ndb/src/common/transporter/Packer.cpp
+++ b/ndb/src/common/transporter/Packer.cpp
@@ -14,13 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Packer.hpp"
#include <TransporterRegistry.hpp>
#include <TransporterCallback.hpp>
#include <RefConvert.hpp>
-#include <stdio.h>
-
Uint32
TransporterRegistry::unpack(Uint32 * readPtr,
Uint32 sizeOfData,
diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp
index 2be857e8115..c52c8a9d8c0 100644
--- a/ndb/src/common/transporter/SCI_Transporter.cpp
+++ b/ndb/src/common/transporter/SCI_Transporter.cpp
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SCI_Transporter.hpp"
-#include <NdbStdio.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbTick.h>
-#include <stdlib.h>
#include <NdbTick.h>
-#if 0
-#include <malloc.h>
-#include <sys/time.h>
-#endif
+
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp
index 43250853fee..32e59dd57a2 100644
--- a/ndb/src/common/transporter/SHM_Buffer.hpp
+++ b/ndb/src/common/transporter/SHM_Buffer.hpp
@@ -17,10 +17,9 @@
#ifndef SHM_BUFFER_HPP
#define SHM_BUFFER_HPP
-#include <stdio.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
+
#include <NdbSleep.h>
-#include <assert.h>
/**
* These classes implement a circular buffer
diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp
index f18b775efa4..525194db3a6 100644
--- a/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -15,15 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-#include <stdlib.h>
-
#ifdef NDB_WIN32
#include <windows.h>
#else
diff --git a/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/ndb/src/common/transporter/SHM_Transporter.unix.cpp
index 975c1191aea..afbf124432e 100644
--- a/ndb/src/common/transporter/SHM_Transporter.unix.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.unix.cpp
@@ -15,15 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-
-
#include <sys/ipc.h>
#include <sys/shm.h>
diff --git a/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/ndb/src/common/transporter/SHM_Transporter.win32.cpp
index 4ba52c9179d..c289a85da0e 100644
--- a/ndb/src/common/transporter/SHM_Transporter.win32.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.win32.cpp
@@ -15,14 +15,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SHM_Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
-#include <stdio.h>
-
#include <windows.h>
diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp
index 75ef0708e83..63a01f3de24 100644
--- a/ndb/src/common/transporter/SendBuffer.hpp
+++ b/ndb/src/common/transporter/SendBuffer.hpp
@@ -33,10 +33,9 @@
#include "TransporterDefinitions.hpp"
#include <TransporterCallback.hpp>
-#include <stdlib.h>
#ifdef DEBUG_TRANSPORTER
-#include <stdio.h>
+#include <ndb_global.h>
#endif
class SendBuffer {
diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp
index 8a7d1741636..99b6a137797 100644
--- a/ndb/src/common/transporter/TCP_Transporter.cpp
+++ b/ndb/src/common/transporter/TCP_Transporter.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbTCP.h>
#include "TCP_Transporter.hpp"
#include <NdbOut.hpp>
@@ -23,13 +25,9 @@
#if defined NDB_OSE || defined NDB_SOFTOSE
#define inet_send inet_send
#else
-#include <NdbStdio.h>
#define inet_send send
#endif
-#include <stdlib.h>
-
-
#ifdef NDB_WIN32
class ndbstrerror
{
diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp
index 1e19a8375ba..5ca523d5185 100644
--- a/ndb/src/common/transporter/Transporter.cpp
+++ b/ndb/src/common/transporter/Transporter.cpp
@@ -17,7 +17,6 @@
#include "Transporter.hpp"
#include "TransporterInternalDefinitions.hpp"
-#include <NdbStdio.h>
#include <NdbSleep.h>
Transporter::Transporter(NodeId lNodeId, NodeId rNodeId,
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index dcd957f40ce..3f98eeed89e 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -14,14 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "TransporterRegistry.hpp"
#include "TransporterInternalDefinitions.hpp"
#include "Transporter.hpp"
-#include <assert.h>
-#include <stdlib.h>
-
#ifdef NDB_TCP_TRANSPORTER
#include "TCP_Transporter.hpp"
#endif
diff --git a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
index 5d8186badb8..c0a437c4907 100644
--- a/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
+++ b/ndb/src/common/transporter/basictest/basicTransporterTest.cpp
@@ -14,18 +14,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
#include <RefConvert.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
int basePortTCP = 17000;
diff --git a/ndb/src/common/transporter/buddy.cpp b/ndb/src/common/transporter/buddy.cpp
index c65aad1df2c..dc25e2dc66c 100644
--- a/ndb/src/common/transporter/buddy.cpp
+++ b/ndb/src/common/transporter/buddy.cpp
@@ -15,9 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "buddy.hpp"
-#include <stdlib.h>
-#include <math.h>
-
void Chunk256::setFree(bool free){
// Bit 0 of allocationTimeStamp represents if the segment is free or not
diff --git a/ndb/src/common/transporter/buddy.hpp b/ndb/src/common/transporter/buddy.hpp
index 7272ac884ec..f720e9e61a1 100644
--- a/ndb/src/common/transporter/buddy.hpp
+++ b/ndb/src/common/transporter/buddy.hpp
@@ -17,8 +17,7 @@
#ifndef BUDDY_H
#define BUDDY_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
typedef unsigned int Uint32;
typedef unsigned short Uint16;
diff --git a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
index 03ce7ea6df3..803029ee565 100644
--- a/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
+++ b/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include "sisci_types.h"
#include "sisci_api.h"
#include "sisci_error.h"
//#include "sisci_demolib.h"
-#include <strings.h>
-#include <ndb_types.h>
#include <NdbTick.h>
-#include "NdbSleep.h"
+#include <NdbSleep.h>
#define NO_CALLBACK NULL
#define NO_FLAGS 0
#define DATA_TRANSFER_READY 8
diff --git a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
index 6d7f7083a48..d33221c2835 100644
--- a/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
+++ b/ndb/src/common/transporter/perftest/perfTransporterTest.cpp
@@ -14,18 +14,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
#include <RefConvert.hpp>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
int basePortTCP = 17000;
diff --git a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
index 919cc9d7511..0fce6aaad39 100644
--- a/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
+++ b/ndb/src/common/transporter/priotest/prioTransporterTest.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "TransporterRegistry.hpp"
#include "TransporterDefinitions.hpp"
#include "TransporterCallback.hpp"
@@ -21,8 +23,6 @@
#include "prioTransporterTest.hpp"
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/util/Base64.cpp b/ndb/src/common/util/Base64.cpp
index 5f4bbc8645a..482d0b10ad2 100644
--- a/ndb/src/common/util/Base64.cpp
+++ b/ndb/src/common/util/Base64.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <Base64.hpp>
static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
diff --git a/ndb/src/common/util/BaseString.cpp b/ndb/src/common/util/BaseString.cpp
index 1b0eaa1b83c..d15249adf72 100644
--- a/ndb/src/common/util/BaseString.cpp
+++ b/ndb/src/common/util/BaseString.cpp
@@ -15,11 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* -*- c-basic-offset: 4; -*- */
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include "BaseString.hpp"
-#include <stdlib.h>
+#include <ndb_global.h>
+#include <BaseString.hpp>
BaseString::BaseString()
{
@@ -340,7 +337,6 @@ BaseString::trim(char * str, const char * delim){
#ifdef TEST_BASE_STRING
-#include <assert.h>
/*
g++ -g -Wall -o tbs -DTEST_BASE_STRING -I$NDB_TOP/include/util \
diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp
index ad72b41835d..ccd6ba24916 100644
--- a/ndb/src/common/util/File.cpp
+++ b/ndb/src/common/util/File.cpp
@@ -16,8 +16,6 @@
#include <File.hpp>
-#include <errno.h>
-#include <string.h>
#include <sys/stat.h>
#if defined NDB_OSE || defined NDB_SOFTOSE
@@ -31,7 +29,7 @@
//
bool
-File::exists(const char* aFileName)
+File_class::exists(const char* aFileName)
{
bool rc = true;
@@ -56,7 +54,7 @@ File::exists(const char* aFileName)
}
long
-File::size(FILE* f)
+File_class::size(FILE* f)
{
long cur_pos = 0, length = 0;
@@ -69,23 +67,23 @@ File::size(FILE* f)
}
bool
-File::rename(const char* currFileName, const char* newFileName)
+File_class::rename(const char* currFileName, const char* newFileName)
{
return ::rename(currFileName, newFileName) == 0 ? true : false;
}
bool
-File::remove(const char* aFileName)
+File_class::remove(const char* aFileName)
{
return ::remove(aFileName) == 0 ? true : false;
}
-File::File() :
+File_class::File_class() :
m_file(NULL),
m_fileMode("r")
{
}
-File::File(const char* aFileName, const char* mode) :
+File_class::File_class(const char* aFileName, const char* mode) :
m_file(NULL),
m_fileMode(mode)
{
@@ -93,13 +91,13 @@ File::File(const char* aFileName, const char* mode) :
}
bool
-File::open()
+File_class::open()
{
return open(m_fileName, m_fileMode);
}
bool
-File::open(const char* aFileName, const char* mode)
+File_class::open(const char* aFileName, const char* mode)
{
if(m_fileName != aFileName){
/**
@@ -116,21 +114,21 @@ File::open(const char* aFileName, const char* mode)
return rc;
}
-File::~File()
+File_class::~File_class()
{
close();
}
bool
-File::remove()
+File_class::remove()
{
// Close the file first!
close();
- return File::remove(m_fileName);
+ return File_class::remove(m_fileName);
}
bool
-File::close()
+File_class::close()
{
bool rc = true;
if (m_file != NULL)
@@ -144,55 +142,55 @@ File::close()
}
int
-File::read(void* buf, size_t itemSize, size_t nitems) const
+File_class::read(void* buf, size_t itemSize, size_t nitems) const
{
return ::fread(buf, itemSize, nitems, m_file);
}
int
-File::readChar(char* buf, long start, long length) const
+File_class::readChar(char* buf, long start, long length) const
{
return ::fread((void*)&buf[start], 1, length, m_file);
}
int
-File::readChar(char* buf)
+File_class::readChar(char* buf)
{
return readChar(buf, 0, strlen(buf));
}
int
-File::write(const void* buf, size_t size, size_t nitems)
+File_class::write(const void* buf, size_t size, size_t nitems)
{
return ::fwrite(buf, size, nitems, m_file);
}
int
-File::writeChar(const char* buf, long start, long length)
+File_class::writeChar(const char* buf, long start, long length)
{
return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
}
int
-File::writeChar(const char* buf)
+File_class::writeChar(const char* buf)
{
return writeChar(buf, 0, ::strlen(buf));
}
long
-File::size() const
+File_class::size() const
{
- return File::size(m_file);
+ return File_class::size(m_file);
}
const char*
-File::getName() const
+File_class::getName() const
{
return m_fileName;
}
int
-File::flush() const
+File_class::flush() const
{
#if defined NDB_OSE || defined NDB_SOFTOSE
::fflush(m_file);
diff --git a/ndb/src/common/util/InputStream.cpp b/ndb/src/common/util/InputStream.cpp
index c52b594225d..410e9a70e9c 100644
--- a/ndb/src/common/util/InputStream.cpp
+++ b/ndb/src/common/util/InputStream.cpp
@@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "InputStream.hpp"
#include <socket_io.h>
-#include <assert.h>
-#include <string.h>
FileInputStream Stdin(stdin);
diff --git a/ndb/src/common/util/Makefile b/ndb/src/common/util/Makefile
index b3e33704266..e8ca2b87c20 100644
--- a/ndb/src/common/util/Makefile
+++ b/ndb/src/common/util/Makefile
@@ -18,15 +18,7 @@ endif
ifeq ($(NDB_OS), OSE)
SOURCES += NdbErrHnd.cpp
endif
-ifdef NDB_STRDUP
- SOURCES.c += strdup.c
-endif
-ifdef NDB_STRLCAT
- SOURCES.c += strlcat.c
-endif
-ifdef NDB_STRLCPY
- SOURCES.c += strlcpy.c
-endif
+ SOURCES.c += strdup.c strlcat.c strlcpy.c
DIRS := testSimpleProperties
diff --git a/ndb/src/common/util/NdbErrHnd.cpp b/ndb/src/common/util/NdbErrHnd.cpp
index 53df5d702ca..f1c28a7bbdd 100644
--- a/ndb/src/common/util/NdbErrHnd.cpp
+++ b/ndb/src/common/util/NdbErrHnd.cpp
@@ -18,7 +18,6 @@
#if defined NDB_OSE || defined NDB_SOFTOSE
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <ndb_types.h>
#include "ose.h"
diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp
index 2624bfa04bd..6d76cf22402 100644
--- a/ndb/src/common/util/NdbOut.cpp
+++ b/ndb/src/common/util/NdbOut.cpp
@@ -14,11 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbOut.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
-#include <NdbUnistd.h>
-#include <string.h>
+#include <ndb_global.h>
+
+#include <NdbOut.hpp>
#include <OutputStream.hpp>
static FileOutputStream ndbouts_fileoutputstream(stdout);
diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp
index dba7012cc0f..e91ade374cf 100644
--- a/ndb/src/common/util/NdbSqlUtil.cpp
+++ b/ndb/src/common/util/NdbSqlUtil.cpp
@@ -286,7 +286,6 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32
#ifdef NDB_SQL_UTIL_TEST
-#include <assert.h>
#include <NdbTick.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp
index 1143fe00fd1..bf3599dbac9 100644
--- a/ndb/src/common/util/OutputStream.cpp
+++ b/ndb/src/common/util/OutputStream.cpp
@@ -15,8 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <OutputStream.hpp>
-#include <stdarg.h>
#include <socket_io.h>
FileOutputStream::FileOutputStream(FILE * file){
diff --git a/ndb/src/common/util/Parser.cpp b/ndb/src/common/util/Parser.cpp
index 2cb50b429b6..2e8120f88ce 100644
--- a/ndb/src/common/util/Parser.cpp
+++ b/ndb/src/common/util/Parser.cpp
@@ -15,12 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Parser.hpp"
-#include <stdio.h>
#include <NdbOut.hpp>
-#include <string.h>
#include <Properties.hpp>
-#include <assert.h>
#include <Base64.hpp>
#undef DEBUG
diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp
index 4841d6e5e9e..2ab008142ba 100644
--- a/ndb/src/common/util/Properties.cpp
+++ b/ndb/src/common/util/Properties.cpp
@@ -14,14 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <Properties.hpp>
#include <NdbTCP.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <NdbString.h>
-
#include <NdbOut.hpp>
/**
diff --git a/ndb/src/common/util/SimpleProperties.cpp b/ndb/src/common/util/SimpleProperties.cpp
index a118478ba6c..c3980f03c4d 100644
--- a/ndb/src/common/util/SimpleProperties.cpp
+++ b/ndb/src/common/util/SimpleProperties.cpp
@@ -14,12 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <SimpleProperties.hpp>
-#include <stdlib.h>
-#include <NdbString.h>
#include <NdbOut.hpp>
#include <NdbTCP.h>
-#include <assert.h>
#include <UtilBuffer.hpp>
bool
diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp
index 39f46eceed9..a0ec0aaa676 100644
--- a/ndb/src/common/util/SocketServer.cpp
+++ b/ndb/src/common/util/SocketServer.cpp
@@ -15,17 +15,15 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SocketServer.hpp"
#include <NdbTCP.h>
-#include <string.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbSleep.h>
-#include <stdio.h>
-#include <assert.h>
-
#define DEBUG(x) ndbout << x << endl;
SocketServer::SocketServer(int maxSessions) :
diff --git a/ndb/src/common/util/filetest/FileUnitTest.cpp b/ndb/src/common/util/filetest/FileUnitTest.cpp
index ebcca26d3d2..b6e7b7e8ec0 100644
--- a/ndb/src/common/util/filetest/FileUnitTest.cpp
+++ b/ndb/src/common/util/filetest/FileUnitTest.cpp
@@ -18,7 +18,6 @@
#include <File.hpp>
#include <NdbOut.hpp>
-#include <assert.h>
typedef bool (*TESTFUNC)(const char*);
diff --git a/ndb/src/common/util/getarg.c b/ndb/src/common/util/getarg.c
index 79742656a8f..136965ad89c 100644
--- a/ndb/src/common/util/getarg.c
+++ b/ndb/src/common/util/getarg.c
@@ -32,16 +32,8 @@
* SUCH DAMAGE.
*/
-#include <ndb_types.h>
+#include <ndb_global.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$KTH: getarg.c,v 1.23 2000/09/01 21:25:54 lha Exp $");
-#endif
-
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <time.h>
#include <ctype.h>
#include "getarg.h"
diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp
index a0709a3fa13..889e83edf6f 100644
--- a/ndb/src/common/util/new.cpp
+++ b/ndb/src/common/util/new.cpp
@@ -1,6 +1,5 @@
-#include <malloc.h>
-#include <stdlib.h>
+#include <ndb_global.h>
extern "C" {
void (* ndb_new_handler)() = 0;
diff --git a/ndb/src/common/util/random.c b/ndb/src/common/util/random.c
index 91da19572e2..286ab093a26 100644
--- a/ndb/src/common/util/random.c
+++ b/ndb/src/common/util/random.c
@@ -18,16 +18,8 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <sys/types.h>
+#include <ndb_global.h>
-#ifndef NDB_WIN32
-#include <sys/time.h>
-#endif
-
-#include <ndb_types.h>
#include <NdbOut.hpp>
#include <random.h>
diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp
index 878a9059512..8def7ebe91b 100644
--- a/ndb/src/common/util/socket_io.cpp
+++ b/ndb/src/common/util/socket_io.cpp
@@ -14,13 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbTCP.h>
#include <socket_io.h>
-#include <stdarg.h>
-#include <string.h>
-#include <NdbStdio.h>
#include <NdbOut.hpp>
-#include <NdbString.h>
extern "C"
int
diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c
index 5291be86b0f..afe2306427e 100644
--- a/ndb/src/common/util/strdup.c
+++ b/ndb/src/common/util/strdup.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
+#include <ndb_global.h>
#ifndef HAVE_STRDUP
char *
diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c
index bf8b0d9a5cb..3da47dee6f5 100644
--- a/ndb/src/common/util/strlcat.c
+++ b/ndb/src/common/util/strlcat.c
@@ -31,17 +31,14 @@
* SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include <ndb_global.h>
#include <ndb_types.h>
/* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */
-/*#include <NdbString.h>*/
#ifndef HAVE_STRLCAT
+
size_t
strlcat (char *dst, const char *src, size_t dst_sz)
{
diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c
index 9a3048081ca..70233e3e239 100644
--- a/ndb/src/common/util/strlcpy.c
+++ b/ndb/src/common/util/strlcpy.c
@@ -31,10 +31,7 @@
* SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include <ndb_global.h>
#include <ndb_types.h>
/* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */
diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp
index 4a2999b89c1..3aa2af92c5b 100644
--- a/ndb/src/common/util/testProperties/testProperties.cpp
+++ b/ndb/src/common/util/testProperties/testProperties.cpp
@@ -14,10 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "Properties.hpp"
#include <NdbOut.hpp>
-#include <stdlib.h>
-#include <string.h>
#include "uucode.h"
diff --git a/ndb/src/common/util/testSimpleProperties/sp_test.cpp b/ndb/src/common/util/testSimpleProperties/sp_test.cpp
index d6dbe2a1502..d4052b64132 100644
--- a/ndb/src/common/util/testSimpleProperties/sp_test.cpp
+++ b/ndb/src/common/util/testSimpleProperties/sp_test.cpp
@@ -14,10 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SimpleProperties.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
-#include <stdio.h>
Uint32 page[8192];
diff --git a/ndb/src/common/util/uucode.c b/ndb/src/common/util/uucode.c
index f862d982204..da34d565153 100644
--- a/ndb/src/common/util/uucode.c
+++ b/ndb/src/common/util/uucode.c
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
/* ENC is the basic 1 character encoding function to make a char printing */
/* DEC is single character decode */
diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c
index ca8477fa7ac..10f621d5db8 100644
--- a/ndb/src/common/util/version.c
+++ b/ndb/src/common/util/version.c
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <string.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include <ndb_version.h>
#include <version.h>
diff --git a/ndb/src/cw/cpcc-win32/C++/StdAfx.h b/ndb/src/cw/cpcc-win32/C++/StdAfx.h
index d84b5811f8d..370d04fb466 100644
--- a/ndb/src/cw/cpcc-win32/C++/StdAfx.h
+++ b/ndb/src/cw/cpcc-win32/C++/StdAfx.h
@@ -48,15 +48,12 @@
#include <afxtempl.h>
// C RunTime Header Files
-#include <stdlib.h>
-#include <malloc.h>
+#include <ndb_global.h>
#include <memory.h>
#include <tchar.h>
#include <commctrl.h>
#include <shlwapi.h>
#include <crtdbg.h>
-#include <string.h>
-#include <stdio.h>
// Local Header Files
#include "resource.h"
diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp
index 9cf17addcc2..caf19ddba0e 100644
--- a/ndb/src/cw/cpcd/APIService.cpp
+++ b/ndb/src/cw/cpcd/APIService.cpp
@@ -23,7 +23,6 @@
#include "APIService.hpp"
#include "CPCD.hpp"
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
/**
diff --git a/ndb/src/cw/cpcd/CPCD.cpp b/ndb/src/cw/cpcd/CPCD.cpp
index 8864ccf6e4e..f2878b7dea1 100644
--- a/ndb/src/cw/cpcd/CPCD.cpp
+++ b/ndb/src/cw/cpcd/CPCD.cpp
@@ -15,11 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <string.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
-#include <errno.h>
#include "APIService.hpp"
#include "CPCD.hpp"
diff --git a/ndb/src/cw/cpcd/Monitor.cpp b/ndb/src/cw/cpcd/Monitor.cpp
index a96f3509ee8..2935cd0a648 100644
--- a/ndb/src/cw/cpcd/Monitor.cpp
+++ b/ndb/src/cw/cpcd/Monitor.cpp
@@ -14,9 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbThread.h>
#include <NdbOut.hpp>
-#include <NdbUnistd.h>
#include <NdbSleep.h>
#include "CPCD.hpp"
diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp
index a54c6b8e475..76639a2a618 100644
--- a/ndb/src/cw/cpcd/Process.cpp
+++ b/ndb/src/cw/cpcd/Process.cpp
@@ -14,13 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <sys/types.h>
+#include <ndb_global.h>
#include <signal.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <NdbUnistd.h>
#include <BaseString.hpp>
#include <InputStream.hpp>
@@ -28,10 +25,10 @@
#include "CPCD.hpp"
#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/wait.h>
void
CPCD::Process::print(FILE * f){
@@ -108,7 +105,7 @@ bool
CPCD::Process::isRunning() {
if(m_pid <= 1){
- logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid);
+ //logger.critical("isRunning(%d) invalid pid: %d", m_id, m_pid);
return false;
}
/* Check if there actually exists a process with such a pid */
@@ -360,7 +357,7 @@ CPCD::Process::start() {
*/
switch(pid = fork()) {
case 0: /* Child */
-
+ setsid();
writePid(getpid());
if(runas(m_runas.c_str()) == 0){
do_exec();
@@ -389,11 +386,11 @@ CPCD::Process::start() {
pid_t pid;
switch(pid = fork()) {
case 0: /* Child */
+ setsid();
writePid(getpid());
if(runas(m_runas.c_str()) != 0){
_exit(1);
}
- setsid();
do_exec();
_exit(1);
/* NOTREACHED */
@@ -428,11 +425,11 @@ CPCD::Process::start() {
while(readPid() < 0){
sched_yield();
}
-
+
if(pid != -1 && pid != m_pid){
logger.error("pid and m_pid don't match: %d %d", pid, m_pid);
}
-
+
if(isRunning()){
m_status = RUNNING;
return 0;
@@ -454,28 +451,32 @@ CPCD::Process::stop() {
}
m_status = STOPPING;
- int ret = kill((pid_t)m_pid, SIGTERM);
+ const pid_t pgid = - getpgid(m_pid);
+ int ret = kill(pgid, SIGTERM);
switch(ret) {
case 0:
- logger.debug("Sent SIGTERM to pid %d", (int)m_pid);
+ logger.debug("Sent SIGTERM to pid %d", (int)pgid);
break;
default:
- logger.debug("kill pid: %d : %s", (int)m_pid, strerror(errno));
+ logger.debug("kill pid: %d : %s", (int)pgid, strerror(errno));
break;
}
-
- if(isRunning()){
- ret = kill((pid_t)m_pid, SIGKILL);
+
+ errno = 0;
+ ret = kill(pgid, 0);
+ if(ret == 0) {
+ errno = 0;
+ ret = kill(pgid, SIGKILL);
switch(ret) {
case 0:
- logger.debug("Sent SIGKILL to pid %d", (int)m_pid);
+ logger.debug("Sent SIGKILL to pid %d", (int)pgid);
break;
default:
- logger.debug("kill pid: %d : %s\n", (int)m_pid, strerror(errno));
+ logger.debug("kill pid: %d : %s\n", (int)pgid, strerror(errno));
break;
}
- }
-
+ }
+
m_pid = -1;
m_status = STOPPED;
}
diff --git a/ndb/src/cw/cpcd/common.hpp b/ndb/src/cw/cpcd/common.hpp
index 65fcce05f66..c3d87b8b9f5 100644
--- a/ndb/src/cw/cpcd/common.hpp
+++ b/ndb/src/cw/cpcd/common.hpp
@@ -17,7 +17,7 @@
#ifndef __CPCD_COMMON_HPP_INCLUDED__
#define __CPCD_COMMON_HPP_INCLUDED__
-#include <stdio.h>
+#include <ndb_global.h>
#include <logger/Logger.hpp>
#include <getarg.h>
diff --git a/ndb/src/cw/test/socketclient/socketClientTest.cpp b/ndb/src/cw/test/socketclient/socketClientTest.cpp
index a4a0ed1e933..423c196aa43 100644
--- a/ndb/src/cw/test/socketclient/socketClientTest.cpp
+++ b/ndb/src/cw/test/socketclient/socketClientTest.cpp
@@ -15,11 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <Properties.hpp>
#include <socket_io.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbSleep.h>
diff --git a/ndb/src/cw/util/ClientInterface.hpp b/ndb/src/cw/util/ClientInterface.hpp
index 764705afacd..66ecfe05197 100644
--- a/ndb/src/cw/util/ClientInterface.hpp
+++ b/ndb/src/cw/util/ClientInterface.hpp
@@ -16,6 +16,7 @@
#ifndef CLIENT_IF_HPP
#define CLIENT_IF_HPP
+#include <ndb_global.h>
#include <Parser.hpp>
#include <InputStream.hpp>
#include <Parser.hpp>
@@ -23,9 +24,6 @@
#include <Properties.hpp>
#include "SocketRegistry.hpp"
#include "SocketService.hpp"
-#include "string.h"
-#include <stdio.h>
-#include <stdlib.h>
class ClientInterface {
private:
diff --git a/ndb/src/kernel/blocks/backup/FsBuffer.hpp b/ndb/src/kernel/blocks/backup/FsBuffer.hpp
index 4b5d95a19a5..2f3c7daae43 100644
--- a/ndb/src/kernel/blocks/backup/FsBuffer.hpp
+++ b/ndb/src/kernel/blocks/backup/FsBuffer.hpp
@@ -17,10 +17,7 @@
#ifndef FS_BUFFER_HPP
#define FS_BUFFER_HPP
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#define DEBUG(x)
diff --git a/ndb/src/kernel/blocks/backup/read.cpp b/ndb/src/kernel/blocks/backup/read.cpp
index 8300c74ab43..921c352ea13 100644
--- a/ndb/src/kernel/blocks/backup/read.cpp
+++ b/ndb/src/kernel/blocks/backup/read.cpp
@@ -15,9 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile b/ndb/src/kernel/blocks/backup/restore/Makefile
index f99e3e3da0d..4c884525d73 100644
--- a/ndb/src/kernel/blocks/backup/restore/Makefile
+++ b/ndb/src/kernel/blocks/backup/restore/Makefile
@@ -1,12 +1,12 @@
include .defs.mk
-TYPE := ndbapi ndbapiclient
+TYPE := *
BIN_TARGET := restore
BIN_TARGET_LIBS :=
-BIN_TARGET_ARCHIVES := NDB_API general
+BIN_TARGET_ARCHIVES := NDB_API
-CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi
+CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi -I$(NDB_TOP)/include/ndbapi -I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib -I$(NDB_TOP)/include/kernel
#ifneq ($(MYSQLCLUSTER_TOP),)
#CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
index b24bf7b1e1d..2c3c1c8df7b 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
@@ -14,11 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Restore.hpp"
#include "BackupFormat.hpp"
#include <NdbTCP.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
#include <Bitmask.hpp>
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
index f1a73bb18b9..0c075e18933 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
@@ -17,16 +17,13 @@
#ifndef RESTORE_H
#define RESTORE_H
-#include <stddef.h>
+#include <ndb_global.h>
#include <BackupFormat.hpp>
#include <NdbApi.hpp>
#include <AttrType.hpp>
#include <NdbOut.hpp>
#include "myVector.hpp"
-#include <NdbStdio.h>
-#include <NdbUnistd.h>
-#include <NdbString.h>
#include <ndb_version.h>
#include <version.h>
diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp
index b38f6ab751b..4c15785d5c2 100644
--- a/ndb/src/kernel/blocks/backup/restore/main.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/main.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Restore.hpp"
#include <getarg.h>
#include <NdbSleep.h>
diff --git a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
index b16990bda6c..51f05ae1d6e 100644
--- a/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
+++ b/ndb/src/kernel/blocks/dbdict/printSchemafile/printSchemafile.cpp
@@ -15,13 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
+#include <ndb_global.h>
+#include <sys/stat.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <SchemaFile.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
void
usage(const char * prg){
diff --git a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
index 4c55425bdd7..90bb1ded490 100644
--- a/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
+++ b/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
@@ -15,13 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
+#include <ndb_global.h>
+#include <sys/stat.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <Sysfile.hpp>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
void
usage(const char * prg){
diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
index d2d166fa03e..540df7b507e 100644
--- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
+++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp
@@ -25,11 +25,10 @@
//----------------------------------------------------------------
+#include <ndb_global.h>
+
#include "records.hpp"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+
#define RETURN_ERROR 1
#define RETURN_OK 0
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index c56e455a42a..4737c8422c4 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -83,6 +83,9 @@
#define jamEntry() jamEntryLine(90000 + __LINE__)
#endif
+#undef max
+#undef min
+
class Configuration;
class Dbtux : public SimulatedBlock {
diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
index a14caa47295..92410e1a784 100644
--- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
+++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
@@ -14,10 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "DbUtil.hpp"
-#include <new>
-#include <stddef.h>
#include <ndb_version.h>
#include <signaldata/WaitGCP.hpp>
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index 68a474cb628..f73c1ec5ee7 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -23,20 +23,17 @@
#endif
#endif
+#include <ndb_global.h>
+
#include "Error.hpp"
#include "AsyncFile.hpp"
#include <ErrorHandlingMacros.hpp>
#include <kernel_types.h>
-#include <string.h>
#include <NdbMem.h>
#include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
#ifdef NDB_LINUX
// This is for pread and pwrite
#ifndef __USE_UNIX98
@@ -44,9 +41,7 @@
#endif
#endif
-#include <NdbUnistd.h>
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
-#include <NdbStdio.h>
#else
// For readv and writev
#include <sys/uio.h>
diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.cpp b/ndb/src/kernel/blocks/ndbfs/Filename.cpp
index c0bc52b4501..494c9c74eb9 100644
--- a/ndb/src/kernel/blocks/ndbfs/Filename.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Filename.cpp
@@ -14,10 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbUnistd.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include "Filename.hpp"
diff --git a/ndb/src/kernel/blocks/ndbfs/Filename.hpp b/ndb/src/kernel/blocks/ndbfs/Filename.hpp
index 4c3569b5485..29aba79c9dc 100644
--- a/ndb/src/kernel/blocks/ndbfs/Filename.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/Filename.hpp
@@ -52,8 +52,8 @@
//
//===========================================================================
+#include <ndb_global.h>
#include <kernel_types.h>
-#include <NdbUnistd.h>
class Filename
{
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
index 6e0c2721ca0..435a6a6b208 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
@@ -76,7 +76,6 @@
#include "NdbCondition.h"
#include <NdbOut.hpp>
-#include <assert.h>
template <class T>
class MemoryChannel
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
index 9f70efcadf7..ca90bc60153 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp
@@ -65,7 +65,6 @@
#include "NdbMutex.h"
#include "NdbCondition.h"
-#include <assert.h>
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 8992a2104e9..9c1cf5021b3 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <limits.h>
-#include <errno.h>
+#include <ndb_global.h>
#include "Ndbfs.hpp"
#include "AsyncFile.hpp"
diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp
index 1aa937f4675..56627cba46f 100644
--- a/ndb/src/kernel/error/ErrorReporter.cpp
+++ b/ndb/src/kernel/error/ErrorReporter.cpp
@@ -15,17 +15,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Error.hpp"
#include "ErrorReporter.hpp"
#include "ErrorMessages.hpp"
#include <FastScheduler.hpp>
#include <DebuggerNames.hpp>
-#include <NdbUnistd.h>
-#include <NdbStdio.h>
#include <NdbHost.h>
#include <NdbConfig.h>
-#include <string.h>
#include <Configuration.hpp>
#define MESSAGE_LENGTH 400
diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp
index f1428821ab0..20340a9602f 100644
--- a/ndb/src/kernel/error/ErrorReporter.hpp
+++ b/ndb/src/kernel/error/ErrorReporter.hpp
@@ -17,9 +17,10 @@
#ifndef ERRORREPORTER_H
#define ERRORREPORTER_H
+#include <ndb_global.h>
+
#include "TimeModule.hpp"
#include "Error.hpp"
-#include <stdio.h>
#include <Emulator.hpp>
diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp
index fa986e5af85..1c0f42dab76 100644
--- a/ndb/src/kernel/ndb-main/Main.cpp
+++ b/ndb/src/kernel/ndb-main/Main.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <ndb_version.h>
#include "Configuration.hpp"
#include <TransporterRegistry.hpp>
@@ -32,7 +34,6 @@
#include <NodeState.hpp>
#if defined NDB_SOLARIS
-#include <sys/types.h> // For system information
#include <sys/processor.h> // For system informatio
#endif
@@ -42,7 +43,6 @@
extern EventLogger g_eventLogger;
#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
-#include <sys/types.h>
#include <sys/wait.h>
#endif
diff --git a/ndb/src/kernel/vm/ArrayPool.hpp b/ndb/src/kernel/vm/ArrayPool.hpp
index 4a84047b614..284d29dcefa 100644
--- a/ndb/src/kernel/vm/ArrayPool.hpp
+++ b/ndb/src/kernel/vm/ArrayPool.hpp
@@ -17,12 +17,12 @@
#ifndef ARRAY_POOL_HPP
#define ARRAY_POOL_HPP
+#include <ndb_global.h>
+
#include <pc.hpp>
#include <ErrorReporter.hpp>
#include <NdbMem.h>
#include <Bitmask.hpp>
-#include <assert.h>
-#include <stddef.h>
template <class T> class Array;
template <class T> class SLList;
diff --git a/ndb/src/kernel/vm/ClusterConfiguration.cpp b/ndb/src/kernel/vm/ClusterConfiguration.cpp
index f04081ee3c1..3a6478380d1 100644
--- a/ndb/src/kernel/vm/ClusterConfiguration.cpp
+++ b/ndb/src/kernel/vm/ClusterConfiguration.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "ClusterConfiguration.hpp"
#include <ErrorHandlingMacros.hpp>
@@ -27,9 +29,6 @@
#include <signaldata/TupSizeAltReq.hpp>
#include <signaldata/TuxSizeAltReq.hpp>
-#include <string.h>
-#include <assert.h>
-
ClusterConfiguration::ClusterConfiguration()
{
for (unsigned i= 0; i< MAX_SIZEALT_BLOCKS; i++) // initialize
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp
index 03495449787..706d75509f2 100644
--- a/ndb/src/kernel/vm/Configuration.cpp
+++ b/ndb/src/kernel/vm/Configuration.cpp
@@ -24,7 +24,6 @@
#include <NdbMem.h>
#include <NdbOut.hpp>
#include <WatchDog.hpp>
-#include <NdbString.h>
#include <getarg.h>
diff --git a/ndb/src/kernel/vm/DLHashTable.hpp b/ndb/src/kernel/vm/DLHashTable.hpp
index f7cd7ae5228..13a9632f8da 100644
--- a/ndb/src/kernel/vm/DLHashTable.hpp
+++ b/ndb/src/kernel/vm/DLHashTable.hpp
@@ -17,9 +17,8 @@
#ifndef DL_HASHTABLE_HPP
#define DL_HASHTABLE_HPP
+#include <ndb_global.h>
#include "ArrayList.hpp"
-#include <assert.h>
-#include <stddef.h>
/**
* DLHashTable implements a hashtable using chaining
diff --git a/ndb/src/kernel/vm/DLHashTable2.hpp b/ndb/src/kernel/vm/DLHashTable2.hpp
index 8386790b0a6..6b166331631 100644
--- a/ndb/src/kernel/vm/DLHashTable2.hpp
+++ b/ndb/src/kernel/vm/DLHashTable2.hpp
@@ -17,10 +17,9 @@
#ifndef DL_HASHTABLE2_HPP
#define DL_HASHTABLE2_HPP
+#include <ndb_global.h>
+
#include "ArrayList.hpp"
-#include <assert.h>
-#include <stddef.h>
-#include <new>
/**
* DLHashTable2 is a DLHashTable variant meant for cases where different
diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index a852e045c6e..7eae1f519c0 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "Emulator.hpp"
#include <FastScheduler.hpp>
#include <SignalLoggerManager.hpp>
@@ -31,7 +33,6 @@
#include <NdbOut.hpp>
#include <NdbMutex.h>
#include <NdbSleep.h>
-#include <stdlib.h>
#include <new>
extern "C" {
diff --git a/ndb/src/kernel/vm/GlobalData.hpp b/ndb/src/kernel/vm/GlobalData.hpp
index ca7dd467750..99b65727374 100644
--- a/ndb/src/kernel/vm/GlobalData.hpp
+++ b/ndb/src/kernel/vm/GlobalData.hpp
@@ -17,11 +17,10 @@
#ifndef GLOBAL_DATA_H
#define GLOBAL_DATA_H
+#include <ndb_global.h>
#include <kernel_types.h>
#include "Prio.hpp"
#include "VMSignal.hpp"
-#include <stdlib.h>
-#include <assert.h>
#include <BlockNumbers.h>
#include <NodeState.hpp>
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index f36b3e43d42..e3f087d7d74 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "SimulatedBlock.hpp"
#include <NdbOut.hpp>
#include <GlobalData.hpp>
@@ -24,8 +26,6 @@
#include <SignalLoggerManager.hpp>
#include <FastScheduler.hpp>
#include <NdbMem.h>
-#include <NdbStdio.h>
-#include <stdarg.h>
#include <signaldata/EventReport.hpp>
#include <signaldata/ContinueFragmented.hpp>
#include <signaldata/NodeStateSignalData.hpp>
diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp
index 1fec4ea86bd..3798e4040c8 100644
--- a/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -14,12 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <TransporterCallback.hpp>
#include <TransporterRegistry.hpp>
#include <FastScheduler.hpp>
#include <Emulator.hpp>
#include <ErrorHandlingMacros.hpp>
-#include <stdio.h>
#include "LongSignal.hpp"
diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp
index d436143c055..45e731f2079 100644
--- a/ndb/src/kernel/vm/VMSignal.hpp
+++ b/ndb/src/kernel/vm/VMSignal.hpp
@@ -17,14 +17,15 @@
#ifndef VMSignal_H
#define VMSignal_H
+#include <ndb_global.h>
+#include <ndb_limits.h>
+#include <kernel_types.h>
+
#include <ErrorReporter.hpp>
#include <NodeBitmask.hpp>
-#include <ndb_limits.h>
-#include <kernel_types.h>
#include <RefConvert.hpp>
#include <TransporterDefinitions.hpp>
-#include <stdlib.h>
/**
* Struct used when sending to multiple blocks
diff --git a/ndb/src/kernel/vm/al_test/arrayListTest.cpp b/ndb/src/kernel/vm/al_test/arrayListTest.cpp
index 39d8170cfc5..bb320106653 100644
--- a/ndb/src/kernel/vm/al_test/arrayListTest.cpp
+++ b/ndb/src/kernel/vm/al_test/arrayListTest.cpp
@@ -16,11 +16,11 @@
+#include <ndb_global.hpp>
+
#include <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
struct A_Listable_Object {
Uint32 next;
diff --git a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
index 8b554d5bb41..e80905121e1 100644
--- a/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
+++ b/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp
@@ -16,12 +16,11 @@
+#include <ndb_global.h>
+
#include <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
-#include <string.h>
struct A_Poolable_Object {
Uint32 next;
diff --git a/ndb/src/kernel/vm/al_test/main.cpp b/ndb/src/kernel/vm/al_test/main.cpp
index 42c36173b56..23193b50725 100644
--- a/ndb/src/kernel/vm/al_test/main.cpp
+++ b/ndb/src/kernel/vm/al_test/main.cpp
@@ -14,11 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <ArrayList.hpp>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
#include <NdbMain.h>
#include "arrayListTest.cpp"
diff --git a/ndb/src/kernel/vm/testCopy/rr.cpp b/ndb/src/kernel/vm/testCopy/rr.cpp
index 2da8383f523..1e8305dfe4c 100644
--- a/ndb/src/kernel/vm/testCopy/rr.cpp
+++ b/ndb/src/kernel/vm/testCopy/rr.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <sched.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
int
main(int argc, char * const argv[]){
diff --git a/ndb/src/kernel/vm/testCopy/testCopy.cpp b/ndb/src/kernel/vm/testCopy/testCopy.cpp
index 1b4b24f5934..78a1dab2619 100644
--- a/ndb/src/kernel/vm/testCopy/testCopy.cpp
+++ b/ndb/src/kernel/vm/testCopy/testCopy.cpp
@@ -15,11 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <ndb_types.h>
-#include <string.h>
-#include <stdlib.h>
#ifdef __NDB_FORTE6
#define HAND
diff --git a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
index def8387e343..5ba59418223 100644
--- a/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
+++ b/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp
@@ -14,10 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <ndb_global.h>
#include <NdbTick.h>
#include <DataBuffer.hpp>
-#include <stdlib.h>
-#include <string.h>
+
+#undef test
struct Buffer {
Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;}
diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
index 6d421268a0a..af4e2ca6e24 100644
--- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
+++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <editline/editline.h>
#include <SignalSender.hpp>
-#include <assert.h>
-#include <stdlib.h>
void
print_help(){
diff --git a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
index 20a5d5230fb..e16870edf11 100644
--- a/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
+++ b/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp
@@ -14,12 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbTick.h>
#include <TransporterDefinitions.hpp>
#include <SimpleProperties.hpp>
#include <LongSignal.hpp>
-#include <stdlib.h>
-#include <string.h>
+
+#undef test
struct Buffer {
Buffer(Uint32 size){ m_sz = size; buffer = new Uint32[m_sz]; m_len = 0;}
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 4c1355e8e46..fcdfe943fb1 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -14,17 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbTCP.h>
#include "mgmapi.h"
#include "mgmapi_debug.h"
#include <socket_io.h>
-#include <stdlib.h>
-
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbString.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <SocketServer.hpp>
#include <Parser.hpp>
diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c
index 4b3b365c94f..d5086b20b6a 100644
--- a/ndb/src/mgmapi/test/keso.c
+++ b/ndb/src/mgmapi/test/keso.c
@@ -15,6 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <mgmapi.h>
#ifdef VM_TRACE
@@ -22,9 +24,6 @@
#endif
#include <NdbOut.hpp>
-#include <NdbStdio.h>
-
-#include <stdlib.h>
static int testConnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
static int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
diff --git a/ndb/src/mgmapi/test/mgmSrvApi.cpp b/ndb/src/mgmapi/test/mgmSrvApi.cpp
index e93c54ae5a7..4a8e38c9ba5 100644
--- a/ndb/src/mgmapi/test/mgmSrvApi.cpp
+++ b/ndb/src/mgmapi/test/mgmSrvApi.cpp
@@ -25,11 +25,9 @@
* Server API" document
*
*****************************************************/
+#include <ndb_global.h>
#include "mgmapi.h"
#include "mgmapi_commands.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index 29d25ebf7d3..fba5fda32dd 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -14,13 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <limits.h>
-
-#include <ndb_version.h>
+#include "CommandInterpreter.hpp"
#include <mgmapi.h>
#include <mgmapi_debug.h>
@@ -34,7 +28,6 @@
#endif // HAVE_GLOBAL_REPLICATION
#include "MgmtErrorReporter.hpp"
-#include "CommandInterpreter.hpp"
#include "CpcClient.hpp"
#ifdef NDB_SOLARIS // XXX fix me
diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp
index 9049ef39915..796a4e4838e 100644
--- a/ndb/src/mgmclient/CommandInterpreter.hpp
+++ b/ndb/src/mgmclient/CommandInterpreter.hpp
@@ -22,9 +22,7 @@
// Author: Peter Lind
//*****************************************************************************
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <Vector.hpp>
#include <editline/editline.h>
diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/src/mgmclient/CpcClient.cpp
index 24eab7194e9..74fa1a828ed 100644
--- a/ndb/src/mgmclient/CpcClient.cpp
+++ b/ndb/src/mgmclient/CpcClient.cpp
@@ -14,14 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <ndb_types.h>
+#include <ndb_global.h>
#include <editline/editline.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
#include <netdb.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <NdbTCP.h>
diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp
index bbadaeb5206..2dcadf9369d 100644
--- a/ndb/src/mgmclient/main.cpp
+++ b/ndb/src/mgmclient/main.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/param.h>
+#include <ndb_global.h>
#include <NdbMain.h>
#include <NdbHost.h>
diff --git a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
index 984ffd952b2..9ffd5ed6201 100644
--- a/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
+++ b/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp
@@ -15,10 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "../CpcClient.hpp"
#include <Vector.hpp>
-#include <assert.h>
-#include <stdlib.h>
SimpleCpcClient g_client("localhost", 1234);
Vector<SimpleCpcClient::Process> g_procs;
diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp
index e68aa7da084..3466ee76226 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.hpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.hpp
@@ -21,9 +21,7 @@
// Author: Peter Lind
//*****************************************************************************
-#include <NdbStdio.h>
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <Vector.hpp>
#include <editline/editline.h>
#include <BaseString.hpp>
diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp
index 4fdf3c99d43..ce8765d6c73 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -20,7 +20,6 @@
#include <kernel_types.h>
#include "Config.hpp"
#include <NdbCondition.h>
-#include <NdbConstant.hpp>
#include <mgmapi.h>
diff --git a/ndb/src/mgmsrv/NodeLogLevel.hpp b/ndb/src/mgmsrv/NodeLogLevel.hpp
index 3e631e57901..3ad758cde99 100644
--- a/ndb/src/mgmsrv/NodeLogLevel.hpp
+++ b/ndb/src/mgmsrv/NodeLogLevel.hpp
@@ -17,7 +17,8 @@
#ifndef NODELOGLEVEL_H
#define NODELOGLEVEL_H
-#include <portlib/NdbConstant.hpp>
+#include <ndb_global.h>
+
#include <signaldata/SetLogLevelOrd.hpp>
/**
diff --git a/ndb/src/mgmsrv/NodeLogLevelList.cpp b/ndb/src/mgmsrv/NodeLogLevelList.cpp
index 7cf6dcc4b7e..6c7c091c1a8 100644
--- a/ndb/src/mgmsrv/NodeLogLevelList.cpp
+++ b/ndb/src/mgmsrv/NodeLogLevelList.cpp
@@ -14,10 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NodeLogLevelList.hpp"
+#include <ndb_global.h>
+#include "NodeLogLevelList.hpp"
#include "NodeLogLevel.hpp"
-#include "NdbStdio.h"
//
// PUBLIC
diff --git a/ndb/src/mgmsrv/convertStrToInt.cpp b/ndb/src/mgmsrv/convertStrToInt.cpp
index 82bdb8e4f2f..e5216047d10 100644
--- a/ndb/src/mgmsrv/convertStrToInt.cpp
+++ b/ndb/src/mgmsrv/convertStrToInt.cpp
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
bool convert(const char* s, int& val) {
diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
index 0e9397e43c0..224c82aa8a1 100644
--- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
+++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
@@ -14,15 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+#include <ndb_version.h>
+
#include <NdbMain.h>
#include <Properties.hpp>
-#include <stdlib.h>
#include "InitConfigFileParser.hpp"
-#include "Config.hpp"
-#include <assert.h>
-#include <NdbUnistd.h>
-#include <ndb_version.h>
+#include <Config.hpp>
void usage(const char * prg){
ndbout << "Usage " << prg << ": <Init config> <Binary file>" << endl;
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index 93fb0109669..1b536b6d741 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -14,6 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+#include <ndb_limits.h>
+#include <ndb_version.h>
+
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
@@ -23,12 +27,8 @@
#include <NdbSleep.h>
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <ndb_limits.h>
-#include <stdio.h>
-#include <assert.h>
-#include <ndb_version.h>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/ApiRegSignalData.hpp>
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index 36fbc85a875..f6f2106f2aa 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -14,12 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "DictCache.hpp"
#include "NdbDictionaryImpl.hpp"
#include <NdbTick.h>
#include <NdbCondition.h>
#include <NdbSleep.h>
-#include <stdlib.h>
LocalDictCache::LocalDictCache(){
m_tableHash.createHashTable();
diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile
index 932fbd844d2..328bb5e3741 100644
--- a/ndb/src/ndbapi/Makefile
+++ b/ndb/src/ndbapi/Makefile
@@ -32,6 +32,8 @@ SOURCES = \
Ndbif.cpp \
Ndbinit.cpp \
Ndberror.cpp \
+ ndberror.c \
+ NdbErrorOut.cpp \
NdbConnection.cpp \
NdbConnectionScan.cpp \
NdbOperation.cpp \
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index d7930f32d72..68f49b975ee 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -21,14 +21,16 @@
Name: Ndb.cpp
******************************************************************************/
+#include <ndb_global.h>
+
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
#include "NdbSchemaOp.hpp"
#include "NdbSchemaCon.hpp"
-#include "NdbOperation.hpp"
-#include "NdbConnection.hpp"
-#include "NdbEventOperation.hpp"
-#include "NdbRecAttr.hpp"
+#include <NdbOperation.hpp>
+#include <NdbConnection.hpp>
+#include <NdbEventOperation.hpp>
+#include <NdbRecAttr.hpp>
#include <md5_hash.hpp>
#include <NdbSleep.h>
#include <NdbOut.hpp>
@@ -1221,7 +1223,6 @@ Ndb::pollEvents(int aMillisecondNumber)
#ifdef VM_TRACE
#include <NdbMutex.h>
-#include <stdarg.h>
static NdbMutex print_state_mutex = NDB_MUTEX_INITIALIZER;
static bool
checkdups(NdbConnection** list, unsigned no)
diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp
index 67f07d2a8c0..962acc0bdac 100644
--- a/ndb/src/ndbapi/NdbConnectionScan.cpp
+++ b/ndb/src/ndbapi/NdbConnectionScan.cpp
@@ -27,10 +27,12 @@
* Documentation:
* Adjust: 2000-06-12 UABRONM First version.
****************************************************************************/
-#include "Ndb.hpp"
-#include "NdbConnection.hpp"
-#include "NdbOperation.hpp"
-#include "NdbScanOperation.hpp"
+#include <ndb_global.h>
+
+#include <Ndb.hpp>
+#include <NdbConnection.hpp>
+#include <NdbOperation.hpp>
+#include <NdbScanOperation.hpp>
#include "NdbScanReceiver.hpp"
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
@@ -41,7 +43,6 @@
#include <signaldata/ScanTab.hpp>
#include <NdbOut.hpp>
-#include <assert.h>
// time out for next scan result (-1 is infinite)
// XXX should change default only if non-trivial interpreted program is used
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index ec9a56cda62..b068ea6460f 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -646,7 +646,6 @@ NdbDictionary::Dictionary::Dictionary(NdbDictionaryImpl & impl)
: m_impl(impl)
{
}
-#include <assert.h>
NdbDictionary::Dictionary::~Dictionary(){
NdbDictionaryImpl * tmp = &m_impl;
if(this != tmp){
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index bd94ba9b080..02e3ee23f9c 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -35,7 +35,6 @@
#include <AttributeList.hpp>
#include <NdbEventOperation.hpp>
#include "NdbEventOperationImpl.hpp"
-#include <assert.h>
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
diff --git a/ndb/include/portlib/NdbStdio.h b/ndb/src/ndbapi/NdbErrorOut.cpp
index 163b7eeef6f..07e0b2fe6e8 100644
--- a/ndb/include/portlib/NdbStdio.h
+++ b/ndb/src/ndbapi/NdbErrorOut.cpp
@@ -14,23 +14,32 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/*
- * NdbStdio.h - stdio.h for ndb
- *
- *
- */
+#include <ndb_global.h>
-#if defined NDB_OSE || defined NDB_SOFTOSE
-/* On OSE Delta the snprintf is declare in outfmt.h */
-#include <outfmt.h>
-#endif
+#include <NdbOut.hpp>
-#include <stdio.h>
+#include <NdbError.hpp>
-#ifdef NDB_WIN32
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#define strtok_r(s1, s2, l) strtok(s1, s2)
-#endif
+/**
+ * operators
+ */
+NdbOut &
+operator<<(NdbOut & out, const NdbError & error){
+ if(error.message != 0)
+ out << error.code << ": " << error.message;
+ else
+ out << error.code << ": ";
+ return out;
+}
+
+NdbOut &
+operator<<(NdbOut & out, const NdbError::Status & status){
+ return out << ndberror_status_message((ndberror_status)status);
+}
+
+NdbOut &
+operator<<(NdbOut & out, const NdbError::Classification & classification){
+ return out << ndberror_classification_message((ndberror_classification)classification);
+}
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index d167b8205a2..acc726e28c5 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-
+#include <ndb_global.h>
+#include <kernel_types.h>
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
@@ -24,21 +24,12 @@
#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
-#include <signaldata/GetTabInfo.hpp>
-#include <signaldata/DictTabInfo.hpp>
-#include <signaldata/CreateTable.hpp>
-#include <signaldata/CreateIndx.hpp>
#include <signaldata/CreateEvnt.hpp>
#include <signaldata/SumaImpl.hpp>
-#include <signaldata/DropTable.hpp>
-#include <signaldata/DropIndx.hpp>
-#include <signaldata/ListTables.hpp>
#include <SimpleProperties.hpp>
#include <Bitmask.hpp>
#include <AttributeHeader.hpp>
#include <AttributeList.hpp>
-#include <ndb_types.h>
-#include <kernel_types.h>
#include <NdbError.hpp>
#include <BaseString.hpp>
#include <UtilBuffer.hpp>
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp
index eaa2b35965b..ccbfa767542 100644
--- a/ndb/src/ndbapi/NdbOperation.cpp
+++ b/ndb/src/ndbapi/NdbOperation.cpp
@@ -37,7 +37,6 @@
#include "API.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
/******************************************************************************
diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index 1b0ad68b1eb..b2a6f99880c 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -25,11 +25,12 @@ Version: 1.2
Description:
Documentation:
***************************************************************************/
-#include "NdbOperation.hpp"
-#include "NdbConnection.hpp"
+
+#include <NdbOperation.hpp>
+#include <NdbConnection.hpp>
#include "NdbApiSignal.hpp"
-#include "Ndb.hpp"
-#include "NdbRecAttr.hpp"
+#include <Ndb.hpp>
+#include <NdbRecAttr.hpp>
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
diff --git a/ndb/src/ndbapi/NdbPoolImpl.cpp b/ndb/src/ndbapi/NdbPoolImpl.cpp
index 08252d26d79..131edc74246 100644
--- a/ndb/src/ndbapi/NdbPoolImpl.cpp
+++ b/ndb/src/ndbapi/NdbPoolImpl.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "NdbPoolImpl.hpp"
-#include <assert.h>
-#include <string.h>
NdbMutex *NdbPool::pool_mutex = NULL;
NdbPool *the_pool = NULL;
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 11f36fbd2c4..0f7baeac4f5 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -26,8 +26,8 @@ Description: Interface between TIS and NDB
Documentation:
Adjust: 971206 UABRONM First version
************************************************************************************************/
+#include <ndb_global.h>
#include "NdbRecAttr.hpp"
-#include <stdlib.h>
#include "NdbDictionaryImpl.hpp"
NdbRecAttr::NdbRecAttr() :
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index f753d2f6b34..4db0f30f56c 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -26,6 +26,7 @@
* Adjust: 2002-04-01 UABMASD First version.
****************************************************************************/
+#include <ndb_global.h>
#include <Ndb.hpp>
#include <NdbScanOperation.hpp>
#include <NdbConnection.hpp>
@@ -33,12 +34,6 @@
#include "NdbApiSignal.hpp"
#include <NdbOut.hpp>
#include "NdbDictionaryImpl.hpp"
-#include <NdbString.h>
-#ifndef NDB_MACOSX
-#include <malloc.h>
-#else
-#include <stdlib.h>
-#endif
NdbScanOperation::NdbScanOperation(Ndb* aNdb) :
NdbCursorOperation(aNdb),
@@ -637,6 +632,24 @@ SetValueRecList::callSetValueFn(SetValueRec& aSetValueRec, NdbOperation& oper)
}
}
+SetValueRec::~SetValueRec()
+{
+ if ((stype == SET_STRING_ATTR1) ||
+ (stype == SET_INT32_ATTR1) ||
+ (stype == SET_UINT32_ATTR1) ||
+ (stype == SET_INT64_ATTR1) ||
+ (stype == SET_UINT64_ATTR1) ||
+ (stype == SET_FLOAT_ATTR1) ||
+ (stype == SET_DOUBLE_ATTR1))
+ free(anAttrName);
+
+ if ((stype == SET_STRING_ATTR1) ||
+ (stype == SET_STRING_ATTR2))
+ free(stringStruct.aStringValue);
+ if (next) delete next;
+ next = 0;
+}
+
int
NdbScanOperation::equal_impl(const NdbColumnImpl* anAttrObject,
const char* aValue,
diff --git a/ndb/src/ndbapi/NdbScanReceiver.hpp b/ndb/src/ndbapi/NdbScanReceiver.hpp
index 5e316719194..72f9e48f02c 100644
--- a/ndb/src/ndbapi/NdbScanReceiver.hpp
+++ b/ndb/src/ndbapi/NdbScanReceiver.hpp
@@ -24,7 +24,6 @@
#include "NdbReceiver.hpp"
#include <NdbOut.hpp>
-#include <assert.h>
class NdbScanReceiver
{
diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp
index eeee087d548..6a82af85987 100644
--- a/ndb/src/ndbapi/NdbUtil.hpp
+++ b/ndb/src/ndbapi/NdbUtil.hpp
@@ -29,8 +29,7 @@ Comment:
#ifndef NdbUtil_H
#define NdbUtil_H
-#include <stdlib.h>
-#include <ndb_types.h>
+#include <ndb_global.h>
#include "AttrType.hpp"
class NdbApiSignal;
diff --git a/ndb/src/ndbapi/Ndberror.cpp b/ndb/src/ndbapi/Ndberror.cpp
index f4fdbf31c4a..faa2f00cfce 100644
--- a/ndb/src/ndbapi/Ndberror.cpp
+++ b/ndb/src/ndbapi/Ndberror.cpp
@@ -16,573 +16,6 @@
#include <NdbError.hpp>
-#include <NdbStdio.h>
-#include <stdarg.h>
-
-#include <assert.h>
-
-struct ErrorBundle {
- int code;
- NdbError::Classification classification;
- const char * message;
-};
-
-/**
- * Shorter names in table below
- */
-static const NdbError::Classification NE = NdbError::NoError;
-static const NdbError::Classification AE = NdbError::ApplicationError;
-static const NdbError::Classification ND = NdbError::NoDataFound;
-static const NdbError::Classification CV = NdbError::ConstraintViolation;
-static const NdbError::Classification SE = NdbError::SchemaError;
-static const NdbError::Classification UD = NdbError::UserDefinedError;
-
-static const NdbError::Classification IS = NdbError::InsufficientSpace;
-static const NdbError::Classification TR = NdbError::TemporaryResourceError;
-static const NdbError::Classification NR = NdbError::NodeRecoveryError;
-static const NdbError::Classification OL = NdbError::OverloadError;
-static const NdbError::Classification TO = NdbError::TimeoutExpired;
-static const NdbError::Classification NS = NdbError::NodeShutdown;
-
-static const NdbError::Classification UR = NdbError::UnknownResultError;
-
-static const NdbError::Classification IE = NdbError::InternalError;
-static const NdbError::Classification NI = NdbError::FunctionNotImplemented;
-static const NdbError::Classification UE = NdbError::UnknownErrorCode;
-
-static
-const
-ErrorBundle ErrorCodes[] = {
- /**
- * No error
- */
- { 0, NE, "No error" },
-
- /**
- * NoDataFound
- */
- { 626, ND, "Tuple did not exist" },
-
- /**
- * ConstraintViolation
- */
- { 630, CV, "Tuple already existed when attempting to insert" },
- { 840, CV, "Trying to set a NOT NULL attribute to NULL" },
- { 893, CV, "Constraint violation e.g. duplicate value in unique index" },
-
- /**
- * Node recovery errors
- */
- { 286, NR, "Node failure caused abort of transaction" },
- { 250, NR, "Node where lock was held crashed, restart scan transaction" },
- { 499, NR, "Scan take over error, restart scan transaction" },
- { 1204, NR, "Temporary failure, distribution changed" },
- { 4002, NR, "Send to NDB failed" },
- { 4010, NR, "Node failure caused abort of transaction" },
- { 4025, NR, "Node failure caused abort of transaction" },
- { 4027, NR, "Node failure caused abort of transaction" },
- { 4028, NR, "Node failure caused abort of transaction" },
- { 4029, NR, "Node failure caused abort of transaction" },
- { 4031, NR, "Node failure caused abort of transaction" },
- { 4033, NR, "Send to NDB failed" },
-
- /**
- * Node shutdown
- */
- { 280, NS, "Transaction aborted due to node shutdown" },
- // This scan trans had an active fragment scan in a LQH which have crashed
- { 270, NS, "Transaction aborted due to node shutdown" },
- { 1223, NS, "Read operation aborted due to node shutdown" },
- { 4023, NS, "Transaction aborted due to node shutdown" },
- { 4030, NS, "Transaction aborted due to node shutdown" },
- { 4034, NS, "Transaction aborted due to node shutdown" },
-
-
-
- /**
- * Unknown result
- */
- { 4008, UR, "Receive from NDB failed" },
- { 4009, UR, "Cluster Failure" },
- { 4012, UR,
- "Time-out, most likely caused by simple read or cluster failure" },
- { 4024, UR,
- "Time-out, most likely caused by simple read or cluster failure" },
- { 4115, UR,
- "Transaction was committed but all read information was not "
- "received due to node crash" },
-
- /**
- * TemporaryResourceError
- */
- { 217, TR, "217" },
- { 218, TR, "218" },
- { 219, TR, "219" },
- { 233, TR, "Out of operation records in transaction coordinator" },
- { 275, TR, "275" },
- { 279, TR, "Out of transaction markers in transaction coordinator" },
- { 414, TR, "414" },
- { 418, TR, "Out of transaction buffers in LQH" },
- { 419, TR, "419" },
- { 245, TR, "Too many active scans" },
- { 488, TR, "Too many active scans" },
- { 490, TR, "Too many active scans" },
- { 805, TR, "Out of attrinfo records in tuple manager" },
- { 830, TR, "Out of add fragment operation records" },
- { 873, TR, "Out of attrinfo records for scan in tuple manager" },
- { 1217, TR, "1217" },
- { 1219, TR, "Out of operation records in local data manager" },
- { 1220, TR, "1220" },
- { 1222, TR, "Out of transaction markers in LQH" },
- { 4021, TR, "Out of Send Buffer space in NDB API" },
- { 4022, TR, "Out of Send Buffer space in NDB API" },
- { 4032, TR, "Out of Send Buffer space in NDB API" },
-
- /**
- * InsufficientSpace
- */
- { 623, IS, "623" },
- { 624, IS, "624" },
- { 625, IS, "Out of memory in Ndb Kernel, index part" },
- { 826, IS, "826" },
- { 827, IS, "Out of memory in Ndb Kernel, data part" },
- { 832, IS, "832" },
-
- /**
- * TimeoutExpired
- */
- { 266, TO, "Time-out in NDB, probably caused by deadlock" },
- { 274, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout
- { 296, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout
- { 297, TO, "Time-out in NDB, probably caused by deadlock" }, // Scan trans timeout, temporary!!
- { 237, TO, "Transaction had timed out when trying to commit it" },
-
-
- /**
- * OverloadError
- */
- { 410, OL, "Out of log file space temporarily" },
- { 677, OL, "Index UNDO buffers overloaded" },
- { 891, OL, "Data UNDO buffers overloaded" },
- { 1221, OL, "REDO log buffers overloaded" },
- { 4006, AE, "Connect failure - out of connection objects" },
-
-
-
- /**
- * Internal errors
- */
- { 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" },
- { 895, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" },
- { 202, IE, "202" },
- { 203, IE, "203" },
- { 207, IE, "207" },
- { 208, IE, "208" },
- { 209, IE, "Communication problem, signal error" },
- { 220, IE, "220" },
- { 230, IE, "230" },
- { 232, IE, "232" },
- { 238, IE, "238" },
- { 271, IE, "Simple Read transaction without any attributes to read" },
- { 272, IE, "Update operation without any attributes to update" },
- { 276, IE, "276" },
- { 277, IE, "277" },
- { 278, IE, "278" },
- { 287, IE, "Index corrupted" },
- { 631, IE, "631" },
- { 632, IE, "632" },
- { 702, IE, "Request to non-master" },
- { 706, IE, "Inconsistency during table creation" },
- { 809, IE, "809" },
- { 812, IE, "812" },
- { 829, IE, "829" },
- { 833, IE, "833" },
- { 839, IE, "Illegal null attribute" },
- { 871, IE, "871" },
- { 882, IE, "882" },
- { 883, IE, "883" },
- { 887, IE, "887" },
- { 888, IE, "888" },
- { 890, IE, "890" },
- { 4000, IE, "MEMORY ALLOCATION ERROR" },
- { 4001, IE, "Signal Definition Error" },
- { 4005, IE, "Internal Error in NdbApi" },
- { 4011, IE, "Internal Error in NdbApi" },
- { 4107, IE, "Simple Transaction and Not Start" },
- { 4108, IE, "Faulty operation type" },
- { 4109, IE, "Faulty primary key attribute length" },
- { 4110, IE, "Faulty length in ATTRINFO signal" },
- { 4111, IE, "Status Error in NdbConnection" },
- { 4113, IE, "Too many operations received" },
- { 4320, IE, "Cannot use the same object twice to create table" },
- { 4321, IE, "Trying to start two schema transactions" },
- { 4344, IE, "Only DBDICT and TRIX can send requests to TRIX" },
- { 4345, IE, "TRIX block is not available yet, probably due to node failure" },
- { 4346, IE, "Internal error at index create/build" },
- { 4347, IE, "Bad state at alter index" },
- { 4348, IE, "Inconsistency detected at alter index" },
- { 4349, IE, "Inconsistency detected at index usage" },
-
- /**
- * Application error
- */
- { 823, AE, "Too much attrinfo from application in tuple manager" },
- { 876, AE, "876" },
- { 877, AE, "877" },
- { 878, AE, "878" },
- { 879, AE, "879" },
- { 884, AE, "Stack overflow in interpreter" },
- { 885, AE, "Stack underflow in interpreter" },
- { 886, AE, "More than 65535 instructions executed in interpreter" },
- { 4256, AE, "Must call Ndb::init() before this function" },
- { 880, AE, "Tried to read too much - too many getValue calls" },
- { 4257, AE, "Tried to read too much - too many getValue calls" },
-
- /**
- * Scan application errors
- */
- { 242, AE, "Zero concurrency in scan"},
- { 244, AE, "Too high concurrency in scan"},
- { 269, AE, "No condition and attributes to read in scan"},
- { 4600, AE, "Transaction is already started"},
- { 4601, AE, "Transaction is not started"},
- { 4602, AE, "You must call getNdbOperation before executeScan" },
- { 4603, AE, "There can only be ONE operation in a scan transaction" },
- { 4604, AE, "takeOverScanOp, opType must be UpdateRequest or DeleteRequest" },
- { 4605, AE, "You may only call openScanRead or openScanExclusive once for each operation"},
- { 4607, AE, "There may only be one operation in a scan transaction"},
- { 4608, AE, "You can not takeOverScan unless you have used openScanExclusive"},
- { 4609, AE, "You must call nextScanResult before trying to takeOverScan"},
- { 4232, AE, "Parallelism can only be between 1 and 240" },
- { 290, AE, "Scan not started or has been closed by kernel due to timeout" },
-
- /**
- * SchemaError
- */
- { 701, SE, "System busy with other schema operation" },
- { 703, SE, "Invalid table format" },
- { 704, SE, "Attribute name too long" },
- { 705, SE, "Table name too long" },
- { 707, SE, "No more table metadata records" },
- { 708, SE, "No more attribute metadata records" },
- { 709, SE, "No such table existed" },
- { 721, SE, "Table or index with given name already exists" },
- { 723, SE, "No such table existed" },
- { 736, SE, "Wrong attribute size" },
- { 737, SE, "Attribute array size too big" },
- { 738, SE, "Record too big" },
- { 739, SE, "Unsupported primary key length" },
- { 740, SE, "Nullable primary key not supported" },
- { 741, SE, "Unsupported alter table" },
- { 241, SE, "Invalid schema object version" },
- { 283, SE, "Table is being dropped" },
- { 284, SE, "Table not defined in transaction coordinator" },
- { 285, SE, "Unknown table error in transaction coordinator" },
- { 881, SE, "Unable to create table, out of data pages" },
- { 1225, SE, "Table not defined in local query handler" },
- { 1226, SE, "Table is being dropped" },
- { 1228, SE, "Cannot use drop table for drop index" },
- { 1229, SE, "Too long frm data supplied" },
-
- /**
- * FunctionNotImplemented
- */
- { 4003, NI, "Function not implemented yet" },
-
- /**
- * Still uncategorized
- */
- { 720, AE, "Attribute name reused in table definition" },
- { 4004, AE, "Attribute name not found in the Table" },
-
- { 4100, AE, "Status Error in NDB" },
- { 4101, AE, "No connections to NDB available and connect failed" },
- { 4102, AE, "Type in NdbTamper not correct" },
- { 4103, AE, "No schema connections to NDB available and connect failed" },
- { 4104, AE, "Ndb Init in wrong state, destroy Ndb object and create a new" },
- { 4105, AE, "Too many Ndb objects" },
- { 4106, AE, "All Not NULL attribute have not been defined" },
- { 4114, AE, "Transaction is already completed" },
- { 4116, AE, "Operation was not defined correctly, probably missing a key" },
- { 4117, AE, "Could not start transporter, configuration error"},
- { 4118, AE, "Parameter error in API call" },
- { 4300, AE, "Tuple Key Type not correct" },
- { 4301, AE, "Fragment Type not correct" },
- { 4302, AE, "Minimum Load Factor not correct" },
- { 4303, AE, "Maximum Load Factor not correct" },
- { 4304, AE, "Maximum Load Factor smaller than Minimum" },
- { 4305, AE, "K value must currently be set to 6" },
- { 4306, AE, "Memory Type not correct" },
- { 4307, AE, "Invalid table name" },
- { 4308, AE, "Attribute Size not correct" },
- { 4309, AE, "Fixed array too large, maximum 64000 bytes" },
- { 4310, AE, "Attribute Type not correct" },
- { 4311, AE, "Storage Mode not correct" },
- { 4312, AE, "Null Attribute Type not correct" },
- { 4313, AE, "Index only storage for non-key attribute" },
- { 4314, AE, "Storage Type of attribute not correct" },
- { 4315, AE, "No more key attributes allowed after defining variable length key attribute" },
- { 4316, AE, "Key attributes are not allowed to be NULL attributes" },
- { 4317, AE, "Too many primary keys defined in table" },
- { 4318, AE, "Invalid attribute name" },
- { 4319, AE, "createAttribute called at erroneus place" },
- { 4322, AE, "Attempt to define distribution key when not prepared to" },
- { 4323, AE, "Distribution Key set on table but not defined on first attribute" },
- { 4324, AE, "Attempt to define distribution group when not prepared to" },
- { 4325, AE, "Distribution Group set on table but not defined on first attribute" },
- { 4326, AE, "Distribution Group with erroneus number of bits" },
- { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" },
- { 4328, AE, "Disk memory attributes not yet supported" },
- { 4329, AE, "Variable stored attributes not yet supported" },
- { 4330, AE, "Table names limited to 127 bytes" },
- { 4331, AE, "Attribute names limited to 31 bytes" },
- { 4332, AE, "Maximum 2000 attributes in a table" },
- { 4333, AE, "Maximum 4092 bytes long keys allowed" },
- { 4334, AE, "Attribute properties length limited to 127 bytes" },
-
- { 4400, AE, "Status Error in NdbSchemaCon" },
- { 4401, AE, "Only one schema operation per schema transaction" },
- { 4402, AE, "No schema operation defined before calling execute" },
-
- { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" },
- { 4501, AE, "Insert in hash table failed when getting table information from Ndb" },
- { 4502, AE, "GetValue not allowed in Update operation" },
- { 4503, AE, "GetValue not allowed in Insert operation" },
- { 4504, AE, "SetValue not allowed in Read operation" },
- { 4505, AE, "NULL value not allowed in primary key search" },
- { 4506, AE, "Missing getValue/setValue when calling execute" },
- { 4507, AE, "Missing operation request when calling execute" },
-
- { 4200, AE, "Status Error when defining an operation" },
- { 4201, AE, "Variable Arrays not yet supported" },
- { 4202, AE, "Set value on tuple key attribute is not allowed" },
- { 4203, AE, "Trying to set a NOT NULL attribute to NULL" },
- { 4204, AE, "Set value and Read/Delete Tuple is incompatible" },
- { 4205, AE, "No Key attribute used to define tuple" },
- { 4206, AE, "Not allowed to equal key attribute twice" },
- { 4207, AE, "Key size is limited to 4092 bytes" },
- { 4208, AE, "Trying to read a non-stored attribute" },
- { 4209, AE, "Length parameter in equal/setValue is incorrect" },
- { 4210, AE, "Ndb sent more info than the length he specified" },
- { 4211, AE, "Inconsistency in list of NdbRecAttr-objects" },
- { 4212, AE, "Ndb reports NULL value on Not NULL attribute" },
- { 4213, AE, "Not all data of an attribute has been received" },
- { 4214, AE, "Not all attributes have been received" },
- { 4215, AE, "More data received than reported in TCKEYCONF message" },
- { 4216, AE, "More than 8052 bytes in setValue cannot be handled" },
- { 4217, AE, "It is not allowed to increment any other than unsigned ints" },
- { 4218, AE, "Currently not allowed to increment NULL-able attributes" },
- { 4219, AE, "Maximum size of interpretative attributes are 64 bits" },
- { 4220, AE, "Maximum size of interpretative attributes are 64 bits" },
- { 4221, AE, "Trying to jump to a non-defined label" },
- { 4222, AE, "Label was not found, internal error" },
- { 4223, AE, "Not allowed to create jumps to yourself" },
- { 4224, AE, "Not allowed to jump to a label in a different subroutine" },
- { 4225, AE, "All primary keys defined, call setValue/getValue"},
- { 4226, AE, "Bad number when defining a label" },
- { 4227, AE, "Bad number when defining a subroutine" },
- { 4228, AE, "Illegal interpreter function in scan definition" },
- { 4229, AE, "Illegal register in interpreter function definition" },
- { 4230, AE, "Illegal state when calling getValue, probably not a read" },
- { 4231, AE, "Illegal state when calling interpreter routine" },
- { 4233, AE, "Calling execute (synchronous) when already prepared asynchronous transaction exists" },
- { 4234, AE, "Illegal to call setValue in this state" },
- { 4235, AE, "No callback from execute" },
- { 4236, AE, "Trigger name too long" },
- { 4237, AE, "Too many triggers" },
- { 4238, AE, "Trigger not found" },
- { 4239, AE, "Trigger with given name already exists"},
- { 4240, AE, "Unsupported trigger type"},
- { 4241, AE, "Index name too long" },
- { 4242, AE, "Too many indexes" },
- { 4243, AE, "Index not found" },
- { 4244, AE, "Index or table with given name already exists" },
- { 4245, AE, "Index attribute must be defined as stored, i.e. the StorageAttributeType must be defined as NormalStorageAttribute"},
- { 4246, AE, "Combined index attributes are not allowed to be NULL attributes" },
- { 4247, AE, "Illegal index/trigger create/drop/alter request" },
- { 4248, AE, "Trigger/index name invalid" },
- { 4249, AE, "Invalid table" },
- { 4250, AE, "Invalid index type or index logging option" },
- { 4251, AE, "Cannot create unique index, duplicate keys found" },
- { 4252, AE, "Failed to allocate space for index" },
- { 4253, AE, "Failed to create index table" },
- { 4254, AE, "Table not an index table" },
- { 4255, AE, "Hash index attributes must be specified in same order as table attributes" },
- { 4258, AE, "Cannot create unique index, duplicate attributes found in definition" },
- { 4259, AE, "Invalid set of range scan bounds" },
- { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"},
- { 4261, UD, "NdbScanFilter: Column is NULL"},
- { 4262, UD, "NdbScanFilter: Condition is out of bounds"}
-
-};
-
-static
-const
-int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle);
-
-struct ErrorStatusClassification {
- NdbError::Status status;
- NdbError::Classification classification;
-};
-
-/**
- * Mapping between classification and status
- */
-static
-const
-ErrorStatusClassification StatusClassificationMapping[] = {
- { NdbError::Success, NdbError::NoError },
- { NdbError::PermanentError, NdbError::ApplicationError },
- { NdbError::PermanentError, NdbError::NoDataFound },
- { NdbError::PermanentError, NdbError::ConstraintViolation },
- { NdbError::PermanentError, NdbError::SchemaError },
- { NdbError::PermanentError, NdbError::UserDefinedError },
- { NdbError::PermanentError, NdbError::InsufficientSpace },
-
- { NdbError::TemporaryError, NdbError::TemporaryResourceError },
- { NdbError::TemporaryError, NdbError::NodeRecoveryError },
- { NdbError::TemporaryError, NdbError::OverloadError },
- { NdbError::TemporaryError, NdbError::TimeoutExpired },
- { NdbError::TemporaryError, NdbError::NodeShutdown },
-
- { NdbError::UnknownResult , NdbError::UnknownResultError },
- { NdbError::UnknownResult , NdbError::UnknownErrorCode },
-
- { NdbError::PermanentError, NdbError::InternalError },
- { NdbError::PermanentError, NdbError::FunctionNotImplemented }
-};
-
-static
-const
-int Nb = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);
-
-/**
- * Complete all fields of an NdbError given the error code
- * and details
- */
-#if 0
-static
-void
-set(NdbError & error, int code, const char * details, ...){
- error.code = code;
-
- va_list ap;
- va_start(ap, details);
- vsnprintf(error.details, sizeof(error.details), details, ap);
- va_end(ap);
-}
-#endif
-
-static
-void
-update(const NdbError & _err){
- NdbError & error = (NdbError &) _err;
-
- bool found = false;
- for(int i = 0; i<NbErrorCodes; i++){
- if(ErrorCodes[i].code == error.code){
- error.classification = ErrorCodes[i].classification;
- error.message = ErrorCodes[i].message;
- found = true;
- break;
- }
- }
-
- if(!found){
- error.classification = NdbError::UnknownErrorCode;
- error.message = "Unknown error code";
- }
-
- found = false;
- for(int i = 0; i<Nb; i++){
- if(StatusClassificationMapping[i].classification == error.classification){
- error.status = StatusClassificationMapping[i].status;
- found = true;
- break;
- }
- }
- if(!found){
- error.status = NdbError::UnknownResult;
- }
-
- error.details = 0;
-}
-
-bool
-checkErrorCodes(){
- for(int i = 0; i<NbErrorCodes; i++)
- for(int j = i+1; j<NbErrorCodes; j++)
- if(ErrorCodes[i].code == ErrorCodes[j].code){
- printf("ErrorCode %d is defined multiple times!!\n",
- ErrorCodes[i].code);
- assert(0);
- }
-
- return true;
-}
-
-static const bool a = checkErrorCodes();
-
-#if CHECK_ERRORCODES
-int main(void){
- checkErrorCodes();
- return 0;
-}
-#endif
-
-#include <NdbOut.hpp>
-
-/**
- * operators
- */
-NdbOut &
-operator<<(NdbOut & out, const NdbError & error){
- if(error.message != 0)
- out << error.code << ": " << error.message;
- else
- out << error.code << ": ";
- return out;
-}
-
-NdbOut &
-operator<<(NdbOut & out, const NdbError::Status & status){
- switch(status) {
- case NdbError::Success: out << "Success"; break;
- case NdbError::TemporaryError: out << "Temporary error"; break;
- case NdbError::PermanentError: out << "Permanent error"; break;
- case NdbError::UnknownResult: out << "Unknown result"; break;
- }
- return out;
-}
-
-NdbOut &
-operator<<(NdbOut & out, const NdbError::Classification & classification){
- switch(classification) {
- case NdbError::NoError: out << "No error"; break;
- case NdbError::ApplicationError: out << "Application error"; break;
- case NdbError::NoDataFound: out << "No data found"; break;
- case NdbError::ConstraintViolation: out << "Constraint violation"; break;
- case NdbError::SchemaError: out << "Schema error"; break;
- case NdbError::UserDefinedError: out << "User defined error"; break;
- case NdbError::InsufficientSpace: out << "Insufficient space"; break;
- case NdbError::TemporaryResourceError: out << "Temporary Resource error";
- break;
- case NdbError::NodeRecoveryError: out << "Node Recovery error"; break;
- case NdbError::OverloadError: out << "Overload error"; break;
- case NdbError::TimeoutExpired: out << "Timeout expired"; break;
- case NdbError::UnknownResultError: out << "Unknown result error"; break;
- case NdbError::InternalError: out << "Internal error"; break;
- case NdbError::FunctionNotImplemented: out << "Function not implemented";
- break;
- case NdbError::UnknownErrorCode: out << "Unknown error code"; break;
- case NdbError::NodeShutdown: out << "Node shutdown"; break;
- }
- return out;
-}
-
-/******************************************************
- *
- */
#include "NdbImpl.hpp"
#include "NdbDictionaryImpl.hpp"
#include <NdbSchemaCon.hpp>
@@ -590,6 +23,14 @@ operator<<(NdbOut & out, const NdbError::Classification & classification){
#include <NdbConnection.hpp>
+static void
+update(const NdbError & _err){
+ NdbError & error = (NdbError &) _err;
+ ndberror_struct ndberror = (ndberror_struct)error;
+ ndberror_update(&ndberror);
+ error = NdbError(ndberror);
+}
+
const
NdbError &
Ndb::getNdbError(int code){
@@ -632,6 +73,3 @@ NdbSchemaCon::getNdbError() const {
update(theError);
return theError;
}
-
-
-
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index e334c1bcc39..696dfe68e40 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -40,7 +40,6 @@
#include <NdbOut.hpp>
#include <NdbTick.h>
-#include <assert.h>
/******************************************************************************
* int init( int aNrOfCon, int aNrOfOp );
diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp
index a2a8d00b48f..4abb54b5081 100644
--- a/ndb/src/ndbapi/ObjectMap.hpp
+++ b/ndb/src/ndbapi/ObjectMap.hpp
@@ -17,10 +17,8 @@
#ifndef NDB_OBJECT_ID_MAP_HPP
#define NDB_OBJECT_ID_MAP_HPP
-#include <ndb_types.h>
+#include <ndb_global.h>
//#include <NdbMutex.h>
-#include <stdlib.h>
-#include <string.h>
#include <NdbOut.hpp>
//#define DEBUG_OBJECTMAP
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 746ab169b41..f4a3ae3e87d 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -14,8 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <ndb_limits.h>
-#include "AttrType.hpp"
+#include <AttrType.hpp>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
@@ -25,14 +26,12 @@
#include <NdbOut.hpp>
#include <NdbEnv.h>
#include <NdbSleep.h>
-#include <assert.h>
#include "API.hpp"
#include <ConfigRetriever.hpp>
#include <NdbConfig.h>
#include <ndb_version.h>
#include <SignalLoggerManager.hpp>
-#include <stdlib.h>
#if !defined NDB_OSE && !defined NDB_SOFTOSE
#include <signal.h>
diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
new file mode 100644
index 00000000000..ea7cf4de426
--- /dev/null
+++ b/ndb/src/ndbapi/ndberror.c
@@ -0,0 +1,590 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+#include <ndb_global.h>
+
+#include <ndberror.h>
+
+typedef struct ErrorBundle {
+ int code;
+ ndberror_classification classification;
+ const char * message;
+} ErrorBundle;
+
+/**
+ * Shorter names in table below
+ */
+
+#define ST_S ndberror_st_success
+#define ST_P ndberror_st_permanent
+#define ST_T ndberror_st_temporary
+#define ST_U ndberror_st_unknown
+
+#define NE ndberror_cl_none
+#define AE ndberror_cl_application
+#define ND ndberror_cl_no_data_found
+#define CV ndberror_cl_constraint_violation
+#define SE ndberror_cl_schema_error
+#define UD ndberror_cl_user_defined
+
+#define IS ndberror_cl_insufficient_space
+#define TR ndberror_cl_temporary_resource
+#define NR ndberror_cl_node_recovery
+#define OL ndberror_cl_overload
+#define TO ndberror_cl_timeout_expired
+#define NS ndberror_cl_node_shutdown
+
+#define UR ndberror_cl_unknown_result
+
+#define IE ndberror_cl_internal_error
+#define NI ndberror_cl_function_not_implemented
+#define UE ndberror_cl_unknown_error_code
+
+static const char* empty_string = "";
+
+static
+const
+ErrorBundle ErrorCodes[] = {
+ /**
+ * No error
+ */
+ { 0, NE, "No error" },
+
+ /**
+ * NoDataFound
+ */
+ { 626, ND, "Tuple did not exist" },
+
+ /**
+ * ConstraintViolation
+ */
+ { 630, CV, "Tuple already existed when attempting to insert" },
+ { 840, CV, "Trying to set a NOT NULL attribute to NULL" },
+ { 893, CV, "Constraint violation e.g. duplicate value in unique index" },
+
+ /**
+ * Node recovery errors
+ */
+ { 286, NR, "Node failure caused abort of transaction" },
+ { 250, NR, "Node where lock was held crashed, restart scan transaction" },
+ { 499, NR, "Scan take over error, restart scan transaction" },
+ { 1204, NR, "Temporary failure, distribution changed" },
+ { 4002, NR, "Send to NDB failed" },
+ { 4010, NR, "Node failure caused abort of transaction" },
+ { 4025, NR, "Node failure caused abort of transaction" },
+ { 4027, NR, "Node failure caused abort of transaction" },
+ { 4028, NR, "Node failure caused abort of transaction" },
+ { 4029, NR, "Node failure caused abort of transaction" },
+ { 4031, NR, "Node failure caused abort of transaction" },
+ { 4033, NR, "Send to NDB failed" },
+
+ /**
+ * Node shutdown
+ */
+ { 280, NS, "Transaction aborted due to node shutdown" },
+ /* This scan trans had an active fragment scan in a LQH which have crashed */
+ { 270, NS, "Transaction aborted due to node shutdown" },
+ { 1223, NS, "Read operation aborted due to node shutdown" },
+ { 4023, NS, "Transaction aborted due to node shutdown" },
+ { 4030, NS, "Transaction aborted due to node shutdown" },
+ { 4034, NS, "Transaction aborted due to node shutdown" },
+
+
+
+ /**
+ * Unknown result
+ */
+ { 4008, UR, "Receive from NDB failed" },
+ { 4009, UR, "Cluster Failure" },
+ { 4012, UR,
+ "Time-out, most likely caused by simple read or cluster failure" },
+ { 4024, UR,
+ "Time-out, most likely caused by simple read or cluster failure" },
+ { 4115, UR,
+ "Transaction was committed but all read information was not "
+ "received due to node crash" },
+
+ /**
+ * TemporaryResourceError
+ */
+ { 217, TR, "217" },
+ { 218, TR, "218" },
+ { 219, TR, "219" },
+ { 233, TR, "Out of operation records in transaction coordinator" },
+ { 275, TR, "275" },
+ { 279, TR, "Out of transaction markers in transaction coordinator" },
+ { 414, TR, "414" },
+ { 418, TR, "Out of transaction buffers in LQH" },
+ { 419, TR, "419" },
+ { 245, TR, "Too many active scans" },
+ { 488, TR, "Too many active scans" },
+ { 490, TR, "Too many active scans" },
+ { 805, TR, "Out of attrinfo records in tuple manager" },
+ { 830, TR, "Out of add fragment operation records" },
+ { 873, TR, "Out of attrinfo records for scan in tuple manager" },
+ { 1217, TR, "1217" },
+ { 1219, TR, "Out of operation records in local data manager" },
+ { 1220, TR, "1220" },
+ { 1222, TR, "Out of transaction markers in LQH" },
+ { 4021, TR, "Out of Send Buffer space in NDB API" },
+ { 4022, TR, "Out of Send Buffer space in NDB API" },
+ { 4032, TR, "Out of Send Buffer space in NDB API" },
+
+ /**
+ * InsufficientSpace
+ */
+ { 623, IS, "623" },
+ { 624, IS, "624" },
+ { 625, IS, "Out of memory in Ndb Kernel, index part" },
+ { 826, IS, "826" },
+ { 827, IS, "Out of memory in Ndb Kernel, data part" },
+ { 832, IS, "832" },
+
+ /**
+ * TimeoutExpired
+ */
+ { 266, TO, "Time-out in NDB, probably caused by deadlock" },
+ { 274, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */
+ { 296, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout */
+ { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */
+ { 237, TO, "Transaction had timed out when trying to commit it" },
+
+
+ /**
+ * OverloadError
+ */
+ { 410, OL, "Out of log file space temporarily" },
+ { 677, OL, "Index UNDO buffers overloaded" },
+ { 891, OL, "Data UNDO buffers overloaded" },
+ { 1221, OL, "REDO log buffers overloaded" },
+ { 4006, AE, "Connect failure - out of connection objects" },
+
+
+
+ /**
+ * Internal errors
+ */
+ { 892, IE, "Inconsistent hash index. The index needs to be dropped and recreated" },
+ { 895, IE, "Inconsistent ordered index. The index needs to be dropped and recreated" },
+ { 202, IE, "202" },
+ { 203, IE, "203" },
+ { 207, IE, "207" },
+ { 208, IE, "208" },
+ { 209, IE, "Communication problem, signal error" },
+ { 220, IE, "220" },
+ { 230, IE, "230" },
+ { 232, IE, "232" },
+ { 238, IE, "238" },
+ { 271, IE, "Simple Read transaction without any attributes to read" },
+ { 272, IE, "Update operation without any attributes to update" },
+ { 276, IE, "276" },
+ { 277, IE, "277" },
+ { 278, IE, "278" },
+ { 287, IE, "Index corrupted" },
+ { 631, IE, "631" },
+ { 632, IE, "632" },
+ { 702, IE, "Request to non-master" },
+ { 706, IE, "Inconsistency during table creation" },
+ { 809, IE, "809" },
+ { 812, IE, "812" },
+ { 829, IE, "829" },
+ { 833, IE, "833" },
+ { 839, IE, "Illegal null attribute" },
+ { 871, IE, "871" },
+ { 882, IE, "882" },
+ { 883, IE, "883" },
+ { 887, IE, "887" },
+ { 888, IE, "888" },
+ { 890, IE, "890" },
+ { 4000, IE, "MEMORY ALLOCATION ERROR" },
+ { 4001, IE, "Signal Definition Error" },
+ { 4005, IE, "Internal Error in NdbApi" },
+ { 4011, IE, "Internal Error in NdbApi" },
+ { 4107, IE, "Simple Transaction and Not Start" },
+ { 4108, IE, "Faulty operation type" },
+ { 4109, IE, "Faulty primary key attribute length" },
+ { 4110, IE, "Faulty length in ATTRINFO signal" },
+ { 4111, IE, "Status Error in NdbConnection" },
+ { 4113, IE, "Too many operations received" },
+ { 4320, IE, "Cannot use the same object twice to create table" },
+ { 4321, IE, "Trying to start two schema transactions" },
+ { 4344, IE, "Only DBDICT and TRIX can send requests to TRIX" },
+ { 4345, IE, "TRIX block is not available yet, probably due to node failure" },
+ { 4346, IE, "Internal error at index create/build" },
+ { 4347, IE, "Bad state at alter index" },
+ { 4348, IE, "Inconsistency detected at alter index" },
+ { 4349, IE, "Inconsistency detected at index usage" },
+
+ /**
+ * Application error
+ */
+ { 823, AE, "Too much attrinfo from application in tuple manager" },
+ { 876, AE, "876" },
+ { 877, AE, "877" },
+ { 878, AE, "878" },
+ { 879, AE, "879" },
+ { 884, AE, "Stack overflow in interpreter" },
+ { 885, AE, "Stack underflow in interpreter" },
+ { 886, AE, "More than 65535 instructions executed in interpreter" },
+ { 4256, AE, "Must call Ndb::init() before this function" },
+ { 880, AE, "Tried to read too much - too many getValue calls" },
+ { 4257, AE, "Tried to read too much - too many getValue calls" },
+
+ /**
+ * Scan application errors
+ */
+ { 242, AE, "Zero concurrency in scan"},
+ { 244, AE, "Too high concurrency in scan"},
+ { 269, AE, "No condition and attributes to read in scan"},
+ { 4600, AE, "Transaction is already started"},
+ { 4601, AE, "Transaction is not started"},
+ { 4602, AE, "You must call getNdbOperation before executeScan" },
+ { 4603, AE, "There can only be ONE operation in a scan transaction" },
+ { 4604, AE, "takeOverScanOp, opType must be UpdateRequest or DeleteRequest" },
+ { 4605, AE, "You may only call openScanRead or openScanExclusive once for each operation"},
+ { 4607, AE, "There may only be one operation in a scan transaction"},
+ { 4608, AE, "You can not takeOverScan unless you have used openScanExclusive"},
+ { 4609, AE, "You must call nextScanResult before trying to takeOverScan"},
+ { 4232, AE, "Parallelism can only be between 1 and 240" },
+ { 290, AE, "Scan not started or has been closed by kernel due to timeout" },
+
+ /**
+ * SchemaError
+ */
+ { 701, SE, "System busy with other schema operation" },
+ { 703, SE, "Invalid table format" },
+ { 704, SE, "Attribute name too long" },
+ { 705, SE, "Table name too long" },
+ { 707, SE, "No more table metadata records" },
+ { 708, SE, "No more attribute metadata records" },
+ { 709, SE, "No such table existed" },
+ { 721, SE, "Table or index with given name already exists" },
+ { 723, SE, "No such table existed" },
+ { 736, SE, "Wrong attribute size" },
+ { 737, SE, "Attribute array size too big" },
+ { 738, SE, "Record too big" },
+ { 739, SE, "Unsupported primary key length" },
+ { 740, SE, "Nullable primary key not supported" },
+ { 741, SE, "Unsupported alter table" },
+ { 241, SE, "Invalid schema object version" },
+ { 283, SE, "Table is being dropped" },
+ { 284, SE, "Table not defined in transaction coordinator" },
+ { 285, SE, "Unknown table error in transaction coordinator" },
+ { 881, SE, "Unable to create table, out of data pages" },
+ { 1225, SE, "Table not defined in local query handler" },
+ { 1226, SE, "Table is being dropped" },
+ { 1228, SE, "Cannot use drop table for drop index" },
+ { 1229, SE, "Too long frm data supplied" },
+
+ /**
+ * FunctionNotImplemented
+ */
+ { 4003, NI, "Function not implemented yet" },
+
+ /**
+ * Still uncategorized
+ */
+ { 720, AE, "Attribute name reused in table definition" },
+ { 4004, AE, "Attribute name not found in the Table" },
+
+ { 4100, AE, "Status Error in NDB" },
+ { 4101, AE, "No connections to NDB available and connect failed" },
+ { 4102, AE, "Type in NdbTamper not correct" },
+ { 4103, AE, "No schema connections to NDB available and connect failed" },
+ { 4104, AE, "Ndb Init in wrong state, destroy Ndb object and create a new" },
+ { 4105, AE, "Too many Ndb objects" },
+ { 4106, AE, "All Not NULL attribute have not been defined" },
+ { 4114, AE, "Transaction is already completed" },
+ { 4116, AE, "Operation was not defined correctly, probably missing a key" },
+ { 4117, AE, "Could not start transporter, configuration error"},
+ { 4118, AE, "Parameter error in API call" },
+ { 4300, AE, "Tuple Key Type not correct" },
+ { 4301, AE, "Fragment Type not correct" },
+ { 4302, AE, "Minimum Load Factor not correct" },
+ { 4303, AE, "Maximum Load Factor not correct" },
+ { 4304, AE, "Maximum Load Factor smaller than Minimum" },
+ { 4305, AE, "K value must currently be set to 6" },
+ { 4306, AE, "Memory Type not correct" },
+ { 4307, AE, "Invalid table name" },
+ { 4308, AE, "Attribute Size not correct" },
+ { 4309, AE, "Fixed array too large, maximum 64000 bytes" },
+ { 4310, AE, "Attribute Type not correct" },
+ { 4311, AE, "Storage Mode not correct" },
+ { 4312, AE, "Null Attribute Type not correct" },
+ { 4313, AE, "Index only storage for non-key attribute" },
+ { 4314, AE, "Storage Type of attribute not correct" },
+ { 4315, AE, "No more key attributes allowed after defining variable length key attribute" },
+ { 4316, AE, "Key attributes are not allowed to be NULL attributes" },
+ { 4317, AE, "Too many primary keys defined in table" },
+ { 4318, AE, "Invalid attribute name" },
+ { 4319, AE, "createAttribute called at erroneus place" },
+ { 4322, AE, "Attempt to define distribution key when not prepared to" },
+ { 4323, AE, "Distribution Key set on table but not defined on first attribute" },
+ { 4324, AE, "Attempt to define distribution group when not prepared to" },
+ { 4325, AE, "Distribution Group set on table but not defined on first attribute" },
+ { 4326, AE, "Distribution Group with erroneus number of bits" },
+ { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" },
+ { 4328, AE, "Disk memory attributes not yet supported" },
+ { 4329, AE, "Variable stored attributes not yet supported" },
+ { 4330, AE, "Table names limited to 127 bytes" },
+ { 4331, AE, "Attribute names limited to 31 bytes" },
+ { 4332, AE, "Maximum 2000 attributes in a table" },
+ { 4333, AE, "Maximum 4092 bytes long keys allowed" },
+ { 4334, AE, "Attribute properties length limited to 127 bytes" },
+
+ { 4400, AE, "Status Error in NdbSchemaCon" },
+ { 4401, AE, "Only one schema operation per schema transaction" },
+ { 4402, AE, "No schema operation defined before calling execute" },
+
+ { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" },
+ { 4501, AE, "Insert in hash table failed when getting table information from Ndb" },
+ { 4502, AE, "GetValue not allowed in Update operation" },
+ { 4503, AE, "GetValue not allowed in Insert operation" },
+ { 4504, AE, "SetValue not allowed in Read operation" },
+ { 4505, AE, "NULL value not allowed in primary key search" },
+ { 4506, AE, "Missing getValue/setValue when calling execute" },
+ { 4507, AE, "Missing operation request when calling execute" },
+
+ { 4200, AE, "Status Error when defining an operation" },
+ { 4201, AE, "Variable Arrays not yet supported" },
+ { 4202, AE, "Set value on tuple key attribute is not allowed" },
+ { 4203, AE, "Trying to set a NOT NULL attribute to NULL" },
+ { 4204, AE, "Set value and Read/Delete Tuple is incompatible" },
+ { 4205, AE, "No Key attribute used to define tuple" },
+ { 4206, AE, "Not allowed to equal key attribute twice" },
+ { 4207, AE, "Key size is limited to 4092 bytes" },
+ { 4208, AE, "Trying to read a non-stored attribute" },
+ { 4209, AE, "Length parameter in equal/setValue is incorrect" },
+ { 4210, AE, "Ndb sent more info than the length he specified" },
+ { 4211, AE, "Inconsistency in list of NdbRecAttr-objects" },
+ { 4212, AE, "Ndb reports NULL value on Not NULL attribute" },
+ { 4213, AE, "Not all data of an attribute has been received" },
+ { 4214, AE, "Not all attributes have been received" },
+ { 4215, AE, "More data received than reported in TCKEYCONF message" },
+ { 4216, AE, "More than 8052 bytes in setValue cannot be handled" },
+ { 4217, AE, "It is not allowed to increment any other than unsigned ints" },
+ { 4218, AE, "Currently not allowed to increment NULL-able attributes" },
+ { 4219, AE, "Maximum size of interpretative attributes are 64 bits" },
+ { 4220, AE, "Maximum size of interpretative attributes are 64 bits" },
+ { 4221, AE, "Trying to jump to a non-defined label" },
+ { 4222, AE, "Label was not found, internal error" },
+ { 4223, AE, "Not allowed to create jumps to yourself" },
+ { 4224, AE, "Not allowed to jump to a label in a different subroutine" },
+ { 4225, AE, "All primary keys defined, call setValue/getValue"},
+ { 4226, AE, "Bad number when defining a label" },
+ { 4227, AE, "Bad number when defining a subroutine" },
+ { 4228, AE, "Illegal interpreter function in scan definition" },
+ { 4229, AE, "Illegal register in interpreter function definition" },
+ { 4230, AE, "Illegal state when calling getValue, probably not a read" },
+ { 4231, AE, "Illegal state when calling interpreter routine" },
+ { 4233, AE, "Calling execute (synchronous) when already prepared asynchronous transaction exists" },
+ { 4234, AE, "Illegal to call setValue in this state" },
+ { 4235, AE, "No callback from execute" },
+ { 4236, AE, "Trigger name too long" },
+ { 4237, AE, "Too many triggers" },
+ { 4238, AE, "Trigger not found" },
+ { 4239, AE, "Trigger with given name already exists"},
+ { 4240, AE, "Unsupported trigger type"},
+ { 4241, AE, "Index name too long" },
+ { 4242, AE, "Too many indexes" },
+ { 4243, AE, "Index not found" },
+ { 4244, AE, "Index or table with given name already exists" },
+ { 4245, AE, "Index attribute must be defined as stored, i.e. the StorageAttributeType must be defined as NormalStorageAttribute"},
+ { 4246, AE, "Combined index attributes are not allowed to be NULL attributes" },
+ { 4247, AE, "Illegal index/trigger create/drop/alter request" },
+ { 4248, AE, "Trigger/index name invalid" },
+ { 4249, AE, "Invalid table" },
+ { 4250, AE, "Invalid index type or index logging option" },
+ { 4251, AE, "Cannot create unique index, duplicate keys found" },
+ { 4252, AE, "Failed to allocate space for index" },
+ { 4253, AE, "Failed to create index table" },
+ { 4254, AE, "Table not an index table" },
+ { 4255, AE, "Hash index attributes must be specified in same order as table attributes" },
+ { 4258, AE, "Cannot create unique index, duplicate attributes found in definition" },
+ { 4259, AE, "Invalid set of range scan bounds" },
+ { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"},
+ { 4261, UD, "NdbScanFilter: Column is NULL"},
+ { 4262, UD, "NdbScanFilter: Condition is out of bounds"}
+
+};
+
+static
+const
+int NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle);
+
+typedef struct ErrorStatusMessage {
+ ndberror_status status;
+ const char * message;
+} ErrorStatusMessage;
+
+typedef struct ErrorStatusClassification {
+ ndberror_status status;
+ ndberror_classification classification;
+ const char * message;
+} ErrorStatusClassification;
+
+/**
+ * Mapping between classification and status
+ */
+static
+const
+ErrorStatusMessage StatusMessageMapping[] = {
+ { ST_S, "Success"},
+ { ST_P, "Permanent error"},
+ { ST_T, "Temporary error"},
+ { ST_U ,"Unknown result"}
+};
+
+static
+const
+int NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage);
+
+static
+const
+ErrorStatusClassification StatusClassificationMapping[] = {
+ { ST_S, NE, "No error"},
+ { ST_P, AE, "Application error"},
+ { ST_P, ND, "No data found"},
+ { ST_P, CV, "Constraint violation"},
+ { ST_P, SE, "Schema error"},
+ { ST_P, UD, "User defined error"},
+ { ST_P, IS, "Insufficient space"},
+
+ { ST_T, TR, "Temporary Resource error"},
+ { ST_T, NR, "Node Recovery error"},
+ { ST_T, OL, "Overload error"},
+ { ST_T, TO, "Timeout expired"},
+ { ST_T, NS, "Node shutdown"},
+
+ { ST_U , UR, "Unknown result error"},
+ { ST_U , UE, "Unknown error code"},
+
+ { ST_P, IE, "Internal error"},
+ { ST_P, NI, "Function not implemented"}
+};
+
+static
+const
+int NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);
+
+/**
+ * Complete all fields of an NdbError given the error code
+ * and details
+ */
+static
+void
+set(ndberror_struct * error, int code, const char * details, ...){
+ error->code = code;
+ {
+ va_list ap;
+ va_start(ap, details);
+ vsnprintf(error->details, sizeof(error->details), details, ap);
+ va_end(ap);
+ }
+}
+
+
+void
+ndberror_update(ndberror_struct * error){
+
+ int found = 0;
+ int i;
+
+ for(i = 0; i<NbErrorCodes; i++){
+ if(ErrorCodes[i].code == error->code){
+ error->classification = ErrorCodes[i].classification;
+ error->message = ErrorCodes[i].message;
+ found = 1;
+ break;
+ }
+ }
+
+ if(!found){
+ error->classification = UE;
+ error->message = "Unknown error code";
+ }
+
+ found = 0;
+ for(i = 0; i<NbClassification; i++){
+ if(StatusClassificationMapping[i].classification == error->classification){
+ error->status = StatusClassificationMapping[i].status;
+ found = 1;
+ break;
+ }
+ }
+ if(!found){
+ error->status = ST_U;
+ }
+
+ error->details = 0;
+}
+
+int
+checkErrorCodes(){
+ int i, j;
+ for(i = 0; i<NbErrorCodes; i++)
+ for(j = i+1; j<NbErrorCodes; j++)
+ if(ErrorCodes[i].code == ErrorCodes[j].code){
+ printf("ErrorCode %d is defined multiple times!!\n",
+ ErrorCodes[i].code);
+ assert(0);
+ }
+
+ return 1;
+}
+
+/*static const int a = checkErrorCodes();*/
+
+#if CHECK_ERRORCODES
+int main(void){
+ checkErrorCodes();
+ return 0;
+}
+#endif
+
+const char *ndberror_status_message(ndberror_status status)
+{
+ int i;
+ for (i= 0; i < NbStatus; i++)
+ if (StatusMessageMapping[i].status == status)
+ return StatusMessageMapping[i].message;
+ return empty_string;
+}
+
+const char *ndberror_classification_message(ndberror_classification classification)
+{
+ int i;
+ for (i= 0; i < NbClassification; i++)
+ if (StatusClassificationMapping[i].classification == classification)
+ return StatusClassificationMapping[i].message;
+ return empty_string;
+}
+
+int ndb_error_string(int err_no, char *str, unsigned int size)
+{
+ ndberror_struct error;
+ unsigned int len;
+
+ error.code = err_no;
+ ndberror_update(&error);
+
+ len = snprintf(str, size-1, "%s: %s: %s", error.message,
+ ndberror_status_message(error.status), ndberror_classification_message(error.classification));
+ str[size-1]= '\0';
+
+ return len;
+}
diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
index d60f6240a9c..e642848dcee 100644
--- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp
+++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "SignalSender.hpp"
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.hpp b/ndb/src/ndbapi/signal-sender/SignalSender.hpp
index fffe027dbdd..e4e6c1931d2 100644
--- a/ndb/src/ndbapi/signal-sender/SignalSender.hpp
+++ b/ndb/src/ndbapi/signal-sender/SignalSender.hpp
@@ -17,11 +17,11 @@
#ifndef SIGNAL_SENDER_HPP
#define SIGNAL_SENDER_HPP
+#include <ndb_global.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <Vector.hpp>
-#include <stdio.h>
struct SimpleSignal {
public:
diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/newtonapi/dba_error.cpp
index 0a154ac1314..f05446522b0 100644
--- a/ndb/src/newtonapi/dba_error.cpp
+++ b/ndb/src/newtonapi/dba_error.cpp
@@ -15,9 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "dba_internal.hpp"
-#include <NdbStdio.h>
-#include <stdarg.h>
static DBA_Error_t latestError = DBA_NO_ERROR;
static DBA_ErrorCode_t latestNdbError = 0;
diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/newtonapi/dba_internal.hpp
index a021db40a7d..84ae7ba222b 100644
--- a/ndb/src/newtonapi/dba_internal.hpp
+++ b/ndb/src/newtonapi/dba_internal.hpp
@@ -17,17 +17,16 @@
#ifndef DBA_INTERNAL_HPP
#define DBA_INTERNAL_HPP
+#include <ndb_global.h>
+
extern "C" {
#include "dba.h"
}
#include <NdbApi.hpp>
#include <NdbMutex.h>
-#include <string.h>
#include <NdbOut.hpp>
-#include <stdlib.h>
-
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/rep/RepApiService.cpp
index f5d51f7990e..d07f7a59375 100644
--- a/ndb/src/rep/RepApiService.cpp
+++ b/ndb/src/rep/RepApiService.cpp
@@ -23,10 +23,8 @@
#include "RepApiInterpreter.hpp"
#include "repapi/repapi.h"
#include <NdbMutex.h>
-#include <NdbStdio.h>
#include <OutputStream.hpp>
-#include <NdbString.h>
/**
const char * name;
const char * realName;
diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/rep/RepComponents.hpp
index 8b24858271b..ff0f29e2128 100644
--- a/ndb/src/rep/RepComponents.hpp
+++ b/ndb/src/rep/RepComponents.hpp
@@ -26,7 +26,6 @@
#include <rep/rep_version.hpp>
-
/**
* Connection data
*/
diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/rep/RepMain.cpp
index e00f6c0040c..d9f057be9a1 100644
--- a/ndb/src/rep/RepMain.cpp
+++ b/ndb/src/rep/RepMain.cpp
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbApiSignal.hpp>
#include <getarg.h>
diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/rep/Requestor.cpp
index af16fc33844..3c93a6394a4 100644
--- a/ndb/src/rep/Requestor.cpp
+++ b/ndb/src/rep/Requestor.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "Requestor.hpp"
#include "ConfigRetriever.hpp"
diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/rep/Requestor.hpp
index ba753be60f2..735d2094bde 100644
--- a/ndb/src/rep/Requestor.hpp
+++ b/ndb/src/rep/Requestor.hpp
@@ -17,12 +17,13 @@
#ifndef REQUESTOR_HPP
#define REQUESTOR_HPP
+#include <ndb_global.h>
+
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <API.hpp>
#include <Vector.hpp>
-#include <stdio.h>
#include <GrepError.hpp>
#include <rep/storage/GCIContainer.hpp>
diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/rep/adapters/AppNDB.hpp
index c24774d4ed3..9563a1e41ab 100644
--- a/ndb/src/rep/adapters/AppNDB.hpp
+++ b/ndb/src/rep/adapters/AppNDB.hpp
@@ -18,13 +18,9 @@
#define APPNDB_HPP
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbThread.h>
diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/rep/adapters/ExtNDB.cpp
index 5ba6bfbbe6e..eb541cdced9 100644
--- a/ndb/src/rep/adapters/ExtNDB.cpp
+++ b/ndb/src/rep/adapters/ExtNDB.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ExtNDB.hpp"
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/rep/adapters/ExtNDB.hpp
index c69f94d9a7e..bcbf51393aa 100644
--- a/ndb/src/rep/adapters/ExtNDB.hpp
+++ b/ndb/src/rep/adapters/ExtNDB.hpp
@@ -17,12 +17,13 @@
#ifndef EXTNDB_HPP
#define EXTNDB_HPP
+#include <ndb_global.h>
+
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
#include <ClusterMgr.hpp>
#include <API.hpp>
#include <Vector.hpp>
-#include <stdio.h>
#include <signaldata/RepImpl.hpp>
#include <signaldata/GrepImpl.hpp>
diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/rep/dbug_hack.cpp
index 364325b55ae..74e5f080777 100644
--- a/ndb/src/rep/dbug_hack.cpp
+++ b/ndb/src/rep/dbug_hack.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
-#include <string.h>
+#include <ndb_global.h>
+
#include <OutputStream.hpp>
#include "NdbOut.hpp"
#include "rep_version.hpp"
@@ -25,6 +25,7 @@ int replogEnabled;
/**
* @todo This should be implemented using MySQLs dbug library
*/
+#if 0
extern "C"
void
DBUG_PRINT(const char * fmt, ...)
@@ -40,6 +41,7 @@ DBUG_PRINT(const char * fmt, ...)
va_end(ap);
#endif
}
+#endif
extern "C"
void
diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/rep/rep_version.hpp
index 0182f080730..3830f9c351c 100644
--- a/ndb/src/rep/rep_version.hpp
+++ b/ndb/src/rep/rep_version.hpp
@@ -29,7 +29,7 @@
extern "C"
void
-DBUG_PRINT(const char * fmt, ...);
+DBUG_PRINT__(const char * fmt, ...);
extern "C"
void
diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/rep/repapi/repapi.cpp
index 80274896004..d34ab098c9c 100644
--- a/ndb/src/rep/repapi/repapi.cpp
+++ b/ndb/src/rep/repapi/repapi.cpp
@@ -14,17 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include <NdbTCP.h>
#include "repapi.h"
//#include "mgmapi_debug.h"
#include <socket_io.h>
-#include <stdlib.h>
-
-#include <string.h>
-#include <NdbStdio.h>
-#include <NdbString.h>
-#include <errno.h>
#include <NdbOut.hpp>
#include <SocketServer.hpp>
#include <Parser.hpp>
diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/rep/state/Interval.cpp
index 75697fa7548..8266f19c58d 100644
--- a/ndb/src/rep/state/Interval.cpp
+++ b/ndb/src/rep/state/Interval.cpp
@@ -16,6 +16,8 @@
#include "Interval.hpp"
+#undef min
+#undef max
Uint32 max(Uint32 a, Uint32 b) { return a > b ? a : b; }
Uint32 min(Uint32 a, Uint32 b) { return a < b ? a : b; }
diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/rep/storage/GCIBuffer.cpp
index 5049e47ea66..013600b30a5 100644
--- a/ndb/src/rep/storage/GCIBuffer.cpp
+++ b/ndb/src/rep/storage/GCIBuffer.cpp
@@ -14,9 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "GCIBuffer.hpp"
-#include <stdlib.h>
-#include <assert.h>
/*****************************************************************************
* Constructor / Destructor
diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/rep/storage/GCIBuffer.hpp
index 5a07b149f81..8a8473d1d49 100644
--- a/ndb/src/rep/storage/GCIBuffer.hpp
+++ b/ndb/src/rep/storage/GCIBuffer.hpp
@@ -18,7 +18,7 @@
#define GCI_BUFFER_HPP
#include "GCIPage.hpp"
-#include "Vector.hpp"
+#include <Vector.hpp>
#include <TransporterDefinitions.hpp>
#include <signaldata/RepImpl.hpp>
diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/rep/storage/GCIContainer.hpp
index 173bb790a57..48cbc66bfbd 100644
--- a/ndb/src/rep/storage/GCIContainer.hpp
+++ b/ndb/src/rep/storage/GCIContainer.hpp
@@ -22,6 +22,7 @@
#include "LogRecord.hpp"
#include "GCIBuffer.hpp"
+#undef swap
#include <list>
#include <iterator>
diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/rep/storage/LogRecord.hpp
index ba2632e23c7..a0bf3d52372 100644
--- a/ndb/src/rep/storage/LogRecord.hpp
+++ b/ndb/src/rep/storage/LogRecord.hpp
@@ -17,8 +17,7 @@
#ifndef LOG_RECORD_HPP
#define LOG_RECORD_HPP
-#include <ndb_types.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <portlib/NdbMem.h>
/**
diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/rep/storage/NodeGroupInfo.hpp
index 605ccf76a38..3d0499d4425 100644
--- a/ndb/src/rep/storage/NodeGroupInfo.hpp
+++ b/ndb/src/rep/storage/NodeGroupInfo.hpp
@@ -18,12 +18,10 @@
#define NODE_GROUPINFO_HPP
#include <Vector.hpp>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
//#include <NdbSleep.h>
-#include <NdbString.h>
#include "NodeGroup.hpp"
#include <rep/rep_version.hpp>
diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/rep/transfer/TransPS.cpp
index 7af53f24415..1f65e95850d 100644
--- a/ndb/src/rep/transfer/TransPS.cpp
+++ b/ndb/src/rep/transfer/TransPS.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ConfigRetriever.hpp"
#include <NdbSleep.h>
diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/rep/transfer/TransPS.hpp
index 35823f1eb19..b47f1acfca2 100644
--- a/ndb/src/rep/transfer/TransPS.hpp
+++ b/ndb/src/rep/transfer/TransPS.hpp
@@ -17,12 +17,10 @@
#ifndef TransPS_HPP
#define TransPS_HPP
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/rep/transfer/TransSS.cpp
index 5399bfb4e3f..83f4b570330 100644
--- a/ndb/src/rep/transfer/TransSS.cpp
+++ b/ndb/src/rep/transfer/TransSS.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
#include "ConfigRetriever.hpp"
diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/rep/transfer/TransSS.hpp
index 90f320a079e..6f2089e46ac 100644
--- a/ndb/src/rep/transfer/TransSS.hpp
+++ b/ndb/src/rep/transfer/TransSS.hpp
@@ -17,12 +17,10 @@
#ifndef TransSS_HPP
#define TransSS_HPP
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbString.h>
#include <TransporterDefinitions.hpp>
#include <TransporterFacade.hpp>
diff --git a/ndb/test/include/NDBT_Stats.hpp b/ndb/test/include/NDBT_Stats.hpp
index 15a125dea86..28212bdba17 100644
--- a/ndb/test/include/NDBT_Stats.hpp
+++ b/ndb/test/include/NDBT_Stats.hpp
@@ -17,9 +17,7 @@
#ifndef NDBT_STATS_HPP
#define NDBT_STATS_HPP
-#include <math.h>
-#include <float.h>
-#include <assert.h>
+#include <ndb_global.h>
class NDBT_Stats {
public:
diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp
index a4482fa8084..950c1f15ff7 100644
--- a/ndb/test/include/NDBT_Table.hpp
+++ b/ndb/test/include/NDBT_Table.hpp
@@ -17,11 +17,11 @@
#ifndef NDBT_TABLE_HPP
#define NDBT_TABLE_HPP
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <string.h>
-
class NDBT_Attribute : public NdbDictionary::Column {
friend class NdbOut& operator <<(class NdbOut&, const NDBT_Attribute &);
public:
diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp
index 41332bb570c..7a5d14689bc 100644
--- a/ndb/test/include/NDBT_Test.hpp
+++ b/ndb/test/include/NDBT_Test.hpp
@@ -24,7 +24,6 @@
#include <NdbSleep.h>
#include <NdbCondition.h>
#include <NdbTimer.hpp>
-#include <assert.h>
#include <Vector.hpp>
#include <NdbDictionary.hpp>
diff --git a/ndb/test/include/NdbTimer.hpp b/ndb/test/include/NdbTimer.hpp
index 8d9a088b7b5..b0d500b5c2c 100644
--- a/ndb/test/include/NdbTimer.hpp
+++ b/ndb/test/include/NdbTimer.hpp
@@ -17,7 +17,6 @@
#ifndef NDBTIMER_H
#define NDBTIMER_H
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbOut.hpp>
diff --git a/ndb/test/ndbapi/acid2/acid2.cpp b/ndb/test/ndbapi/acid2/acid2.cpp
index 5835b76453e..434a0450daa 100644
--- a/ndb/test/ndbapi/acid2/acid2.cpp
+++ b/ndb/test/ndbapi/acid2/acid2.cpp
@@ -17,7 +17,6 @@
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbThread.h>
#include <NdbSleep.h>
#include <NdbMutex.h>
diff --git a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
index ee724236855..d84818baf24 100644
--- a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
+++ b/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
index 0b6fc9c1f97..55e9081a598 100644
--- a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
+++ b/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
index 7071de9f63e..ab3e862e8d2 100644
--- a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
+++ b/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
@@ -15,8 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
index cfb2c93e4ad..ba8de9e4af1 100644
--- a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
+++ b/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
index 155a35998bb..0c7d5d72473 100644
--- a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
+++ b/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
index cc8e2792cbf..13136755de8 100644
--- a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
+++ b/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
index f2b28d8b057..18881cae216 100644
--- a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
+++ b/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
@@ -14,7 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
index eaa99e8a79d..55d04888144 100644
--- a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
+++ b/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/create_tab/create_tab.cpp b/ndb/test/ndbapi/create_tab/create_tab.cpp
index 2f2911b4ef4..8bb1e7a9572 100644
--- a/ndb/test/ndbapi/create_tab/create_tab.cpp
+++ b/ndb/test/ndbapi/create_tab/create_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
index 8e67493c003..59c57396acd 100644
--- a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
+++ b/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
index 3938cd21f78..0822f3ee999 100644
--- a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
+++ b/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
@@ -24,8 +24,6 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <NdbStdio.h>
#include <NDBT_Error.hpp>
#include <NdbTest.hpp>
diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench/flexBench.cpp
index 17d9be73925..852944fd471 100644
--- a/ndb/test/ndbapi/flexBench/flexBench.cpp
+++ b/ndb/test/ndbapi/flexBench/flexBench.cpp
@@ -51,13 +51,9 @@ Arguments:
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbTimer.hpp>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/flexHammer/flexHammer.cpp b/ndb/test/ndbapi/flexHammer/flexHammer.cpp
index f8a519f021a..057efb31e74 100644
--- a/ndb/test/ndbapi/flexHammer/flexHammer.cpp
+++ b/ndb/test/ndbapi/flexHammer/flexHammer.cpp
@@ -57,8 +57,6 @@ Revision history:
#include <NdbTimer.hpp>
#include <NdbTick.h>
#include <NdbTest.hpp>
-#include <string.h>
-#include <assert.h>
#include <NDBT_Error.hpp>
ErrorData * flexHammerErrorData;
diff --git a/ndb/test/ndbapi/flexScan/flexScan.cpp b/ndb/test/ndbapi/flexScan/flexScan.cpp
index 55163a99fbe..19fb6dc5ab0 100644
--- a/ndb/test/ndbapi/flexScan/flexScan.cpp
+++ b/ndb/test/ndbapi/flexScan/flexScan.cpp
@@ -59,12 +59,9 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <assert.h>
#include <NdbMain.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
-#include <NdbStdio.h>
#define PKSIZE 1
#define FOREVER 1
diff --git a/ndb/test/ndbapi/flexTT/flexTT.cpp b/ndb/test/ndbapi/flexTT/flexTT.cpp
index 1705f20b706..c45cbd95762 100644
--- a/ndb/test/ndbapi/flexTT/flexTT.cpp
+++ b/ndb/test/ndbapi/flexTT/flexTT.cpp
@@ -15,7 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NdbApi.hpp"
+#include <ndb_global.h>
+
+#include <NdbApi.hpp>
#include <NdbMain.h>
#include <md5_hash.hpp>
@@ -24,9 +26,6 @@
#include <NdbTick.h>
#include <NdbOut.hpp>
#include <NdbTimer.hpp>
-#include <string.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
diff --git a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
index 6a00463339b..7cc883ab3e6 100644
--- a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
+++ b/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
@@ -57,13 +57,9 @@ Arguments:
#include "NdbApi.hpp"
-#include <string.h>
-#include <assert.h>
-
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbTick.h>
#include <NdbTimer.hpp>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/indexTest/index.cpp b/ndb/test/ndbapi/indexTest/index.cpp
index d0eb490e1a0..508186de529 100644
--- a/ndb/test/ndbapi/indexTest/index.cpp
+++ b/ndb/test/ndbapi/indexTest/index.cpp
@@ -37,9 +37,8 @@
1 - Invalid arguments
* *************************************************** */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
#include <NdbTick.h>
diff --git a/ndb/test/ndbapi/indexTest2/index2.cpp b/ndb/test/ndbapi/indexTest2/index2.cpp
index 5a3674f0bbf..e49113d2f1b 100644
--- a/ndb/test/ndbapi/indexTest2/index2.cpp
+++ b/ndb/test/ndbapi/indexTest2/index2.cpp
@@ -37,9 +37,8 @@
1 - Invalid arguments
* *************************************************** */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbOut.hpp>
#include <NdbTick.h>
diff --git a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
index b9d1eca1cc9..a2352edf707 100644
--- a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
+++ b/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
@@ -54,9 +54,6 @@
* *************************************************** */
-#include <NdbStdio.h>
-#include <string.h>
-#include <assert.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
#include <NdbMutex.h>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
index 25eb1830de9..84a93414712 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include "dbGenerator.h"
#include <NdbApi.hpp>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
index d7506c9dd2c..f613c66d07b 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
@@ -14,10 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <NdbUnistd.h>
+#include <ndb_global.h>
#include <NdbHost.h>
#include <NdbSleep.h>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
index c049cdbad33..22b7f564490 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
@@ -17,8 +17,7 @@
#ifndef MACROS_H
#define MACROS_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#define ERROR(x) {ndbout_c((x));}
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
index 91a061c7cf4..9e6c5e55e73 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
@@ -17,7 +17,7 @@
#ifndef NDB_ERROR_H
#define NDB_ERROR_H
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include "userInterface.h"
#include <NdbError.hpp>
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
index ece82628ba7..fdbc229cc98 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
+#include <ndb_global.h>
#include <time.h>
#include "ndb_schema.hpp"
@@ -31,7 +29,6 @@
#include <NdbTick.h>
#include <NdbApi.hpp>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
/***************************************************************
* L O C A L C O N S T A N T S *
diff --git a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
index c6ad11016b2..2f4aeb30975 100644
--- a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
+++ b/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
@@ -23,12 +23,6 @@
#include <ndb_types.h>
-/***************************************************************
-* M A C R O S *
-***************************************************************/
-
-typedef Uint32 uint32;
-
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
@@ -62,14 +56,14 @@ typedef char GroupName[GROUP_NAME_LENGTH];
typedef char ChangedBy[CHANGED_BY_LENGTH];
typedef char ChangedTime[CHANGED_TIME_LENGTH];
typedef char SessionDetails[SESSION_DETAILS_LENGTH];
-typedef uint32 ServerId;
-typedef uint32 ServerBit;
-typedef uint32 GroupId;
-typedef uint32 Location;
-typedef uint32 Permission;
-
-typedef uint32 Counter;
-typedef uint32 ActiveSessions;
+typedef Uint32 ServerId;
+typedef Uint32 ServerBit;
+typedef Uint32 GroupId;
+typedef Uint32 Location;
+typedef Uint32 Permission;
+
+typedef Uint32 Counter;
+typedef Uint32 ActiveSessions;
typedef unsigned int BranchExecuted;
typedef unsigned int DoRollback;
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
index eedcd914d85..7484c7647f5 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
+++ b/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include "dbGenerator.h"
/***************************************************************
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
index 6ddf0a47775..4a31db0b4e9 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
+++ b/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
@@ -14,11 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
+#include <ndb_global.h>
#include <NdbHost.h>
#include <NdbSleep.h>
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
index 9f8629ec1f0..42fbb52f3b2 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
+++ b/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include "userInterface.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
index 9dde902d006..838ac8a7196 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
+++ b/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "dbPopulate.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
index ca8a64ab59c..dd100507016 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
@@ -18,7 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "userHandle.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/lmc-bench/src/user/macros.h
index beb4352c269..363f247b93f 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/macros.h
+++ b/ndb/test/ndbapi/lmc-bench/src/user/macros.h
@@ -17,8 +17,7 @@
#ifndef MACROS_H
#define MACROS_H
-#include <stdlib.h>
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#define ERROR(x) {ndbout_c((x)); }
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
index 5f792342ed9..b3aaeac822e 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
@@ -17,7 +17,6 @@
#ifndef NDB_ERROR_H
#define NDB_ERROR_H
-#include <stdio.h>
#include <NdbOut.hpp>
#define error_handler(x,y, z) { \
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
index 6a35bccd064..ce3a76cdd59 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
@@ -19,7 +19,7 @@ extern "C" {
#include "user_populate.h"
}
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include "ndb_schema.hpp"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
index c68f287f5dd..bacf1861dde 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
@@ -18,10 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/time.h>
+#include <ndb_global.h>
#include "userInterface.h"
#include "userHandle.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
index 17069b0a042..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <time.h>
#include "sql.h"
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
index fc3f6955a47..67c4e037215 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
@@ -18,9 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <NdbStdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
+#include <ndb_global.h>
#ifndef NDB_WIN32
#include <sys/time.h>
#endif
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
index 17069b0a042..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
+++ b/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
@@ -18,8 +18,7 @@
* I N C L U D E D F I L E S *
***************************************************************/
-#include <stdio.h>
-#include <string.h>
+#include <ndb_global.h>
#include <time.h>
#include "sql.h"
diff --git a/ndb/test/ndbapi/restarter/restarter.cpp b/ndb/test/ndbapi/restarter/restarter.cpp
index ad3507df98a..9a522f5dcac 100644
--- a/ndb/test/ndbapi/restarter/restarter.cpp
+++ b/ndb/test/ndbapi/restarter/restarter.cpp
@@ -26,8 +26,6 @@
#include <NdbRestarter.hpp>
#include <NdbRestarts.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/restarter2/restarter2.cpp b/ndb/test/ndbapi/restarter2/restarter2.cpp
index 71eaf1a9b0f..f2bcf6f8e7b 100644
--- a/ndb/test/ndbapi/restarter2/restarter2.cpp
+++ b/ndb/test/ndbapi/restarter2/restarter2.cpp
@@ -24,8 +24,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/restarts/restarts.cpp b/ndb/test/ndbapi/restarts/restarts.cpp
index 2f9bab3b233..0ec2883d53c 100644
--- a/ndb/test/ndbapi/restarts/restarts.cpp
+++ b/ndb/test/ndbapi/restarts/restarts.cpp
@@ -25,8 +25,6 @@
#include <NdbRestarts.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
index 71fa286a21b..ce0aee35e8f 100644
--- a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
+++ b/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
@@ -26,6 +26,8 @@
* *************************************************** */
+#include <ndb_global.h>
+
#include <NdbApi.hpp>
#include <NdbTest.hpp>
#include <NdbOut.hpp>
@@ -36,11 +38,6 @@
#include <NdbTick.h>
#include <random.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
#define MAX_TIMERS 4
#define MAXSTRLEN 16
#define MAXATTR 64
diff --git a/ndb/test/ndbapi/telco/msa.cpp b/ndb/test/ndbapi/telco/msa.cpp
index f074733dce4..39ddaac2019 100644
--- a/ndb/test/ndbapi/telco/msa.cpp
+++ b/ndb/test/ndbapi/telco/msa.cpp
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <assert.h>
-#include <math.h>
+#include <ndb_global.h>
#include <NdbApi.hpp>
#include <NdbCondition.h>
#include <NdbMutex.h>
#include <NdbSleep.h>
-#include <NdbStdio.h>
#include <NdbThread.h>
#include <NdbTick.h>
-#include <NdbString.h>
const char* const c_szDatabaseName = "TEST_DB";
diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp
index b8fe51dc1e4..9f959702402 100644
--- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp
+++ b/ndb/test/ndbapi/testBlobs/testBlobs.cpp
@@ -18,13 +18,8 @@
* testBlobs
*/
-#include <new>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <NdbUnistd.h>
-#include <NdbString.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
index fd6570fad0a..b8e0fef6cef 100644
--- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
+++ b/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
@@ -28,14 +28,12 @@
* Creates tables TB00 to TB15
*/
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
#include <NdbTest.hpp>
-#include <NdbStdio.h>
// limits
static int const MaxAttr = 64;
diff --git a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
index 056aa9bf173..7fd2c19d9f7 100644
--- a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
+++ b/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
@@ -31,8 +31,6 @@
#include <UtilTransactions.hpp>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
-#include <assert.h>
-#include <NdbStdio.h>
#define CHECK(b) if (!(b)) { \
diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
index 68fa6ec5474..a47d9d2099e 100644
--- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
+++ b/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
@@ -18,17 +18,12 @@
* testOIBasic - ordered index test
*/
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <new>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
#include <NdbTest.hpp>
-#include <NdbStdio.h>
#include <NdbMutex.h>
#include <NdbCondition.h>
#include <NdbThread.h>
diff --git a/ndb/test/ndbapi/vw_test/bcd.h b/ndb/test/ndbapi/vw_test/bcd.h
index ce1309693c8..d0aaffbd8b7 100644
--- a/ndb/test/ndbapi/vw_test/bcd.h
+++ b/ndb/test/ndbapi/vw_test/bcd.h
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <math.h>
-#include <stdio.h>
+#include <ndb_global.h>
struct bcdtab {
char tab[3];
diff --git a/ndb/test/ndbapi/vw_test/cdrserver.cpp b/ndb/test/ndbapi/vw_test/cdrserver.cpp
index 3c3f32e8886..8354d28f53f 100644
--- a/ndb/test/ndbapi/vw_test/cdrserver.cpp
+++ b/ndb/test/ndbapi/vw_test/cdrserver.cpp
@@ -31,28 +31,22 @@
/* must also have the same entry (same port number) in its */
/* ./etc/services file. */
/* **************************************************************** */
+
+#include <ndb_global.h>
+
/******** NDB INCLUDE ******/
#include <NdbApi.hpp>
/***************************/
/*#include <sys/shm.h>*/
-#include <unistd.h>
-#include <stdlib.h>
-#include <strings.h>
#include <pthread.h>
#include <sys/sem.h>
-#include <sys/types.h>
#include <sys/shm.h>
-#include <sys/socket.h>
-#include <errno.h>
#include <netinet/in.h>
#include <signal.h>
-#include <stdio.h>
#include <netdb.h>
#include <time.h>
#include <synch.h>
#include <sched.h>
-#include <limits.h>
-#include <math.h>
extern "C" {
#include "utv.h"
diff --git a/ndb/test/ndbapi/vw_test/size.cpp b/ndb/test/ndbapi/vw_test/size.cpp
index 397cc02f4f6..c506771ebde 100644
--- a/ndb/test/ndbapi/vw_test/size.cpp
+++ b/ndb/test/ndbapi/vw_test/size.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include "utv.h"
int main(void)
diff --git a/ndb/test/newtonapi/basic_test/basic/basic.cpp b/ndb/test/newtonapi/basic_test/basic/basic.cpp
index 90f5bf14acf..bc33400078d 100644
--- a/ndb/test/newtonapi/basic_test/basic/basic.cpp
+++ b/ndb/test/newtonapi/basic_test/basic/basic.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t EmpColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
index fb26abc65aa..4120cfba864 100644
--- a/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
+++ b/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t EmpColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/common.cpp b/ndb/test/newtonapi/basic_test/common.cpp
index 6fd63730832..d4c4e6a74a7 100644
--- a/ndb/test/newtonapi/basic_test/common.cpp
+++ b/ndb/test/newtonapi/basic_test/common.cpp
@@ -16,10 +16,6 @@
#include "common.hpp"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
NdbOut &
operator << (NdbOut & out, const Employee_t & emp){
diff --git a/ndb/test/newtonapi/basic_test/common.hpp b/ndb/test/newtonapi/basic_test/common.hpp
index e081df723ef..0df8f7e078d 100644
--- a/ndb/test/newtonapi/basic_test/common.hpp
+++ b/ndb/test/newtonapi/basic_test/common.hpp
@@ -17,12 +17,13 @@
#ifndef COMMON_H
#define COMMON_H
+#include <ndb_global.h>
+
extern "C" {
#include <dba.h>
}
#include <NdbOut.hpp>
-#include <stdlib.h>
typedef struct Employee {
UInt32_t EmpNo;
diff --git a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
index fc6dfc40372..2c9cee5be87 100644
--- a/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
+++ b/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp
@@ -26,7 +26,6 @@ extern "C" {
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbMain.h>
-#include <assert.h>
static const
DBA_ColumnDesc_t ColDesc[] = {
diff --git a/ndb/test/newtonapi/basic_test/too_basic.cpp b/ndb/test/newtonapi/basic_test/too_basic.cpp
index 9099f0d9154..883aacf8841 100644
--- a/ndb/test/newtonapi/basic_test/too_basic.cpp
+++ b/ndb/test/newtonapi/basic_test/too_basic.cpp
@@ -18,6 +18,9 @@
/****** THIS LINE IS 80 CHARACTERS WIDE - DO *NOT* EXCEED 80 CHARACTERS! ****/
+#include <ndb_global.h>
+#include <NdbOut.hpp>
+
//#include <cfg/cfg_db.h>
//#include <init/init_start_restart.h>
//#include "pcn_types.h"
@@ -27,13 +30,6 @@ extern "C" {
#include <cfg_db.h>
}
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <NdbOut.hpp>
-
-
-
typedef struct Employee {
UInt32_t EmpNo;
diff --git a/ndb/test/newtonapi/perf_test/perf.cpp b/ndb/test/newtonapi/perf_test/perf.cpp
index 81d4cc5fd08..7b818e93a2a 100644
--- a/ndb/test/newtonapi/perf_test/perf.cpp
+++ b/ndb/test/newtonapi/perf_test/perf.cpp
@@ -15,14 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
extern "C" {
#include <dba.h>
}
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbTimer.hpp>
@@ -31,6 +29,9 @@ extern "C" {
#include <NdbMain.h>
#include <time.h>
+#undef min
+#undef max
+
static const int NP_Insert = 0;
static const int NP_Update = 1;
static const int NP_WriteUpdate = 2;
diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp
index 9731c00eeaf..b856b6a21f2 100644
--- a/ndb/test/odbc/driver/testOdbcDriver.cpp
+++ b/ndb/test/odbc/driver/testOdbcDriver.cpp
@@ -36,12 +36,7 @@
* Test of ODBC and SQL using a fixed set of tables.
*/
-#include <new>
-#include <NdbUnistd.h>
-#include <stdlib.h>
-#include <NdbString.h>
-#include <stdarg.h>
-#include <NdbStdio.h>
+#include <ndb_global.h>
#include <ndb_version.h>
#include <kernel/ndb_limits.h>
#include <Bitmask.hpp>
@@ -49,9 +44,7 @@
#ifdef ndbODBC
#include <NdbApi.hpp>
#endif
-#include <math.h>
#include <sqlext.h>
-#include <assert.h>
#undef BOOL
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index 1ce9124431c..eb8a626dc2b 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <getarg.h>
#include <BaseString.hpp>
#include <Parser.hpp>
diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp
index 8387f8638ed..8d00a7b6a55 100644
--- a/ndb/test/run-test/run-test.hpp
+++ b/ndb/test/run-test/run-test.hpp
@@ -24,6 +24,8 @@
#include <mgmapi.h>
#include <CpcClient.hpp>
+#undef MYSQL_CLIENT
+
enum ErrorCodes {
ERR_OK = 0,
ERR_NDB_FAILED = 101,
diff --git a/ndb/test/src/HugoCalculator.cpp b/ndb/test/src/HugoCalculator.cpp
index 9e2ba9f143e..246dde09c00 100644
--- a/ndb/test/src/HugoCalculator.cpp
+++ b/ndb/test/src/HugoCalculator.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "HugoCalculator.hpp"
-#include <assert.h>
-#include <NdbStdio.h>
#include <NDBT.hpp>
/* *************************************************************
diff --git a/ndb/test/src/NDBT_Error.cpp b/ndb/test/src/NDBT_Error.cpp
index 92c0b2e5c1f..ffacb3eb928 100644
--- a/ndb/test/src/NDBT_Error.cpp
+++ b/ndb/test/src/NDBT_Error.cpp
@@ -17,11 +17,9 @@
/* NDBT_Error.cpp */
/* This program deals with error handling */
-#include <string.h>
-#include <assert.h>
+#include <ndb_global.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
-#include <NdbStdio.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
#include <NdbSleep.h>
diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp
index 098e4cfb796..87694aabb2b 100644
--- a/ndb/test/src/NDBT_ResultRow.cpp
+++ b/ndb/test/src/NDBT_ResultRow.cpp
@@ -14,10 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
#include "NDBT_ResultRow.hpp"
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
#include <NdbOut.hpp>
NDBT_ResultRow::NDBT_ResultRow(const NdbDictionary::Table& tab,
diff --git a/ndb/test/src/NDBT_ReturnCodes.cpp b/ndb/test/src/NDBT_ReturnCodes.cpp
index 542547c7a48..5bffc00177f 100644
--- a/ndb/test/src/NDBT_ReturnCodes.cpp
+++ b/ndb/test/src/NDBT_ReturnCodes.cpp
@@ -14,14 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+/* System include files */
+#include <ndb_global.h>
+
#include "NDBT_ReturnCodes.h"
/* Ndb include files */
#include <NdbOut.hpp>
-/* System include files */
-#include <stdlib.h>
-
const char* rcodeToChar(int rcode){
switch (rcode){
case NDBT_OK:
diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp
index 2bd2c265f10..c520b01c990 100644
--- a/ndb/test/src/NDBT_Table.cpp
+++ b/ndb/test/src/NDBT_Table.cpp
@@ -15,8 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "NDBT_Table.hpp"
-#include <NdbString.h>
-#include <assert.h>
#include <NdbTimer.hpp>
#include <NDBT.hpp>
diff --git a/ndb/test/src/NDBT_Tables.cpp b/ndb/test/src/NDBT_Tables.cpp
index 41a38e4fe44..548e755a3fb 100644
--- a/ndb/test/src/NDBT_Tables.cpp
+++ b/ndb/test/src/NDBT_Tables.cpp
@@ -18,7 +18,6 @@
#include <NDBT_Table.hpp>
#include <NDBT_Tables.hpp>
-#include <assert.h>
/* ******************************************************* */
// Define Ndb standard tables
//
diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp
index 689aae64c81..3f73369f488 100644
--- a/ndb/test/src/NdbBackup.cpp
+++ b/ndb/test/src/NdbBackup.cpp
@@ -18,7 +18,6 @@
#include <NdbBackup.hpp>
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp
index d61b74cf62b..aa0bb252f58 100644
--- a/ndb/test/src/NdbConfig.cpp
+++ b/ndb/test/src/NdbConfig.cpp
@@ -17,7 +17,6 @@
#include "NdbConfig.hpp"
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
diff --git a/ndb/test/src/NdbGrep.cpp b/ndb/test/src/NdbGrep.cpp
index 747c62d5bc6..8b7442b0e77 100644
--- a/ndb/test/src/NdbGrep.cpp
+++ b/ndb/test/src/NdbGrep.cpp
@@ -18,7 +18,6 @@
#include <NdbGrep.hpp>
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
-#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp
index 1df214572c7..252fa28feec 100644
--- a/ndb/test/src/NdbRestarter.cpp
+++ b/ndb/test/src/NdbRestarter.cpp
@@ -24,7 +24,6 @@
#include <random.h>
#include <kernel/ndb_limits.h>
#include <ndb_version.h>
-#include <assert.h>
#define MGMERR(h) \
ndbout << "latest_error="<<ndb_mgm_get_latest_error(h) \
diff --git a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
index 4cb801d3d73..7f2751be2ba 100644
--- a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
+++ b/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
@@ -14,8 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
-#include <stdlib.h>
#include <NdbSleep.h>
#include <NDBT_Tables.hpp>
#include <getarg.h>
diff --git a/ndb/test/tools/hugoFill/hugoFill.cpp b/ndb/test/tools/hugoFill/hugoFill.cpp
index 748623cb253..dee6ce2e6c8 100644
--- a/ndb/test/tools/hugoFill/hugoFill.cpp
+++ b/ndb/test/tools/hugoFill/hugoFill.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
index 90c08649ec2..e2c2cd13f00 100644
--- a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
+++ b/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
index f77dc21bd0b..1855f19796f 100644
--- a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
+++ b/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
index 2e9c2c35260..50351f08195 100644
--- a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
+++ b/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
index 6335c391bc3..ac17ffffee8 100644
--- a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
+++ b/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
@@ -14,8 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
-#include <stdlib.h>
#include <NdbSleep.h>
#include <NDBT_Tables.hpp>
#include <getarg.h>
diff --git a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
index 141d01e3aee..e7edc3a991d 100644
--- a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
+++ b/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
index 2376280d004..47ea8f4a8a7 100644
--- a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
+++ b/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
index 56cd3b8c969..3e2255ca0f3 100644
--- a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
+++ b/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/test/tools/restart/restart.cpp b/ndb/test/tools/restart/restart.cpp
index f391aecabe1..88cfb231a72 100644
--- a/ndb/test/tools/restart/restart.cpp
+++ b/ndb/test/tools/restart/restart.cpp
@@ -15,7 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <string.h>
+#include <ndb_global.h>
+
#include <NdbMain.h>
#include <OutputStream.hpp>
#include <NdbOut.hpp>
@@ -24,8 +25,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
-#include <NdbStdio.h>
int main(int argc, const char** argv){
diff --git a/ndb/test/tools/waiter/waiter.cpp b/ndb/test/tools/waiter/waiter.cpp
index 14803fec71d..d57daff3aea 100644
--- a/ndb/test/tools/waiter/waiter.cpp
+++ b/ndb/test/tools/waiter/waiter.cpp
@@ -25,7 +25,6 @@
#include <NdbRestarter.hpp>
#include <NDBT.hpp>
-#include <assert.h>
int main(int argc, const char** argv){
diff --git a/ndb/tools/copy_tab/copy_tab.cpp b/ndb/tools/copy_tab/copy_tab.cpp
index 32cfb0b35ff..33ce8e01d9a 100644
--- a/ndb/tools/copy_tab/copy_tab.cpp
+++ b/ndb/tools/copy_tab/copy_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/tools/cpcc/cpcc.cpp
index 5a826f250c0..745f897a096 100644
--- a/ndb/tools/cpcc/cpcc.cpp
+++ b/ndb/tools/cpcc/cpcc.cpp
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdarg.h>
+#include <ndb_global.h>
#include <getarg.h>
#include "CpcClient.hpp"
#include <NdbEnv.h>
diff --git a/ndb/tools/create_index/create_index.cpp b/ndb/tools/create_index/create_index.cpp
index 32da39a5208..dc9e6c606d6 100644
--- a/ndb/tools/create_index/create_index.cpp
+++ b/ndb/tools/create_index/create_index.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/delete_all/delete_all.cpp b/ndb/tools/delete_all/delete_all.cpp
index e78ad4a2e1e..9cbba503e68 100644
--- a/ndb/tools/delete_all/delete_all.cpp
+++ b/ndb/tools/delete_all/delete_all.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/drop_index/drop_index.cpp b/ndb/tools/drop_index/drop_index.cpp
index 146f01113b2..327f15741c9 100644
--- a/ndb/tools/drop_index/drop_index.cpp
+++ b/ndb/tools/drop_index/drop_index.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/drop_tab/drop_tab.cpp b/ndb/tools/drop_tab/drop_tab.cpp
index 5946ada5956..70e5d85aabe 100644
--- a/ndb/tools/drop_tab/drop_tab.cpp
+++ b/ndb/tools/drop_tab/drop_tab.cpp
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdio.h>
+#include <ndb_global.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/list_tables/listTables.cpp b/ndb/tools/list_tables/listTables.cpp
index c14808050c6..41433862304 100644
--- a/ndb/tools/list_tables/listTables.cpp
+++ b/ndb/tools/list_tables/listTables.cpp
@@ -21,8 +21,9 @@
*
*/
-#include <stdarg.h>
+#include <ndb_global.h>
#include <getarg.h>
+
#include <NdbApi.hpp>
#include <NDBT.hpp>
diff --git a/ndb/tools/select_all/select_all.cpp b/ndb/tools/select_all/select_all.cpp
index 32e9d1c6872..34f63a095bb 100644
--- a/ndb/tools/select_all/select_all.cpp
+++ b/ndb/tools/select_all/select_all.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/select_count/select_count.cpp b/ndb/tools/select_count/select_count.cpp
index 4d281b9bdd5..b1513ad4135 100644
--- a/ndb/tools/select_count/select_count.cpp
+++ b/ndb/tools/select_count/select_count.cpp
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <NdbStdio.h>
-#include <stdlib.h>
+#include <ndb_global.h>
+
#include <NdbOut.hpp>
#include <NdbApi.hpp>
diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/tools/transproxy/transproxy.cpp
index 4c1308e63e7..384a8a34f03 100644
--- a/ndb/tools/transproxy/transproxy.cpp
+++ b/ndb/tools/transproxy/transproxy.cpp
@@ -14,14 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <ndb_global.h>
#include <NdbTCP.h>
#include <NdbOut.hpp>
diff --git a/ndb/tools/verify_index/verify_index.cpp b/ndb/tools/verify_index/verify_index.cpp
index 324bb11cfe4..1295b657e9b 100644
--- a/ndb/tools/verify_index/verify_index.cpp
+++ b/ndb/tools/verify_index/verify_index.cpp
@@ -14,9 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
-#include <NdbStdio.h>
-#include <stdlib.h>
#include <NdbOut.hpp>
#include <NdbApi.hpp>