summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-07-07 11:29:39 +0300
committerunknown <monty@mysql.com>2004-07-07 11:29:39 +0300
commit11b8987313aab1eb8d9f829731fa0dcd83bf62f5 (patch)
treeca8974710746bb69b04a49bc64f938d0b1a8420a /ndb
parentc92670d80b3674fa025e373e0498eccbb407f873 (diff)
parent9890cd9a9eb37083d13370947fa50d64e21e54ff (diff)
downloadmariadb-git-11b8987313aab1eb8d9f829731fa0dcd83bf62f5.tar.gz
Merge with 4.1.3-beta
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union VC++Files/libmysqld/libmysqld.dsp: Auto merged VC++Files/sql/mysqld.dsp: Auto merged client/mysql.cc: Auto merged client/mysqlbinlog.cc: Auto merged client/mysqltest.c: Auto merged include/config-netware.h: Auto merged include/my_base.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql_com.h: Auto merged include/sql_state.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/row/row0sel.c: Auto merged libmysql/libmysql.c: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/mi_check.c: Auto merged mysql-test/r/bdb.result: Auto merged mysql-test/r/connect.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/derived.result: Auto merged mysql-test/r/func_group.result: Auto merged mysql-test/r/func_like.result: Auto merged mysql-test/r/func_sapdb.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/insert.result: Auto merged mysql-test/r/insert_select.result: Auto merged mysql-test/r/join_outer.result: Auto merged mysql-test/r/key.result: Auto merged mysql-test/r/multi_update.result: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/null.result: Auto merged mysql-test/r/null_key.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/rpl_rotate_logs.result: Auto merged mysql-test/r/rpl_server_id1.result: Auto merged mysql-test/r/rpl_until.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/system_mysql_db.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/mysqlbinlog.test: Auto merged mysql-test/t/rpl000015.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/variables.test: Auto merged mysys/mf_iocache2.c: Auto merged mysys/my_bitmap.c: Auto merged mysys/my_pthread.c: Auto merged netware/Makefile.am: Auto merged netware/my_manage.c: Auto merged netware/mysql_test_run.c: Auto merged netware/BUILD/compile-linux-tools: Auto merged netware/BUILD/compile-netware-standard: Auto merged netware/BUILD/mwenv: Auto merged netware/BUILD/nwbootstrap: Auto merged scripts/make_binary_distribution.sh: Auto merged scripts/mysql_install_db.sh: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged sql/ha_heap.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_create.cc: Auto merged sql/item_create.h: Auto merged sql/item_func.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/item_timefunc.h: Auto merged sql/lex.h: Auto merged sql/mysql_priv.h: Auto merged sql/net_serv.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/records.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_update.cc: Auto merged sql/structs.h: Auto merged sql-common/client.c: Auto merged configure.in: Merge with 4.1 include/mysqld_error.h: New errors from 4.1 libmysqld/Makefile.am: Merge with 4.1 myisam/myisamchk.c: Merge with 4.1 myisam/myisamdef.h: Merge with 4.1 myisam/sort.c: Merge with 4.1 mysql-test/r/mysqlbinlog.result: Merge with 4.1 mysql-test/r/range.result: Merge with 4.1 mysql-test/r/rpl_flush_log_loop.result: Merge with 4.1 mysql-test/r/rpl_replicate_do.result: Merge with 4.1 mysql-test/r/rpl_temporary.result: Merge with 4.1 mysql-test/r/rpl_user_variables.result: Merge with 4.1 mysql-test/t/func_time.test: Merge with 4.1 scripts/mysql_create_system_tables.sh: Merge with 4.1 scripts/mysql_fix_privilege_tables.sql: Merge with 4.1 sql/Makefile.am: Merge with 4.1 sql/filesort.cc: Merge with 4.1 sql/ha_innodb.cc: Merge with 4.1 sql/ha_innodb.h: Merge with 4.1 sql/ha_myisam.cc: Merge with 4.1 sql/handler.cc: Merge with 4.1 sql/handler.h: Merge with 4.1 sql/item_func.cc: Merge with 4.1 sql/item_timefunc.cc: Merge with 4.1 sql/log.cc: Merge with 4.1 sql/log_event.cc: Merge with 4.1 sql/mysqld.cc: Merge with 4.1 sql/opt_range.cc: Merge with 4.1 sql/opt_range.h: Merge with 4.1 sql/share/czech/errmsg.txt: Merge with 4.1 Updated english error messages sql/share/danish/errmsg.txt: Merge with 4.1 sql/share/dutch/errmsg.txt: Merge with 4.1 sql/share/english/errmsg.txt: Merge with 4.1 sql/share/estonian/errmsg.txt: Merge with 4.1 sql/share/french/errmsg.txt: Merge with 4.1 sql/share/german/errmsg.txt: Merge with 4.1 sql/share/greek/errmsg.txt: Merge with 4.1 sql/share/hungarian/errmsg.txt: Merge with 4.1 sql/share/italian/errmsg.txt: Merge with 4.1 sql/share/japanese/errmsg.txt: Merge with 4.1 sql/share/korean/errmsg.txt: Merge with 4.1 sql/share/norwegian-ny/errmsg.txt: Merge with 4.1 sql/share/norwegian/errmsg.txt: Merge with 4.1 sql/share/polish/errmsg.txt: Merge with 4.1 sql/share/portuguese/errmsg.txt: Merge with 4.1 sql/share/romanian/errmsg.txt: Merge with 4.1 sql/share/russian/errmsg.txt: Merge with 4.1 sql/share/serbian/errmsg.txt: Merge with 4.1 sql/share/slovak/errmsg.txt: Merge with 4.1 sql/share/spanish/errmsg.txt: Merge with 4.1 sql/share/swedish/errmsg.txt: Merge with 4.1 sql/share/ukrainian/errmsg.txt: Merge with 4.1 sql/slave.cc: Merge with 4.1 sql/sql_class.cc: Merge with 4.1 sql/sql_class.h: Merge with 4.1 sql/sql_db.cc: Merge with 4.1 sql/sql_insert.cc: Merge with 4.1 sql/sql_lex.cc: Merge with 4.1 sql/sql_lex.h: Merge with 4.1 sql/sql_parse.cc: Merge with 4.1 tree Changed // comments to /* */ sql/sql_prepare.cc: Merge with 4.1 sql/sql_select.cc: Merge with 4.1 sql/sql_table.cc: Merge with 4.1 sql/sql_yacc.yy: Merge with 4.1 sql/table.h: Merge with 4.1 tests/client_test.c: Merge with 4.1
Diffstat (limited to 'ndb')
-rw-r--r--ndb/BinDist.sh121
-rw-r--r--ndb/Defs.mk64
-rw-r--r--ndb/Epilogue.mk876
-rw-r--r--ndb/Makefile69
-rw-r--r--ndb/Makefile.am19
-rw-r--r--ndb/README7
-rw-r--r--ndb/SrcDist.sh87
-rwxr-xr-xndb/bin/mysqlcluster11
-rwxr-xr-xndb/bin/mysqlcluster_install_db119
-rwxr-xr-xndb/bin/mysqlclusterd34
-rw-r--r--ndb/bin/regression.sh644
-rw-r--r--ndb/config/Defs.DEBUG.mk4
-rw-r--r--ndb/config/Defs.HPUX.HPPA.GCC.mk50
-rw-r--r--ndb/config/Defs.IBMAIX.POWERPC.GCC.mk49
-rw-r--r--ndb/config/Defs.LINUX.x86.GCC.mk60
-rw-r--r--ndb/config/Defs.LINUX.x86.ICC.mk54
-rw-r--r--ndb/config/Defs.LINUX.x86_64.GCC.mk54
-rw-r--r--ndb/config/Defs.MACOSX.POWERPC.GCC.mk58
-rw-r--r--ndb/config/Defs.OSE.PPC750.DIAB.mk47
-rw-r--r--ndb/config/Defs.RELEASE.mk3
-rw-r--r--ndb/config/Defs.RELEASE_TRACE.mk3
-rw-r--r--ndb/config/Defs.SIMCELLO.SOFTOSE.GCC.mk53
-rw-r--r--ndb/config/Defs.SOFTOSE.SPARC.GCC.mk57
-rw-r--r--ndb/config/Defs.SOLARIS.SPARC.FORTE6.mk54
-rw-r--r--ndb/config/Defs.SOLARIS.SPARC.GCC.mk54
-rw-r--r--ndb/config/Defs.SOLARIS.SPARC_64.GCC.mk53
-rw-r--r--ndb/config/Defs.SOLARIS6.SPARC.GCC.mk53
-rw-r--r--ndb/config/Defs.TRU64X.ALPHA.GCC.mk49
-rw-r--r--ndb/config/Defs.WIN32.x86.VC7.mk61
-rwxr-xr-xndb/config/GuessConfig.sh115
-rw-r--r--ndb/config/Makefile.am31
-rw-r--r--ndb/config/acinclude.m41513
-rw-r--r--ndb/config/common.mk.am12
-rw-r--r--ndb/config/config.h.in993
-rw-r--r--ndb/config/configure.in2085
-rw-r--r--ndb/config/type_kernel.mk.am18
-rw-r--r--ndb/config/type_mgmapiclient.mk.am2
-rw-r--r--ndb/config/type_ndbapi.mk.am12
-rw-r--r--ndb/config/type_ndbapiclient.mk.am2
-rw-r--r--ndb/config/type_ndbapitest.mk.am11
-rw-r--r--ndb/config/type_ndbapitools.mk.am10
-rw-r--r--ndb/config/type_util.mk.am6
-rwxr-xr-xndb/configure33
-rw-r--r--ndb/docs/Makefile97
-rw-r--r--ndb/docs/Makefile.am102
-rwxr-xr-xndb/docs/doxygen/postdoxy.pl1
-rwxr-xr-xndb/docs/doxygen/predoxy.pl1
-rw-r--r--ndb/env.sh8
-rw-r--r--ndb/include/Makefile.am42
-rw-r--r--ndb/include/kernel/BlockNumbers.h1
-rw-r--r--ndb/include/kernel/GlobalSignalNumbers.h84
-rw-r--r--ndb/include/kernel/LogLevel.hpp28
-rw-r--r--ndb/include/kernel/kernel_config_parameters.h56
-rw-r--r--ndb/include/kernel/ndb_limits.h5
-rw-r--r--ndb/include/kernel/signaldata/CheckNodeGroups.hpp12
-rw-r--r--ndb/include/kernel/signaldata/CntrStart.hpp69
-rw-r--r--ndb/include/kernel/signaldata/CreateEvnt.hpp2
-rw-r--r--ndb/include/kernel/signaldata/DictTabInfo.hpp11
-rw-r--r--ndb/include/kernel/signaldata/EventSubscribeReq.hpp6
-rw-r--r--ndb/include/kernel/signaldata/FsOpenReq.hpp1
-rw-r--r--ndb/include/kernel/signaldata/ReadConfig.hpp24
-rw-r--r--ndb/include/kernel/signaldata/ReadNodesConf.hpp48
-rw-r--r--ndb/include/kernel/signaldata/SetLogLevelOrd.hpp1
-rw-r--r--ndb/include/kernel/signaldata/TcKeyConf.hpp2
-rw-r--r--ndb/include/kernel/signaldata/TupAccess.hpp2
-rw-r--r--ndb/include/kernel/signaldata/TupFrag.hpp5
-rw-r--r--ndb/include/kernel/signaldata/TuxMaint.hpp9
-rw-r--r--ndb/include/kernel/signaldata/UpgradeStartup.hpp36
-rw-r--r--ndb/include/kernel/trigger_definitions.h1
-rw-r--r--ndb/include/mgmapi/mgmapi.h35
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters.h144
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters_debug.h8
-rw-r--r--ndb/include/mgmcommon/ConfigRetriever.hpp32
-rw-r--r--ndb/include/mgmcommon/IPCConfig.hpp4
-rw-r--r--ndb/include/ndb_global.h10
-rw-r--r--ndb/include/ndb_types.h2
-rw-r--r--ndb/include/ndb_version.h10
-rw-r--r--ndb/include/ndbapi/AttrType.hpp329
-rw-r--r--ndb/include/ndbapi/Ndb.hpp72
-rw-r--r--ndb/include/ndbapi/NdbApi.hpp5
-rw-r--r--ndb/include/ndbapi/NdbBlob.hpp293
-rw-r--r--ndb/include/ndbapi/NdbConnection.hpp101
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp36
-rw-r--r--ndb/include/ndbapi/NdbIndexOperation.hpp2
-rw-r--r--ndb/include/ndbapi/NdbOperation.hpp110
-rw-r--r--ndb/include/ndbapi/NdbRecAttr.hpp43
-rw-r--r--ndb/include/ndbapi/NdbReceiver.hpp4
-rw-r--r--ndb/include/ndbapi/NdbScanOperation.hpp6
-rw-r--r--ndb/include/ndbapi/ndbapi_limits.h20
-rw-r--r--ndb/include/portlib/PortDefs.h2
-rw-r--r--ndb/include/util/Base64.hpp5
-rw-r--r--ndb/include/util/BaseString.hpp4
-rw-r--r--ndb/include/util/Bitmask.hpp42
-rw-r--r--ndb/include/util/ConfigValues.hpp252
-rw-r--r--ndb/include/util/NdbSqlUtil.hpp36
-rw-r--r--ndb/include/util/Parser.hpp1
-rw-r--r--ndb/include/util/Properties.hpp17
-rw-r--r--ndb/include/util/UtilBuffer.hpp9
-rw-r--r--ndb/mysqlclusterenv.sh51
-rw-r--r--ndb/src/Makefile33
-rw-r--r--ndb/src/Makefile.am18
-rw-r--r--ndb/src/common/Makefile.am13
-rw-r--r--ndb/src/common/Makefile_old (renamed from ndb/src/common/Makefile)0
-rw-r--r--ndb/src/common/debugger/LogLevel.cpp19
-rw-r--r--ndb/src/common/debugger/Makefile.am11
-rw-r--r--ndb/src/common/debugger/Makefile_old (renamed from ndb/src/common/debugger/Makefile)0
-rw-r--r--ndb/src/common/debugger/signaldata/BackupImpl.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/CntrStart.cpp37
-rw-r--r--ndb/src/common/debugger/signaldata/CreateTrig.cpp2
-rw-r--r--ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp6
-rw-r--r--ndb/src/common/debugger/signaldata/Makefile.am32
-rw-r--r--ndb/src/common/debugger/signaldata/Makefile_old (renamed from ndb/src/common/debugger/signaldata/Makefile)1
-rw-r--r--ndb/src/common/debugger/signaldata/ReadNodesConf.cpp24
-rw-r--r--ndb/src/common/debugger/signaldata/SignalDataPrint.cpp8
-rw-r--r--ndb/src/common/debugger/signaldata/SignalNames.cpp36
-rw-r--r--ndb/src/common/debugger/signaldata/TuxMaint.cpp8
-rw-r--r--ndb/src/common/editline/Makefile.am10
-rw-r--r--ndb/src/common/editline/Makefile_old (renamed from ndb/src/common/editline/Makefile)0
-rw-r--r--ndb/src/common/logger/Makefile.am11
-rw-r--r--ndb/src/common/logger/Makefile_old (renamed from ndb/src/common/logger/Makefile)0
-rw-r--r--ndb/src/common/mgmcommon/Config.cpp59
-rw-r--r--ndb/src/common/mgmcommon/Config.hpp22
-rw-r--r--ndb/src/common/mgmcommon/ConfigInfo.cpp3988
-rw-r--r--ndb/src/common/mgmcommon/ConfigInfo.hpp49
-rw-r--r--ndb/src/common/mgmcommon/ConfigRetriever.cpp386
-rw-r--r--ndb/src/common/mgmcommon/IPCConfig.cpp159
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.cpp191
-rw-r--r--ndb/src/common/mgmcommon/InitConfigFileParser.hpp77
-rw-r--r--ndb/src/common/mgmcommon/Makefile.am18
-rw-r--r--ndb/src/common/mgmcommon/Makefile_old (renamed from ndb/src/common/mgmcommon/Makefile)3
-rw-r--r--ndb/src/common/mgmcommon/printConfig/Makefile6
-rw-r--r--ndb/src/common/mgmcommon/printConfig/printConfig.cpp11
-rw-r--r--ndb/src/common/portlib/Makefile.am18
-rw-r--r--ndb/src/common/portlib/Makefile_old (renamed from ndb/src/common/portlib/Makefile)0
-rw-r--r--ndb/src/common/portlib/NdbCondition.c (renamed from ndb/src/common/portlib/unix/NdbCondition.c)0
-rw-r--r--ndb/src/common/portlib/NdbDaemon.c (renamed from ndb/src/common/portlib/unix/NdbDaemon.c)6
-rw-r--r--ndb/src/common/portlib/NdbEnv.c (renamed from ndb/src/common/portlib/unix/NdbEnv.c)0
-rw-r--r--ndb/src/common/portlib/NdbHost.c (renamed from ndb/src/common/portlib/unix/NdbHost.c)0
-rw-r--r--ndb/src/common/portlib/NdbMem.c (renamed from ndb/src/common/portlib/unix/NdbMem.c)0
-rw-r--r--ndb/src/common/portlib/NdbMutex.c (renamed from ndb/src/common/portlib/unix/NdbMutex.c)0
-rw-r--r--ndb/src/common/portlib/NdbPortLibTest.cpp (renamed from ndb/src/common/portlib/test/NdbPortLibTest.cpp)0
-rw-r--r--ndb/src/common/portlib/NdbSleep.c (renamed from ndb/src/common/portlib/unix/NdbSleep.c)0
-rw-r--r--ndb/src/common/portlib/NdbTCP.c (renamed from ndb/src/common/portlib/unix/NdbTCP.c)0
-rw-r--r--ndb/src/common/portlib/NdbThread.c (renamed from ndb/src/common/portlib/unix/NdbThread.c)9
-rw-r--r--ndb/src/common/portlib/NdbTick.c (renamed from ndb/src/common/portlib/unix/NdbTick.c)0
-rw-r--r--ndb/src/common/portlib/gcc.cpp2
-rw-r--r--ndb/src/common/portlib/memtest.c (renamed from ndb/src/common/portlib/memtest/memtest.c)0
-rw-r--r--ndb/src/common/portlib/mmslist.cpp (renamed from ndb/src/common/portlib/mmstest/mmslist.cpp)0
-rw-r--r--ndb/src/common/portlib/mmstest.cpp (renamed from ndb/src/common/portlib/mmstest/mmstest.cpp)0
-rw-r--r--ndb/src/common/portlib/munmaptest.cpp (renamed from ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp)0
-rw-r--r--ndb/src/common/portlib/old_dirs/memtest/Makefile (renamed from ndb/src/common/portlib/memtest/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile (renamed from ndb/src/common/portlib/memtest/munmaptest/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/Makefile (renamed from ndb/src/common/portlib/ose/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbCondition.c (renamed from ndb/src/common/portlib/ose/NdbCondition.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h (renamed from ndb/src/common/portlib/ose/NdbConditionOSE.h)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbEnv.c (renamed from ndb/src/common/portlib/ose/NdbEnv.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbHost.c (renamed from ndb/src/common/portlib/ose/NdbHost.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbMem.c (renamed from ndb/src/common/portlib/ose/NdbMem.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp (renamed from ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbMutex.c (renamed from ndb/src/common/portlib/ose/NdbMutex.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp (renamed from ndb/src/common/portlib/ose/NdbOut.cpp)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbSleep.c (renamed from ndb/src/common/portlib/ose/NdbSleep.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbTCP.c (renamed from ndb/src/common/portlib/ose/NdbTCP.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbThread.c (renamed from ndb/src/common/portlib/ose/NdbThread.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/ose/NdbTick.c (renamed from ndb/src/common/portlib/ose/NdbTick.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/test/Makefile (renamed from ndb/src/common/portlib/test/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/unix/Makefile_old (renamed from ndb/src/common/portlib/unix/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/Makefile (renamed from ndb/src/common/portlib/win32/Makefile)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbCondition.c (renamed from ndb/src/common/portlib/win32/NdbCondition.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c (renamed from ndb/src/common/portlib/win32/NdbDaemon.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbEnv.c (renamed from ndb/src/common/portlib/win32/NdbEnv.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbHost.c (renamed from ndb/src/common/portlib/win32/NdbHost.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbMem.c (renamed from ndb/src/common/portlib/win32/NdbMem.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbMutex.c (renamed from ndb/src/common/portlib/win32/NdbMutex.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbSleep.c (renamed from ndb/src/common/portlib/win32/NdbSleep.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbTCP.c (renamed from ndb/src/common/portlib/win32/NdbTCP.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbThread.c (renamed from ndb/src/common/portlib/win32/NdbThread.c)0
-rw-r--r--ndb/src/common/portlib/old_dirs/win32/NdbTick.c (renamed from ndb/src/common/portlib/win32/NdbTick.c)0
-rw-r--r--ndb/src/common/transporter/Makefile.am22
-rw-r--r--ndb/src/common/transporter/Makefile_old (renamed from ndb/src/common/transporter/Makefile)0
-rw-r--r--ndb/src/common/transporter/Transporter.hpp2
-rw-r--r--ndb/src/common/util/Base64.cpp161
-rw-r--r--ndb/src/common/util/ConfigValues.cpp743
-rw-r--r--ndb/src/common/util/Makefile.am17
-rw-r--r--ndb/src/common/util/Makefile_old (renamed from ndb/src/common/util/Makefile)4
-rw-r--r--ndb/src/common/util/NdbSqlUtil.cpp20
-rw-r--r--ndb/src/common/util/Properties.cpp122
-rw-r--r--ndb/src/common/util/md5_hash.cpp2
-rw-r--r--ndb/src/common/util/new.cpp4
-rw-r--r--ndb/src/common/util/socket_io.cpp6
-rw-r--r--ndb/src/common/util/testConfigValues/Makefile12
-rw-r--r--ndb/src/common/util/testConfigValues/testConfigValues.cpp122
-rw-r--r--ndb/src/common/util/testProperties/Makefile5
-rw-r--r--ndb/src/common/util/testProperties/testProperties.cpp11
-rw-r--r--ndb/src/cw/Makefile.am1
-rw-r--r--ndb/src/cw/Makefile_old (renamed from ndb/src/cw/Makefile)0
-rw-r--r--ndb/src/cw/cpcd/Makefile.am14
-rw-r--r--ndb/src/cw/cpcd/Makefile_old (renamed from ndb/src/cw/cpcd/Makefile)0
-rw-r--r--ndb/src/kernel/Main.cpp (renamed from ndb/src/kernel/ndb-main/Main.cpp)28
-rw-r--r--ndb/src/kernel/Makefile5
-rw-r--r--ndb/src/kernel/Makefile.am58
-rw-r--r--ndb/src/kernel/Makefile_old (renamed from ndb/src/scripts/Makefile)2
-rw-r--r--ndb/src/kernel/SimBlockList.cpp (renamed from ndb/src/kernel/ndb-main/SimBlockList.cpp)51
-rw-r--r--ndb/src/kernel/blocks/ERROR_codes.txt9
-rw-r--r--ndb/src/kernel/blocks/Makefile.am17
-rw-r--r--ndb/src/kernel/blocks/Makefile_old (renamed from ndb/src/kernel/blocks/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/Start.txt32
-rw-r--r--ndb/src/kernel/blocks/backup/BackupInit.cpp18
-rw-r--r--ndb/src/kernel/blocks/backup/Makefile.am12
-rw-r--r--ndb/src/kernel/blocks/backup/Makefile_old (renamed from ndb/src/kernel/blocks/backup/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Makefile20
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Makefile.am12
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.cpp818
-rw-r--r--ndb/src/kernel/blocks/backup/restore/Restore.hpp175
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer.cpp107
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer.hpp34
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp55
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp50
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp516
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp75
-rw-r--r--ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp652
-rw-r--r--ndb/src/kernel/blocks/backup/restore/main.cpp1461
-rw-r--r--ndb/src/kernel/blocks/backup/restore/myVector.hpp128
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp390
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp13
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Makefile.am10
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Makefile_old (renamed from ndb/src/kernel/blocks/cmvmi/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbacc/Dbacc.hpp5
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dbacc/DbaccMain.cpp114
-rw-r--r--ndb/src/kernel/blocks/dbacc/Makefile.am10
-rw-r--r--ndb/src/kernel/blocks/dbacc/Makefile_old (renamed from ndb/src/kernel/blocks/dbacc/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp72
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.hpp34
-rw-r--r--ndb/src/kernel/blocks/dbdict/Makefile.am11
-rw-r--r--ndb/src/kernel/blocks/dbdict/Makefile_old (renamed from ndb/src/kernel/blocks/dbdict/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbdih/Dbdih.hpp8
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihInit.cpp3
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihMain.cpp199
-rw-r--r--ndb/src/kernel/blocks/dbdih/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/dbdih/Makefile_old (renamed from ndb/src/kernel/blocks/dbdih/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dblqh/Dblqh.hpp7
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhInit.cpp2
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhMain.cpp180
-rw-r--r--ndb/src/kernel/blocks/dblqh/Makefile.am11
-rw-r--r--ndb/src/kernel/blocks/dblqh/Makefile_old (renamed from ndb/src/kernel/blocks/dblqh/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbtc/Dbtc.hpp7
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcInit.cpp21
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp221
-rw-r--r--ndb/src/kernel/blocks/dbtc/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/dbtc/Makefile_old (renamed from ndb/src/kernel/blocks/dbtc/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbtup/Dbtup.hpp29
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp98
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp175
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp13
-rw-r--r--ndb/src/kernel/blocks/dbtup/Makefile.am27
-rw-r--r--ndb/src/kernel/blocks/dbtup/Makefile_old (renamed from ndb/src/kernel/blocks/dbtup/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbtux/Dbtux.hpp676
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp97
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp80
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp132
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp159
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp19
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp491
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp135
-rw-r--r--ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp480
-rw-r--r--ndb/src/kernel/blocks/dbtux/Makefile.am19
-rw-r--r--ndb/src/kernel/blocks/dbtux/Makefile_old (renamed from ndb/src/kernel/blocks/dbtux/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/dbtux/Times.txt52
-rw-r--r--ndb/src/kernel/blocks/dbutil/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/dbutil/Makefile_old (renamed from ndb/src/kernel/blocks/dbutil/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/grep/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/grep/Makefile_old (renamed from ndb/src/kernel/blocks/grep/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/Makefile.am12
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/Makefile_old (renamed from ndb/src/kernel/blocks/ndbcntr/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp251
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp25
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp2344
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp10
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Makefile.am13
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Makefile_old (renamed from ndb/src/kernel/blocks/ndbfs/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp5
-rw-r--r--ndb/src/kernel/blocks/qmgr/Makefile.am11
-rw-r--r--ndb/src/kernel/blocks/qmgr/Makefile_old (renamed from ndb/src/kernel/blocks/qmgr/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/qmgr/Qmgr.hpp176
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrInit.cpp22
-rw-r--r--ndb/src/kernel/blocks/qmgr/QmgrMain.cpp1815
-rw-r--r--ndb/src/kernel/blocks/suma/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/suma/Makefile_old (renamed from ndb/src/kernel/blocks/suma/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/trix/Makefile.am9
-rw-r--r--ndb/src/kernel/blocks/trix/Makefile_old (renamed from ndb/src/kernel/blocks/trix/Makefile)0
-rw-r--r--ndb/src/kernel/blocks/trix/Trix.hpp17
-rw-r--r--ndb/src/kernel/error/ErrorReporter.cpp30
-rw-r--r--ndb/src/kernel/error/ErrorReporter.hpp10
-rw-r--r--ndb/src/kernel/error/Makefile.am11
-rw-r--r--ndb/src/kernel/error/Makefile_old (renamed from ndb/src/kernel/error/Makefile)0
-rw-r--r--ndb/src/kernel/ndb-main/Makefile42
-rw-r--r--ndb/src/kernel/vm/Configuration.cpp439
-rw-r--r--ndb/src/kernel/vm/Configuration.hpp28
-rw-r--r--ndb/src/kernel/vm/Emulator.cpp10
-rw-r--r--ndb/src/kernel/vm/Emulator.hpp19
-rw-r--r--ndb/src/kernel/vm/FastScheduler.cpp14
-rw-r--r--ndb/src/kernel/vm/FastScheduler.hpp14
-rw-r--r--ndb/src/kernel/vm/Makefile.am29
-rw-r--r--ndb/src/kernel/vm/Makefile_old (renamed from ndb/src/kernel/vm/Makefile)5
-rw-r--r--ndb/src/kernel/vm/SignalCounter.hpp2
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp59
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.hpp15
-rw-r--r--ndb/src/kernel/vm/TransporterCallback.cpp7
-rw-r--r--ndb/src/kernel/vm/VMSignal.hpp9
-rw-r--r--ndb/src/kernel/vm/pc.hpp21
-rw-r--r--ndb/src/kernel/vm/testLongSig/testLongSig.cpp40
-rw-r--r--ndb/src/mgmapi/Makefile.am13
-rw-r--r--ndb/src/mgmapi/Makefile_old (renamed from ndb/src/mgmapi/Makefile)2
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp152
-rw-r--r--ndb/src/mgmapi/mgmapi_configuration.cpp157
-rw-r--r--ndb/src/mgmapi/mgmapi_configuration.hpp32
-rw-r--r--ndb/src/mgmapi/test/keso.c14
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp28
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.hpp2
-rw-r--r--ndb/src/mgmclient/Makefile.am21
-rw-r--r--ndb/src/mgmclient/Makefile_old (renamed from ndb/src/mgmclient/Makefile)2
-rw-r--r--ndb/src/mgmsrv/CommandInterpreter.cpp10
-rw-r--r--ndb/src/mgmsrv/Makefile.am30
-rw-r--r--ndb/src/mgmsrv/Makefile_old (renamed from ndb/src/mgmsrv/Makefile)5
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp152
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.hpp12
-rw-r--r--ndb/src/mgmsrv/MgmtSrvrConfig.cpp27
-rw-r--r--ndb/src/mgmsrv/Services.cpp184
-rw-r--r--ndb/src/mgmsrv/main.cpp57
-rw-r--r--ndb/src/mgmsrv/mkconfig/Makefile5
-rw-r--r--ndb/src/mgmsrv/mkconfig/mkconfig.cpp20
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp124
-rw-r--r--ndb/src/ndbapi/ClusterMgr.hpp4
-rw-r--r--ndb/src/ndbapi/DictCache.hpp3
-rw-r--r--ndb/src/ndbapi/Makefile.am50
-rw-r--r--ndb/src/ndbapi/Makefile_old (renamed from ndb/src/ndbapi/Makefile)8
-rw-r--r--ndb/src/ndbapi/Ndb.cpp126
-rw-r--r--ndb/src/ndbapi/NdbApiSignal.cpp1
-rw-r--r--ndb/src/ndbapi/NdbApiSignal.hpp1
-rw-r--r--ndb/src/ndbapi/NdbBlob.cpp1349
-rw-r--r--ndb/src/ndbapi/NdbConnection.cpp150
-rw-r--r--ndb/src/ndbapi/NdbDictionary.cpp81
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp124
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.hpp32
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.cpp51
-rw-r--r--ndb/src/ndbapi/NdbEventOperationImpl.hpp1
-rw-r--r--ndb/src/ndbapi/NdbIndexOperation.cpp17
-rw-r--r--ndb/src/ndbapi/NdbOperation.cpp37
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp34
-rw-r--r--ndb/src/ndbapi/NdbOperationExec.cpp2
-rw-r--r--ndb/src/ndbapi/NdbOperationInt.cpp13
-rw-r--r--ndb/src/ndbapi/NdbOperationScan.cpp39
-rw-r--r--ndb/src/ndbapi/NdbOperationSearch.cpp35
-rw-r--r--ndb/src/ndbapi/NdbRecAttr.cpp97
-rw-r--r--ndb/src/ndbapi/NdbResultSet.cpp12
-rw-r--r--ndb/src/ndbapi/NdbScanOperation.cpp30
-rw-r--r--ndb/src/ndbapi/NdbUtil.hpp1
-rw-r--r--ndb/src/ndbapi/Ndberr.cpp8
-rw-r--r--ndb/src/ndbapi/Ndbif.cpp96
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp49
-rw-r--r--ndb/src/ndbapi/Ndblist.cpp38
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp118
-rw-r--r--ndb/src/ndbapi/TransporterFacade.hpp22
-rw-r--r--ndb/src/ndbapi/ndberror.c10
-rw-r--r--ndb/src/ndbapi/signal-sender/SignalSender.cpp2
-rw-r--r--ndb/src/old_files/client/Makefile (renamed from ndb/src/client/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/Extra.mk (renamed from ndb/src/client/odbc/Extra.mk)0
-rw-r--r--ndb/src/old_files/client/odbc/Makefile (renamed from ndb/src/client/odbc/Makefile)0
-rwxr-xr-xndb/src/old_files/client/odbc/NdbOdbc.cpp (renamed from ndb/src/client/odbc/NdbOdbc.cpp)0
-rwxr-xr-xndb/src/old_files/client/odbc/NdbOdbc.def (renamed from ndb/src/client/odbc/NdbOdbc.def)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/CodeGen.cpp (renamed from ndb/src/client/odbc/codegen/CodeGen.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/CodeGen.hpp (renamed from ndb/src/client/odbc/codegen/CodeGen.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_base.cpp (renamed from ndb/src/client/odbc/codegen/Code_base.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_base.hpp (renamed from ndb/src/client/odbc/codegen/Code_base.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_column.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_column.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_comp_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_comp_op.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_index.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_row.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_row.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_table.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_table.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp (renamed from ndb/src/client/odbc/codegen/Code_data_type.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp (renamed from ndb/src/client/odbc/codegen/Code_data_type.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_column.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_column.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_constr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_constr.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_row.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_row.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_index.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_lookup.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_scan.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml_column.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml_column.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml_row.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml_row.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_drop_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_drop_index.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_drop_table.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_drop_table.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_column.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_column.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_const.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_const.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_conv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_conv.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_func.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_func.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_op.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_param.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_param.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_row.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_row.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_idx_column.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_idx_column.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_insert.cpp (renamed from ndb/src/client/odbc/codegen/Code_insert.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_insert.hpp (renamed from ndb/src/client/odbc/codegen/Code_insert.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_pred.cpp (renamed from ndb/src/client/odbc/codegen/Code_pred.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_pred.hpp (renamed from ndb/src/client/odbc/codegen/Code_pred.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_pred_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_pred_op.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query.cpp (renamed from ndb/src/client/odbc/codegen/Code_query.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query.hpp (renamed from ndb/src/client/odbc/codegen/Code_query.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_count.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_count.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_distinct.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_distinct.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_filter.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_filter.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_group.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_group.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_index.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_join.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_join.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_lookup.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_project.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_project.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_range.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_range.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_repeat.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_repeat.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_scan.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_sort.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_sort.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_sys.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_sys.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_root.cpp (renamed from ndb/src/client/odbc/codegen/Code_root.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_root.hpp (renamed from ndb/src/client/odbc/codegen/Code_root.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_select.cpp (renamed from ndb/src/client/odbc/codegen/Code_select.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_select.hpp (renamed from ndb/src/client/odbc/codegen/Code_select.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_set_row.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_set_row.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp (renamed from ndb/src/client/odbc/codegen/Code_stmt.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp (renamed from ndb/src/client/odbc/codegen/Code_stmt.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_table.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_table.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp (renamed from ndb/src/client/odbc/codegen/Code_table_list.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp (renamed from ndb/src/client/odbc/codegen/Code_table_list.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update.cpp (renamed from ndb/src/client/odbc/codegen/Code_update.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update.hpp (renamed from ndb/src/client/odbc/codegen/Code_update.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_index.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_lookup.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_scan.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/Makefile (renamed from ndb/src/client/odbc/codegen/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp (renamed from ndb/src/client/odbc/codegen/SimpleGram.ypp)26
-rw-r--r--ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp (renamed from ndb/src/client/odbc/codegen/SimpleParser.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp (renamed from ndb/src/client/odbc/codegen/SimpleParser.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp (renamed from ndb/src/client/odbc/codegen/SimpleScan.lpp)2
-rw-r--r--ndb/src/old_files/client/odbc/common/AttrArea.cpp (renamed from ndb/src/client/odbc/common/AttrArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/AttrArea.hpp (renamed from ndb/src/client/odbc/common/AttrArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/CodeTree.cpp (renamed from ndb/src/client/odbc/common/CodeTree.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/CodeTree.hpp (renamed from ndb/src/client/odbc/common/CodeTree.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/ConnArea.cpp (renamed from ndb/src/client/odbc/common/ConnArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/ConnArea.hpp (renamed from ndb/src/client/odbc/common/ConnArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/Ctx.cpp (renamed from ndb/src/client/odbc/common/Ctx.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/common/Ctx.hpp (renamed from ndb/src/client/odbc/common/Ctx.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DataField.cpp (renamed from ndb/src/client/odbc/common/DataField.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/common/DataField.hpp (renamed from ndb/src/client/odbc/common/DataField.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DataRow.cpp (renamed from ndb/src/client/odbc/common/DataRow.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DataRow.hpp (renamed from ndb/src/client/odbc/common/DataRow.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DataType.cpp (renamed from ndb/src/client/odbc/common/DataType.cpp)6
-rw-r--r--ndb/src/old_files/client/odbc/common/DataType.hpp (renamed from ndb/src/client/odbc/common/DataType.hpp)1
-rw-r--r--ndb/src/old_files/client/odbc/common/DescArea.cpp (renamed from ndb/src/client/odbc/common/DescArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DescArea.hpp (renamed from ndb/src/client/odbc/common/DescArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DiagArea.cpp (renamed from ndb/src/client/odbc/common/DiagArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/DiagArea.hpp (renamed from ndb/src/client/odbc/common/DiagArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/Makefile (renamed from ndb/src/client/odbc/common/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/common/OdbcData.cpp (renamed from ndb/src/client/odbc/common/OdbcData.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/common/OdbcData.hpp (renamed from ndb/src/client/odbc/common/OdbcData.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/ResultArea.cpp (renamed from ndb/src/client/odbc/common/ResultArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/ResultArea.hpp (renamed from ndb/src/client/odbc/common/ResultArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/Sqlstate.cpp (renamed from ndb/src/client/odbc/common/Sqlstate.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/Sqlstate.hpp (renamed from ndb/src/client/odbc/common/Sqlstate.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/StmtArea.cpp (renamed from ndb/src/client/odbc/common/StmtArea.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/StmtArea.hpp (renamed from ndb/src/client/odbc/common/StmtArea.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/StmtInfo.cpp (renamed from ndb/src/client/odbc/common/StmtInfo.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/StmtInfo.hpp (renamed from ndb/src/client/odbc/common/StmtInfo.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/common.cpp (renamed from ndb/src/client/odbc/common/common.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/common/common.hpp (renamed from ndb/src/client/odbc/common/common.hpp)6
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp (renamed from ndb/src/client/odbc/dictionary/DictCatalog.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp (renamed from ndb/src/client/odbc/dictionary/DictCatalog.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp (renamed from ndb/src/client/odbc/dictionary/DictColumn.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp (renamed from ndb/src/client/odbc/dictionary/DictColumn.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp (renamed from ndb/src/client/odbc/dictionary/DictIndex.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp (renamed from ndb/src/client/odbc/dictionary/DictIndex.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp (renamed from ndb/src/client/odbc/dictionary/DictSchema.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp (renamed from ndb/src/client/odbc/dictionary/DictSchema.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictSys.cpp (renamed from ndb/src/client/odbc/dictionary/DictSys.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictSys.hpp (renamed from ndb/src/client/odbc/dictionary/DictSys.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictTable.cpp (renamed from ndb/src/client/odbc/dictionary/DictTable.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/DictTable.hpp (renamed from ndb/src/client/odbc/dictionary/DictTable.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/dictionary/Makefile (renamed from ndb/src/client/odbc/dictionary/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/class.fig (renamed from ndb/src/client/odbc/docs/class.fig)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/descfield.pl (renamed from ndb/src/client/odbc/docs/descfield.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/diag.txt (renamed from ndb/src/client/odbc/docs/diag.txt)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/getinfo.pl (renamed from ndb/src/client/odbc/docs/getinfo.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/gettypeinfo.pl (renamed from ndb/src/client/odbc/docs/gettypeinfo.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/handleattr.pl (renamed from ndb/src/client/odbc/docs/handleattr.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/main.hpp (renamed from ndb/src/client/odbc/docs/main.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/ndbodbc.html (renamed from ndb/src/client/odbc/docs/ndbodbc.html)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/select.fig (renamed from ndb/src/client/odbc/docs/select.fig)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/systables.pl (renamed from ndb/src/client/odbc/docs/systables.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/docs/type.txt (renamed from ndb/src/client/odbc/docs/type.txt)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/Func.data (renamed from ndb/src/client/odbc/driver/Func.data)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/Func.pl (renamed from ndb/src/client/odbc/driver/Func.pl)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/Makefile (renamed from ndb/src/client/odbc/driver/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocConnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocEnv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocHandle.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocStmt.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp (renamed from ndb/src/client/odbc/driver/SQLBindCol.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp (renamed from ndb/src/client/odbc/driver/SQLBindParam.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp (renamed from ndb/src/client/odbc/driver/SQLBindParameter.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLBrowseConnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp (renamed from ndb/src/client/odbc/driver/SQLBulkOperations.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLCancel.cpp (renamed from ndb/src/client/odbc/driver/SQLCancel.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp (renamed from ndb/src/client/odbc/driver/SQLCloseCursor.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp (renamed from ndb/src/client/odbc/driver/SQLColAttribute.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp (renamed from ndb/src/client/odbc/driver/SQLColAttributes.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp (renamed from ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLColumns.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLConnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp (renamed from ndb/src/client/odbc/driver/SQLCopyDesc.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp (renamed from ndb/src/client/odbc/driver/SQLDataSources.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp (renamed from ndb/src/client/odbc/driver/SQLDescribeCol.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp (renamed from ndb/src/client/odbc/driver/SQLDescribeParam.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp (renamed from ndb/src/client/odbc/driver/SQLDisconnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLDriverConnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp (renamed from ndb/src/client/odbc/driver/SQLDrivers.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp (renamed from ndb/src/client/odbc/driver/SQLEndTran.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLError.cpp (renamed from ndb/src/client/odbc/driver/SQLError.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp (renamed from ndb/src/client/odbc/driver/SQLExecDirect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLExecute.cpp (renamed from ndb/src/client/odbc/driver/SQLExecute.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp (renamed from ndb/src/client/odbc/driver/SQLExtendedFetch.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFetch.cpp (renamed from ndb/src/client/odbc/driver/SQLFetch.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp (renamed from ndb/src/client/odbc/driver/SQLFetchScroll.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp (renamed from ndb/src/client/odbc/driver/SQLForeignKeys.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeConnect.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeEnv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeHandle.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeStmt.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp (renamed from ndb/src/client/odbc/driver/SQLGetConnectOption.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp (renamed from ndb/src/client/odbc/driver/SQLGetCursorName.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetData.cpp (renamed from ndb/src/client/odbc/driver/SQLGetData.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDescField.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDescRec.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDiagField.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDiagRec.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp (renamed from ndb/src/client/odbc/driver/SQLGetFunctions.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp (renamed from ndb/src/client/odbc/driver/SQLGetInfo.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp (renamed from ndb/src/client/odbc/driver/SQLGetStmtOption.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp (renamed from ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp (renamed from ndb/src/client/odbc/driver/SQLMoreResults.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp (renamed from ndb/src/client/odbc/driver/SQLNativeSql.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp (renamed from ndb/src/client/odbc/driver/SQLNumParams.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp (renamed from ndb/src/client/odbc/driver/SQLNumResultCols.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLParamData.cpp (renamed from ndb/src/client/odbc/driver/SQLParamData.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp (renamed from ndb/src/client/odbc/driver/SQLParamOptions.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp (renamed from ndb/src/client/odbc/driver/SQLPrepare.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp (renamed from ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLProcedureColumns.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp (renamed from ndb/src/client/odbc/driver/SQLProcedures.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLPutData.cpp (renamed from ndb/src/client/odbc/driver/SQLPutData.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp (renamed from ndb/src/client/odbc/driver/SQLRowCount.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp (renamed from ndb/src/client/odbc/driver/SQLSetConnectOption.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp (renamed from ndb/src/client/odbc/driver/SQLSetCursorName.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp (renamed from ndb/src/client/odbc/driver/SQLSetDescField.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp (renamed from ndb/src/client/odbc/driver/SQLSetDescRec.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp (renamed from ndb/src/client/odbc/driver/SQLSetParam.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp (renamed from ndb/src/client/odbc/driver/SQLSetPos.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp (renamed from ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp (renamed from ndb/src/client/odbc/driver/SQLSetStmtOption.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLSpecialColumns.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp (renamed from ndb/src/client/odbc/driver/SQLStatistics.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp (renamed from ndb/src/client/odbc/driver/SQLTablePrivileges.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLTables.cpp (renamed from ndb/src/client/odbc/driver/SQLTables.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/SQLTransact.cpp (renamed from ndb/src/client/odbc/driver/SQLTransact.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/driver/driver.cpp (renamed from ndb/src/client/odbc/driver/driver.cpp)2
-rw-r--r--ndb/src/old_files/client/odbc/driver/driver.hpp (renamed from ndb/src/client/odbc/driver/driver.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_comp_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_create_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp (renamed from ndb/src/client/odbc/executor/Exec_create_table.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_drop_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp (renamed from ndb/src/client/odbc/executor/Exec_drop_table.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_conv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_func.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_insert.cpp (renamed from ndb/src/client/odbc/executor/Exec_insert.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_pred_op.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_range.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_sys.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_index.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_lookup.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_scan.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Executor.cpp (renamed from ndb/src/client/odbc/executor/Executor.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Executor.hpp (renamed from ndb/src/client/odbc/executor/Executor.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/executor/Makefile (renamed from ndb/src/client/odbc/executor/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/AttrDbc.cpp (renamed from ndb/src/client/odbc/handles/AttrDbc.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/AttrEnv.cpp (renamed from ndb/src/client/odbc/handles/AttrEnv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/AttrRoot.cpp (renamed from ndb/src/client/odbc/handles/AttrRoot.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/AttrStmt.cpp (renamed from ndb/src/client/odbc/handles/AttrStmt.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/DescSpec.cpp (renamed from ndb/src/client/odbc/handles/DescSpec.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/FuncTab.cpp (renamed from ndb/src/client/odbc/handles/FuncTab.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleBase.cpp (renamed from ndb/src/client/odbc/handles/HandleBase.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleBase.hpp (renamed from ndb/src/client/odbc/handles/HandleBase.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleDbc.cpp (renamed from ndb/src/client/odbc/handles/HandleDbc.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleDbc.hpp (renamed from ndb/src/client/odbc/handles/HandleDbc.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleDesc.cpp (renamed from ndb/src/client/odbc/handles/HandleDesc.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleDesc.hpp (renamed from ndb/src/client/odbc/handles/HandleDesc.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleEnv.cpp (renamed from ndb/src/client/odbc/handles/HandleEnv.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleEnv.hpp (renamed from ndb/src/client/odbc/handles/HandleEnv.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleRoot.cpp (renamed from ndb/src/client/odbc/handles/HandleRoot.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleRoot.hpp (renamed from ndb/src/client/odbc/handles/HandleRoot.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleStmt.cpp (renamed from ndb/src/client/odbc/handles/HandleStmt.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/HandleStmt.hpp (renamed from ndb/src/client/odbc/handles/HandleStmt.hpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/InfoTab.cpp (renamed from ndb/src/client/odbc/handles/InfoTab.cpp)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/Makefile (renamed from ndb/src/client/odbc/handles/Makefile)0
-rw-r--r--ndb/src/old_files/client/odbc/handles/PoolNdb.cpp (renamed from ndb/src/client/odbc/handles/PoolNdb.cpp)1
-rw-r--r--ndb/src/old_files/client/odbc/handles/PoolNdb.hpp (renamed from ndb/src/client/odbc/handles/PoolNdb.hpp)2
-rw-r--r--ndb/src/old_files/client/odbc/handles/handles.hpp (renamed from ndb/src/client/odbc/handles/handles.hpp)0
-rw-r--r--ndb/src/old_files/ndbbaseclient/Makefile (renamed from ndb/src/ndbbaseclient/Makefile)0
-rw-r--r--ndb/src/old_files/ndbbaseclient/ndbbaseclient_dummy.cpp (renamed from ndb/src/ndbbaseclient/ndbbaseclient_dummy.cpp)0
-rw-r--r--ndb/src/old_files/ndbclient/Makefile (renamed from ndb/src/ndbclient/Makefile)0
-rw-r--r--ndb/src/old_files/ndbclient/ndbclient_dummy.cpp (renamed from ndb/src/ndbclient/ndbclient_dummy.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/Makefile (renamed from ndb/src/newtonapi/Makefile)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_binding.cpp (renamed from ndb/src/newtonapi/dba_binding.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_bulkread.cpp (renamed from ndb/src/newtonapi/dba_bulkread.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_config.cpp (renamed from ndb/src/newtonapi/dba_config.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_dac.cpp (renamed from ndb/src/newtonapi/dba_dac.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_error.cpp (renamed from ndb/src/newtonapi/dba_error.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_init.cpp (renamed from ndb/src/newtonapi/dba_init.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_internal.hpp (renamed from ndb/src/newtonapi/dba_internal.hpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_process.cpp (renamed from ndb/src/newtonapi/dba_process.cpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_process.hpp (renamed from ndb/src/newtonapi/dba_process.hpp)0
-rw-r--r--ndb/src/old_files/newtonapi/dba_schema.cpp (renamed from ndb/src/newtonapi/dba_schema.cpp)19
-rw-r--r--ndb/src/old_files/rep/ExtSender.cpp (renamed from ndb/src/rep/ExtSender.cpp)0
-rw-r--r--ndb/src/old_files/rep/ExtSender.hpp (renamed from ndb/src/rep/ExtSender.hpp)0
-rw-r--r--ndb/src/old_files/rep/Makefile (renamed from ndb/src/rep/Makefile)0
-rw-r--r--ndb/src/old_files/rep/NodeConnectInfo.hpp (renamed from ndb/src/rep/NodeConnectInfo.hpp)0
-rw-r--r--ndb/src/old_files/rep/README (renamed from ndb/src/rep/README)0
-rw-r--r--ndb/src/old_files/rep/RepApiInterpreter.cpp (renamed from ndb/src/rep/RepApiInterpreter.cpp)0
-rw-r--r--ndb/src/old_files/rep/RepApiInterpreter.hpp (renamed from ndb/src/rep/RepApiInterpreter.hpp)0
-rw-r--r--ndb/src/old_files/rep/RepApiService.cpp (renamed from ndb/src/rep/RepApiService.cpp)0
-rw-r--r--ndb/src/old_files/rep/RepApiService.hpp (renamed from ndb/src/rep/RepApiService.hpp)0
-rw-r--r--ndb/src/old_files/rep/RepCommandInterpreter.cpp (renamed from ndb/src/rep/RepCommandInterpreter.cpp)0
-rw-r--r--ndb/src/old_files/rep/RepCommandInterpreter.hpp (renamed from ndb/src/rep/RepCommandInterpreter.hpp)0
-rw-r--r--ndb/src/old_files/rep/RepComponents.cpp (renamed from ndb/src/rep/RepComponents.cpp)0
-rw-r--r--ndb/src/old_files/rep/RepComponents.hpp (renamed from ndb/src/rep/RepComponents.hpp)0
-rw-r--r--ndb/src/old_files/rep/RepMain.cpp (renamed from ndb/src/rep/RepMain.cpp)0
-rw-r--r--ndb/src/old_files/rep/Requestor.cpp (renamed from ndb/src/rep/Requestor.cpp)0
-rw-r--r--ndb/src/old_files/rep/Requestor.hpp (renamed from ndb/src/rep/Requestor.hpp)0
-rw-r--r--ndb/src/old_files/rep/RequestorSubscriptions.cpp (renamed from ndb/src/rep/RequestorSubscriptions.cpp)0
-rw-r--r--ndb/src/old_files/rep/SignalQueue.cpp (renamed from ndb/src/rep/SignalQueue.cpp)0
-rw-r--r--ndb/src/old_files/rep/SignalQueue.hpp (renamed from ndb/src/rep/SignalQueue.hpp)2
-rw-r--r--ndb/src/old_files/rep/TODO (renamed from ndb/src/rep/TODO)0
-rw-r--r--ndb/src/old_files/rep/adapters/AppNDB.cpp (renamed from ndb/src/rep/adapters/AppNDB.cpp)8
-rw-r--r--ndb/src/old_files/rep/adapters/AppNDB.hpp (renamed from ndb/src/rep/adapters/AppNDB.hpp)0
-rw-r--r--ndb/src/old_files/rep/adapters/ExtAPI.cpp (renamed from ndb/src/rep/adapters/ExtAPI.cpp)0
-rw-r--r--ndb/src/old_files/rep/adapters/ExtAPI.hpp (renamed from ndb/src/rep/adapters/ExtAPI.hpp)0
-rw-r--r--ndb/src/old_files/rep/adapters/ExtNDB.cpp (renamed from ndb/src/rep/adapters/ExtNDB.cpp)30
-rw-r--r--ndb/src/old_files/rep/adapters/ExtNDB.hpp (renamed from ndb/src/rep/adapters/ExtNDB.hpp)10
-rw-r--r--ndb/src/old_files/rep/adapters/Makefile (renamed from ndb/src/rep/adapters/Makefile)0
-rw-r--r--ndb/src/old_files/rep/adapters/TableInfoPs.hpp (renamed from ndb/src/rep/adapters/TableInfoPs.hpp)0
-rw-r--r--ndb/src/old_files/rep/dbug_hack.cpp (renamed from ndb/src/rep/dbug_hack.cpp)0
-rw-r--r--ndb/src/old_files/rep/rep_version.hpp (renamed from ndb/src/rep/rep_version.hpp)0
-rw-r--r--ndb/src/old_files/rep/repapi/Makefile (renamed from ndb/src/rep/repapi/Makefile)0
-rw-r--r--ndb/src/old_files/rep/repapi/repapi.cpp (renamed from ndb/src/rep/repapi/repapi.cpp)0
-rw-r--r--ndb/src/old_files/rep/repapi/repapi.h (renamed from ndb/src/rep/repapi/repapi.h)0
-rw-r--r--ndb/src/old_files/rep/state/Channel.cpp (renamed from ndb/src/rep/state/Channel.cpp)8
-rw-r--r--ndb/src/old_files/rep/state/Channel.hpp (renamed from ndb/src/rep/state/Channel.hpp)0
-rw-r--r--ndb/src/old_files/rep/state/Interval.cpp (renamed from ndb/src/rep/state/Interval.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/Interval.hpp (renamed from ndb/src/rep/state/Interval.hpp)0
-rw-r--r--ndb/src/old_files/rep/state/Makefile (renamed from ndb/src/rep/state/Makefile)0
-rw-r--r--ndb/src/old_files/rep/state/RepState.cpp (renamed from ndb/src/rep/state/RepState.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/RepState.hpp (renamed from ndb/src/rep/state/RepState.hpp)1
-rw-r--r--ndb/src/old_files/rep/state/RepStateEvent.cpp (renamed from ndb/src/rep/state/RepStateEvent.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/RepStateRequests.cpp (renamed from ndb/src/rep/state/RepStateRequests.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/testInterval/Makefile (renamed from ndb/src/rep/state/testInterval/Makefile)0
-rw-r--r--ndb/src/old_files/rep/state/testInterval/testInterval.cpp (renamed from ndb/src/rep/state/testInterval/testInterval.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/testRepState/Makefile (renamed from ndb/src/rep/state/testRepState/Makefile)0
-rw-r--r--ndb/src/old_files/rep/state/testRepState/testRequestor.cpp (renamed from ndb/src/rep/state/testRepState/testRequestor.cpp)0
-rw-r--r--ndb/src/old_files/rep/state/testRepState/testRequestor.hpp (renamed from ndb/src/rep/state/testRepState/testRequestor.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIBuffer.cpp (renamed from ndb/src/rep/storage/GCIBuffer.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIBuffer.hpp (renamed from ndb/src/rep/storage/GCIBuffer.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIContainer.cpp (renamed from ndb/src/rep/storage/GCIContainer.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIContainer.hpp (renamed from ndb/src/rep/storage/GCIContainer.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIContainerPS.cpp (renamed from ndb/src/rep/storage/GCIContainerPS.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIContainerPS.hpp (renamed from ndb/src/rep/storage/GCIContainerPS.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIPage.cpp (renamed from ndb/src/rep/storage/GCIPage.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/GCIPage.hpp (renamed from ndb/src/rep/storage/GCIPage.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/LogRecord.hpp (renamed from ndb/src/rep/storage/LogRecord.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/Makefile (renamed from ndb/src/rep/storage/Makefile)0
-rw-r--r--ndb/src/old_files/rep/storage/NodeConnectInfo.hpp (renamed from ndb/src/rep/storage/NodeConnectInfo.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/NodeGroup.cpp (renamed from ndb/src/rep/storage/NodeGroup.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/NodeGroup.hpp (renamed from ndb/src/rep/storage/NodeGroup.hpp)0
-rw-r--r--ndb/src/old_files/rep/storage/NodeGroupInfo.cpp (renamed from ndb/src/rep/storage/NodeGroupInfo.cpp)0
-rw-r--r--ndb/src/old_files/rep/storage/NodeGroupInfo.hpp (renamed from ndb/src/rep/storage/NodeGroupInfo.hpp)0
-rw-r--r--ndb/src/old_files/rep/transfer/Makefile (renamed from ndb/src/rep/transfer/Makefile)0
-rw-r--r--ndb/src/old_files/rep/transfer/TransPS.cpp (renamed from ndb/src/rep/transfer/TransPS.cpp)8
-rw-r--r--ndb/src/old_files/rep/transfer/TransPS.hpp (renamed from ndb/src/rep/transfer/TransPS.hpp)8
-rw-r--r--ndb/src/old_files/rep/transfer/TransSS.cpp (renamed from ndb/src/rep/transfer/TransSS.cpp)8
-rw-r--r--ndb/src/old_files/rep/transfer/TransSS.hpp (renamed from ndb/src/rep/transfer/TransSS.hpp)6
-rw-r--r--ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp (renamed from ndb/src/rep/transfer/TransSSSubscriptions.cpp)0
-rw-r--r--ndb/test/Makefile19
-rw-r--r--ndb/test/Makefile.am6
-rw-r--r--ndb/test/include/NDBT_Table.hpp69
-rw-r--r--ndb/test/include/NdbConfig.hpp19
-rw-r--r--ndb/test/include/NdbRestarter.hpp4
-rw-r--r--ndb/test/include/NdbSchemaCon.hpp (renamed from ndb/include/ndbapi/NdbSchemaCon.hpp)25
-rw-r--r--ndb/test/include/NdbSchemaOp.hpp (renamed from ndb/include/ndbapi/NdbSchemaOp.hpp)185
-rw-r--r--ndb/test/ndbapi/InsertRecs.cpp (renamed from ndb/test/ndbapi/telco/InsertRecs.cpp)0
-rw-r--r--ndb/test/ndbapi/Makefile.am81
-rw-r--r--ndb/test/ndbapi/Makefile_old (renamed from ndb/test/ndbapi/Makefile)3
-rw-r--r--ndb/test/ndbapi/ScanFilter.hpp (renamed from ndb/test/ndbapi/testScanInterpreter/ScanFilter.hpp)0
-rw-r--r--ndb/test/ndbapi/ScanFunctions.hpp (renamed from ndb/test/ndbapi/testScan/ScanFunctions.hpp)0
-rw-r--r--ndb/test/ndbapi/ScanInterpretTest.hpp (renamed from ndb/test/ndbapi/testScanInterpreter/ScanInterpretTest.hpp)0
-rw-r--r--ndb/test/ndbapi/TraceNdbApi.cpp (renamed from ndb/test/ndbapi/acid2/TraceNdbApi.cpp)0
-rw-r--r--ndb/test/ndbapi/VerifyNdbApi.cpp (renamed from ndb/test/ndbapi/acid2/VerifyNdbApi.cpp)0
-rw-r--r--ndb/test/ndbapi/acid.cpp (renamed from ndb/test/ndbapi/acid/acid.cpp)15
-rw-r--r--ndb/test/ndbapi/acid2.cpp (renamed from ndb/test/ndbapi/acid2/acid2.cpp)0
-rw-r--r--ndb/test/ndbapi/adoInsertRecs.cpp (renamed from ndb/test/ndbapi/telco/adoInsertRecs.cpp)0
-rw-r--r--ndb/test/ndbapi/asyncGenerator.cpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp)0
-rw-r--r--ndb/test/ndbapi/bank/Bank.cpp (renamed from ndb/test/ndbapi/bank/src/Bank.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/BankLoad.cpp (renamed from ndb/test/ndbapi/bank/src/BankLoad.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/Makefile.am22
-rw-r--r--ndb/test/ndbapi/bank/Makefile_old (renamed from ndb/test/ndbapi/bank/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/bankCreator.cpp (renamed from ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/bankMakeGL.cpp (renamed from ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/bankSumAccounts.cpp (renamed from ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/bankTimer.cpp (renamed from ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/bankTransactionMaker.cpp (renamed from ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/bankValidateAllGLs.cpp (renamed from ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp)2
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankCreator/Makefile (renamed from ndb/test/ndbapi/bank/bankCreator/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankMakeGL/Makefile (renamed from ndb/test/ndbapi/bank/bankMakeGL/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankSumAccounts/Makefile (renamed from ndb/test/ndbapi/bank/bankSumAccounts/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankTimer/Makefile (renamed from ndb/test/ndbapi/bank/bankTimer/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankTransactionMaker/Makefile (renamed from ndb/test/ndbapi/bank/bankTransactionMaker/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/bankValidateAllGLs/Makefile (renamed from ndb/test/ndbapi/bank/bankValidateAllGLs/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/src/Makefile (renamed from ndb/test/ndbapi/bank/src/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/old_dirs/testBank/Makefile (renamed from ndb/test/ndbapi/bank/testBank/Makefile)0
-rw-r--r--ndb/test/ndbapi/bank/testBank.cpp (renamed from ndb/test/ndbapi/bank/testBank/testBank.cpp)2
-rw-r--r--ndb/test/ndbapi/benchronja.cpp (renamed from ndb/test/ndbapi/ronja/benchronja/benchronja.cpp)0
-rw-r--r--ndb/test/ndbapi/bulk_copy.cpp (renamed from ndb/test/ndbapi/bulk_copy/bulk_copy.cpp)0
-rw-r--r--ndb/test/ndbapi/cdrserver.cpp (renamed from ndb/test/ndbapi/vw_test/cdrserver.cpp)0
-rw-r--r--ndb/test/ndbapi/celloDb.cpp (renamed from ndb/test/ndbapi/cello-sessionDb/celloDb.cpp)0
-rw-r--r--ndb/test/ndbapi/create_all_tabs.cpp (renamed from ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp)0
-rw-r--r--ndb/test/ndbapi/create_tab.cpp (renamed from ndb/test/ndbapi/create_tab/create_tab.cpp)0
-rw-r--r--ndb/test/ndbapi/drop_all_tabs.cpp (renamed from ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp)0
-rw-r--r--ndb/test/ndbapi/flexAsynch.cpp (renamed from ndb/test/ndbapi/flexAsynch/flexAsynch.cpp)9
-rw-r--r--ndb/test/ndbapi/flexBench.cpp (renamed from ndb/test/ndbapi/flexBench/flexBench.cpp)0
-rw-r--r--ndb/test/ndbapi/flexHammer.cpp (renamed from ndb/test/ndbapi/flexHammer/flexHammer.cpp)15
-rw-r--r--ndb/test/ndbapi/flexScan.cpp (renamed from ndb/test/ndbapi/flexScan/flexScan.cpp)25
-rw-r--r--ndb/test/ndbapi/flexTT.cpp (renamed from ndb/test/ndbapi/flexTT/flexTT.cpp)5
-rw-r--r--ndb/test/ndbapi/flexTimedAsynch.cpp (renamed from ndb/test/ndbapi/flexTimedAsynch/flexTimedAsynch.cpp)0
-rw-r--r--ndb/test/ndbapi/flex_bench_mysql.cpp (renamed from ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp)0
-rw-r--r--ndb/test/ndbapi/index.cpp (renamed from ndb/test/ndbapi/indexTest/index.cpp)0
-rw-r--r--ndb/test/ndbapi/index2.cpp (renamed from ndb/test/ndbapi/indexTest2/index2.cpp)0
-rw-r--r--ndb/test/ndbapi/initronja.cpp (renamed from ndb/test/ndbapi/ronja/initronja/initronja.cpp)11
-rw-r--r--ndb/test/ndbapi/interpreterInTup.cpp (renamed from ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp)45
-rw-r--r--ndb/test/ndbapi/mainAsyncGenerator.cpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp)0
-rw-r--r--ndb/test/ndbapi/msa.cpp (renamed from ndb/test/ndbapi/telco/msa.cpp)6
-rw-r--r--ndb/test/ndbapi/ndb_async1.cpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async1.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_async2.cpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async2.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_populate.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction2.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction2.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction3.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction3.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction4.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction4.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction5.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction5.cpp)0
-rw-r--r--ndb/test/ndbapi/ndb_user_transaction6.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction6.cpp)0
-rw-r--r--ndb/test/ndbapi/old_dirs/acid/Makefile (renamed from ndb/test/ndbapi/acid/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/acid2/Makefile (renamed from ndb/test/ndbapi/acid2/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp (renamed from ndb/test/ndbapi/acid2/TraceNdbApi.hpp)0
-rw-r--r--ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp (renamed from ndb/test/ndbapi/acid2/VerifyNdbApi.hpp)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/basicAsynch/Makefile (renamed from ndb/test/ndbapi/basicAsynch/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/bulk_copy/Makefile (renamed from ndb/test/ndbapi/bulk_copy/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/create_all_tabs/Makefile (renamed from ndb/test/ndbapi/create_all_tabs/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/create_tab/Makefile (renamed from ndb/test/ndbapi/create_tab/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/drop_all_tabs/Makefile (renamed from ndb/test/ndbapi/drop_all_tabs/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexAsynch/Makefile (renamed from ndb/test/ndbapi/flexAsynch/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexBench/Makefile.am10
-rw-r--r--ndb/test/ndbapi/old_dirs/flexBench/Makefile_old (renamed from ndb/test/ndbapi/flexBench/Makefile)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/flexBench/ndbplot.pl (renamed from ndb/test/ndbapi/flexBench/ndbplot.pl)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexHammer/Makefile (renamed from ndb/test/ndbapi/flexHammer/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexHammer/README (renamed from ndb/test/ndbapi/flexHammer/README)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexScan/Makefile (renamed from ndb/test/ndbapi/flexScan/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexScan/README (renamed from ndb/test/ndbapi/flexScan/README)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexTT/Makefile (renamed from ndb/test/ndbapi/flexTT/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flexTimedAsynch/Makefile (renamed from ndb/test/ndbapi/flexTimedAsynch/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/flex_bench_mysql/Makefile (renamed from ndb/test/ndbapi/flex_bench_mysql/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/indexTest/Makefile (renamed from ndb/test/ndbapi/indexTest/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/indexTest2/Makefile (renamed from ndb/test/ndbapi/indexTest2/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/interpreterInTup/Makefile (renamed from ndb/test/ndbapi/interpreterInTup/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/Makefile (renamed from ndb/test/ndbapi/lmc-bench/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/Makefile (renamed from ndb/test/ndbapi/lmc-bench/async-src/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/generator/Makefile (renamed from ndb/test/ndbapi/lmc-bench/async-src/generator/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h (renamed from ndb/test/ndbapi/lmc-bench/async-src/include/dbGenerator.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h (renamed from ndb/test/ndbapi/lmc-bench/async-src/include/testData.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h (renamed from ndb/test/ndbapi/lmc-bench/async-src/include/userInterface.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/Makefile (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/macros.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/bin/.empty (renamed from ndb/test/ndbapi/lmc-bench/bin/.empty)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp (renamed from ndb/test/ndbapi/lmc-bench/include/ndb_schema.hpp)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h (renamed from ndb/test/ndbapi/lmc-bench/include/testDefinitions.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/lib/.empty (renamed from ndb/test/ndbapi/lmc-bench/lib/.empty)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/script/Makefile (renamed from ndb/test/ndbapi/lmc-bench/script/Makefile)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l-p10.sh (renamed from ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l-p10.sh)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l.sh (renamed from ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l.sh)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-p10.sh (renamed from ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-p10.sh)0
-rwxr-xr-xndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench.sh (renamed from ndb/test/ndbapi/lmc-bench/script/async-lmc-bench.sh)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/Makefile (renamed from ndb/test/ndbapi/lmc-bench/src/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/README (renamed from ndb/test/ndbapi/lmc-bench/src/README)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/Makefile (renamed from ndb/test/ndbapi/lmc-bench/src/generator/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c (renamed from ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h (renamed from ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c (renamed from ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h (renamed from ndb/test/ndbapi/lmc-bench/src/include/testData.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h (renamed from ndb/test/ndbapi/lmc-bench/src/include/userInterface.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.linux (renamed from ndb/test/ndbapi/lmc-bench/src/makevars.linux)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.sparc (renamed from ndb/test/ndbapi/lmc-bench/src/makevars.sparc)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/Makefile (renamed from ndb/test/ndbapi/lmc-bench/src/populator/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c (renamed from ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h (renamed from ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c (renamed from ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/Makefile (renamed from ndb/test/ndbapi/lmc-bench/src/user/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c (renamed from ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h (renamed from ndb/test/ndbapi/lmc-bench/src/user/macros.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/Makefile (renamed from ndb/test/ndbapi/lmc-bench/src/user/old/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h (renamed from ndb/test/ndbapi/lmc-bench/src/user/old/userHandle.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c (renamed from ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c (renamed from ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h (renamed from ndb/test/ndbapi/lmc-bench/src/user/userHandle.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp (renamed from ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp)61
-rw-r--r--ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c (renamed from ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c)0
-rw-r--r--ndb/test/ndbapi/old_dirs/restarter/Makefile (renamed from ndb/test/ndbapi/restarter/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/restarter2/Makefile (renamed from ndb/test/ndbapi/restarter2/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/restarts/Makefile (renamed from ndb/test/ndbapi/restarts/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/ronja/Makefile (renamed from ndb/test/ndbapi/ronja/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/ronja/benchronja/Makefile (renamed from ndb/test/ndbapi/ronja/benchronja/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/ronja/initronja/Makefile (renamed from ndb/test/ndbapi/ronja/initronja/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/telco/Makefile (renamed from ndb/test/ndbapi/telco/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/telco/readme (renamed from ndb/test/ndbapi/telco/readme)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testBackup/Makefile (renamed from ndb/test/ndbapi/testBackup/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testBasic/Makefile (renamed from ndb/test/ndbapi/testBasic/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testBlobs/Makefile (renamed from ndb/test/ndbapi/testBlobs/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testDataBuffers/Makefile (renamed from ndb/test/ndbapi/testDataBuffers/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testDict/Makefile (renamed from ndb/test/ndbapi/testDict/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testGrep/Makefile (renamed from ndb/test/ndbapi/testGrep/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile (renamed from ndb/test/ndbapi/testGrep/verify/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testIndex/Makefile (renamed from ndb/test/ndbapi/testIndex/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testInterpreter/Makefile (renamed from ndb/test/ndbapi/testInterpreter/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testMgm/Makefile (renamed from ndb/test/ndbapi/testMgm/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testNdbApi/Makefile (renamed from ndb/test/ndbapi/testNdbApi/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testNodeRestart/Makefile (renamed from ndb/test/ndbapi/testNodeRestart/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testOIBasic/Makefile (renamed from ndb/test/ndbapi/testOIBasic/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testOIBasic/times.txt (renamed from ndb/test/ndbapi/testOIBasic/times.txt)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testOperations/Makefile (renamed from ndb/test/ndbapi/testOperations/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testOrderedIndex/Makefile (renamed from ndb/test/ndbapi/testOrderedIndex/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testRestartGci/Makefile (renamed from ndb/test/ndbapi/testRestartGci/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testScan/Makefile (renamed from ndb/test/ndbapi/testScan/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testScanInterpreter/Makefile (renamed from ndb/test/ndbapi/testScanInterpreter/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testSystemRestart/Makefile (renamed from ndb/test/ndbapi/testSystemRestart/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testTimeout/Makefile (renamed from ndb/test/ndbapi/testTimeout/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/testTransactions/Makefile (renamed from ndb/test/ndbapi/testTransactions/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/test_event/Makefile (renamed from ndb/test/ndbapi/test_event/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/vw_test/Makefile (renamed from ndb/test/ndbapi/vw_test/Makefile)0
-rw-r--r--ndb/test/ndbapi/old_dirs/vw_test/bcd.h (renamed from ndb/test/ndbapi/vw_test/bcd.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/vw_test/script/client_start (renamed from ndb/test/ndbapi/vw_test/script/client_start)0
-rw-r--r--ndb/test/ndbapi/old_dirs/vw_test/utv.h (renamed from ndb/test/ndbapi/vw_test/utv.h)0
-rw-r--r--ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h (renamed from ndb/test/ndbapi/vw_test/vcdrfunc.h)0
-rw-r--r--ndb/test/ndbapi/restarter.cpp (renamed from ndb/test/ndbapi/restarter/restarter.cpp)0
-rw-r--r--ndb/test/ndbapi/restarter2.cpp (renamed from ndb/test/ndbapi/restarter2/restarter2.cpp)0
-rw-r--r--ndb/test/ndbapi/restarts.cpp (renamed from ndb/test/ndbapi/restarts/restarts.cpp)0
-rw-r--r--ndb/test/ndbapi/size.cpp (renamed from ndb/test/ndbapi/vw_test/size.cpp)0
-rw-r--r--ndb/test/ndbapi/testBackup.cpp (renamed from ndb/test/ndbapi/testBackup/testBackup.cpp)3
-rw-r--r--ndb/test/ndbapi/testBasic.cpp (renamed from ndb/test/ndbapi/testBasic/testBasic.cpp)0
-rw-r--r--[-rwxr-xr-x]ndb/test/ndbapi/testBasicAsynch.cpp (renamed from ndb/test/ndbapi/basicAsynch/testBasicAsynch.cpp)0
-rw-r--r--ndb/test/ndbapi/testBlobs.cpp1213
-rw-r--r--ndb/test/ndbapi/testBlobs/testBlobs.cpp195
-rw-r--r--ndb/test/ndbapi/testDataBuffers.cpp (renamed from ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp)6
-rw-r--r--ndb/test/ndbapi/testDict.cpp (renamed from ndb/test/ndbapi/testDict/testDict.cpp)6
-rw-r--r--ndb/test/ndbapi/testGrep.cpp (renamed from ndb/test/ndbapi/testGrep/testGrep.cpp)0
-rw-r--r--ndb/test/ndbapi/testGrepVerify.cpp (renamed from ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp)5
-rw-r--r--ndb/test/ndbapi/testIndex.cpp (renamed from ndb/test/ndbapi/testIndex/testIndex.cpp)0
-rw-r--r--ndb/test/ndbapi/testInterpreter.cpp (renamed from ndb/test/ndbapi/testInterpreter/testInterpreter.cpp)0
-rw-r--r--ndb/test/ndbapi/testMgm.cpp (renamed from ndb/test/ndbapi/testMgm/testMgm.cpp)0
-rw-r--r--ndb/test/ndbapi/testNdbApi.cpp (renamed from ndb/test/ndbapi/testNdbApi/testNdbApi.cpp)4
-rw-r--r--ndb/test/ndbapi/testNodeRestart.cpp (renamed from ndb/test/ndbapi/testNodeRestart/testNodeRestart.cpp)0
-rw-r--r--ndb/test/ndbapi/testOIBasic.cpp (renamed from ndb/test/ndbapi/testOIBasic/testOIBasic.cpp)61
-rw-r--r--ndb/test/ndbapi/testOperations.cpp (renamed from ndb/test/ndbapi/testOperations/testOperations.cpp)0
-rw-r--r--ndb/test/ndbapi/testOrderedIndex.cpp (renamed from ndb/test/ndbapi/testOrderedIndex/testOrderedIndex.cpp)0
-rw-r--r--ndb/test/ndbapi/testRestartGci.cpp (renamed from ndb/test/ndbapi/testRestartGci/testRestartGci.cpp)2
-rw-r--r--ndb/test/ndbapi/testScan.cpp (renamed from ndb/test/ndbapi/testScan/testScan.cpp)91
-rw-r--r--ndb/test/ndbapi/testScanInterpreter.cpp (renamed from ndb/test/ndbapi/testScanInterpreter/testScanInterpreter.cpp)20
-rw-r--r--ndb/test/ndbapi/testScanPerf/Makefile9
-rw-r--r--ndb/test/ndbapi/testScanPerf/testScanPerf.cpp368
-rw-r--r--ndb/test/ndbapi/testSystemRestart.cpp (renamed from ndb/test/ndbapi/testSystemRestart/testSystemRestart.cpp)247
-rw-r--r--ndb/test/ndbapi/testTimeout.cpp (renamed from ndb/test/ndbapi/testTimeout/testTimeout.cpp)12
-rw-r--r--ndb/test/ndbapi/testTransactions.cpp (renamed from ndb/test/ndbapi/testTransactions/testTransactions.cpp)0
-rw-r--r--ndb/test/ndbapi/test_event.cpp (renamed from ndb/test/ndbapi/test_event/test_event.cpp)0
-rw-r--r--ndb/test/ndbapi/userInterface.cpp (renamed from ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp)0
-rw-r--r--ndb/test/newtonapi/Makefile8
-rw-r--r--ndb/test/odbc/Makefile13
-rw-r--r--ndb/test/odbc/driver/testOdbcDriver.cpp2
-rw-r--r--ndb/test/run-test/Makefile.am18
-rw-r--r--ndb/test/run-test/Makefile_old (renamed from ndb/test/run-test/Makefile)0
-rw-r--r--ndb/test/run-test/README43
-rw-r--r--ndb/test/run-test/atrt-example.tgzbin0 -> 2196 bytes
-rw-r--r--ndb/test/run-test/basic.txt763
-rw-r--r--ndb/test/run-test/main.cpp150
-rwxr-xr-xndb/test/run-test/make-html-reports.sh406
-rw-r--r--ndb/test/src/Makefile.am20
-rw-r--r--ndb/test/src/Makefile_old (renamed from ndb/test/src/Makefile)8
-rw-r--r--ndb/test/src/NDBT_ResultRow.cpp74
-rw-r--r--ndb/test/src/NDBT_Table.cpp128
-rw-r--r--ndb/test/src/NdbBackup.cpp33
-rw-r--r--ndb/test/src/NdbConfig.cpp131
-rw-r--r--ndb/test/src/NdbRestarter.cpp13
-rw-r--r--ndb/test/src/NdbSchemaCon.cpp (renamed from ndb/src/ndbapi/NdbSchemaCon.cpp)60
-rw-r--r--ndb/test/src/NdbSchemaOp.cpp (renamed from ndb/src/ndbapi/NdbSchemaOp.cpp)29
-rw-r--r--ndb/test/src/UtilTransactions.cpp4
-rw-r--r--ndb/test/tools/Makefile.am31
-rw-r--r--ndb/test/tools/Makefile_old (renamed from ndb/test/tools/Makefile)0
-rw-r--r--ndb/test/tools/copy_tab.cpp (renamed from ndb/tools/copy_tab/copy_tab.cpp)0
-rw-r--r--ndb/test/tools/cpcc.cpp (renamed from ndb/tools/cpcc/cpcc.cpp)0
-rw-r--r--ndb/test/tools/create_index.cpp (renamed from ndb/tools/create_index/create_index.cpp)0
-rw-r--r--ndb/test/tools/hugoCalculator.cpp (renamed from ndb/test/tools/hugoCalculator/hugoCalculator.cpp)0
-rw-r--r--ndb/test/tools/hugoFill.cpp (renamed from ndb/test/tools/hugoFill/hugoFill.cpp)0
-rw-r--r--ndb/test/tools/hugoLoad.cpp (renamed from ndb/test/tools/hugoLoad/hugoLoad.cpp)0
-rw-r--r--ndb/test/tools/hugoLockRecords.cpp (renamed from ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp)0
-rw-r--r--ndb/test/tools/hugoPkDelete.cpp (renamed from ndb/test/tools/hugoPkDelete/hugoPkDel.cpp)0
-rw-r--r--ndb/test/tools/hugoPkRead.cpp (renamed from ndb/test/tools/hugoPkRead/hugoPkRead.cpp)0
-rw-r--r--ndb/test/tools/hugoPkReadRecord.cpp (renamed from ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp)0
-rw-r--r--ndb/test/tools/hugoPkUpdate.cpp (renamed from ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp)0
-rw-r--r--ndb/test/tools/hugoScanRead.cpp (renamed from ndb/test/tools/hugoScanRead/hugoScanRead.cpp)0
-rw-r--r--ndb/test/tools/hugoScanUpdate.cpp (renamed from ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp)0
-rw-r--r--ndb/test/tools/old_dirs/hugoCalculator/Makefile (renamed from ndb/test/tools/hugoCalculator/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoFill/Makefile (renamed from ndb/test/tools/hugoFill/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoLoad/Makefile (renamed from ndb/test/tools/hugoLoad/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoLockRecords/Makefile (renamed from ndb/test/tools/hugoLockRecords/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoPkDelete/Makefile (renamed from ndb/test/tools/hugoPkDelete/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoPkRead/Makefile (renamed from ndb/test/tools/hugoPkRead/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoPkReadRecord/Makefile (renamed from ndb/test/tools/hugoPkReadRecord/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoPkUpdate/Makefile (renamed from ndb/test/tools/hugoPkUpdate/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoScanRead/Makefile (renamed from ndb/test/tools/hugoScanRead/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/hugoScanUpdate/Makefile (renamed from ndb/test/tools/hugoScanUpdate/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/restart/Makefile (renamed from ndb/test/tools/restart/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/transproxy/Makefile (renamed from ndb/tools/transproxy/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/verify_index/Makefile (renamed from ndb/tools/verify_index/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/waiter/Makefile_old (renamed from ndb/test/tools/waiter/Makefile)0
-rw-r--r--ndb/test/tools/old_dirs/waiter/waiter.cpp (renamed from ndb/test/tools/waiter/waiter.cpp)0
-rw-r--r--ndb/test/tools/restart.cpp (renamed from ndb/test/tools/restart/restart.cpp)0
-rw-r--r--ndb/test/tools/transproxy.cpp (renamed from ndb/tools/transproxy/transproxy.cpp)0
-rw-r--r--ndb/test/tools/verify_index.cpp (renamed from ndb/tools/verify_index/verify_index.cpp)0
-rw-r--r--ndb/tools/Makefile.am36
-rw-r--r--ndb/tools/Makefile_old (renamed from ndb/tools/Makefile)0
-rw-r--r--ndb/tools/delete_all.cpp181
-rw-r--r--ndb/tools/delete_all/delete_all.cpp93
-rw-r--r--ndb/tools/desc.cpp (renamed from ndb/tools/desc/desc.cpp)45
-rw-r--r--ndb/tools/drop_index.cpp (renamed from ndb/tools/drop_index/drop_index.cpp)0
-rw-r--r--ndb/tools/drop_tab.cpp (renamed from ndb/tools/drop_tab/drop_tab.cpp)0
-rw-r--r--ndb/tools/listTables.cpp (renamed from ndb/tools/list_tables/listTables.cpp)6
-rw-r--r--ndb/tools/ndbsql.cpp (renamed from ndb/tools/ndbsql/ndbsql.cpp)13
-rw-r--r--ndb/tools/old_dirs/copy_tab/Makefile (renamed from ndb/tools/copy_tab/Makefile)0
-rw-r--r--ndb/tools/old_dirs/cpcc/Makefile (renamed from ndb/tools/cpcc/Makefile)0
-rw-r--r--ndb/tools/old_dirs/create_index/Makefile (renamed from ndb/tools/create_index/Makefile)0
-rw-r--r--ndb/tools/old_dirs/delete_all/Makefile (renamed from ndb/tools/delete_all/Makefile)0
-rw-r--r--ndb/tools/old_dirs/desc/Makefile (renamed from ndb/tools/desc/Makefile)0
-rw-r--r--ndb/tools/old_dirs/drop_index/Makefile (renamed from ndb/tools/drop_index/Makefile)0
-rw-r--r--ndb/tools/old_dirs/drop_tab/Makefile (renamed from ndb/tools/drop_tab/Makefile)0
-rw-r--r--ndb/tools/old_dirs/list_tables/Makefile (renamed from ndb/tools/list_tables/Makefile)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/Makefile.PL (renamed from ndb/tools/ndbnet/Makefile.PL)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Base.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Base.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Client.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Client.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Command.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Command.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Config.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Config.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Database.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Database.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Env.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Env.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Node.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Node.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeApi.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/NodeApi.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeDb.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/NodeDb.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeMgmt.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/NodeMgmt.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Server.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/Server.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerINET.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/ServerINET.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerUNIX.pm (renamed from ndb/tools/ndbnet/lib/NDB/Net/ServerUNIX.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Run.pm (renamed from ndb/tools/ndbnet/lib/NDB/Run.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Base.pm (renamed from ndb/tools/ndbnet/lib/NDB/Run/Base.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Database.pm (renamed from ndb/tools/ndbnet/lib/NDB/Run/Database.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Env.pm (renamed from ndb/tools/ndbnet/lib/NDB/Run/Env.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Node.pm (renamed from ndb/tools/ndbnet/lib/NDB/Run/Node.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Base.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Base.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Dir.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Dir.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Event.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Event.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/File.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/File.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/IO.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/IO.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Lock.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Lock.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Log.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Log.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Socket.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/Socket.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketINET.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/SocketINET.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketUNIX.pm (renamed from ndb/tools/ndbnet/lib/NDB/Util/SocketUNIX.pm)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/ndbnet.pl (renamed from ndb/tools/ndbnet/ndbnet.pl)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/ndbnetd.pl (renamed from ndb/tools/ndbnet/ndbnetd.pl)0
-rw-r--r--ndb/tools/old_dirs/ndbnet/ndbrun (renamed from ndb/tools/ndbnet/ndbrun)0
-rw-r--r--ndb/tools/old_dirs/ndbsql/Makefile (renamed from ndb/tools/ndbsql/Makefile)0
-rw-r--r--ndb/tools/old_dirs/select_all/Makefile (renamed from ndb/tools/select_all/Makefile)0
-rw-r--r--ndb/tools/old_dirs/select_count/Makefile (renamed from ndb/tools/select_count/Makefile)0
-rw-r--r--ndb/tools/old_dirs/src/counterviewer/CounterViewer.java (renamed from ndb/tools/src/counterviewer/CounterViewer.java)0
-rw-r--r--ndb/tools/select_all.cpp (renamed from ndb/tools/select_all/select_all.cpp)0
-rw-r--r--ndb/tools/select_count.cpp199
-rw-r--r--ndb/tools/select_count/select_count.cpp90
-rw-r--r--ndb/tools/waiter.cpp299
1070 files changed, 19932 insertions, 20196 deletions
diff --git a/ndb/BinDist.sh b/ndb/BinDist.sh
deleted file mode 100644
index 2f9620549f4..00000000000
--- a/ndb/BinDist.sh
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# Invoked from scripts/make_binary_distribution as "sh BinDist.sh".
-# Prints list of dirs and files to include under mysql/ndb.
-#
-
-# release notes
-
-grep -v '^#' <<__END__
-#ReleaseNotes.html
-mysqlclusterenv.sh
-__END__
-
-# subset of bins, libs, includes
-
-grep -v '^#' <<__END__
-bin/
-bin/ndb
-bin/mgmtsrvr
-bin/mgmtclient
-bin/mysqlcluster
-bin/mysqlcluster_install_db
-bin/mysqlclusterd
-bin/restore
-bin/ndb_rep
-bin/desc
-bin/flexBench
-bin/select_all
-bin/select_count
-bin/delete_all
-#bin/ndbsql
-bin/drop_tab
-bin/drop_index
-bin/list_tables
-bin/waiter
-lib/
-lib/libNEWTON_API.a
-lib/libNEWTON_API.so
-lib/libNDB_API.a
-lib/libNDB_API.so
-lib/libMGM_API.a
-lib/libMGM_API.so
-#lib/libNDB_ODBC.so
-lib/libMGM_API_pic.a
-lib/libNDB_API_pic.a
-include/
-include/ndb_types.h
-include/ndb_version.h
-include/mgmapi/
-include/mgmapi/mgmapi.h
-include/mgmapi/mgmapi_debug.h
-include/ndbapi/
-include/ndbapi/ndbapi_limits.h
-include/ndbapi/AttrType.hpp
-include/ndbapi/Ndb.hpp
-include/ndbapi/NdbApi.hpp
-include/ndbapi/NdbConnection.hpp
-include/ndbapi/NdbCursorOperation.hpp
-include/ndbapi/NdbDictionary.hpp
-include/ndbapi/NdbError.hpp
-include/ndbapi/NdbEventOperation.hpp
-include/ndbapi/NdbIndexOperation.hpp
-include/ndbapi/NdbOperation.hpp
-include/ndbapi/NdbPool.hpp
-include/ndbapi/NdbRecAttr.hpp
-include/ndbapi/NdbReceiver.hpp
-include/ndbapi/NdbResultSet.hpp
-include/ndbapi/NdbScanFilter.hpp
-include/ndbapi/NdbScanOperation.hpp
-include/ndbapi/NdbSchemaCon.hpp
-include/ndbapi/NdbSchemaOp.hpp
-include/newtonapi/dba.h
-include/newtonapi/defs/pcn_types.h
-__END__
-
-#if [ -f /usr/local/lib/libstdc++.a ]; then
-# cp /usr/local/lib/libstdc++.a lib/.
-# echo lib/libstdc++.a
-#fi
-#if [ -f /usr/local/lib/libstdc++.so.5 ]; then
-# cp /usr/local/lib/libstdc++.so.5 lib/.
-# echo lib/libstdc++.so.5
-#fi
-#if [ -f /usr/local/lib/libgcc_s.so.1 ]; then
-# cp /usr/local/lib/libgcc_s.so.1 lib/.
-# echo lib/libgcc_s.so.1
-#fi
-
-# docs
-
-#find docs/*.html docs/*.pdf -print | sort -t/
-
-# demos
-
-find demos -print | grep -v /SCCS | sort -t/
-
-# examples
-
-grep -v '^#' <<__END__
-examples/
-examples/Makefile
-examples/ndbapi_example1/
-examples/ndbapi_example1/Makefile
-examples/ndbapi_example1/ndbapi_example1.cpp
-examples/ndbapi_example2/
-examples/ndbapi_example2/Makefile
-examples/ndbapi_example2/ndbapi_example2.cpp
-examples/ndbapi_example3/
-examples/ndbapi_example3/Makefile
-examples/ndbapi_example3/ndbapi_example3.cpp
-examples/ndbapi_example4/
-examples/ndbapi_example4/Makefile
-examples/ndbapi_example4/ndbapi_example4.cpp
-examples/ndbapi_example5/
-examples/ndbapi_example5/Makefile
-examples/ndbapi_example5/ndbapi_example5.cpp
-examples/select_all/
-examples/select_all/Makefile
-examples/select_all/select_all.cpp
-__END__
-
-exit 0
diff --git a/ndb/Defs.mk b/ndb/Defs.mk
deleted file mode 100644
index ac4507562fd..00000000000
--- a/ndb/Defs.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-include $(NDB_TOP)/config/config.mk
-include $(NDB_TOP)/config/Defs.$(NDB_VERSION).mk
-include $(NDB_TOP)/config/Defs.$(NDB_OS).$(NDB_ARCH).$(NDB_COMPILER).mk
-
-ifeq ($(NDB_OS), WIN32)
-# Windows specific definitions
-OBJEXT := obj
-LIBEXT := lib
-LIBPREFIX :=
-fixpath = `cygpath -w $1`
-ar_rcs = lib -out:`cygpath -w $1` $2
-link_so = link -DLL -OUT:`cygpath -w $1` $(WIN_LIBS) $2
-#check-odbc = Y
-USE_EDITLINE := N
-#STRCASECMP is defined in include/portlib/PortDefs.h to _strcmpi
-else
-#Common definitions for almost all non-Windows environments
-OBJEXT := o
-LIBEXT := a
-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))
-endif
-
-ifeq ($(NDB_OS), WIN32)
-SHLIBEXT := dll
-endif
-
-ifeq ($(NDB_OS), LINUX)
-SHLIBEXT := so
-endif
-
-ifeq ($(NDB_OS), SOLARIS)
-SHLIBEXT := so
-endif
-
-ifeq ($(NDB_OS), HPUX)
-SHLIBEXT := sl
-endif
-
-ifeq ($(NDB_OS), MACOSX)
-SHLIBEXT := dylib
-endif
-
-ifeq ($(NDB_OS), OSE)
-SHLIBEXT := so
-endif
-
-ifeq ($(NDB_OS), SOFTOSE)
-SHLIBEXT := so
-endif
-
-ifeq ($(NDB_SCI), Y)
-CCFLAGS_TOP += -DHAVE_NDB_SCI
-endif
-
-ifeq ($(NDB_SHM), Y)
-CCFLAGS_TOP += -DHAVE_NDB_SHM
-endif
-
-ifneq ($(findstring OSE, $(NDB_OS)),)
-USE_EDITLINE := N
-endif
diff --git a/ndb/Epilogue.mk b/ndb/Epilogue.mk
deleted file mode 100644
index bcdc54a87f1..00000000000
--- a/ndb/Epilogue.mk
+++ /dev/null
@@ -1,876 +0,0 @@
-# .KEEP_STATE:
-# bk test !!!
-
-###
-# For building some intermediary targets in /tmp (only useful on solaris)
-ifneq ($(NDB_BUILDROOT),)
-NDB_TOPABS := $(shell cd $(NDB_TOP) && /bin/pwd)
-NDB_BUILDDIR := $(subst $(NDB_TOPABS),$(NDB_BUILDROOT),$(CURDIR))/
-ifeq ($(wildcard $(NDB_BUILDDIR)),)
-dummy := $(shell mkdir -p $(NDB_BUILDDIR))
-endif
-endif
-
-###
-CCFLAGS_TOP += -DNDB_$(NDB_OS) -DNDB_$(NDB_ARCH) -DNDB_$(NDB_COMPILER)
-
-ifdef BIN_TARGET
-BIN_EXE = Y
-endif
-
-###
-#
-# OS specifics
-#
-
-# Disable shared libraries on HP-UX for the time being.
-ifeq ($(NDB_OS), HPUX)
- SO_LIB := N
- PIC_LIB := N
- PIC_ARCHIVE := N
- NONPIC_ARCHIVE := Y
-endif
-
-ifeq ($(NDB_OS), OSE)
- SO_LIB := N
- PIC_LIB := N
- PIC_ARCHIVE := N
- NONPIC_ARCHIVE := Y
-
-ifdef BIN_TARGET
- BIN_LIB_TARGET := lib$(BIN_TARGET).a
- BIN_TARGET := lib$(BIN_TARGET).a
-endif
-endif
-
-ifeq ($(NDB_OS), SOFTOSE)
- SO_LIB := N
- PIC_LIB := N
- PIC_ARCHIVE := N
-
-ifdef BIN_TARGET
- BIN_EXE_TARGET := $(BIN_TARGET)
- BIN_LIB_TARGET := lib$(BIN_TARGET).a
- EXTRA_MAIN := osemain.o
-endif
-endif
-
-ifeq ($(filter OSE, $(NDB_OS)),)
- BIN_EXE_TARGET := $(BIN_TARGET)
-endif
-
-
-ifeq ($(NDB_OS), MACOSX)
-.LIBPATTERNS= lib%.dylib lib%.a
-endif
-
-###
-#
-#
-
-###
-# External dependencies definition : the place we store libraries
-# we get from outside the NDB development group.
-EXTERNAL_DEPENDS_TOP=$(NDB_TOP)/src/external/$(NDB_OS).$(NDB_ARCH)
-
-
-###
-#
-# TYPE Handling
-
-#
-# TYPE := kernel
-#
-ifneq ($(filter kernel, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/vm) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/error) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel) \
- -I$(call fixpath,$(NDB_TOP)/include/kernel) \
- -I$(call fixpath,$(NDB_TOP)/include/transporter) \
- -I$(call fixpath,$(NDB_TOP)/include/debugger) \
- -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/include/logger)
-endif
-
-#
-# TYPE := ndbapi
-#
-ifneq ($(filter ndbapi, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/kernel) \
- -I$(call fixpath,$(NDB_TOP)/include/transporter) \
- -I$(call fixpath,$(NDB_TOP)/include/debugger) \
- -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/include/logger)
-endif
-
-#
-# TYPE := ndbapiclient
-#
-ifneq ($(filter ndbapiclient, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi)
-
-BIN_TARGET_LIBS += NDB_API
-endif
-
-#
-# TYPE := mgmapiclient
-#
-ifneq ($(filter mgmapiclient, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/mgmapi)
-
-BIN_TARGET_LIBS += MGM_API
-endif
-
-#
-# TYPE := ndbapitest
-#
-ifneq ($(filter ndbapitest, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/test/include) \
- -I$(call fixpath,$(NDB_TOP)/include/mgmapi)
-
-BIN_TARGET_LIBS += NDBT
-LDFLAGS_LOC += -lNDB_API -lMGM_API -lm
-
-endif
-
-#
-# TYPE := signalsender
-#
-ifneq ($(filter signalsender, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/src/ndbapi/signal-sender) \
- -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/include/transporter) \
- -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
- -I$(call fixpath,$(NDB_TOP)/include/kernel)
-
-BIN_TARGET_LIBS += NDB_API
-BIN_TARGET_ARCHIVES += editline signal-sender
-
-endif
-
-
-#
-# TYPE := repserver
-#
-ifneq ($(filter repserver, $(TYPE)),)
-CCFLAGS_LOC += \
- -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/src) \
- -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \
- -I$(call fixpath,$(NDB_TOP)/src/ndbapi/signal-sender) \
- -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/include/transporter) \
- -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
- -I$(call fixpath,$(NDB_TOP)/include/kernel)
-endif
-
-#
-# TYPE := odbcclient
-#
-
-ifneq ($(filter odbcclient, $(TYPE)),)
-TYPE += util
-LDFLAGS_LOC += -lm
-#ifneq ($(call check-odbc),)
-ifneq ($(NDB_ODBC),N)
-ifeq ($(NDB_OS), SOLARIS)
-CCFLAGS_LOC += -I/usr/local/include
-BIN_TARGET_LIBS_DIRS += /usr/local/lib
-BIN_TARGET_LIBS += odbc odbcinst NDBT
-endif
-ifeq ($(NDB_OS), LINUX)
-BIN_TARGET_LIBS += odbc odbcinst NDBT
-endif
-ifeq ($(NDB_OS), MACOSX)
-BIN_TARGET_LIBS += odbc odbcinst NDBT
-endif
-ifeq ($(NDB_OS), IBMAIX)
-BIN_TARGET_LIBS += odbc odbcinst NDBT
-endif
-ifeq ($(NDB_OS), TRU64X)
-BIN_TARGET_LIBS += odbc odbcinst NDBT
-endif
-else
-BIN_EXE = N
-endif
-endif
-
-#
-# TYPE := *
-#
-#
-# TYPE := util
-#
-ifneq ($(filter util, $(TYPE)),)
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \
- -I$(call fixpath,$(NDB_TOP)/include/portlib) \
- -I$(call fixpath,$(NDB_TOP)/include/logger)
-BIN_TARGET_LIBS += logger general portlib
-endif
-
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include)
-
-ifeq ($(NDB_SCI), Y)
-BIN_TARGET_LIBS += sisci
-BIN_TARGET_LIBS_DIRS += $(EXTERNAL_DEPENDS_TOP)/sci/lib
-
-CCFLAGS_LOC += -I$(call fixpath,$(EXTERNAL_DEPENDS_TOP)/sci/include)
-endif
-
-#
-# TYPE Handling
-###
-
-###
-#
-# First rule
-#
-first:
- $(MAKE) libs
- $(MAKE) bins
-
-ifeq ($(findstring all,$(replace-targets)),)
-all: first
-endif
-
-###
-#
-# Nice to have rules
-api: libs
- $(MAKE) -C $(NDB_TOP)/src/ndbapi bins
-
-mgm: libs
- $(MAKE) -C $(NDB_TOP)/src/mgmsrv bins
-
-ndb: libs
- $(MAKE) -C $(NDB_TOP)/src/kernel/ndb-main bins
-
-apitest: first
- $(MAKE) -C $(NDB_TOP)/test/ndbapi all
-
-#-lNDBT:
-# $(MAKE) -C $(NDB_TOP)/test/src all
-#
-#-lNDB_API: libs
-# $(MAKE) -C $(NDB_TOP)/src/ndbapi bins
-
-#
-# Libs/Bins
-#
-ifdef PREREQ_LOC
-_libs:: $(PREREQ_LOC)
-_bins:: $(PREREQ_LOC)
-endif
-
-L_DIRS := $(LIB_DIRS) $(DIRS)
-B_DIRS := $(BIN_DIRS) $(DIRS)
-A_DIRS := $(LIB_DIRS) $(BIN_DIRS) $(DIRS)
-
-_libs::
-
-_bins::
-
-libs: _libs $(patsubst %, _libs_%, $(L_DIRS))
-$(patsubst %, _libs_%, $(L_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _libs_%,%,$@) libs
-
-bins: _bins $(patsubst %, _bins_%, $(B_DIRS))
-$(patsubst %, _bins_%, $(B_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _bins_%,%,$@) bins
-
-###
-#
-# Links
-_links:
- -$(NDB_TOP)/tools/make-links.sh $(NDB_TOP)/include `pwd`
-
-links: _links $(patsubst %, _links_%, $(A_DIRS))
-$(patsubst %, _links_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _links_%,%,$@) links
-
-
-####
-#
-# OSE build_spec (
-ifdef SOURCES
-BS := Y
-endif
-
-ifdef SOURCES_c
-BS := Y
-endif
-
-_build_spec: Makefile
-ifdef BS
- @echo "TYPE = SWU" > build.spec
- @echo "include $(NDB_TOP)/Ndb.mk" >> build.spec
-# @for i in $(CCFLAGS_LOC); do echo "INC += $$i" >> build.spec ; done
- @for i in $(patsubst -I%, %, $(CCFLAGS_LOC)); do echo "INC += $$i" >> build.spec ; done
- @echo "INC += /vobs/cello/cls/rtosi_if/include" >> build.spec
- @echo "INC += /vobs/cello/cls/rtosi_if/include.@@@" >> build.spec
- @echo "INC += /vobs/cello/cls/rtosi_if/include.<<<" >> build.spec
-endif
-
-build_spec: _build_spec $(patsubst %, _build_spec_%, $(A_DIRS))
-$(patsubst %, _build_spec_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _build_spec_%,%,$@) build_spec
-
-###
-#
-# Phony targets
-
-.PHONY: $(A_DIRS)
-
-###
-#
-# Dummy rule
-
-DUMMY:
-
-###
-#
-# Definitions of...
-
-PIC_DIR := $(NDB_BUILDDIR).pic
-A_TMP_DIR := $(NDB_BUILDDIR).a_tmp
-SO_TMP_DIR := $(NDB_BUILDDIR).so_tmp
-PIC_TMP_DIR := $(NDB_BUILDDIR).pic_tmp
-
-$(PIC_DIR):
- mkdir -p $(PIC_DIR)
-
-SRC_C := $(filter %.C, $(SOURCES))
-SRC_CPP := $(filter %.cpp, $(SOURCES))
-SRC_CC := $(filter %.cc, $(SOURCES))
-SRC_c := $(filter %.c, $(SOURCES)) $(filter %.c, $(SOURCES.c))
-SRC_YPP := $(filter %.ypp, $(SOURCES))
-SRC_LPP := $(filter %.lpp, $(SOURCES))
-
-OBJECTS := $(SRC_C:%.C=%.$(OBJEXT)) \
- $(SRC_CPP:%.cpp=%.$(OBJEXT)) \
- $(SRC_CC:%.cc=%.$(OBJEXT)) \
- $(SRC_c:%.c=%.$(OBJEXT)) \
- $(SRC_YPP:%.ypp=%.tab.$(OBJEXT)) \
- $(SRC_LPP:%.lpp=%.yy.$(OBJEXT)) \
- $(OBJECTS_LOC)
-
-PIC_OBJS := $(OBJECTS:%=$(PIC_DIR)/%)
-
-LIB_DIR := $(NDB_TOP)/lib
-BIN_DIR := $(NDB_TOP)/bin
-
-###
-#
-# ARCHIVE_TARGET
-#
-ifdef ARCHIVE_TARGET
-
-ifndef NONPIC_ARCHIVE
-NONPIC_ARCHIVE := Y
-endif
-
-ifeq ($(NONPIC_ARCHIVE), Y)
-_libs:: $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT) : $(OBJECTS)
- $(call ar_rcs,$@,$(OBJECTS))
-
-endif # NONPIC_ARCHIVE := Y
-
-ifeq ($(PIC_ARCHIVE), Y)
-_libs:: $(PIC_DIR) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT) : $(PIC_OBJS)
- cd $(PIC_DIR) && $(call ar_rcs,../$@,$(OBJECTS))
-
-PIC_DEP := Y
-
-endif # PIC_ARCHIVE := Y
-
-endif # ARCHIVE_TARGET
-
-###
-#
-# LIB_TARGET
-#
-ifdef LIB_TARGET
-
-ifeq ($(A_LIB), Y)
-
-A_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT))
-
-_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT) : $(A_LIB_ARCHIVES)
- @rm -rf $(A_TMP_DIR) && mkdir $(A_TMP_DIR)
- cd $(A_TMP_DIR) && for i in $^; do ar -x ../$$i; done && $(call ar_rcs,../$@,*.$(OBJEXT))
- $(NDB_TOP)/home/bin/ndb_deploy $@
-endif # A_LIB := Y
-
-ifeq ($(SO_LIB), Y)
-ifneq ($(NDB_OS), WIN32)
-SO_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT))
-
-_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) : $(SO_LIB_ARCHIVES)
- @rm -rf $(SO_TMP_DIR) && mkdir $(SO_TMP_DIR)
- cd $(SO_TMP_DIR) && for i in $^; do ar -x ../$$i; done
-ifneq ($(NDB_OS), MACOSX)
- $(SO) $@.new $(SO_TMP_DIR)/*.$(OBJEXT) -L$(LIB_DIR) $(LIB_TARGET_LIBS) $(LDFLAGS_LAST)
- rm -f $@; mv $@.new $@
-else
- $(SO) $@ $(SO_TMP_DIR)/*.$(OBJEXT) -L$(LIB_DIR) $(LIB_TARGET_LIBS) $(LDFLAGS_LAST)
-endif
-ifeq ($(NDB_VERSION), RELEASE)
-ifneq ($(NDB_OS), MACOSX)
- strip $@
-endif
-endif
- $(NDB_TOP)/home/bin/ndb_deploy $@
-else # WIN32
-SO_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT))
-
-_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) : $(SO_LIB_ARCHIVES)
- @rm -rf $(SO_TMP_DIR) && mkdir $(SO_TMP_DIR)
- cd $(SO_TMP_DIR) && for i in $^; do ar -x ../$$i; done
- $(call link_so,$@.new,$(SO_TMP_DIR)/*.$(OBJEXT))
- rm -f $@; mv $@.new $@
-#ifeq ($(NDB_VERSION), RELEASE)
-# strip $@
-#endif
-
-endif
-endif # SO_LIB := Y
-
-ifeq ($(PIC_LIB), Y)
-
-PIC_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT))
-
-_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT)
-$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT) : $(PIC_LIB_ARCHIVES)
- @rm -rf $(PIC_TMP_DIR) && mkdir $(PIC_TMP_DIR)
- cd $(PIC_TMP_DIR) && for i in $^; do ar -x ../$$i; done && $(call ar_rcs,../$@,*.$(OBJEXT))
-
-endif # PIC_LIB := Y
-
-endif # LIB_TARGET
-
-###
-#
-# BIN_TARGET
-#
-ifeq ($(BIN_EXE), Y)
-ifneq ($(NDB_OS), WIN32)
-BIN_LIBS := $(BIN_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT))
-BIN_LIBS += $(BIN_TARGET_LIBS:%=-l%)
-
-BIN_DEPS := $(OBJECTS) $(EXTRA_MAIN) $(BIN_LIBS)
-BIN_LIB_DIRS := $(BIN_TARGET_LIBS_DIRS:%=-L%)
-
-BIN_FLAGS := $(BIN_LIB_DIRS) $(BIN_DEPS)
-
-VPATH := $(LIB_DIR) $(BIN_TARGET_LIBS_DIRS)
-_bins:: $(BIN_DIR)/$(BIN_TARGET)
-$(BIN_DIR)/$(BIN_TARGET) : $(BIN_DEPS)
- $(LINK.cc) $(LDFLAGS) $(LDLIBS) -L$(LIB_DIR) $(BIN_FLAGS) -o $@.new $(LDFLAGS_LAST)
- rm -f $@; mv $@.new $@
-ifeq ($(NDB_VERSION), RELEASE)
-ifneq ($(NDB_OS), MACOSX)
- strip $@
-endif
-endif
- $(NDB_TOP)/home/bin/ndb_deploy $@
-else # WIN32
-BIN_LIBS := $(foreach lib,$(BIN_TARGET_ARCHIVES),$(call fixpath,$(LIB_DIR)/$(LIBPREFIX)$(lib).$(LIBEXT)))
-BIN_LIBS += $(BIN_TARGET_LIBS:%=$(LIBPREFIX)%.$(LIBEXT))
-
-BIN_DEPS := $(OBJECTS) $(BIN_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT))
-BIN_LIB_DIRS := -libpath:$(call fixpath,$(LIB_DIR)) $(BIN_TARGET_LIBS_DIRS:%=-libpath:%)
-
-BIN_FLAGS := $(BIN_LIB_DIRS)
-
-VPATH := $(LIB_DIR) $(BIN_TARGET_LIBS_DIRS)
-_bins:: $(BIN_DIR)/$(BIN_TARGET).exe
-$(BIN_DIR)/$(BIN_TARGET).exe : $(BIN_DEPS)
- $(LINK.cc) -out:$(call fixpath,$@.new) $(OBJECTS) $(BIN_FLAGS) $(BIN_LIBS)
- rm -f $@; mv $@.new $@
-ifeq ($(NDB_VERSION), RELEASE)
- strip $@
-endif
-
-endif
-endif
-
-###
-#
-# SOURCES.sh
-#
-ifdef SOURCES.sh
-
-BIN_SRC := $(SOURCES.sh:%=$(BIN_DIR)/%)
-
-_bins:: $(BIN_SRC)
-
-$(BIN_SRC) : $(SOURCES.sh)
- rm -f $(^:%=$(BIN_DIR)/%)
- cp $^ $(BIN_DIR)
-endif
-
-#
-# Compile rules PIC objects
-#
-ifeq ($(NDB_OS), WIN32)
-OUT := -Fo
-else
-OUT := -o
-endif
-
-$(PIC_DIR)/%.$(OBJEXT): %.C
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $<
-
-$(PIC_DIR)/%.$(OBJEXT): %.cpp
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $<
-
-$(PIC_DIR)/%.$(OBJEXT): %.cc
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $<
-
-$(PIC_DIR)/%.$(OBJEXT): %.c
- $(CC) $(OUT)$@ -c $(CFLAGS) $(CFLAGS_$<) $(PIC) $<
-
-#
-# Compile rules
-#
-%.$(OBJEXT) : %.cpp
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.$(OBJEXT) : %.C
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.$(OBJEXT) : %.cc
- $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.$(OBJEXT) : %.c
- $(CC) $(OUT)$@ -c $(CFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.s : %.C
- $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.s : %.cpp
- $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.s : %.cc
- $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-%.s : %.c
- $(CC) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $<
-
-BISON = bison
-BISONHACK = :
-%.tab.cpp %.tab.hpp : %.ypp
- $(BISON) $<
- $(BISONHACK) $*.tab.cpp $*.tab.hpp
-
-FLEX = flex
-FLEXHACK = :
-%.yy.cpp : %.lpp
- $(FLEX) -o$@ $<
- $(FLEXHACK) $@
-
-###
-#
-# Defines regarding dependencies
-
-DEPMK := $(NDB_BUILDDIR).depend.mk
-
-DEPDIR := $(NDB_BUILDDIR).depend
-
-DEPENDENCIES := $(SRC_C:%.C=$(DEPDIR)/%.d) \
- $(SRC_CC:%.cc=$(DEPDIR)/%.d) \
- $(SRC_CPP:%.cpp=$(DEPDIR)/%.d) \
- $(SRC_c:%.c=$(DEPDIR)/%.d) \
- $(SRC_YPP:%.ypp=$(DEPDIR)/%.tab.d) \
- $(SRC_LPP:%.lpp=$(DEPDIR)/%.yy.d)
-
-###
-#
-# Dependency rule
-
-_depend: $(DEPMK)
-
-depend: _depend $(patsubst %, _depend_%, $(A_DIRS))
-
-$(patsubst %, _depend_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _depend_%,%,$@) depend
-
-###
-#
-# Clean dependencies
-
-_clean_dep:
- -rm -rf $(DEPMK) $(DEPDIR)/*
-
-clean_dep: _clean_dep $(patsubst %, _clean_dep_%, $(A_DIRS))
-
-$(patsubst %, _clean_dep_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _clean_dep_%,%,$@) clean_dep
-
-###
-#
-# Generate dependencies
-
-$(DEPDIR):
- -@mkdir -p $(DEPDIR)
-
-$(DEPDIR)/%.d: %.C
- @echo Generating depend for $<
- @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@
-
-$(DEPDIR)/%.d: %.c
- @echo Generating depend for $<
- @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@
-
-$(DEPDIR)/%.d: %.cpp
- @echo Generating depend for $<
- @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@
-
-$(DEPDIR)/%.d: %.cc
- @echo Generating depend for $<
- @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@
-
-ifeq ($(NDB_OS), WIN32)
-ifndef PIC_DEP
-DEP_PTN := -e 's/\(.*\)\.o[ :]*/\1.$(OBJEXT) $(DEPDIR)\/\1.d : /g'
-else
-DEP_PTN := -e 's/\(.*\)\.o[ :]*/\1.$(OBJEXT) $(PIC_DIR)\/\1.$(OBJEXT) $(DEPDIR)\/\1.d : /g'
-endif
-else
-ifndef PIC_DEP
-DEP_PTN := -e 's!\(.*\)\.$(OBJEXT)[ :]*!\1.$(OBJEXT) $(DEPDIR)\/\1.d : !g'
-else
-DEP_PTN := -e 's!\(.*\)\.$(OBJEXT)[ :]*!\1.$(OBJEXT) $(PIC_DIR)\/\1.$(OBJEXT) $(DEPDIR)\/\1.d : !g'
-endif
-endif
-#DEP_PTN += -e 's!/usr/include/[-+a-zA-Z0-9_/.]*!!g'
-#DEP_PTN += -e 's!/usr/local/lib/gcc-lib/[-+a-zA-Z0-9_/.]*!!g'
-
-$(DEPMK): $(DEPDIR) $(SRC_YPP:%.ypp=%.tab.hpp) $(SRC_LPP:%.lpp=%.yy.cpp) $(DEPENDENCIES) $(wildcard $(NDB_TOP)/.update.d)
- @echo "updating .depend.mk"
- @sed $(DEP_PTN) /dev/null $(DEPENDENCIES) >$(DEPMK)
-
-###
-#
-# clean
-#
-_clean:
- -rm -rf SunWS_cache $(PIC_DIR)/SunWS_cache
-ifeq ($(NONPIC_ARCHIVE), Y)
- -rm -f $(OBJECTS) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT)
-endif
-ifeq ($(PIC_ARCHIVE), Y)
- -rm -f $(PIC_OBJS) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT)
-endif
-ifdef BIN_TARGET
- -rm -f $(OBJECTS)
-endif
-ifdef LIB_TARGET
-ifeq ($(A_LIB), Y)
- -rm -f $(A_TMP_DIR)/*
-endif
-ifeq ($(SO_LIB), Y)
- -rm -f $(SO_TMP_DIR)/*
-endif
-ifeq ($(PIC_LIB), Y)
- -rm -f $(PIC_TMP_DIR)/*
-endif
-endif
-ifneq ($(SRC_YPP),)
- -rm -f $(SRC_YPP:%.ypp=%.tab.[hc]pp) $(SRC_YPP:%.ypp=%.output)
-endif
-ifneq ($(SRC_LPP),)
- -rm -f $(SRC_LPP:%.lpp=%.yy.*)
-endif
-ifdef CLEAN_LOC
- -rm -f $(CLEAN_LOC)
-endif
-
-###
-#
-# clean all
-#
-clobber: cleanall
-_cleanall: _clean clean_links
- -rm -f osemain.con osemain.c
-ifdef LIB_TARGET
-ifeq ($(A_LIB), Y)
- -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT)
-endif
-ifeq ($(SO_LIB), Y)
- -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT)
-endif
-ifeq ($(PIC_LIB), Y)
- -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT)
-endif
-endif
-ifdef BIN_TARGET
- -rm -f $(BIN_DIR)/$(BIN_TARGET)
-endif
-
-clean_links:
-
-###
-#
-# Dist clean
-#
-_distclean: _tidy
- rm -rf $(DEPDIR) $(PIC_DIR) $(PIC_TMP_DIR) $(SO_TMP_DIR) $(A_TMP_DIR) Sources build.spec
-
-###
-#
-# tidy
-#
-_tidy: _cleanall _clean_dep
- -rm -f *~ *.$(OBJEXT) *.$(LIBEXT) *.${SHLIBEXT}
-
-#
-# clean cleanall tidy - recursion
-#
-ifeq ($(findstring clean,$(replace-targets)),)
-clean: _clean $(patsubst %, _clean_%, $(A_DIRS))
-endif
-
-$(patsubst %, _clean_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _clean_%,%,$@) clean
-
-cleanall: _cleanall $(patsubst %, _cleanall_%, $(A_DIRS))
-
-$(patsubst %, _cleanall_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _cleanall_%,%,$@) cleanall
-
-tidy: _tidy $(patsubst %, _tidy_%, $(A_DIRS))
-
-$(patsubst %, _tidy_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _tidy_%,%,$@) tidy
-
-distclean: _distclean $(patsubst %, _distclean_%, $(A_DIRS))
-
-$(patsubst %, _distclean_%, $(A_DIRS)) : DUMMY
- $(MAKE) -C $(patsubst _distclean_%,%,$@) distclean
-
-###
-#
-# Guess configuration
-
-$(NDB_TOP)/config/config.mk: $(NDB_TOP)/config/GuessConfig.sh
- $(NDB_TOP)/config/GuessConfig.sh -D
-
-$(NDB_TOP)/config/Defs....mk: $(NDB_TOP)/config/config.mk
-$(NDB_TOP)/config/Defs..mk: $(NDB_TOP)/config/config.mk
-
-###
-# Soft ose envirment stuff
-#
-osemain.con: $(NDB_TOP)/src/env/softose/osemain_con.org
- cp $< $@
- echo "PRI_PROC(init_$(BIN_TARGET), init_$(BIN_TARGET), 65535, 3, ndb, 0, NULL)" >> $@
-
-osemain.c: $(OSE_LOC)/sfk-solaris2/krn-solaris2/src/osemain.c
- ln -s $< $@
-
-osemain.o : osemain.con
-
-$(DEPDIR)/osemain.d : osemain.con
-
-###
-#
-# These target dont want dependencies
-
-NO_DEP=clean clobber cleanall tidy clean_dep $(DEPDIR) build_spec \
- $(NDB_TOP)/config/config.mk distclean osemain.con osemain.c
-
-ifeq ($(filter $(NO_DEP), $(MAKECMDGOALS)),)
-ifneq ($(strip $(DEPENDENCIES)),)
- include $(DEPMK)
-endif
-endif
-
-###
-#
-# Auxiliary targets
-
-sources: Sources
-
-Sources: Makefile
- @rm -f $@
- @for f in Makefile $(A_DIRS) $(SOURCES) $(SOURCES.c); do echo $$f; done >$@
-
-###
-#
-# TAG generation for emacs and vi folks
-#
-# In emacs "Esc- ." or "M- ." to find a symbol location
-# In vi use the :\tag command
-# by convention:
-# TAGS is used with emacs
-# tags is used with vi
-#
-# Hopefully the make is being done from $(NDB_TOP)/src
-# and your TAGS/tags file then is in the same directory.
-
-TAGS: DUMMY
- rm -f TAGS
- find $(NDB_TOP) -name "*.[ch]" | xargs $(ETAGS) --append
- find $(NDB_TOP) -name "*.[ch]pp" | xargs $(ETAGS) --append
-
-tags: DUMMY
- rm -f tags
- find $(NDB_TOP) -name "*.[ch]" | xargs $(CTAGS) --append
- find $(NDB_TOP) -name "*.[ch]pp" | xargs $(CTAGS) --append
-
-install:
-
-
-ebrowse: DUMMY
- cd $(NDB_TOP); rm -f EBROWSE
- cd $(NDB_TOP); find . -name "*.hpp" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" > tmpfile~
- cd $(NDB_TOP); ebrowse --file tmpfile~
- cd $(NDB_TOP); rm -f tmpfile~
-
-srcdir = $(NDB_TOP)
-top_distdir = $(NDB_TOP)/..
-mkinstalldirs := /bin/sh ../mkinstalldirs
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)/ndb
-
-distdir:
- $(mkinstalldirs) $(distdir)
- @list='$(shell /bin/sh SrcDist.sh)'; for file in $$list; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -f $$d/$$file; then \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
diff --git a/ndb/Makefile b/ndb/Makefile
deleted file mode 100644
index 475914f6120..00000000000
--- a/ndb/Makefile
+++ /dev/null
@@ -1,69 +0,0 @@
-include .defs.mk
-
-DIRS := src test tools examples
-
-# hack before full autoconf
-replace-targets := all clean
-NDB_RELEASE := $(shell ../scripts/mysql_config --version)
-
-all:
- $(MAKE) -C src
- $(MAKE) -C test/src
- $(MAKE) -C tools
- $(MAKE) -C test/ndbapi/flexBench
- $(MAKE) -C test/tools/waiter
-
-include $(NDB_TOP)/Epilogue.mk
-
-_libs_test : _bins_src
-_libs_tools : _libs_test
-_libs_examples : _bins_src
-_bins_src : _libs_src
-_bins_tools : _bins_src
-
-# always release compile except for ndbapi static lib
-old-all:
- $(MAKE) -C src/ndbapi libs
- $(MAKE) libs NDB_VERSION=RELEASE
- $(MAKE) bins NDB_VERSION=RELEASE
-ifeq ($(NDB_OS),LINUX)
- NDB_RELEASE=$(NDB_RELEASE) $(MAKE) -j1 -C docs all </dev/null || :
-endif
-
-# old distclean matches clean better
-clean: distclean
- $(MAKE) -C docs clean
-
-nuke-deps:
- find . -name '.depend*' | xargs rm -rf
-
-vim-tags:
- bk sfiles -g | ctags --c-types=+p --extra=+fq -L -
-
-cvs-update:
-ifeq ($(NDB_VERSION),main)
- -cvs update -d
-else
-ifeq ($(NDB_TAG),HEAD)
- -cvs -q update
- -cd include && cvs -q update -d
- -cd src && cvs -q update -d
- -cd test && cvs -q update -d
- -cd tools && cvs -q update -d
-else
- -cvs -q update -r $(NDB_TAG)
- -cd include && cvs -q update -d -r $(NDB_TAG)
- -cd src && cvs -q update -d -r $(NDB_TAG)
- -cd test && cvs -q update -d -r $(NDB_TAG)
- -cd tools && cvs -q update -d -r $(NDB_TAG)
-endif
-endif
- make nuke-deps
- make vim-tags
- make TAGS
-
-bk-update:
- bk pull
- make nuke-deps
- make vim-tags
- make TAGS
diff --git a/ndb/Makefile.am b/ndb/Makefile.am
new file mode 100644
index 00000000000..82f424fcfb4
--- /dev/null
+++ b/ndb/Makefile.am
@@ -0,0 +1,19 @@
+SUBDIRS = src tools . include @ndb_opt_subdirs@
+DIST_SUBDIRS = src tools include test docs
+EXTRA_DIST = config
+
+include $(top_srcdir)/ndb/config/common.mk.am
+
+dist-hook:
+ -rm -rf `find $(distdir) -type d -name SCCS`
+ -rm -rf `find $(distdir) -type d -name old_files`
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" != "." -a "$$subdir" != "include"; then \
+ files="`find $$subdir -name '*\.h'` `find $$subdir -name '*\.hpp'`"; \
+ for f in $$files; do \
+ if test -d "$(distdir)/`dirname $$f`" -a ! -e "$(distdir)/$$f"; then \
+ cp $$f $(distdir)/$$f; \
+ fi; \
+ done; \
+ fi; \
+ done
diff --git a/ndb/README b/ndb/README
deleted file mode 100644
index 3b21fca1d48..00000000000
--- a/ndb/README
+++ /dev/null
@@ -1,7 +0,0 @@
-INSTALLATION
-To compile a pentium version of MySQL Cluster from this BK clone do:
-
-shell> cd /home/bk/mysql-4.1-ndb
-shell> BUILD/compile-pentium-debug -c --prefix=/usr/local/mysql-4.1-ndb
-shell> make
-
diff --git a/ndb/SrcDist.sh b/ndb/SrcDist.sh
deleted file mode 100644
index 03e697b1475..00000000000
--- a/ndb/SrcDist.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# Invoked from make distdir.
-# Prints list of dirs and files to include under mysql/ndb.
-#
-
-# top dir
-
-grep -v '^#' <<__END__
-#ReleaseNotes.html
-.defs.mk
-Defs.mk
-configure
-Makefile
-Epilogue.mk
-SrcDist.sh
-BinDist.sh
-mysqlclusterenv.sh
-__END__
-
-# subset of bins, libs
-
-grep -v '^#' <<__END__
-bin/
-bin/mysqlcluster
-bin/mysqlcluster_install_db
-bin/mysqlclusterd
-lib/
-__END__
-
-# docs
-
-#find docs/*.html docs/*.pdf -print
-
-# include
-
-find include -print | grep -v /SCCS
-
-# config
-
-find config -print | grep -v /SCCS
-
-# tools
-
-find tools -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v tools/ndbsql
-
-# home
-
-find home -print | grep -v /SCCS
-
-# test
-
-find test -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v test/odbc
-
-# src
-
-find src -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v src/client/odbc | grep -v cpcc-win32
-
-# demos
-
-find demos -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend'
-
-# examples
-
-grep -v '^#' <<__END__
-examples/
-examples/Makefile
-examples/ndbapi_example1/
-examples/ndbapi_example1/Makefile
-examples/ndbapi_example1/ndbapi_example1.cpp
-examples/ndbapi_example2/
-examples/ndbapi_example2/Makefile
-examples/ndbapi_example2/ndbapi_example2.cpp
-examples/ndbapi_example3/
-examples/ndbapi_example3/Makefile
-examples/ndbapi_example3/ndbapi_example3.cpp
-examples/ndbapi_example4/
-examples/ndbapi_example4/Makefile
-examples/ndbapi_example4/ndbapi_example4.cpp
-examples/ndbapi_example5/
-examples/ndbapi_example5/Makefile
-examples/ndbapi_example5/ndbapi_example5.cpp
-examples/select_all/
-examples/select_all/Makefile
-examples/select_all/select_all.cpp
-__END__
-
-exit 0
diff --git a/ndb/bin/mysqlcluster b/ndb/bin/mysqlcluster
deleted file mode 100755
index 81fc7308942..00000000000
--- a/ndb/bin/mysqlcluster
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
- echo "MYSQLCLUSTER_TOP not set or directory does not exist"
- exit 1
-fi
-if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
- echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
- exit 1
-fi
-
-mysql --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
diff --git a/ndb/bin/mysqlcluster_install_db b/ndb/bin/mysqlcluster_install_db
deleted file mode 100755
index 6fe95ff105d..00000000000
--- a/ndb/bin/mysqlcluster_install_db
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/bin/sh
-
-NDB_HOME=
-export NDB_CONNECTSTRING
-if [ -z "$MYSQLCLUSTER_TOP" ]; then
- echo "MYSQLCLUSTER_TOP not set"
- exit 1
-fi
-if [ -d "$MYSQLCLUSTER_TOP" ]; then :; else
- echo "$MYSQLCLUSTER_TOP directory does not exist"
- exit 1
-fi
-if [ -d "$MYSQLCLUSTER_TOP/ndb" ]; then :; else
- echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
- exit 1
-fi
-
-start_default_ndbcluster() {
-
-# configurable parameters, make sure to change in mysqlcluterd as well
-MYSQLCLUSTER_FILESYSTEM=$MYSQLCLUSTER_TOP/data/mysqlclusterfs
-MYSQLCLUSTER_PORT_BASE="22" # using ports MYSQLCLUSTER_PORT_BASE{"00","01", etc}
-# end configurable parameters
-
-# do some checks
-
-NDB_CONNECTSTRING=
-
-[ -d "$MYSQLCLUSTER_FILESYSTEM" ] || mkdir "$MYSQLCLUSTER_FILESYSTEM"
-if [ -d "$MYSQLCLUSTER_FILESYSTEM" ]; then :; else
- echo "$MYSQLCLUSTER_FILESYSTEM filesystem directory does not exist"
- exit 1
-fi
-
-
-# set som help variables
-
-NDB_HOST="localhost"
-NDB_PORT=$MYSQLCLUSTER_PORT_BASE"00"
-NDB_CONNECTSTRING_BASE="host=$NDB_HOST:$NDB_PORT;nodeid="
-
-
-# Edit file system path and ports in config file
-
-cd $MYSQLCLUSTER_FILESYSTEM
-sed \
- -e s,"WRITE_PATH_TO_FILESYSTEM_2_HERE",$MYSQLCLUSTER_FILESYSTEM,g \
- -e s,"CHOOSE_PORT_BASE",$MYSQLCLUSTER_PORT_BASE,g \
- < $MYSQLCLUSTER_TOP/ndb/demos/config-templates/config_template-install.ini \
- > config.ini
-
-
-# Start management server as deamon
-
-NDB_ID="1"
-NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-#xterm -e mgmtsrvr -c $MYSQLCLUSTER_FILESYSTEM/config.ini &
-if mgmtsrvr -d -c $MYSQLCLUSTER_FILESYSTEM/config.ini ; then :; else
- echo "Unable to start mgmtsrvr"
- exit 1
-fi
-
-
-# Start database node
-
-cd $MYSQLCLUSTER_FILESYSTEM # the output from the database node gets where it starts
-NDB_ID="2"
-NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-#xterm -T "NDB Cluster DB Node" -geometry 80x10 -xrm *.hold:true -e ndb -i &
-ndb -d -i &
-
-# Start xterm for application programs
-
-NDB_ID="3"
-NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-#xterm -T "NDB Cluster API Node" -geometry 80x10 &
-echo set before running ndbApi programs > export NDB_CONNECTSTRING=$NDB_CONNECTSTRING
-
-# Start management client
-
-#xterm -T "NDB Management Client" -geometry 80x10 -xrm *.hold:true -e mgmtclient $NDB_HOST $NDB_PORT &
-echo "NDB Management Client starts with: mgmtclient $NDB_HOST $NDB_PORT"
-
-# test if Ndb Cluster starts properly
-
-NDB_ID="11"
-NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-if list_tables | grep "NDBT_ProgramExit: 0 - OK"; then :; else
- echo "Ndbcluster startup failed"
- exit 1
-fi
-}
-
-start_mysql_install_db() {
- # run install of regular MySQL Server
-
- cd $MYSQLCLUSTER_TOP
- scripts/mysql_install_db --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
-}
-
-if test "$1" = "ndb_started"
-then
- shift
- mgmt_host=$1
- shift
- mgmt_port=$1
- shift
- if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
- echo "syntax: ndb_started hostname port"
- exit 1
- fi
- NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
- echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
- start_mysql_install_db $*
-else
- start_default_ndbcluster
- start_mysql_install_db
-fi
-
diff --git a/ndb/bin/mysqlclusterd b/ndb/bin/mysqlclusterd
deleted file mode 100755
index 3b4deb3ed48..00000000000
--- a/ndb/bin/mysqlclusterd
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-# configurable parameters
-MYSQLCLUSTER_PORT_BASE="22"
-# end configurable parameters
-
-if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
- echo "MYSQLCLUSTER_TOP not set or directory does not exist"
- exit 1
-fi
-if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
- echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
- exit 1
-fi
-
-if test "$1" = "ndb_started"
-then
- shift
- mgmt_host=$1
- shift
- mgmt_port=$1
- shift
- if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
- echo "syntax: ndb_started hostname port"
- exit 1
- fi
- NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
- echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
-else
- NDB_CONNECTSTRING="host=localhost:"$MYSQLCLUSTER_PORT_BASE"00;nodeid=11"
-fi
-export NDB_CONNECTSTRING
-
-mysqld --default-table-type=ndbcluster --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
diff --git a/ndb/bin/regression.sh b/ndb/bin/regression.sh
deleted file mode 100644
index 5d0531c7460..00000000000
--- a/ndb/bin/regression.sh
+++ /dev/null
@@ -1,644 +0,0 @@
-#!/bin/sh
-# NAME
-# regression.sh
-#
-# SYNOPSIS
-# regression.sh
-#
-# DESCRIPTION
-#
-# This script runs a number of regression tests to verify that nothing
-# is broken. Currently it executes the same tests as in the autotest
-# regression suite.
-#
-# OPTIONS
-#
-# EXAMPLES
-#
-#
-# ENVIRONMENT
-# verbose verbose printouts
-#
-# FILES
-#
-#
-# SEE ALSO
-#
-# DIAGNOSTICTS
-#
-#
-# VERSION
-# 1.0
-#
-# AUTHOR
-#
-#
-
-
-# die prints the supplied message to stderr,
-# prefixed with the program name, and exits
-# with the exit code given by "-e num" or
-# 1, if no -e option is present.
-#
-die ()
-{
- die_code__=1
- [ "X$1" = X-e ] && { die_code__=$2; shift 2; }
- [ "X$1" = X-- ] && shift
- errmsg "$@"
- exit $die_code__
-}
-
-
-# msg prints the supplied message to stderr,
-# prefixed with the program name.
-#
-errmsg ()
-{
- echo "${progname:-<no program name set>}:" "$@" >&2
-}
-
-# rawdie prints the supplied message to stderr.
-# It then exits with the exit code given with "-e num"
-# or 1, if no -e option is present.
-#
-rawdie ()
-{
- rawdie_code__=1
- [ "X$1" = X-e ] && { rawdie_code__=$2; shift 2; }
- [ "X$1" = X-- ] && shift
- rawerrmsg "$@"
- exit $rawdie_code__
-}
-
-# Syndie prints the supplied message (if present) to stderr,
-# prefixed with the program name, on the first line.
-# On the second line, it prints $synopsis.
-# It then exits with the exit code given with "-e num"
-# or 1, if no -e option is present.
-#
-syndie ()
-{
- syndie_code__=1
- [ "X$1" = X-e ] && { syndie_code__=$2; shift 2; }
- [ "X$1" = X-- ] && shift
- [ -n "$*" ] && msg "$*"
- rawdie -e $syndie_code__ "Synopsis: $synopsis"
-}
-
-
-
-
-# msg prints the supplied message to stdout,
-# prefixed with the program name.
-#
-msg ()
-{
- echo "${progname:-<no program name set>}:" "$@"
-}
-
-rawmsg () { echo "$*"; } # print the supplied message to stdout
-rawerrmsg () { echo "$*" >&2; } # print the supplied message to stderr
-
-# trace prints the supplied message to stdout if verbose is non-null
-#
-trace ()
-{
- [ -n "$verbose" ] && msg "$@"
-}
-
-
-# errtrace prints the supplied message to stderr if verbose is non-null
-#
-errtrace ()
-{
- [ -n "$verbose" ] && msg "$@" >&2
-}
-
-
-synopsis="regression.sh"
-progname=`basename $0`
-
-numOfTestsOK=0
-numOfTestsFailed=0
-
-LOG=regression-$1.`date '+%Y-%m-%d'`
-
-executeTest()
-{
- eval "$@" | tee -a $LOG
-
- if [ $? -eq 0 ]
- then
- echo "SUCCESS: $@"
- numOfTestsOK=`expr $numOfTestsOK + 1`
- else
- echo "FAILED: $@"
- numOfTestsFailed=`expr $numOfTestsFailed + 1`
- fi
-}
-
-#
-# INFO
-#
-trace "Starting: `date`"
-trace "NDB_TOP = $NDB_TOP"
-
-#
-# THE TESTS TO EXECUTE
-#
-
-# BASIC FUNCTIONALITY
-if [ $1 = "basic" ]
-then
-executeTest 'testBasic -n PkRead'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n PkUpdate'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n PkDelete'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n PkInsert'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n UpdateAndRead'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n PkReadAndLocker' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n PkReadAndLocker2' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n PkReadUpdateAndLocker' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n ReadWithLocksAndInserts' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n PkInsertTwice' T1 T6 T10
-executeTest 'drop_tab' T1 T6 T10
-
-executeTest 'testBasic -n PkDirtyRead'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasic -n Fill' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n Fill' T1
-executeTest 'drop_tab' T1
-
-executeTest 'testBasic -n NoCommitSleep' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n NoCommit626' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n NoCommitAndClose' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n Commit626' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n CommitTry626' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n CommitAsMuch626' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n NoCommit626' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n NoCommitRollback626' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n Commit630' T1 T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n CommitTry630' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n CommitAsMuch630' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n NoCommit630' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n NoCommitRollback630' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n NoCommitAndClose' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n RollbackUpdate' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n RollbackDeleteMultiple' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n ImplicitRollbackDelete' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n CommitDelete' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n RollbackNothing' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testBasic -n ReadConsistency' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testBasic -n PkRead' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-executeTest 'drop_tab' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-
-executeTest 'testBasic -n PkUpdate' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-executeTest 'drop_tab' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-
-executeTest 'testBasic -n PkDelete' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-executeTest 'drop_tab' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-
-executeTest 'testBasic -n PkInsert' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_409
-executeTest 'drop_tab' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-
-executeTest 'testBasic -n UpdateAndRead' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-#executeTest 'drop_tab' TPK_33 TPK_34 TPK_1003 TPK_2003 TPK_4092
-
-executeTest 'testBasicAsynch -n PkInsertAsynch'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasicAsynch -n PkReadAsynch'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasicAsynch -n PkUpdateAsynch'
-executeTest 'drop_all_tabs'
-
-executeTest 'testBasicAsynch -n PkDeleteAsynch'
-executeTest 'drop_all_tabs'
-fi
-
-# SCAN TESTS
-if [ $1 = "scan" ]
-then
-executeTest 'testScan -n ScanRead16'
-executeTest 'drop_all_tabs'
-
-executeTest 'testScan -n ScanRead240'
-executeTest 'drop_all_tabs'
-
-executeTest 'testScan -n ScanUpdate'
-executeTest 'drop_all_tabs'
-
-executeTest 'testScan -n ScanUpdate2' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanDelete'
-executeTest 'drop_all_tabs'
-
-executeTest 'testScan -n ScanDelete2' T10
-executeTest 'drop_tab' T10
-
-executeTest 'testScan -n ScanUpdateAndScanRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadAndLocker' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadAndPkRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanRead488' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanWithLocksAndInserts' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadAbort' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadAbort15' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadAbort240' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanUpdateAbort16' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanReadRestart' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ScanUpdateRestart' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n CheckGetValue' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n CloseWithoutStop' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n NextScanWhenNoMore' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n ExecuteScanWithoutOpenScan' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n OnlyOpenScanOnce' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n OnlyOneOpInScanTrans' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n OnlyOneOpBeforeOpenScan' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n OnlyOneScanPerTrans' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n NoCloseTransaction' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n CheckInactivityTimeOut' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n CheckInactivityBeforeClose' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testScan -n CheckAfterTerror' T6
-executeTest 'drop_tab' T6
-fi
-
-
-# DICT TESTS
-if [ $1 = "dict" ]
-then
-executeTest 'testDict -n CreateAndDrop'
-executeTest 'drop_all_tabs'
-
-executeTest 'testDict -n CreateAndDropWithData'
-executeTest 'drop_all_tabs'
-
-executeTest 'testDict -n CreateAndDropDuring' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testDict -n CreateInvalidTables'
-executeTest 'drop_all_tabs'
-
-executeTest 'testDict -n CreateTableWhenDbIsFull' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testDict -n CreateMaxTables' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testDict -n FragmentTypeAll' T1 T6 T7 T8
-executeTest 'drop_tab' T1 T6 T7 T8
-
-executeTest 'testDict -n FragmentTypeAllLarge' T1 T6 T7 T8
-executeTest 'drop_tab' T1 T6 T7 T8
-
-executeTest 'testDict -n TemporaryTables' T1 T6 T7 T8
-executeTest 'drop_tab' T1 T6 T7 T8
-fi
-
-# TEST NDBAPI
-if [ $1 = "api" ]
-then
-executeTest 'testNdbApi -n MaxNdb' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n MaxTransactions' T1 T6 T7 T8 T13
-executeTest 'drop_tab' T1 T6 T7 T8 T13
-
-executeTest 'testNdbApi -n MaxOperations' T1 T6 T7 T8 T1
-executeTest 'drop_tab' T1 T6 T7 T8 T13
-
-executeTest 'testNdbApi -n MaxGetValue' T1 T6 T7 T8 T13
-executeTest 'drop_tab' T1 T6 T7 T8 T13
-
-executeTest 'testNdbApi -n MaxEqual'
-executeTest 'drop_all_tabs'
-
-executeTest 'testNdbApi -n DeleteNdb' T1 T6
-executeTest 'drop_tab' T1 T6
-
-executeTest 'testNdbApi -n WaitUntilReady' T1 T6 T7 T8 T13
-executeTest 'drop_tab' T1 T6 T7 T8 T13
-
-executeTest 'testNdbApi -n GetOperationNoTab' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n NdbErrorOperation' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n MissingOperation' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n GetValueInUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n UpdateWithoutKeys' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testNdbApi -n UpdateWithoutValues' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadReadEx' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadInsert' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadDelete' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadExRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadExReadEx' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadExInsert' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadExUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n ReadExDelete' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n InsertRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n InsertReadEx' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n InsertInsert' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n InsertUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n InsertDelete' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n UpdateRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n UpdateReadEx' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n UpdateInsert' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n UpdateUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n UpdateDelete' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n DeleteRead' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n DeleteReadEx' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n DeleteInsert' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n DeleteUpdate' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testOperations -n DeleteDelete' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testRestartGci' T6
-executeTest 'drop_tab' T6
-
-executeTest 'testIndex -n CreateAll'
-executeTest 'drop_all_tabs'
-
-executeTest 'testIndex -n InsertDeleteGentle' T1 T6 T8 T10
-executeTest 'drop_tab' T1 T6 T8 T10
-
-executeTest 'testIndex -n InsertDelete' T1 T6 T8 T10
-executeTest 'drop_tab' T1 T6 T8 T10
-
-executeTest 'testIndex -n CreateLoadDropGentle' T1 T6 T8 T10
-executeTest 'drop_tab' T1 T6 T8 T10
-
-executeTest 'testIndex -n CreateLoadDrop' T1 T6 T8 T10
-executeTest 'drop_tab' T1 T6 T8 T10
-
-executeTest 'testBackup' -n BackupOne
-
-executeTest 'testBackup' -n BackupBank T6
-executeTest 'drop_tab' T6
-fi
-
-# TEST SYSTEM RESTARTS
-if [ $1 = "sr" ]
-then
-executeTest 'testSystemRestart -n SR1' T1
-executeTest 'testSystemRestart -n SR1' T6
-executeTest 'testSystemRestart -n SR1' T7
-executeTest 'testSystemRestart -n SR1' T8
-executeTest 'testSystemRestart -n SR1' T10
-executeTest 'testSystemRestart -n SR2' T1
-executeTest 'testSystemRestart -n SR2' T6
-executeTest 'testSystemRestart -n SR2' T7
-executeTest 'testSystemRestart -n SR2' T10
-executeTest 'testSystemRestart -n SR2' T13
-executeTest 'testSystemRestart -n SR3' T6
-executeTest 'testSystemRestart -n SR3' T10
-executeTest 'testSystemRestart -n SR4' T6
-executeTest 'testSystemRestart -n SR_UNDO' T1
-executeTest 'testSystemRestart -n SR_UNDO' T6
-executeTest 'testSystemRestart -n SR_UNDO' T7
-executeTest 'testSystemRestart -n SR_UNDO' T8
-executeTest 'testSystemRestart -n SR_UNDO' T10
-executeTest 'drop_tab' T1 T6 T7 T8 T10
-fi
-
-# TEST NODE RESTARTS
-if [ $1 = "nr" ]
-then
-executeTest 'testNodeRestart -n NoLoad' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n PkRead' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n PkReadPkUpdate' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n ReadUpdateScan' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n Terror' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n FullDb' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartRandomNode' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartRandomNodeError' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartRandomNodeInitial' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartNFDuringNR' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartNodeDuringLCP' T6 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartMasterNodeError' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n TwoNodeFailure' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n TwoMasterNodeFailure' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n FiftyPercentFail' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartAllNodes' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartAllNodesAbort' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n RestartAllNodesError9999' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-executeTest 'testNodeRestart -n FiftyPercentStopAndWait' T6 T8 T13
-executeTest 'drop_tab' T6 T8 T13
-
-fi
-
-# TESTS FINISHED
-trace "Finished: `date`"
-
-#
-# TEST SUMMARY
-#
-if [ $numOfTestsFailed -eq 0 ]
-then
- echo "-- REGRESSION TEST SUCCESSFUL --"
-else
- echo "-- REGRESSION TEST FAILED!! --"
-fi
-echo "Number of successful tests: $numOfTestsOK"
-echo "Number of failed tests : $numOfTestsFailed"
diff --git a/ndb/config/Defs.DEBUG.mk b/ndb/config/Defs.DEBUG.mk
deleted file mode 100644
index 309ae90a0ba..00000000000
--- a/ndb/config/Defs.DEBUG.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-
-VERSION_FLAGS := -DNDB_DEBUG -DUSE_EMULATED_JAM -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD
-#-DDEBUG_TRANSPORTER
-
diff --git a/ndb/config/Defs.HPUX.HPPA.GCC.mk b/ndb/config/Defs.HPUX.HPPA.GCC.mk
deleted file mode 100644
index 895c7672071..00000000000
--- a/ndb/config/Defs.HPUX.HPPA.GCC.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := ar rcs
-SO := ld -b -o
-
-SHLIBEXT := sl
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -MA -C -N
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic
-# -Wno-sign-compare Use this flag if you are annoyed with all the warnings
-CCFLAGS_TOP = -DHPUX -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lnsl -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
diff --git a/ndb/config/Defs.IBMAIX.POWERPC.GCC.mk b/ndb/config/Defs.IBMAIX.POWERPC.GCC.mk
deleted file mode 100644
index ae975fb2cb8..00000000000
--- a/ndb/config/Defs.IBMAIX.POWERPC.GCC.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -Wall #-pedantic
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-CCFLAGS_TOP += -fno-rtti
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
diff --git a/ndb/config/Defs.LINUX.x86.GCC.mk b/ndb/config/Defs.LINUX.x86.GCC.mk
deleted file mode 100644
index 6167a30ff23..00000000000
--- a/ndb/config/Defs.LINUX.x86.GCC.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := gcc$(GCC_VERSION)
-CC := gcc$(GCC_VERSION)
-AR_RCS := $(PURE) ar rcs
-SO := gcc$(GCC_VERSION) -shared -lpthread -o
-#SO := gcc$(GCC_VERSION) -shared -o
-
-MAKEDEPEND := gcc$(GCC_VERSION) -M
-#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-# gcc3.3 __THROW problem if -pedantic and -O2
-ifeq ($(NDB_VERSION),DEBUG)
-CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic
-else
-CCFLAGS_WARNINGS = -Wno-long-long -Wall
-endif
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP =
-#CCFLAGS_TOP = -DSAFE_MUTEX
-CCFLAGS_TOP += -fno-rtti -fno-exceptions
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O2
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O2 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp
-#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread
diff --git a/ndb/config/Defs.LINUX.x86.ICC.mk b/ndb/config/Defs.LINUX.x86.ICC.mk
deleted file mode 100644
index 8e8540409da..00000000000
--- a/ndb/config/Defs.LINUX.x86.ICC.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := icc
-CC := icc
-AR_RCS := $(PURE) ar rcs
-SO := g++$(GCC_VERSION) -shared -lpthread -o
-
-MAKEDEPEND := g++$(GCC_VERSION) -M
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-# gcc3.3 __THROW problem if -pedantic and -O2
-ifeq ($(NDB_VERSION),DEBUG)
-CCFLAGS_WARNINGS =
-else
-CCFLAGS_WARNINGS =
-endif
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-CCFLAGS_TOP +=
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O2
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O2 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
diff --git a/ndb/config/Defs.LINUX.x86_64.GCC.mk b/ndb/config/Defs.LINUX.x86_64.GCC.mk
deleted file mode 100644
index a238d29ef4c..00000000000
--- a/ndb/config/Defs.LINUX.x86_64.GCC.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -lpthread -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-# gcc3.3 __THROW problem if -pedantic and -O2
-ifeq ($(NDB_VERSION),DEBUG)
-CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic
-else
-CCFLAGS_WARNINGS = -Wno-long-long -Wall
-endif
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-CCFLAGS_TOP += -fno-rtti -fno-exceptions -m64
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O2
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O2 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
diff --git a/ndb/config/Defs.MACOSX.POWERPC.GCC.mk b/ndb/config/Defs.MACOSX.POWERPC.GCC.mk
deleted file mode 100644
index bb73e9bcc61..00000000000
--- a/ndb/config/Defs.MACOSX.POWERPC.GCC.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := gcc
-CC := gcc
-CXX := gcc
-AR_RCS := $(PURE) ar rcs
-#SO := g++ -dynamiclib -Wl,-segprot,__TEXT,rwx,rwx -o
-SO := gcc -dynamiclib -o
-
-SHLIBEXT := dylib
-
-MAKEDEPEND := gcc -M
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -Wall -Winline #-Werror#-pedantic
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_BIG_ENDIAN
-CXX_FLAGS_TOP = -fno-rtti -felide-constructors -fno-exceptions -fno-omit-fram-pointer
-C_FLAGS_TOP += -fno-omit-frame-pointer
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(CXXFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(C_FLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-#LDFLAGS_LAST = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-LDFLAGS_LAST = -lstdc++
-
diff --git a/ndb/config/Defs.OSE.PPC750.DIAB.mk b/ndb/config/Defs.OSE.PPC750.DIAB.mk
deleted file mode 100644
index 8773021a152..00000000000
--- a/ndb/config/Defs.OSE.PPC750.DIAB.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := dplus
-CC := dcc
-AR_RCS := $(PURE) ar rcs
-SO := dar -r
-
-MAKEDEPEND := g++ -M -nostdinc
-PIC :=
-
-RPCGENFLAGS := -MA -C -N
-
-###
-#
-# Flags
-#
-CCFLAGS_INCLUDE = -I/vobs/cello/cls/rtosi_if/include -I/vobs/cello/cls/rtosi_if/include.mp750 -I/vobs/cello/cls/rtosi_if/include.ppc
-CCFLAGS_TOP = -tPPC750EH -DBIG_ENDIAN -D_BIG_ENDIAN -DPPC -DPPC750 -DOSE_DELTA -DMP -Xlint -Xforce-prototypes -DINLINE=__inline__ -Xansi -Xsmall-data=0 -Xsmall-const=0 -Xstrings-in-text
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -XO
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -XO -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_INCLUDE)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_INCLUDE)
-
-LDFLAGS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-
-
diff --git a/ndb/config/Defs.RELEASE.mk b/ndb/config/Defs.RELEASE.mk
deleted file mode 100644
index fad72d53a43..00000000000
--- a/ndb/config/Defs.RELEASE.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-
-VERSION_FLAGS := -DNDB_RELEASE -DUSE_EMULATED_JAM -DNDEBUG
-
diff --git a/ndb/config/Defs.RELEASE_TRACE.mk b/ndb/config/Defs.RELEASE_TRACE.mk
deleted file mode 100644
index 06726f282e4..00000000000
--- a/ndb/config/Defs.RELEASE_TRACE.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-
-VERSION_FLAGS := -DNDB_RELEASE -DUSE_EMULATED_JAM -DNDEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD
-
diff --git a/ndb/config/Defs.SIMCELLO.SOFTOSE.GCC.mk b/ndb/config/Defs.SIMCELLO.SOFTOSE.GCC.mk
deleted file mode 100644
index 8d73e7a752b..00000000000
--- a/ndb/config/Defs.SIMCELLO.SOFTOSE.GCC.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-###
-#
-# Flags
-#
-NDB_STRDUP := Y
-CCFLAGS_WARNINGS = -Wall -pedantic -Wno-sign-compare
-CC_FLAGS_OSE = -DSPARC -DSIM -DOSE_DELTA -DMP
-CCFLAGS_TOP = $(CC_FLAGS_OSE) $(CC_FLAGS_WARNINGS) -DNDB_STRDUP
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-
-CCFLAGS_LOC_OSE= -I/vobs/cello/cls/rtosi_if/include.sparc
-
-
-CCFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDLIBS_LOC = -L$(NDB_TOP)/lib -L$(OSE_LOC)/sfk-solaris2/lib -L$(OSE_LOC)/sfk-solaris2/krn-solaris2/lib
-
-LDLIBS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(LDFLAGS)
-
-
-
diff --git a/ndb/config/Defs.SOFTOSE.SPARC.GCC.mk b/ndb/config/Defs.SOFTOSE.SPARC.GCC.mk
deleted file mode 100644
index 6788fa956bf..00000000000
--- a/ndb/config/Defs.SOFTOSE.SPARC.GCC.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-###
-#
-# Flags
-#
-NDB_STRDUP := Y
-CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic -Wno-sign-compare -ansi
-CC_FLAGS_OSE = -DUSE_OSEDEF_H -DOSE_DELTA -DOS_DEBUG -DBIG_ENDIAN
-CCFLAGS_TOP = $(CC_FLAGS_OSE) $(CC_FLAGS_WARNINGS) -DNDB_STRDUP
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g -DOS_DEBUG
-endif
-endif
-
-OSE_LOC = /opt/as/OSE/OSE4.3.1
-
-CCFLAGS_LOC_OSESTD = -I$(OSE_LOC)/sfk-solaris2/std-include
-CCFLAGS_LOC_OSE = -I$(OSE_LOC)/sfk-solaris2/include -I$(OSE_LOC)/sfk-solaris2/krn-solaris2/include -I$(NDB_TOP)/src/env/softose
-
-
-CCFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC_OSESTD) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC_OSESTD) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDLIBS_LOC = -L$(NDB_TOP)/lib -L$(OSE_LOC)/sfk-solaris2/lib -L$(OSE_LOC)/sfk-solaris2/krn-solaris2/lib
-
-LDLIBS_TOP =
-
-LDLIBS_LAST = -lsoftose_env -lsoftose_krn -llnh -lefs -lshell -lfss -ltosv -lrtc -lheap -linetutil -linetapi -lsoftose -lsoftose_env -lsoftose_krn -losepthread -lrtc -lnsl -lsocket -lpthread -lcrt -lm
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(LDFLAGS)
-
-
-
diff --git a/ndb/config/Defs.SOLARIS.SPARC.FORTE6.mk b/ndb/config/Defs.SOLARIS.SPARC.FORTE6.mk
deleted file mode 100644
index 8a95205703d..00000000000
--- a/ndb/config/Defs.SOLARIS.SPARC.FORTE6.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := CC
-CC := /opt/as/forte6/SUNWspro/bin/cc
-AR_RCS := $(PURE) CC -xar -o
-SO := CC -G -z text -o
-
-MAKEDEPEND := CC -xM1
-PIC := -KPIC
-ETAGS := etags
-CTAGS := ctags
-
-RPCGENFLAGS := -MA -C -N
-
-###
-#
-# Flags
-
-CCFLAGS_TOP = -mt -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-
-ifneq ($(PURE),)
- CCFLAGS_TOP += -xs
- CCFLAGS_TOP += -DNDB_PURIFY
-endif
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -xO3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -xO3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS)
-
-LDFLAGS_TOP = -L/opt/as/forte6/SUNWspro/WS6/lib -lpthread -lsocket -lnsl -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) -xildoff $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-
-
-
diff --git a/ndb/config/Defs.SOLARIS.SPARC.GCC.mk b/ndb/config/Defs.SOLARIS.SPARC.GCC.mk
deleted file mode 100644
index 25920515278..00000000000
--- a/ndb/config/Defs.SOLARIS.SPARC.GCC.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-CXX := gcc
-C++ := g++
-CC := gcc
-AR_RCS := ar rcs
-SO := gcc -G -o
-
-#GXX_VERSION := $(shell gcc --version | sed -e 's,.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*,\1,1' -e q)
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -MA -C -N
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic
-# -Wno-sign-compare Use this flag if you are annoyed with all the warnings
-CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER
-CCFLAGS_TOP += -fno-rtti
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O2
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O2 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(CXX) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-LDFLAGS_LAST = -lpthread -lsocket -lnsl -lrt -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-
diff --git a/ndb/config/Defs.SOLARIS.SPARC_64.GCC.mk b/ndb/config/Defs.SOLARIS.SPARC_64.GCC.mk
deleted file mode 100644
index 2b8b9d4cc24..00000000000
--- a/ndb/config/Defs.SOLARIS.SPARC_64.GCC.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-###
-#
-# Note: LD_LIBRARY_PATH must be set for /usr/local/lib/sparcv9 to dynamically link
-# to 64-bit libraries
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++ -m64
-CC := gcc -m64
-AR_RCS := ar rcs
-SO := g++ -m64 -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -MA -C -N
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic
-# -Wno-sign-compare Use this flag if you are annoyed with all the warnings
-CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER
-CCFLAGS_TOP += -fno-rtti
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O2
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O2 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lsocket -lnsl -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-
diff --git a/ndb/config/Defs.SOLARIS6.SPARC.GCC.mk b/ndb/config/Defs.SOLARIS6.SPARC.GCC.mk
deleted file mode 100644
index f1c570ba101..00000000000
--- a/ndb/config/Defs.SOLARIS6.SPARC.GCC.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -MA -C -N
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic
-# -Wno-sign-compare Use this flag if you are annoyed with all the warnings
-CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER
-
-# SOLARIS 6 should use the same settings as SOLARIS7
-# if something in the SOLARIS 7 port does not work for SOLARIS 6
-# it can be ifdefed using
-# if ! defined NDB_SOLRIS6
-CCFLAGS_TOP = -DNDB_SOLARIS
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lsocket -lnsl -lposix4
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
-
-
diff --git a/ndb/config/Defs.TRU64X.ALPHA.GCC.mk b/ndb/config/Defs.TRU64X.ALPHA.GCC.mk
deleted file mode 100644
index ae975fb2cb8..00000000000
--- a/ndb/config/Defs.TRU64X.ALPHA.GCC.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-C++ := g++
-CC := gcc
-AR_RCS := $(PURE) ar rcs
-SO := g++ -shared -o
-
-MAKEDEPEND := g++ -M
-PIC := -fPIC
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS = -Wno-long-long -Wall #-pedantic
-# Add these for more warnings -Weffc++ -W
-CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-CCFLAGS_TOP += -fno-rtti
-
-ifeq (RELEASE, $(NDB_VERSION))
-VERSION_FLAGS += -O3
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-VERSION_FLAGS += -O3 -g
-else
-VERSION_FLAGS += -g
-endif
-endif
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP = -lpthread -lrt
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS)
-
-LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
diff --git a/ndb/config/Defs.WIN32.x86.VC7.mk b/ndb/config/Defs.WIN32.x86.VC7.mk
deleted file mode 100644
index e66dacb78e7..00000000000
--- a/ndb/config/Defs.WIN32.x86.VC7.mk
+++ /dev/null
@@ -1,61 +0,0 @@
-###
-#
-# Defines
-SHELL := /bin/sh
-
-
-DEFINES = -D_WIN32 -D_M_IX86=600 -D_MSC_EXTENSIONS=0 -U_cdecl -D_MT
-#
-MAKEDEPEND = g++ -M --nostdinc --nostdinc++ -I"`cygpath -u "$(MSVCDIR)\include"`" -I"`cygpath -u "$(MSVCDIR)\PlatformSDK\include"`" $(DEFINES)
-PIC = -D_LIB
-NON_PIC = -D_LIB
-
-RPCGENFLAGS := -M -C -N
-
-ETAGS := etags
-CTAGS := ctags
-
-###
-#
-# Flags
-#
-CCFLAGS_WARNINGS =
-CCFLAGS_TOP =
-CCFLAGS_LOC =
-CCFLAGS_WIN = -DWIN32 -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -D_MBCS -DNO_COMMAND_HANDLER
-CCFLAGS_WIN += -W3 -EHsc
-#CCFLAGS_WIN += -clr
-
-ifeq (RELEASE, $(NDB_VERSION))
-CCFLAGS_WIN += -MT -O2 -Ob1 -DNO_DEBUG_MESSAGES
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-CCFLAGS_WIN += -MT -O2 -Ob1 -DNO_DEBUG_MESSAGES
-else
-CCFLAGS_WIN += -MTd -Zi -Od -GS -D_DEBUG
-endif
-endif
-
-C++ = cl -nologo $(CCFLAGS_WIN)
-CC = cl -nologo $(CCFLAGS_WIN)
-
-CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS)
-
-LDFLAGS_TOP =
-
-LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP)
-
-LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP)
-
-WIN_LIBS := Ws2_32.lib Advapi32.lib
-
-ifeq (RELEASE, $(NDB_VERSION))
-LINK.cc = link -INCREMENTAL:NO -NOLOGO -LARGEADDRESSAWARE $(WIN_LIBS)
-else
-ifeq (RELEASE_TRACE, $(NDB_VERSION))
-LINK.cc = link -INCREMENTAL:NO -NOLOGO -LARGEADDRESSAWARE $(WIN_LIBS)
-else
-LINK.cc = link -INCREMENTAL -NOLOGO -DEBUG -LARGEADDRESSAWARE $(WIN_LIBS)
-endif
-endif
diff --git a/ndb/config/GuessConfig.sh b/ndb/config/GuessConfig.sh
deleted file mode 100755
index 3caeeaae6d0..00000000000
--- a/ndb/config/GuessConfig.sh
+++ /dev/null
@@ -1,115 +0,0 @@
-#! /bin/sh
-
-if [ -z "$NDB_TOP" ]
-then
- echo "You have not set NDB_TOP. Exiting" 1>&2
- exit 1
-fi
-
-if [ -z "$NDB_SCI" ]
-then
- NDB_SCI=N
-fi
-
-if [ -z "$NDB_SHM" ]
-then
- NDB_SHM=N
-fi
-
-os=`uname -s`
-case $os in
-Linux)
- NDB_OS=LINUX
- NDB_ARCH=x86
- NDB_COMPILER=GCC
- ;;
-Darwin)
- NDB_OS=MACOSX
- NDB_ARCH=POWERPC
- NDB_COMPILER=GCC
- ;;
-HP-UX)
- NDB_OS=HPUX
- NDB_ARCH=HPPA
- NDB_COMPILER=GCC
- ;;
-CYGWIN_NT-5.0)
- NDB_OS=WIN32
- NDB_ARCH=x86
- NDB_COMPILER=VC7
- ;;
-*)
- if [ "$os" = "SunOS" ] && [ `uname -r` = "5.6" ]
- then
- NDB_OS=OSE
- NDB_ARCH=PPC750
- NDB_COMPILER=DIAB
- else
- NDB_OS=SOLARIS
- NDB_ARCH=SPARC
- NDB_COMPILER=GCC
- fi;;
-esac
-
-if [ -z "$NDB_ODBC" ]
-then
- NDB_ODBC=N
-fi
-
-
-mch=`uname -m`
-case $mch in
-x86_64)
- NDB_ARCH=x86_64
- ;;
-*)
- ;;
-esac
-
-if [ -f $NDB_TOP/config/Makefile ]
-then
-TERMCAP_LIB=`grep TERMCAP_LIB $NDB_TOP/config/Makefile | sed -e s,"TERMCAP_LIB.*=.*-l","",g`
-fi
-if [ "$TERMCAP_LIB" = "" ]
-then
-TERMCAP_LIB=termcap
-fi
-
-# defaults
-NDB_VERSION=DEBUG
-PACKAGE=
-VERSION=
-
-parse_arguments() {
- for arg do
- case "$arg" in
- -GCC) NDB_COMPILER=GCC ;;
- -R) NDB_VERSION=RELEASE ;;
- -D) NDB_VERSION=DEBUG ;;
- --PACKAGE=*) PACKAGE=`echo "$arg" | sed -e "s;--PACKAGE=;;"` ;;
- --VERSION=*) VERSION=`echo "$arg" | sed -e "s;--VERSION=;;"` ;;
- *)
- echo "Unknown argument '$arg'"
- exit 1
- ;;
- esac
- done
-}
-
-parse_arguments "$@"
-
-(
- echo "# This file was automatically generated `date`"
- echo "NDB_OS := $NDB_OS"
- echo "NDB_ARCH := $NDB_ARCH"
- echo "NDB_COMPILER := $NDB_COMPILER"
- echo "NDB_VERSION := $NDB_VERSION"
- echo "NDB_SCI := $NDB_SCI"
- echo "NDB_ODBC := $NDB_ODBC"
- echo "TERMCAP_LIB := $TERMCAP_LIB"
- echo "PACKAGE := $PACKAGE"
- echo "VERSION := $VERSION"
-) > $NDB_TOP/config/config.mk
-
-exit 0
-
diff --git a/ndb/config/Makefile.am b/ndb/config/Makefile.am
deleted file mode 100644
index b5fd81814a1..00000000000
--- a/ndb/config/Makefile.am
+++ /dev/null
@@ -1,31 +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
-
-# Process this file with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS = foreign
-
-# These are built from source in the Docs directory
-EXTRA_DIST =
-SUBDIRS =
-
-# Relink after clean
-linked_sources =
-
-CLEANFILES = $(linked_sources)
-
-# This is just so that the linking is done early.
-config.h:
diff --git a/ndb/config/acinclude.m4 b/ndb/config/acinclude.m4
deleted file mode 100644
index b9edaf801ed..00000000000
--- a/ndb/config/acinclude.m4
+++ /dev/null
@@ -1,1513 +0,0 @@
-# Local macros for automake & autoconf
-
-AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[
- AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface,
- AC_TRY_COMPILE(
- [
- #include "stdio.h"
- #include "readline/readline.h"
- ],
- [
- char res= *(*rl_completion_entry_function)(0,0);
- completion_matches(0,0);
- ],
- [
- mysql_cv_libedit_interface=yes
- AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
- ],
- [mysql_cv_libedit_interface=no]
- )
- )
-])
-
-AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[
- AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface,
- AC_TRY_COMPILE(
- [
- #include "stdio.h"
- #include "readline/readline.h"
- ],
- [
- rl_completion_func_t *func1= (rl_completion_func_t*)0;
- rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
- ],
- [
- mysql_cv_new_rl_interface=yes
- AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE)
- ],
- [mysql_cv_new_rl_interface=no]
- )
- )
-])
-
-# A local version of AC_CHECK_SIZEOF that includes sys/types.h
-dnl MYSQL_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
-AC_DEFUN(MYSQL_CHECK_SIZEOF,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof($1));
- exit(0);
-}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
-
-#---START: Used in for client configure
-AC_DEFUN(MYSQL_TYPE_ACCEPT,
-[ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes"
-then
- CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
-fi
-mysql_cv_btype_last_arg_accept=none
-[AC_TRY_COMPILE([#if defined(inline)
-#undef inline
-#endif
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0);],
-mysql_cv_btype_last_arg_accept=socklen_t)]
-if test "$mysql_cv_btype_last_arg_accept" = "none"; then
-[AC_TRY_COMPILE([#if defined(inline)
-#undef inline
-#endif
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);],
-mysql_cv_btype_last_arg_accept=size_t)]
-fi
-if test "$mysql_cv_btype_last_arg_accept" = "none"; then
-mysql_cv_btype_last_arg_accept=int
-fi)
-AC_LANG_RESTORE
-AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $mysql_cv_btype_last_arg_accept)
-CXXFLAGS="$ac_save_CXXFLAGS"
-])
-#---END:
-
-dnl Find type of qsort
-AC_DEFUN(MYSQL_TYPE_QSORT,
-[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
-[AC_TRY_COMPILE([#include <stdlib.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-void qsort(void *base, size_t nel, size_t width,
- int (*compar) (const void *, const void *));
-],
-[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)])
-AC_DEFINE_UNQUOTED(RETQSORTTYPE, $mysql_cv_type_qsort)
-if test "$mysql_cv_type_qsort" = "void"
-then
- AC_DEFINE_UNQUOTED(QSORT_TYPE_IS_VOID, 1)
-fi
-])
-
-AC_DEFUN(MYSQL_TIMESPEC_TS,
-[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts,
-[AC_TRY_COMPILE([#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[struct timespec abstime;
-
-abstime.ts_sec = time(NULL)+1;
-abstime.ts_nsec = 0;
-], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
-if test "$mysql_cv_timespec_ts" = "yes"
-then
- AC_DEFINE(HAVE_TIMESPEC_TS_SEC)
-fi
-])
-
-AC_DEFUN(MYSQL_TZNAME,
-[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
-[AC_TRY_COMPILE([#include <time.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[ tzset();
- return tzname[0] != 0;
-], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
-if test "$mysql_cv_tzname" = "yes"
-then
- AC_DEFINE(HAVE_TZNAME)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [
-save_LIBS="$LIBS"
-LIBS="-l$1 $LIBS"
-AC_CACHE_CHECK([if libz with compress], mysql_cv_compress,
-[AC_TRY_RUN([#include <zlib.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-int main(int argv, char **argc)
-{
- return 0;
-}
-
-int link_test()
-{
- return compress(0, (unsigned long*) 0, "", 0);
-}
-], mysql_cv_compress=yes, mysql_cv_compress=no)])
-if test "$mysql_cv_compress" = "yes"
-then
- AC_DEFINE(HAVE_COMPRESS)
-else
- LIBS="$save_LIBS"
-fi
-])
-
-#---START: Used in for client configure
-AC_DEFUN(MYSQL_CHECK_ULONG,
-[AC_MSG_CHECKING(for type ulong)
-AC_CACHE_VAL(ac_cv_ulong,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- ulong foo;
- foo++;
- exit(0);
-}], ac_cv_ulong=yes, ac_cv_ulong=no, ac_cv_ulong=no)])
-AC_MSG_RESULT($ac_cv_ulong)
-if test "$ac_cv_ulong" = "yes"
-then
- AC_DEFINE(HAVE_ULONG)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_UCHAR,
-[AC_MSG_CHECKING(for type uchar)
-AC_CACHE_VAL(ac_cv_uchar,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- uchar foo;
- foo++;
- exit(0);
-}], ac_cv_uchar=yes, ac_cv_uchar=no, ac_cv_uchar=no)])
-AC_MSG_RESULT($ac_cv_uchar)
-if test "$ac_cv_uchar" = "yes"
-then
- AC_DEFINE(HAVE_UCHAR)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_UINT,
-[AC_MSG_CHECKING(for type uint)
-AC_CACHE_VAL(ac_cv_uint,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- uint foo;
- foo++;
- exit(0);
-}], ac_cv_uint=yes, ac_cv_uint=no, ac_cv_uint=no)])
-AC_MSG_RESULT($ac_cv_uint)
-if test "$ac_cv_uint" = "yes"
-then
- AC_DEFINE(HAVE_UINT)
-fi
-])
-
-
-AC_DEFUN(MYSQL_CHECK_IN_ADDR_T,
-[AC_MSG_CHECKING(for type in_addr_t)
-AC_CACHE_VAL(ac_cv_in_addr_t,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-int main(int argc, char **argv)
-{
- in_addr_t foo;
- exit(0);
-}], ac_cv_in_addr_t=yes, ac_cv_in_addr_t=no, ac_cv_in_addr_t=no)])
-AC_MSG_RESULT($ac_cv_in_addr_t)
-if test "$ac_cv_in_addr_t" = "yes"
-then
- AC_DEFINE(HAVE_IN_ADDR_T)
-fi
-])
-
-
-AC_DEFUN(MYSQL_PTHREAD_YIELD,
-[AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
-[AC_TRY_LINK([#define _GNU_SOURCE
-#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[
- pthread_yield();
-], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
-if test "$ac_cv_pthread_yield_zero_arg" = "yes"
-then
- AC_DEFINE(HAVE_PTHREAD_YIELD_ZERO_ARG)
-fi
-]
-[AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
-[AC_TRY_LINK([#define _GNU_SOURCE
-#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[
- pthread_yield(0);
-], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
-if test "$ac_cv_pthread_yield_one_arg" = "yes"
-then
- AC_DEFINE(HAVE_PTHREAD_YIELD_ONE_ARG)
-fi
-]
-)
-
-
-
-#---END:
-
-AC_DEFUN(MYSQL_CHECK_FP_EXCEPT,
-[AC_MSG_CHECKING(for type fp_except)
-AC_CACHE_VAL(ac_cv_fp_except,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-#include <ieeefp.h>
-main()
-{
- fp_except foo;
- foo++;
- exit(0);
-}], ac_cv_fp_except=yes, ac_cv_fp_except=no, ac_cv_fp_except=no)])
-AC_MSG_RESULT($ac_cv_fp_except)
-if test "$ac_cv_fp_except" = "yes"
-then
- AC_DEFINE(HAVE_FP_EXCEPT)
-fi
-])
-
-# From fileutils-3.14/aclocal.m4
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so. This macro tries various
-# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
-# handles function prototypes correctly.
-#
-# Patched by monty to only check if __STDC__ is defined. With the original
-# check it's impossible to get things to work with the Sunpro compiler from
-# Workshop 4.2
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN(AM_PROG_CC_STDC,
-[AC_REQUIRE([AC_PROG_CC])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it.
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
-do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
-[#if !defined(__STDC__)
-choke me
-#endif
-/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/stat.h>
-#endif
-], [
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-AC_MSG_RESULT($am_cv_prog_cc_stdc)
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
-
-#
-# Check to make sure that the build environment is sane.
-#
-
-AC_DEFUN(AM_SANITY_CHECK,
-[AC_MSG_CHECKING([whether build environment is sane])
-sleep 1
-echo timestamp > conftestfile
-# Do this in a subshell so we don't clobber the current shell's
-# arguments. FIXME: maybe try `-L' hack like GETLOADAVG test?
-if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-rm -f conftest*
-AC_MSG_RESULT(yes)])
-
-# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty.
-
-AC_DEFUN(MYSQL_CHECK_LIB_TERMCAP,
-[
-AC_CACHE_VAL(mysql_cv_termcap_lib,
-[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
- [AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses,
- [AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap,
- mysql_cv_termcap_lib=NOT_FOUND)])])])
-AC_MSG_CHECKING(for termcap functions library)
-if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then
-AC_MSG_ERROR([No curses/termcap library found])
-elif test "$mysql_cv_termcap_lib" = "libtermcap"; then
-TERMCAP_LIB=-ltermcap
-elif test "$mysql_cv_termcap_lib" = "libncurses"; then
-TERMCAP_LIB=-lncurses
-else
-TERMCAP_LIB=-lcurses
-fi
-AC_MSG_RESULT($TERMCAP_LIB)
-])
-
-dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
-AC_DEFUN(MYSQL_SIGNAL_CHECK,
-[AC_REQUIRE([AC_TYPE_SIGNAL])
-AC_MSG_CHECKING(for type of signal functions)
-AC_CACHE_VAL(mysql_cv_signal_vintage,
-[
- AC_TRY_LINK([#include <signal.h>],[
- sigset_t ss;
- struct sigaction sa;
- sigemptyset(&ss); sigsuspend(&ss);
- sigaction(SIGINT, &sa, (struct sigaction *) 0);
- sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
- ], mysql_cv_signal_vintage=posix,
- [
- AC_TRY_LINK([#include <signal.h>], [
- int mask = sigmask(SIGINT);
- sigsetmask(mask); sigblock(mask); sigpause(mask);
- ], mysql_cv_signal_vintage=4.2bsd,
- [
- AC_TRY_LINK([
- #include <signal.h>
- RETSIGTYPE foo() { }], [
- int mask = sigmask(SIGINT);
- sigset(SIGINT, foo); sigrelse(SIGINT);
- sighold(SIGINT); sigpause(SIGINT);
- ], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7
- )]
- )]
-)
-])
-AC_MSG_RESULT($mysql_cv_signal_vintage)
-if test "$mysql_cv_signal_vintage" = posix; then
-AC_DEFINE(HAVE_POSIX_SIGNALS)
-elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then
-AC_DEFINE(HAVE_BSD_SIGNALS)
-elif test "$mysql_cv_signal_vintage" = svr3; then
-AC_DEFINE(HAVE_USG_SIGHOLD)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_GETPW_FUNCS,
-[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
-AC_CACHE_VAL(mysql_cv_can_redecl_getpw,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <pwd.h>
-extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();],
- mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)])
-AC_MSG_RESULT($mysql_cv_can_redecl_getpw)
-if test "$mysql_cv_can_redecl_getpw" = "no"; then
-AC_DEFINE(HAVE_GETPW_DECLS)
-fi
-])
-
-AC_DEFUN(MYSQL_HAVE_TIOCGWINSZ,
-[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
- mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl)
-if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then
-AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
-fi
-])
-
-AC_DEFUN(MYSQL_HAVE_FIONREAD,
-[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = FIONREAD;],
- mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_fionread_in_ioctl)
-if test "$mysql_cv_fionread_in_ioctl" = "yes"; then
-AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
-fi
-])
-
-AC_DEFUN(MYSQL_HAVE_TIOCSTAT,
-[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = TIOCSTAT;],
- mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl)
-if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then
-AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
-fi
-])
-
-AC_DEFUN(MYSQL_STRUCT_DIRENT_D_INO,
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(if struct dirent has a d_ino member)
-AC_CACHE_VAL(mysql_cv_dirent_has_dino,
-[AC_TRY_COMPILE([
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#if defined(HAVE_DIRENT_H)
-# include <dirent.h>
-#else
-# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* SYSNDIR */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* SYSDIR */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif /* HAVE_DIRENT_H */
-],[
-struct dirent d; int z; z = d.d_ino;
-], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)])
-AC_MSG_RESULT($mysql_cv_dirent_has_dino)
-if test "$mysql_cv_dirent_has_dino" = "yes"; then
-AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
-fi
-])
-
-AC_DEFUN(MYSQL_TYPE_SIGHANDLER,
-[AC_MSG_CHECKING([whether signal handlers are of type void])
-AC_CACHE_VAL(mysql_cv_void_sighandler,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C"
-#endif
-void (*signal ()) ();],
-[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl
-AC_MSG_RESULT($mysql_cv_void_sighandler)
-if test "$mysql_cv_void_sighandler" = "yes"; then
-AC_DEFINE(VOID_SIGHANDLER)
-fi
-])
-
-AC_DEFUN(MYSQL_CXX_BOOL,
-[
-AC_REQUIRE([AC_PROG_CXX])
-AC_MSG_CHECKING(if ${CXX} supports bool types)
-AC_CACHE_VAL(mysql_cv_have_bool,
-[
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-AC_TRY_COMPILE(,[bool b = true;],
-mysql_cv_have_bool=yes,
-mysql_cv_have_bool=no)
-AC_LANG_RESTORE
-])
-AC_MSG_RESULT($mysql_cv_have_bool)
-if test "$mysql_cv_have_bool" = yes; then
-AC_DEFINE(HAVE_BOOL)
-fi
-])dnl
-
-AC_DEFUN(MYSQL_STACK_DIRECTION,
- [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
- [AC_TRY_RUN([#include <stdlib.h>
- int find_stack_direction ()
- {
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
- }
- int main ()
- {
- exit (find_stack_direction() < 0);
- }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
- ac_cv_c_stack_direction=0)])
- AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-])dnl
-
-AC_DEFUN(MYSQL_FUNC_ALLOCA,
-[
-# Since we have heard that alloca fails on IRIX never define it on a
-# SGI machine
-if test ! "$host_vendor" = "sgi"
-then
- AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- # for constant arguments. Useless!
- AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h,
- [AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
- ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])
- if test "$ac_cv_header_alloca_h" = "yes"
- then
- AC_DEFINE(HAVE_ALLOCA)
- fi
-
- AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
- [AC_TRY_LINK([
- #ifdef __GNUC__
- # define alloca __builtin_alloca
- #else
- # if HAVE_ALLOCA_H
- # include <alloca.h>
- # else
- # ifdef _AIX
- #pragma alloca
- # else
- # ifndef alloca /* predefined by HP cc +Olibcalls */
- char *alloca ();
- # endif
- # endif
- # endif
- #endif
- ], [char *p = (char *) alloca(1);],
- ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
- if test "$ac_cv_func_alloca_works" = "yes"; then
- AC_DEFINE(HAVE_ALLOCA)
- fi
-
- if test "$ac_cv_func_alloca_works" = "no"; then
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
- AC_DEFINE(C_ALLOCA)
-
- AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
- [AC_EGREP_CPP(webecray,
- [#if defined(CRAY) && ! defined(CRAY2)
- webecray
- #else
- wenotbecray
- #endif
- ], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
- if test "$ac_cv_os_cray" = "yes"; then
- for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func)
- break])
- done
- fi
- fi
- AC_SUBST(ALLOCA)dnl
-else
- AC_MSG_RESULT("Skipped alloca tests")
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_LONGLONG_TO_FLOAT,
-[
-AC_MSG_CHECKING(if conversion of longlong to float works)
-AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
-[AC_TRY_RUN([#include <stdio.h>
-typedef long long longlong;
-main()
-{
- longlong ll=1;
- float f;
- FILE *file=fopen("conftestval", "w");
- f = (float) ll;
- fprintf(file,"%g\n",f);
- fclose(file);
- exit (0);
-}], ac_cv_conv_longlong_to_float=`cat conftestval`, ac_cv_conv_longlong_to_float=0, ifelse([$2], , , ac_cv_conv_longlong_to_float=$2))])dnl
-if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes"
-then
- ac_cv_conv_longlong_to_float=yes
-else
- ac_cv_conv_longlong_to_float=no
-fi
-AC_MSG_RESULT($ac_cv_conv_longlong_to_float)
-])
-
-AC_DEFUN(MYSQL_CHECK_CPU,
-[AC_CACHE_CHECK([if compiler supports optimizations for current cpu],
-mysql_cv_cpu,[
-
-ac_save_CFLAGS="$CFLAGS"
-if test -r /proc/cpuinfo ; then
- cpuinfo="cat /proc/cpuinfo"
- cpu_family=`$cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
- cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
-fi
-if test "$cpu_vendor" = "AuthenticAMD"; then
- if test $cpu_family -ge 6; then
- cpu_set="athlon pentiumpro k5 pentium i486 i386";
- elif test $cpu_family -eq 5; then
- cpu_set="k5 pentium i486 i386";
- elif test $cpu_family -eq 4; then
- cpu_set="i486 i386"
- else
- cpu_set="i386"
- fi
-elif test "$cpu_vendor" = "GenuineIntel"; then
- if test $cpu_family -ge 6; then
- cpu_set="pentiumpro pentium i486 i386";
- elif test $cpu_family -eq 5; then
- cpu_set="pentium i486 i386";
- elif test $cpu_family -eq 4; then
- cpu_set="i486 i386"
- else
- cpu_set="i386"
- fi
-fi
-
-for ac_arg in $cpu_set;
-do
- CFLAGS="$ac_save_CFLAGS -mcpu=$ac_arg -march=$ac_arg -DCPU=$ac_arg"
- AC_TRY_COMPILE([],[int i],mysql_cv_cpu=$ac_arg; break;, mysql_cv_cpu="unknown")
-done
-
-if test "$mysql_cv_cpu" = "unknown"
-then
- CFLAGS="$ac_save_CFLAGS"
- AC_MSG_RESULT(none)
-else
- AC_MSG_RESULT($mysql_cv_cpu)
-fi
-]]))
-
-AC_DEFUN(MYSQL_CHECK_VIO, [
- AC_ARG_WITH([vio],
- [ --with-vio Include the Virtual IO support],
- [vio="$withval"],
- [vio=no])
-
- if test "$vio" = "yes"
- then
- vio_dir="vio"
- vio_libs="../vio/libvio.la"
- AC_DEFINE(HAVE_VIO)
- else
- vio_dir=""
- vio_libs=""
- fi
- AC_SUBST([vio_dir])
- AC_SUBST([vio_libs])
-])
-
-AC_DEFUN(MYSQL_FIND_OPENSSL, [
- incs="$1"
- libs="$2"
- case "$incs---$libs" in
- ---)
- for d in /usr/ssl/include /usr/local/ssl/include /usr/include \
-/usr/include/ssl /opt/ssl/include /opt/openssl/include \
-/usr/local/ssl/include /usr/local/include ; do
- if test -f $d/openssl/ssl.h ; then
- OPENSSL_INCLUDE=-I$d
- fi
- done
-
- for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
-/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib /usr/local/lib/ ; do
- if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then
- OPENSSL_LIB=$d
- fi
- done
- ;;
- ---* | *---)
- AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified])
- ;;
- * )
- if test -f $incs/openssl/ssl.h ; then
- OPENSSL_INCLUDE=-I$incs
- fi
- if test -f $libs/libssl.a || test -f $libs/libssl.so || test -f $libs/libssl.dylib ; then
- OPENSSL_LIB=$libs
- fi
- ;;
- esac
-
- # On RedHat 9 we need kerberos to compile openssl
- for d in /usr/kerberos/include
- do
- if test -f $d/krb5.h ; then
- OPENSSL_KERBEROS_INCLUDE="$d"
- fi
- done
-
-
- if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then
- echo "Could not find an installation of OpenSSL"
- if test -n "$OPENSSL_LIB" ; then
- if test "$IS_LINUX" = "true"; then
- echo "Looks like you've forgotten to install OpenSSL development RPM"
- fi
- fi
- exit 1
- fi
-
-])
-
-AC_DEFUN(MYSQL_CHECK_OPENSSL, [
-AC_MSG_CHECKING(for OpenSSL)
- AC_ARG_WITH([openssl],
- [ --with-openssl Include the OpenSSL support],
- [openssl="$withval"],
- [openssl=no])
-
- AC_ARG_WITH([openssl-includes],
- [
- --with-openssl-includes=DIR
- Find OpenSSL headers in DIR],
- [openssl_includes="$withval"],
- [openssl_includes=""])
-
- AC_ARG_WITH([openssl-libs],
- [
- --with-openssl-libs=DIR
- Find OpenSSL libraries in DIR],
- [openssl_libs="$withval"],
- [openssl_libs=""])
-
- if test "$openssl" = "yes"
- then
- MYSQL_FIND_OPENSSL([$openssl_includes], [$openssl_libs])
- #force VIO use
- vio_dir="vio"
- vio_libs="../vio/libvio.la"
- AC_DEFINE(HAVE_VIO)
- AC_MSG_RESULT(yes)
- openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
- # Don't set openssl_includes to /usr/include as this gives us a lot of
- # compiler warnings when using gcc 3.x
- openssl_includes=""
- if test "$OPENSSL_INCLUDE" != "-I/usr/include"
- then
- openssl_includes="$OPENSSL_INCLUDE"
- fi
- if test "$OPENSSL_KERBEROS_INCLUDE"
- then
- openssl_includes="$openssl_includes -I$OPENSSL_KERBEROS_INCLUDE"
- fi
- AC_DEFINE(HAVE_OPENSSL)
-
- # openssl-devel-0.9.6 requires dlopen() and we can't link staticly
- # on many platforms (We should actually test this here, but it's quite
- # hard) to do as we are doing libtool for linking.
- using_static=""
- case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in
- *-all-static*) using_static="yes" ;;
- esac
- if test "$using_static" = "yes"
- then
- echo "You can't use the --all-static link option when using openssl."
- exit 1
- fi
- NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
- else
- AC_MSG_RESULT(no)
- fi
- AC_SUBST(openssl_libs)
- AC_SUBST(openssl_includes)
-])
-
-
-AC_DEFUN(MYSQL_CHECK_MYSQLFS, [
- AC_ARG_WITH([mysqlfs],
- [
- --with-mysqlfs Include the corba-based MySQL file system],
- [mysqlfs="$withval"],
- [mysqlfs=no])
-
-dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@
-dnl get substituted.
- MYSQL_CHECK_ORBIT
-
- AC_MSG_CHECKING(if we should build MySQLFS)
- fs_dirs=""
- if test "$mysqlfs" = "yes"
- then
- if test -n "$orbit_exec_prefix"
- then
- fs_dirs=fs
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT(disabled because ORBIT, the CORBA ORB, was not found)
- fi
- else
- AC_MSG_RESULT([no])
- fi
- AC_SUBST([fs_dirs])
-])
-
-AC_DEFUN(MYSQL_CHECK_ORBIT, [
-AC_MSG_CHECKING(for ORBit)
-orbit_config_path=`which orbit-config`
-if test -n "$orbit_config_path" -a $? = 0
-then
- orbit_exec_prefix=`orbit-config --exec-prefix`
- orbit_includes=`orbit-config --cflags server`
- orbit_libs=`orbit-config --libs server`
- orbit_idl="$orbit_exec_prefix/bin/orbit-idl"
- AC_MSG_RESULT(found!)
- AC_DEFINE(HAVE_ORBIT)
-else
- orbit_exec_prefix=
- orbit_includes=
- orbit_libs=
- orbit_idl=
- AC_MSG_RESULT(not found)
-fi
-AC_SUBST(orbit_includes)
-AC_SUBST(orbit_libs)
-AC_SUBST(orbit_idl)
-])
-
-AC_DEFUN([MYSQL_CHECK_ISAM], [
- AC_ARG_WITH([isam], [
- --with-isam Enable the ISAM table type],
- [with_isam="$withval"],
- [with_isam=no])
-
- isam_libs=
- if test X"$with_isam" = X"yes"
- then
- AC_DEFINE(HAVE_ISAM)
- isam_libs="\$(top_builddir)/isam/libnisam.a\
- \$(top_builddir)/merge/libmerge.a"
- fi
- AC_SUBST(isam_libs)
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_BDB
-dnl Sets HAVE_BERKELEY_DB if inst library is found
-dnl Makes sure db version is correct.
-dnl Looks in $srcdir for Berkeley distribution if not told otherwise
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_CHECK_BDB], [
- AC_ARG_WITH([berkeley-db],
- [
- --with-berkeley-db[=DIR]
- Use BerkeleyDB located in DIR],
- [bdb="$withval"],
- [bdb=no])
-
- AC_ARG_WITH([berkeley-db-includes],
- [
- --with-berkeley-db-includes=DIR
- Find Berkeley DB headers in DIR],
- [bdb_includes="$withval"],
- [bdb_includes=default])
-
- AC_ARG_WITH([berkeley-db-libs],
- [
- --with-berkeley-db-libs=DIR
- Find Berkeley DB libraries in DIR],
- [bdb_libs="$withval"],
- [bdb_libs=default])
-
- AC_MSG_CHECKING([for BerkeleyDB])
-
-dnl SORT OUT THE SUPPLIED ARGUMENTS TO DETERMINE WHAT TO DO
-dnl echo "DBG1: bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
- have_berkeley_db=no
- case "$bdb" in
- no )
- mode=no
- AC_MSG_RESULT([no])
- ;;
- yes | default )
- case "$bdb_includes---$bdb_libs" in
- default---default )
- mode=search-$bdb
- AC_MSG_RESULT([searching...])
- ;;
- default---* | *---default | yes---* | *---yes )
- AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified])
- ;;
- * )
- mode=supplied-two
- AC_MSG_RESULT([supplied])
- ;;
- esac
- ;;
- * )
- mode=supplied-one
- AC_MSG_RESULT([supplied])
- ;;
- esac
-
-dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
-
- case $mode in
- no )
- bdb_includes=
- bdb_libs=
- bdb_libs_with_path=
- ;;
- supplied-two )
- MYSQL_CHECK_INSTALLED_BDB([$bdb_includes], [$bdb_libs])
- case $bdb_dir_ok in
- installed ) mode=yes ;;
- * ) AC_MSG_ERROR([didn't find valid BerkeleyDB: $bdb_dir_ok]) ;;
- esac
- ;;
- supplied-one )
- MYSQL_CHECK_BDB_DIR([$bdb])
- case $bdb_dir_ok in
- source ) mode=compile ;;
- installed ) mode=yes ;;
- * ) AC_MSG_ERROR([didn't find valid BerkeleyDB: $bdb_dir_ok]) ;;
- esac
- ;;
- search-* )
- MYSQL_SEARCH_FOR_BDB
- case $bdb_dir_ok in
- source ) mode=compile ;;
- installed ) mode=yes ;;
- * )
- # not found
- case $mode in
- *-yes ) AC_MSG_ERROR([no suitable BerkeleyDB found]) ;;
- * ) mode=no ;;
- esac
- bdb_includes=
- bdb_libs=
- bdb_libs_with_path=
- ;;
- esac
- ;;
- *)
- AC_MSG_ERROR([impossible case condition '$mode': please report this to bugs@lists.mysql.com])
- ;;
- esac
-
-dnl echo "DBG3: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
- case $mode in
- no )
- AC_MSG_RESULT([Not using Berkeley DB])
- ;;
- yes )
- have_berkeley_db="yes"
- AC_MSG_RESULT([Using Berkeley DB in '$bdb_includes'])
- ;;
- compile )
- have_berkeley_db="$bdb"
- AC_MSG_RESULT([Compiling Berekeley DB in '$have_berkeley_db'])
- ;;
- * )
- AC_MSG_ERROR([impossible case condition '$mode': please report this to bugs@lists.mysql.com])
- ;;
- esac
-
- AC_SUBST(bdb_includes)
- AC_SUBST(bdb_libs)
- AC_SUBST(bdb_libs_with_path)
-])
-
-AC_DEFUN([MYSQL_CHECK_INSTALLED_BDB], [
-dnl echo ["MYSQL_CHECK_INSTALLED_BDB ($1) ($2)"]
- inc="$1"
- lib="$2"
- if test -f "$inc/db.h"
- then
- MYSQL_CHECK_BDB_VERSION([$inc/db.h],
- [.*#define[ ]*], [[ ][ ]*])
-
- if test X"$bdb_version_ok" = Xyes; then
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="-L$lib $LDFLAGS"
- AC_CHECK_LIB(db,db_env_create, [
- bdb_dir_ok=installed
- MYSQL_TOP_BUILDDIR([inc])
- MYSQL_TOP_BUILDDIR([lib])
- bdb_includes="-I$inc"
- bdb_libs="-L$lib -ldb"
- bdb_libs_with_path="$lib/libdb.a"
- ])
- LDFLAGS="$save_LDFLAGS"
- else
- bdb_dir_ok="$bdb_version_ok"
- fi
- else
- bdb_dir_ok="no db.h file in '$inc'"
- fi
-])
-
-AC_DEFUN([MYSQL_CHECK_BDB_DIR], [
-dnl ([$bdb])
-dnl echo ["MYSQL_CHECK_BDB_DIR ($1)"]
- dir="$1"
-
- MYSQL_CHECK_INSTALLED_BDB([$dir/include], [$dir/lib])
-
- if test X"$bdb_dir_ok" != Xinstalled; then
- # test to see if it's a source dir
- rel="$dir/dist/RELEASE"
- if test -f "$rel"; then
- MYSQL_CHECK_BDB_VERSION([$rel], [], [=])
- if test X"$bdb_version_ok" = Xyes; then
- bdb_dir_ok=source
- bdb="$dir"
- MYSQL_TOP_BUILDDIR([dir])
- bdb_includes="-I$dir/build_unix"
- bdb_libs="-L$dir/build_unix -ldb"
- bdb_libs_with_path="$dir/build_unix/libdb.a"
- else
- bdb_dir_ok="$bdb_version_ok"
- fi
- else
- bdb_dir_ok="'$dir' doesn't look like a BDB directory ($bdb_dir_ok)"
- fi
- fi
-])
-
-AC_DEFUN([MYSQL_SEARCH_FOR_BDB], [
-dnl echo ["MYSQL_SEARCH_FOR_BDB"]
- bdb_dir_ok="no BerkeleyDB found"
-
- for test_dir in $srcdir/bdb $srcdir/db-*.*.* /usr/local/BerkeleyDB*; do
-dnl echo "-----------> Looking at ($test_dir; `cd $test_dir && pwd`)"
- MYSQL_CHECK_BDB_DIR([$test_dir])
- if test X"$bdb_dir_ok" = Xsource || test X"$bdb_dir_ok" = Xinstalled; then
-dnl echo "-----------> Found it ($bdb), ($srcdir)"
-dnl This is needed so that 'make distcheck' works properly (VPATH build).
-dnl VPATH build won't work if bdb is not under the source tree; but in
-dnl that case, hopefully people will just make and install inside the
-dnl tree, or install BDB first, and then use the installed version.
- case "$bdb" in
- "$srcdir/"* ) bdb=`echo "$bdb" | sed -e "s,^$srcdir/,,"` ;;
- esac
- break
- fi
- done
-])
-
-dnl MYSQL_CHECK_BDB_VERSION takes 3 arguments:
-dnl 1) the file to look in
-dnl 2) the search pattern before DB_VERSION_XXX
-dnl 3) the search pattern between DB_VERSION_XXX and the number
-dnl It assumes that the number is the last thing on the line
-AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [
- db_major=`sed -e '/^[$2]DB_VERSION_MAJOR[$3]/ !d' -e 's///' [$1]`
- db_minor=`sed -e '/^[$2]DB_VERSION_MINOR[$3]/ !d' -e 's///' [$1]`
- db_patch=`sed -e '/^[$2]DB_VERSION_PATCH[$3]/ !d' -e 's///' [$1]`
- test -z "$db_major" && db_major=0
- test -z "$db_minor" && db_minor=0
- test -z "$db_patch" && db_patch=0
-
- # This is ugly, but about as good as it can get
-# mysql_bdb=
-# if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3
-# then
-# mysql_bdb=h
-# elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9
-# then
-# want_bdb_version="3.2.9a" # hopefully this will stay up-to-date
-# mysql_bdb=a
-# fi
-
-dnl RAM:
-want_bdb_version="4.1.24"
-bdb_version_ok=yes
-
-# if test -n "$mysql_bdb" && \
-# grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null
-# then
-# bdb_version_ok=yes
-# else
-# bdb_version_ok="invalid version $db_major.$db_minor.$db_patch"
-# bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)"
-# fi
-])
-
-AC_DEFUN([MYSQL_TOP_BUILDDIR], [
- case "$[$1]" in
- /* ) ;; # don't do anything with an absolute path
- "$srcdir"/* )
- # If BDB is under the source directory, we need to look under the
- # build directory for bdb/build_unix.
- # NOTE: I'm being lazy, and assuming the user did not specify
- # something like --with-berkeley-db=bdb (it would be missing "./").
- [$1]="\$(top_builddir)/"`echo "$[$1]" | sed -e "s,^$srcdir/,,"`
- ;;
- * )
- AC_MSG_ERROR([The BDB directory must be directly under the MySQL source directory, or be specified using the full path. ('$srcdir'; '$[$1]')])
- ;;
- esac
- if test X"$[$1]" != "/"
- then
- [$1]=`echo $[$1] | sed -e 's,/$,,'`
- fi
-])
-
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_BDB SECTION
-dnl ---------------------------------------------------------------------------
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_INNODB
-dnl Sets HAVE_INNOBASE_DB if --with-innodb is used
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_CHECK_INNODB], [
- AC_ARG_WITH([innodb],
- [
- --without-innodb Do not include the InnoDB table handler],
- [innodb="$withval"],
- [innodb=yes])
-
- AC_MSG_CHECKING([for Innodb])
-
- have_innodb=no
- innodb_includes=
- innodb_libs=
- case "$innodb" in
- yes )
- AC_MSG_RESULT([Using Innodb])
- AC_DEFINE(HAVE_INNOBASE_DB)
- have_innodb="yes"
- innodb_includes="-I../innobase/include"
- innodb_system_libs=""
-dnl Some libs are listed several times, in order for gcc to sort out
-dnl circular references.
- innodb_libs="\
- \$(top_builddir)/innobase/usr/libusr.a\
- \$(top_builddir)/innobase/srv/libsrv.a\
- \$(top_builddir)/innobase/dict/libdict.a\
- \$(top_builddir)/innobase/que/libque.a\
- \$(top_builddir)/innobase/srv/libsrv.a\
- \$(top_builddir)/innobase/ibuf/libibuf.a\
- \$(top_builddir)/innobase/row/librow.a\
- \$(top_builddir)/innobase/pars/libpars.a\
- \$(top_builddir)/innobase/btr/libbtr.a\
- \$(top_builddir)/innobase/trx/libtrx.a\
- \$(top_builddir)/innobase/read/libread.a\
- \$(top_builddir)/innobase/usr/libusr.a\
- \$(top_builddir)/innobase/buf/libbuf.a\
- \$(top_builddir)/innobase/ibuf/libibuf.a\
- \$(top_builddir)/innobase/eval/libeval.a\
- \$(top_builddir)/innobase/log/liblog.a\
- \$(top_builddir)/innobase/fsp/libfsp.a\
- \$(top_builddir)/innobase/fut/libfut.a\
- \$(top_builddir)/innobase/fil/libfil.a\
- \$(top_builddir)/innobase/lock/liblock.a\
- \$(top_builddir)/innobase/mtr/libmtr.a\
- \$(top_builddir)/innobase/page/libpage.a\
- \$(top_builddir)/innobase/rem/librem.a\
- \$(top_builddir)/innobase/thr/libthr.a\
- \$(top_builddir)/innobase/sync/libsync.a\
- \$(top_builddir)/innobase/data/libdata.a\
- \$(top_builddir)/innobase/mach/libmach.a\
- \$(top_builddir)/innobase/ha/libha.a\
- \$(top_builddir)/innobase/dyn/libdyn.a\
- \$(top_builddir)/innobase/mem/libmem.a\
- \$(top_builddir)/innobase/sync/libsync.a\
- \$(top_builddir)/innobase/ut/libut.a\
- \$(top_builddir)/innobase/os/libos.a\
- \$(top_builddir)/innobase/ut/libut.a"
-
- AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
- ;;
- * )
- AC_MSG_RESULT([Not using Innodb])
- ;;
- esac
-
- AC_SUBST(innodb_includes)
- AC_SUBST(innodb_libs)
- AC_SUBST(innodb_system_libs)
-])
-
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_INNODB SECTION
-dnl ---------------------------------------------------------------------------
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_NDBCLUSTER
-dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
- AC_ARG_WITH([ndbcluster],
- [
- --without-ndbcluster Do not include the Ndb Cluster table handler],
- [ndbcluster="$withval"],
- [ndbcluster=yes])
-
- AC_MSG_CHECKING([for Ndb Cluster])
-
- have_ndbcluster=no
- ndbcluster_includes=
- ndbcluster_libs=
- case "$ndbcluster" in
- yes )
- AC_MSG_RESULT([Using Ndb Cluster])
- AC_DEFINE(HAVE_NDBCLUSTER_DB)
- have_ndbcluster="yes"
- ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi"
- ndbcluster_libs="\$(top_builddir)/ndb/lib/libNDB_API.a"
- ndbcluster_system_libs=""
- esac
-
- AC_SUBST(ndbcluster_includes)
- AC_SUBST(ndbcluster_libs)
- AC_SUBST(ndbcluster_system_libs)
-])
-
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
-dnl ---------------------------------------------------------------------------
-
-dnl By default, many hosts won't let programs access large files;
-dnl one must use special compiler options to get large-file access to work.
-dnl For more details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
-AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
- [AC_CACHE_CHECK([for $1 value to request large file support],
- ac_cv_sys_largefile_$1,
- [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
- then
- ac_cv_sys_largefile_$1=`cat conftest.1`
- else
- ac_cv_sys_largefile_$1=no
- ifelse($1, CFLAGS,
- [case "$host_os" in
- # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
-changequote(, )dnl
- hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
-changequote([, ])dnl
- if test "$GCC" = yes; then
- case `$CC --version 2>/dev/null` in
- 2.95.*) ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ ;;
- esac
- fi
- ;;
- # IRIX 6.2 and later require cc -n32.
-changequote(, )dnl
- irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
-changequote([, ])dnl
- if test "$GCC" != yes; then
- ac_cv_sys_largefile_CFLAGS=-n32
- fi
- esac
- if test "$ac_cv_sys_largefile_CFLAGS" != no; then
- ac_save_CC="$CC"
- CC="$CC $ac_cv_sys_largefile_CFLAGS"
- AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
- CC="$ac_save_CC"
- fi])
- fi
- rm -f conftest*])])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
-AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
- [case $2 in
- no) ;;
- ?*)
- case "[$]$1" in
- '') $1=$2 ;;
- *) $1=[$]$1' '$2 ;;
- esac ;;
- esac])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
-AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
- [AC_CACHE_CHECK([for $1], $2,
- [$2=no
-changequote(, )dnl
- for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
- case "$ac_flag" in
- -D$1)
- $2=1 ;;
- -D$1=*)
- $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
- esac
- done
- $4
-changequote([, ])dnl
- ])
- if test "[$]$2" != no; then
- AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
- fi])
-
-AC_DEFUN(MYSQL_SYS_LARGEFILE,
- [AC_REQUIRE([AC_CANONICAL_HOST])
- AC_ARG_ENABLE(largefile,
- [ --disable-largefile Omit support for large files])
- if test "$enable_largefile" != no; then
- AC_CHECK_TOOL(GETCONF, getconf)
- AC_SYS_LARGEFILE_FLAGS(CFLAGS)
- AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
- AC_SYS_LARGEFILE_FLAGS(LIBS)
-
- for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
- case "$ac_flag" in
- no) ;;
- -D_FILE_OFFSET_BITS=*) ;;
- -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
- -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
- -D?* | -I?*)
- AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
- *)
- AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
- esac
- done
- AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
- AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
-
- AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
- ac_cv_sys_file_offset_bits,
- [Number of bits in a file offset, on hosts where this is settable.],
- [case "$host_os" in
- # HP-UX 10.20 and later
- hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
- ac_cv_sys_file_offset_bits=64 ;;
- # We can't declare _FILE_OFFSET_BITS here as this will cause
- # compile errors as AC_PROG_CC adds include files in confdefs.h
- # We solve this (until autoconf is fixed) by instead declaring it
- # as define instead
- solaris2.[8,9])
- CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
- CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
- ac_cv_sys_file_offset_bits=no ;;
- esac])
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
- ac_cv_sys_largefile_source,
- [Define to make fseeko etc. visible, on some hosts.],
- [case "$host_os" in
- # HP-UX 10.20 and later
- hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
- ac_cv_sys_largefile_source=1 ;;
- esac])
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
- ac_cv_sys_large_files,
- [Define for large files, on AIX-style hosts.],
- [case "$host_os" in
- # AIX 4.2 and later
- aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
- ac_cv_sys_large_files=1 ;;
- esac])
- fi
- ])
-
-
-# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not
-# include #stdlib.h as default as this breaks things on Solaris
-# (Conflicts with pthreads and big file handling)
-
-m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
-[for ac_declaration in \
- ''\
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);' \
- '#include <stdlib.h>'
-do
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h>
-$ac_declaration],
- [exit (42);])],
- [],
- [continue])
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
- [exit (42);])],
- [break])
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-])# _AC_PROG_CXX_EXIT_DECLARATION
-
-dnl ---------------------------------------------------------------------------
-
diff --git a/ndb/config/common.mk.am b/ndb/config/common.mk.am
new file mode 100644
index 00000000000..869e2fae91d
--- /dev/null
+++ b/ndb/config/common.mk.am
@@ -0,0 +1,12 @@
+ndbbindir = "$(libexecdir)"
+ndbtoolsdir = "$(bindir)"
+ndbtestdir = "$(bindir)"
+ndblibdir = "$(pkglibdir)"
+ndbincludedir = "$(pkgincludedir)/ndb"
+ndbapiincludedir = "$(pkgincludedir)/ndb/ndbapi"
+mgmapiincludedir = "$(pkgincludedir)/ndb/mgmapi"
+
+INCLUDES = $(INCLUDES_LOC)
+LDADD = $(top_srcdir)/ndb/src/common/portlib/gcc.cpp $(LDADD_LOC)
+DEFS = @DEFS@ @NDB_DEFS@ $(DEFS_LOC) $(NDB_EXTRA_FLAGS)
+NDB_CXXFLAGS=@ndb_cxxflags_fix@ $(NDB_CXXFLAGS_LOC)
diff --git a/ndb/config/config.h.in b/ndb/config/config.h.in
deleted file mode 100644
index 82749d5ece6..00000000000
--- a/ndb/config/config.h.in
+++ /dev/null
@@ -1,993 +0,0 @@
-/* config.h.in. Generated from configure.in by autoheader. */
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-#undef C_ALLOCA
-
-#undef CRAY_STACKSEG_END
-
-/* Define the default charset name */
-#undef MYSQL_DEFAULT_CHARSET_NAME
-
-/* Define the default charset name */
-#undef MYSQL_DEFAULT_COLLATION_NAME
-
-/* Version of .frm files */
-#undef DOT_FRM_VERSION
-
-/* If LOAD DATA LOCAL INFILE should be enabled by default */
-#undef ENABLED_LOCAL_INFILE
-
-/* READLINE: */
-#undef FIONREAD_IN_SYS_IOCTL
-
-/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
-#undef GWINSZ_IN_SYS_IOCTL
-
-/* Handing of large files on Solaris 2.6 */
-#undef _FILE_OFFSET_BITS
-
-/* Do we have FIONREAD */
-#undef FIONREAD_IN_SYS_IOCTL
-
-/* Do we need to define _GNU_SOURCE */
-#undef _GNU_SOURCE
-
-/* atomic_add() from <asm/atomic.h> (Linux only) */
-#undef HAVE_ATOMIC_ADD
-
-/* atomic_sub() from <asm/atomic.h> (Linux only) */
-#undef HAVE_ATOMIC_SUB
-
-/* If we have a working alloca() implementation */
-#undef HAVE_ALLOCA
-
-/* bool is not defined by all C++ compilators */
-#undef HAVE_BOOL
-
-/* Have berkeley db installed */
-#undef HAVE_BERKELEY_DB
-
-/* DSB style signals ? */
-#undef HAVE_BSD_SIGNALS
-
-/* Can netinet be included */
-#undef HAVE_BROKEN_NETINET_INCLUDES
-
-/* READLINE: */
-#undef HAVE_BSD_SIGNALS
-
-/* Define charsets you want */
-#undef HAVE_CHARSET_armscii8
-#undef HAVE_CHARSET_ascii
-#undef HAVE_CHARSET_big5
-#undef HAVE_CHARSET_cp1250
-#undef HAVE_CHARSET_cp1251
-#undef HAVE_CHARSET_cp1256
-#undef HAVE_CHARSET_cp1257
-#undef HAVE_CHARSET_cp850
-#undef HAVE_CHARSET_cp852
-#undef HAVE_CHARSET_cp866
-#undef HAVE_CHARSET_dec8
-#undef HAVE_CHARSET_euckr
-#undef HAVE_CHARSET_gb2312
-#undef HAVE_CHARSET_gbk
-#undef HAVE_CHARSET_greek
-#undef HAVE_CHARSET_hebrew
-#undef HAVE_CHARSET_hp8
-#undef HAVE_CHARSET_keybcs2
-#undef HAVE_CHARSET_koi8r
-#undef HAVE_CHARSET_koi8u
-#undef HAVE_CHARSET_latin1
-#undef HAVE_CHARSET_latin2
-#undef HAVE_CHARSET_latin5
-#undef HAVE_CHARSET_latin7
-#undef HAVE_CHARSET_macce
-#undef HAVE_CHARSET_macroman
-#undef HAVE_CHARSET_sjis
-#undef HAVE_CHARSET_swe7
-#undef HAVE_CHARSET_tis620
-#undef HAVE_CHARSET_ucs2
-#undef HAVE_CHARSET_ujis
-#undef HAVE_CHARSET_utf8
-
-/* ZLIB and compress: */
-#undef HAVE_COMPRESS
-
-/* Define if we are using OSF1 DEC threads */
-#undef HAVE_DEC_THREADS
-
-/* Define if we are using OSF1 DEC threads on 3.2 */
-#undef HAVE_DEC_3_2_THREADS
-
-/* fp_except from ieeefp.h */
-#undef HAVE_FP_EXCEPT
-
-/* READLINE: */
-#undef HAVE_GETPW_DECLS
-
-/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
- this with 6 arguments */
-#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE
-
-/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
-#undef HAVE_GETHOSTBYNAME_R_RETURN_INT
-
-/* Define if int8, int16 and int32 types exist */
-#undef HAVE_INT_8_16_32
-
-/* Using Innobase DB */
-#undef HAVE_INNOBASE_DB
-
-/* Using old ISAM tables */
-#undef HAVE_ISAM
-
-/* Define if we have GNU readline */
-#undef HAVE_LIBREADLINE
-
-/* Define if have -lwrap */
-#undef HAVE_LIBWRAP
-
-/* Define if we are using Xavier Leroy's LinuxThreads */
-#undef HAVE_LINUXTHREADS
-
-/* Do we have lstat */
-#undef HAVE_LSTAT
-
-/* Do we use user level threads */
-#undef HAVE_mit_thread
-
-/* Using Ndb Cluster DB */
-#undef HAVE_NDBCLUSTER_DB
-
-/* For some non posix threads */
-#undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
-
-/* For some non posix threads */
-#undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
-
-/* READLINE: */
-#undef HAVE_POSIX_SIGNALS
-
-/* Well.. */
-#undef HAVE_POSIX_SIGSETJMP
-
-/* sigwait with one argument */
-#undef HAVE_NONPOSIX_SIGWAIT
-
-/* ORBIT */
-#undef HAVE_ORBIT
-
-/* pthread_attr_setscope */
-#undef HAVE_PTHREAD_ATTR_SETSCOPE
-
-/* pthread_yield that doesn't take any arguments */
-#undef HAVE_PTHREAD_YIELD_ZERO_ARG
-
-/* pthread_yield function with one argument */
-#undef HAVE_PTHREAD_YIELD_ONE_ARG
-
-/* POSIX readdir_r */
-#undef HAVE_READDIR_R
-
-/* Have Gemini db installed */
-#undef HAVE_GEMINI_DB
-
-/* POSIX sigwait */
-#undef HAVE_SIGWAIT
-
-/* crypt */
-#undef HAVE_CRYPT
-
-/* If we want to have query cache */
-#undef HAVE_QUERY_CACHE
-
-/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
- this with 8 arguments */
-#undef HAVE_SOLARIS_STYLE_GETHOST
-
-/* MIT pthreads does not support connecting with unix sockets */
-#undef HAVE_THREADS_WITHOUT_SOCKETS
-
-/* Timespec has a ts_sec instead of tv_sev */
-#undef HAVE_TIMESPEC_TS_SEC
-
-/* Have the tzname variable */
-#undef HAVE_TZNAME
-
-/* Define if the system files define uchar */
-#undef HAVE_UCHAR
-
-/* Define if the system files define uint */
-#undef HAVE_UINT
-
-/* Define if the system files define ulong */
-#undef HAVE_ULONG
-
-/* Define if the system files define in_addr_t */
-#undef HAVE_IN_ADDR_T
-
-/* UNIXWARE7 threads are not posix */
-#undef HAVE_UNIXWARE7_THREADS
-
-/* new UNIXWARE7 threads that are not yet posix */
-#undef HAVE_UNIXWARE7_POSIX
-
-/* OpenSSL */
-#undef HAVE_OPENSSL
-
-/* READLINE: */
-#undef HAVE_USG_SIGHOLD
-
-/* Virtual IO */
-#undef HAVE_VIO
-
-/* Handling of large files on Solaris 2.6 */
-#undef _LARGEFILE_SOURCE
-
-/* Handling of large files on Solaris 2.6 */
-#undef _LARGEFILE64_SOURCE
-
-/* Define if want -lwrap */
-#undef LIBWRAP
-
-/* Define to machine type name eg sun10 */
-#undef MACHINE_TYPE
-
-#undef MUST_REINSTALL_SIGHANDLERS
-
-/* Defined to used character set */
-#undef MY_CHARSET_CURRENT
-
-/* READLINE: no sys file*/
-#undef NO_SYS_FILE
-
-/* Program name */
-#undef PACKAGE
-
-/* mysql client protocoll version */
-#undef PROTOCOL_VERSION
-
-/* Define if qsort returns void */
-#undef QSORT_TYPE_IS_VOID
-
-/* Define as the return type of qsort (int or void). */
-#undef RETQSORTTYPE
-
-/* Size of off_t */
-#undef SIZEOF_OFF_T
-
-/* Define as the base type of the last arg to accept */
-#undef SOCKET_SIZE_TYPE
-
-/* Last argument to get/setsockopt */
-#undef SOCKOPT_OPTLEN_TYPE
-
-#undef SPEED_T_IN_SYS_TYPES
-#undef SPRINTF_RETURNS_PTR
-#undef SPRINTF_RETURNS_INT
-#undef SPRINTF_RETURNS_GARBAGE
-
-/* Needed to get large file support on HPUX 10.20 */
-#undef __STDC_EXT__
-
-#undef STACK_DIRECTION
-
-#undef STRCOLL_BROKEN
-
-#undef STRUCT_DIRENT_HAS_D_FILENO
-#undef STRUCT_DIRENT_HAS_D_INO
-
-#undef STRUCT_WINSIZE_IN_SYS_IOCTL
-#undef STRUCT_WINSIZE_IN_TERMIOS
-
-/* Define to name of system eg solaris*/
-#undef SYSTEM_TYPE
-
-/* Define if you want to have threaded code. This may be undef on client code */
-#undef THREAD
-
-/* Should be client be thread safe */
-#undef THREAD_SAFE_CLIENT
-
-/* READLINE: */
-#undef TIOCSTAT_IN_SYS_IOCTL
-
-/* Use multi-byte character routines */
-#undef USE_MB
-#undef USE_MB_IDENT
-
-/* the pstack backtrace library */
-#undef USE_PSTACK
-
-/* Use MySQL RAID */
-#undef USE_RAID
-
-/* Program version */
-#undef VERSION
-
-/* READLINE: */
-#undef VOID_SIGHANDLER
-
-/* used libedit interface (can we dereference result of rl_completion_entry_function?) */
-#undef USE_LIBEDIT_INTERFACE
-
-/* used new readline interface (does rl_completion_func_t and rl_compentry_func_t defined?) */
-#undef USE_NEW_READLINE_INTERFACE
-
-/* macro for libedit */
-#undef HAVE_VIS_H
-#undef HAVE_FGETLN
-#undef HAVE_ISSETUGID
-#undef HAVE_STRLCPY
-#undef HAVE_GETLINE
-#undef HAVE_FLOCKFILE
-#undef HAVE_SYS_TYPES_H
-#undef HAVE_SYS_CDEFS_H
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for `alloca.c' support on those systems.
- */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define to 1 if you have the `alarm' function. */
-#undef HAVE_ALARM
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
- */
-#undef HAVE_ALLOCA_H
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* Define to 1 if you have the <asm/termbits.h> header file. */
-#undef HAVE_ASM_TERMBITS_H
-
-/* Define to 1 if you have the `bcmp' function. */
-#undef HAVE_BCMP
-
-/* Define to 1 if you have the `bfill' function. */
-#undef HAVE_BFILL
-
-/* Define to 1 if you have the `bmove' function. */
-#undef HAVE_BMOVE
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
-
-/* Define to 1 if you have the `chsize' function. */
-#undef HAVE_CHSIZE
-
-/* Define to 1 if you have the `clock_gettime' function. */
-#undef HAVE_CLOCK_GETTIME
-
-/* Define to 1 if you have the <crypt.h> header file. */
-#undef HAVE_CRYPT_H
-
-/* Define to 1 if you have the <curses.h> header file. */
-#undef HAVE_CURSES_H
-
-/* Define to 1 if you have the `cuserid' function. */
-#undef HAVE_CUSERID
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the `dlerror' function. */
-#undef HAVE_DLERROR
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the `dlopen' function. */
-#undef HAVE_DLOPEN
-
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
-/* Define to 1 if you have the `fchmod' function. */
-#undef HAVE_FCHMOD
-
-/* Define to 1 if you have the `fcntl' function. */
-#undef HAVE_FCNTL
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `fconvert' function. */
-#undef HAVE_FCONVERT
-
-/* Define to 1 if you have the `fdatasync' function. */
-#undef HAVE_FDATASYNC
-
-/* Define to 1 if you have the `fgetln' function. */
-#undef HAVE_FGETLN
-
-/* Define to 1 if you have the `finite' function. */
-#undef HAVE_FINITE
-
-/* Define to 1 if you have the <floatingpoint.h> header file. */
-#undef HAVE_FLOATINGPOINT_H
-
-/* Define to 1 if you have the <float.h> header file. */
-#undef HAVE_FLOAT_H
-
-/* Define to 1 if you have the `flockfile' function. */
-#undef HAVE_FLOCKFILE
-
-/* Define to 1 if you have the `fpresetsticky' function. */
-#undef HAVE_FPRESETSTICKY
-
-/* Define to 1 if you have the `fpsetmask' function. */
-#undef HAVE_FPSETMASK
-
-/* Define to 1 if you have the `fsync' function. */
-#undef HAVE_FSYNC
-
-/* Define to 1 if you have the `ftruncate' function. */
-#undef HAVE_FTRUNCATE
-
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
-/* Define to 1 if you have the `gethostbyaddr_r' function. */
-#undef HAVE_GETHOSTBYADDR_R
-
-/* Define to 1 if you have the `gethostbyname_r' function. */
-#undef HAVE_GETHOSTBYNAME_R
-
-/* Define to 1 if you have the `getline' function. */
-#undef HAVE_GETLINE
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpass' function. */
-#undef HAVE_GETPASS
-
-/* Define to 1 if you have the `getpassphrase' function. */
-#undef HAVE_GETPASSPHRASE
-
-/* Define to 1 if you have the `getpwnam' function. */
-#undef HAVE_GETPWNAM
-
-/* Define to 1 if you have the `getpwuid' function. */
-#undef HAVE_GETPWUID
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getwd' function. */
-#undef HAVE_GETWD
-
-/* Define to 1 if you have the `gmtime_r' function. */
-#undef HAVE_GMTIME_R
-
-/* Define to 1 if you have the <grp.h> header file. */
-#undef HAVE_GRP_H
-
-/* Define to 1 if you have the <ieeefp.h> header file. */
-#undef HAVE_IEEEFP_H
-
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
-/* Define to 1 if you have the `initgroups' function. */
-#undef HAVE_INITGROUPS
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* isinf() macro or function */
-#undef HAVE_ISINF
-
-/* Define to 1 if you have the `isnan' function. */
-#undef HAVE_ISNAN
-
-/* Define to 1 if you have the `issetugid' function. */
-#undef HAVE_ISSETUGID
-
-/* Define to 1 if you have the `bind' library (-lbind). */
-#undef HAVE_LIBBIND
-
-/* Define to 1 if you have the `compat' library (-lcompat). */
-#undef HAVE_LIBCOMPAT
-
-/* Define to 1 if you have the `crypt' library (-lcrypt). */
-#undef HAVE_LIBCRYPT
-
-/* Define to 1 if you have the `c_r' library (-lc_r). */
-#undef HAVE_LIBC_R
-
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
-/* Define to 1 if you have the `gen' library (-lgen). */
-#undef HAVE_LIBGEN
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `nsl_r' library (-lnsl_r). */
-#undef HAVE_LIBNSL_R
-
-/* Define to 1 if you have the `posix4' library (-lposix4). */
-#undef HAVE_LIBPOSIX4
-
-/* Define to 1 if you have the `pthread' library (-lpthread). */
-#undef HAVE_LIBPTHREAD
-
-/* Define to 1 if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <linux/config.h> header file. */
-#undef HAVE_LINUX_CONFIG_H
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if you have the `localtime_r' function. */
-#undef HAVE_LOCALTIME_R
-
-/* Define to 1 if you have the `locking' function. */
-#undef HAVE_LOCKING
-
-/* Define to 1 if you have the `longjmp' function. */
-#undef HAVE_LONGJMP
-
-/* Define to 1 if you have the `lrand48' function. */
-#undef HAVE_LRAND48
-
-/* Define to 1 if you have the `lstat' function. */
-#undef HAVE_LSTAT
-
-/* Define to 1 if you have the `madvise' function. */
-#undef HAVE_MADVISE
-
-/* Define to 1 if you have the `mallinfo' function. */
-#undef HAVE_MALLINFO
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mkstemp' function. */
-#undef HAVE_MKSTEMP
-
-/* Define to 1 if you have the `mlockall' function. */
-#undef HAVE_MLOCKALL
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <ndir.h> header file. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define to 1 if you have the `perror' function. */
-#undef HAVE_PERROR
-
-/* Define to 1 if you have the `poll' function. */
-#undef HAVE_POLL
-
-/* Define to 1 if you have the `pread' function. */
-#undef HAVE_PREAD
-
-/* Define to 1 if you have the `pthread_attr_create' function. */
-#undef HAVE_PTHREAD_ATTR_CREATE
-
-/* Define to 1 if you have the `pthread_attr_getstacksize' function. */
-#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
-
-/* Define to 1 if you have the `pthread_attr_setprio' function. */
-#undef HAVE_PTHREAD_ATTR_SETPRIO
-
-/* Define to 1 if you have the `pthread_attr_setschedparam' function. */
-#undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM
-
-/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
-#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
-
-/* Define to 1 if you have the `pthread_condattr_create' function. */
-#undef HAVE_PTHREAD_CONDATTR_CREATE
-
-/* Define to 1 if you have the `pthread_getsequence_np' function. */
-#undef HAVE_PTHREAD_GETSEQUENCE_NP
-
-/* Define to 1 if you have the `pthread_init' function. */
-#undef HAVE_PTHREAD_INIT
-
-/* Define to 1 if you have the `pthread_key_delete' function. */
-#undef HAVE_PTHREAD_KEY_DELETE
-
-/* Define to 1 if you have the `pthread_rwlock_rdlock' function. */
-#undef HAVE_PTHREAD_RWLOCK_RDLOCK
-
-/* Define to 1 if you have the `pthread_setprio' function. */
-#undef HAVE_PTHREAD_SETPRIO
-
-/* Define to 1 if you have the `pthread_setprio_np' function. */
-#undef HAVE_PTHREAD_SETPRIO_NP
-
-/* Define to 1 if you have the `pthread_setschedparam' function. */
-#undef HAVE_PTHREAD_SETSCHEDPARAM
-
-/* Define to 1 if you have the `pthread_sigmask' function. */
-#undef HAVE_PTHREAD_SIGMASK
-
-/* Define to 1 if you have the `putenv' function. */
-#undef HAVE_PUTENV
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* Define to 1 if you have the `readlink' function. */
-#undef HAVE_READLINK
-
-/* Define to 1 if you have the `realpath' function. */
-#undef HAVE_REALPATH
-
-/* Define to 1 if you have the `regcomp' function. */
-#undef HAVE_REGCOMP
-
-/* Define to 1 if you have the `rename' function. */
-#undef HAVE_RENAME
-
-/* Define to 1 if system calls automatically restart after interruption by a
- signal. */
-#undef HAVE_RESTARTABLE_SYSCALLS
-
-/* Define to 1 if you have the `re_comp' function. */
-#undef HAVE_RE_COMP
-
-/* Define to 1 if you have the `rint' function. */
-#undef HAVE_RINT
-
-/* Define to 1 if you have the `rwlock_init' function. */
-#undef HAVE_RWLOCK_INIT
-
-/* Define to 1 if you have the <sched.h> header file. */
-#undef HAVE_SCHED_H
-
-/* Define to 1 if you have the `select' function. */
-#undef HAVE_SELECT
-
-/* Define to 1 if you have the <select.h> header file. */
-#undef HAVE_SELECT_H
-
-/* Define to 1 if you have the <semaphore.h> header file. */
-#undef HAVE_SEMAPHORE_H
-
-/* Define to 1 if you have the `setenv' function. */
-#undef HAVE_SETENV
-
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
-/* Define to 1 if you have the `setupterm' function. */
-#undef HAVE_SETUPTERM
-
-/* Define to 1 if you have the `sighold' function. */
-#undef HAVE_SIGHOLD
-
-/* Define to 1 if you have the `sigset' function. */
-#undef HAVE_SIGSET
-
-/* Define to 1 if you have the `sigthreadmask' function. */
-#undef HAVE_SIGTHREADMASK
-
-/* Define to 1 if you have the `snprintf' function. */
-#undef HAVE_SNPRINTF
-
-/* Define to 1 if you have the `socket' function. */
-#undef HAVE_SOCKET
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `stpcpy' function. */
-#undef HAVE_STPCPY
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the `strcoll' function. */
-#undef HAVE_STRCOLL
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strlcat' function. */
-#undef HAVE_STRLCAT
-
-/* Define to 1 if you have the `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the `strnlen' function. */
-#undef HAVE_STRNLEN
-
-/* Define to 1 if you have the `strpbrk' function. */
-#undef HAVE_STRPBRK
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
-/* Define to 1 if you have the `strtok_r' function. */
-#undef HAVE_STRTOK_R
-
-/* Define to 1 if you have the `strtol' function. */
-#undef HAVE_STRTOL
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoul' function. */
-#undef HAVE_STRTOUL
-
-/* Define to 1 if you have the `strtoull' function. */
-#undef HAVE_STRTOULL
-
-/* Define to 1 if `st_rdev' is member of `struct stat'. */
-#undef HAVE_STRUCT_STAT_ST_RDEV
-
-/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
- `HAVE_STRUCT_STAT_ST_RDEV' instead. */
-#undef HAVE_ST_RDEV
-
-/* Define to 1 if you have the <synch.h> header file. */
-#undef HAVE_SYNCH_H
-
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#undef HAVE_SYS_CDEFS_H
-
-/* Define to 1 if you have the <sys/dir.h> header file. */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/malloc.h> header file. */
-#undef HAVE_SYS_MALLOC_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file. */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/ptem.h> header file. */
-#undef HAVE_SYS_PTEM_H
-
-/* Define to 1 if you have the <sys/pte.h> header file. */
-#undef HAVE_SYS_PTE_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/stream.h> header file. */
-#undef HAVE_SYS_STREAM_H
-
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#undef HAVE_SYS_TIMEB_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#undef HAVE_SYS_UN_H
-
-/* Define to 1 if you have the <sys/utime.h> header file. */
-#undef HAVE_SYS_UTIME_H
-
-/* Define to 1 if you have the <sys/vadvise.h> header file. */
-#undef HAVE_SYS_VADVISE_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the `tcgetattr' function. */
-#undef HAVE_TCGETATTR
-
-/* Define to 1 if you have the `tell' function. */
-#undef HAVE_TELL
-
-/* Define to 1 if you have the `tempnam' function. */
-#undef HAVE_TEMPNAM
-
-/* Define to 1 if you have the <termbits.h> header file. */
-#undef HAVE_TERMBITS_H
-
-/* Define to 1 if you have the <termcap.h> header file. */
-#undef HAVE_TERMCAP_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
-/* Define to 1 if you have the <term.h> header file. */
-#undef HAVE_TERM_H
-
-/* Define to 1 if you have the `thr_setconcurrency' function. */
-#undef HAVE_THR_SETCONCURRENCY
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
-#undef HAVE_UTIME_NULL
-
-/* Define to 1 if you have the <varargs.h> header file. */
-#undef HAVE_VARARGS_H
-
-/* Define to 1 if you have the `vidattr' function. */
-#undef HAVE_VIDATTR
-
-/* Define to 1 if you have the <vis.h> header file. */
-#undef HAVE_VIS_H
-
-/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* The size of a `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
-
-/* The size of a `char*', as computed by sizeof. */
-#undef SIZEOF_CHARP
-
-/* The size of a `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of a `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of a `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define to make fseeko etc. visible, on some hosts. */
-#undef _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
- if it is not supported. */
-#undef inline
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/ndb/config/configure.in b/ndb/config/configure.in
deleted file mode 100644
index 4fa5ccdb672..00000000000
--- a/ndb/config/configure.in
+++ /dev/null
@@ -1,2085 +0,0 @@
-dnl -*- ksh -*-
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT(../../sql/mysqld.cc)
-AC_CANONICAL_SYSTEM
-# The Docs Makefile.am parses this line!
-AM_INIT_AUTOMAKE(mysql, 4.1.2-3.4.3-alpha)
-AM_CONFIG_HEADER(config.h)
-
-PROTOCOL_VERSION=10
-DOT_FRM_VERSION=6
-# See the libtool docs for information on how to do shared lib versions.
-SHARED_LIB_VERSION=14:0:0
-
-# Set all version vars based on $VERSION. How do we do this more elegant ?
-# Remember that regexps needs to quote [ and ] since this is run through m4
-MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
-MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"`
-MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
-
-# The port should be constant for a LONG time
-MYSQL_TCP_PORT_DEFAULT=3306
-MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
-
-#####
-#####
-
-AC_SUBST(MYSQL_NO_DASH_VERSION)
-AC_SUBST(MYSQL_BASE_VERSION)
-AC_SUBST(MYSQL_VERSION_ID)
-AC_SUBST(PROTOCOL_VERSION)
-AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, $PROTOCOL_VERSION)
-AC_SUBST(DOT_FRM_VERSION)
-AC_DEFINE_UNQUOTED(DOT_FRM_VERSION, $DOT_FRM_VERSION)
-AC_SUBST(SHARED_LIB_VERSION)
-
-# Canonicalize the configuration name.
-SYSTEM_TYPE="$host_vendor-$host_os"
-MACHINE_TYPE="$host_cpu"
-AC_SUBST(SYSTEM_TYPE)
-AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE")
-AC_SUBST(MACHINE_TYPE)
-AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$MACHINE_TYPE")
-
-# Detect intel x86 like processor
-BASE_MACHINE_TYPE=$MACHINE_TYPE
-case $MACHINE_TYPE in
- i?86) BASE_MACHINE_TYPE=i386 ;;
-esac
-
-# Save some variables and the command line options for mysqlbug
-SAVE_ASFLAGS="$ASFLAGS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_CXXFLAGS="$CXXFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-SAVE_CXXLDFLAGS="$CXXLDFLAGS"
-CONF_COMMAND="$0 $ac_configure_args"
-AC_SUBST(CONF_COMMAND)
-AC_SUBST(SAVE_ASFLAGS)
-AC_SUBST(SAVE_CFLAGS)
-AC_SUBST(SAVE_CXXFLAGS)
-AC_SUBST(SAVE_LDFLAGS)
-AC_SUBST(SAVE_CXXLDFLAGS)
-AC_SUBST(CXXLDFLAGS)
-
-AC_PREREQ(2.12)dnl Minimum Autoconf version required.
-
-AM_MAINTAINER_MODE
-#AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE
-AM_SANITY_CHECK
-# This is needed is SUBDIRS is set
-AC_PROG_MAKE_SET
-
-# This is need before AC_PROG_CC
-#
-
-if test "x${CFLAGS-}" = x ; then
- cflags_is_set=no
-else
- cflags_is_set=yes
-fi
-
-if test "x${CPPFLAGS-}" = x ; then
- cppflags_is_set=no
-else
- cppflags_is_set=yes
-fi
-
-if test "x${LDFLAGS-}" = x ; then
- ldflags_is_set=no
-else
- ldflags_is_set=yes
-fi
-
-# The following hack should ensure that configure doesn't add optimizing
-# or debugging flags to CFLAGS or CXXFLAGS
-CFLAGS="$CFLAGS "
-CXXFLAGS="$CXXFLAGS "
-
-dnl Checks for programs.
-AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_CPP
-
-# Print version of CC and CXX compiler (if they support --version)
-case $SYSTEM_TYPE in
- *netware*)
-CC_VERSION=`$CC -version | grep -i version`
- ;;
- *)
-CC_VERSION=`$CC --version | sed 1q`
- ;;
-esac
-if test $? -eq "0"
-then
- AC_MSG_CHECKING("C Compiler version");
- AC_MSG_RESULT("$CC $CC_VERSION")
-else
-CC_VERSION=""
-fi
-case $SYSTEM_TYPE in
- *netware*)
-CXX_VERSION=`$CXX -version | grep -i version`
- ;;
- *)
-CXX_VERSION=`$CXX --version | sed 1q`
- ;;
-esac
-if test $? -eq "0"
-then
- AC_MSG_CHECKING("C++ compiler version");
- AC_MSG_RESULT("$CXX $CXX_VERSION")
-else
-CXX_VERSION=""
-fi
-AC_SUBST(CXX_VERSION)
-AC_SUBST(CC_VERSION)
-
-# Fix for sgi gcc / sgiCC which tries to emulate gcc
-if test "$CC" = "sgicc"
-then
- ac_cv_prog_gcc="no"
-fi
-if test "$CXX" = "sgi++"
-then
- GXX="no"
-fi
-
-if test "$ac_cv_prog_gcc" = "yes"
-then
- AS="$CC -c"
- AC_SUBST(AS)
-else
- AC_PATH_PROG(AS, as, as)
-fi
-# Still need ranlib for readline; local static use only so no libtool.
-AC_PROG_RANLIB
-# We use libtool
-#AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
-
-# Ensure that we have --preserve-dup-deps defines, otherwise we get link
-# problems of 'mysql' with CXX=g++
-LIBTOOL="$LIBTOOL --preserve-dup-deps"
-AC_SUBST(LIBTOOL)dnl
-
-#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC
-
-# AC_PROG_INSTALL
-AC_PROG_INSTALL
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-# Not critical since the generated file is distributed
-AC_PROG_YACC
-AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
-AC_CHECK_PROG(DVIS, tex, manual.dvi)
-
-AC_MSG_CHECKING("return type of sprintf")
-
-#check the return type of sprintf
-case $SYSTEM_TYPE in
- *netware*)
- AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int")
- ;;
- *)
-AC_TRY_RUN([
- int main()
- {
- char* s = "hello";
- char buf[6];
- if((int)sprintf(buf, s) == strlen(s))
- return 0;
-
- return -1;
- }
- ],
-AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int"),
- AC_TRY_RUN([
- int main()
- {
- char* s = "hello";
- char buf[6];
- if((char*)sprintf(buf,s) == buf + strlen(s))
- return 0;
- return -1;
- }
-], AC_DEFINE(SPRINTF_RETURNS_PTR) AC_MSG_RESULT("ptr"),
- AC_DEFINE(SPRINTF_RETURNS_GARBAGE) AC_MSG_RESULT("garbage")))
- ;;
-esac
-
-
-# option, cache_name, variable,
-# code to execute if yes, code to exectute if fail
-AC_DEFUN(AC_SYS_COMPILER_FLAG,
-[
- AC_MSG_CHECKING($1)
- OLD_CFLAGS="[$]CFLAGS"
- AC_CACHE_VAL(mysql_cv_option_$2,
- [
- CFLAGS="[$]OLD_CFLAGS $1"
- AC_TRY_RUN([int main(){exit(0);}],mysql_cv_option_$2=yes,mysql_cv_option_$2=no,mysql_cv_option_$2=no)
- ])
-
- CFLAGS="[$]OLD_CFLAGS"
-
- if test x"[$]mysql_cv_option_$2" = "xyes" ; then
- $3="[$]$3 $1"
- AC_MSG_RESULT(yes)
- $5
- else
- AC_MSG_RESULT(no)
- $4
- fi
-])
-
-# arch, option, cache_name, variable
-AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG,
-[
- if test "`uname -m 2>/dev/null`" = "$1" ; then
- AC_SYS_COMPILER_FLAG($2,$3,$4)
- fi
-])
-
-# os, option, cache_name, variable
-AC_DEFUN(AC_SYS_OS_COMPILER_FLAG,
-[
- if test "x$mysql_cv_sys_os" = "x$1" ; then
- AC_SYS_COMPILER_FLAG($2,$3,$4)
- fi
-])
-
-# We need some special hacks when running slowaris
-AC_PATH_PROG(uname_prog, uname, no)
-
-# We should go through this and put all the explictly system dependent
-# stuff in one place
-AC_MSG_CHECKING(operating system)
-AC_CACHE_VAL(mysql_cv_sys_os,
-[
-if test "$uname_prog" != "no"; then
- mysql_cv_sys_os="`uname`"
-else
- mysql_cv_sys_os="Not Solaris"
-fi
-])
-AC_MSG_RESULT($mysql_cv_sys_os)
-
-# This should be rewritten to use $target_os
-case "$target_os" in
- sco3.2v5*)
- CFLAGS="$CFLAGS -DSCO"
- CXXFLAGS="$CXXFLAGS -DSCO"
- LD='$(CC) $(CFLAGS)'
- case "$CFLAGS" in
- *-belf*)
- AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
- case "$LDFLAGS" in
- *-belf*) ;;
- *) echo "Adding -belf option to ldflags."
- LDFLAGS="$LDFLAGS -belf"
- ;;
- esac
- ])
- ;;
- *)
- AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
- case "$LDFLAGS" in
- *-belf*) ;;
- *)
- echo "Adding -belf option to ldflags."
- LDFLAGS="$LDFLAGS -belf"
- ;;
- esac
- ])
- ;;
- esac
- ;;
- sysv5UnixWare*)
- if test "$GCC" != "yes"; then
- # We are using built-in inline function
- CFLAGS="$CFLAGS -Kalloca"
- fi
- CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
- ;;
- sysv5OpenUNIX8*)
- if test "$GCC" != "yes"; then
- # We are using built-in inline function
- CFLAGS="$CFLAGS -Kalloca"
- fi
- CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
- ;;
-esac
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CXX)
-AC_SUBST(CXXFLAGS)
-AC_SUBST(LD)
-AC_SUBST(INSTALL_SCRIPT)
-
-export CC CXX CFLAGS LD LDFLAGS AR
-
-if test "$GXX" = "yes"
-then
- # mysqld requires -fno-implicit-templates.
- # Disable exceptions as they seams to create problems with gcc and threads.
- # mysqld doesn't use run-time-type-checking, so we disable it.
- CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
-
- # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
- # we will gets some problems when linking static programs.
- # The following code is used to fix this problem.
-
- if test "$CXX" = "gcc" -o "$CXX" = "ccache gcc"
- then
- if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
- then
- CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
- fi
- fi
-fi
-
-# Avoid bug in fcntl on some versions of linux
-AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os")
-# Any wariation of Linux
-if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
-then
- MYSQLD_DEFAULT_SWITCHES="--skip-locking"
- IS_LINUX="true"
- AC_MSG_RESULT("yes");
-else
- MYSQLD_DEFAULT_SWITCHES=""
- IS_LINUX="false"
- AC_MSG_RESULT("no");
-fi
-AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
-AC_SUBST(IS_LINUX)
-
-dnl Find paths to some shell programs
-AC_PATH_PROG(LN, ln, ln)
-# This must be able to take a -f flag like normal unix ln.
-AC_PATH_PROG(LN_CP_F, ln, ln)
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-# If ln -f does not exists use -s (AFS systems)
-if test -n "$LN_CP_F"; then
- LN_CP_F="$LN_CP_F -s"
-fi
-fi
-
-AC_PATH_PROG(MV, mv, mv)
-AC_PATH_PROG(RM, rm, rm)
-AC_PATH_PROG(CP, cp, cp)
-AC_PATH_PROG(SED, sed, sed)
-AC_PATH_PROG(CMP, cmp, cmp)
-AC_PATH_PROG(CHMOD, chmod, chmod)
-AC_PATH_PROG(HOSTNAME, hostname, hostname)
-# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
-# fall back to 'tar' otherwise and hope that it's a GNU tar as well
-AC_CHECK_PROGS(TAR, gnutar gtar tar)
-
-dnl We use a path for perl so the script startup works
-dnl We make sure to use perl, not perl5, in hopes that the RPMs will
-dnl not depend on the perl5 binary being installed (probably a bug in RPM)
-AC_PATH_PROG(PERL, perl, no)
-if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
-then
- PERL5=$PERL
-else
- AC_PATH_PROG(PERL5, perl5, no)
- if test "$PERL5" != no
- then
- PERL=$PERL5
- ac_cv_path_PERL=$ac_cv_path_PERL5
- fi
-fi
-
-AC_SUBST(HOSTNAME)
-AC_SUBST(PERL)
-AC_SUBST(PERL5)
-
-# Lock for PS
-AC_PATH_PROG(PS, ps, ps)
-AC_MSG_CHECKING("how to check if pid exists")
-PS=$ac_cv_path_PS
-# Linux style
-if $PS p $$ 2> /dev/null | grep $0 > /dev/null
-then
- FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null"
-# Solaris
-elif $PS -p $$ 2> /dev/null | grep $0 > /dev/null
-then
- FIND_PROC="$PS -p \$\$PID | grep mysqld > /dev/null"
-# BSD style
-elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
-then
- FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null"
-# SysV style
-elif $PS -ef 2> /dev/null | grep $0 > /dev/null
-then
- FIND_PROC="$PS -ef | grep mysqld | grep \" \$\$PID \" > /dev/null"
-# Do anybody use this?
-elif $PS $$ 2> /dev/null | grep $0 > /dev/null
-then
- FIND_PROC="$PS \$\$PID | grep mysqld > /dev/null"
-else
- case $SYSTEM_TYPE in
- *freebsd*)
- FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null"
- ;;
- *darwin*)
- FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null"
- ;;
- *cygwin*)
- FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null"
- ;;
- *netware* | *modesto*)
- FIND_PROC=
- ;;
- *)
- AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
- esac
-fi
-AC_SUBST(FIND_PROC)
-AC_MSG_RESULT("$FIND_PROC")
-
-# Check if a pid is valid
-AC_PATH_PROG(KILL, kill, kill)
-AC_MSG_CHECKING("for kill switches")
-if $ac_cv_path_KILL -0 $$
-then
- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
-elif kill -s 0 $$
-then
- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
-else
- AC_MSG_WARN([kill -0 to check for pid seems to fail])
- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
-fi
-AC_SUBST(CHECK_PID)
-AC_MSG_RESULT("$CHECK_PID")
-
-# We need a ANSI C compiler
-AM_PROG_CC_STDC
-
-# We need an assembler, too
-AM_PROG_AS
-
-if test "$am_cv_prog_cc_stdc" = "no"
-then
- AC_MSG_ERROR([MySQL requires a ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
-fi
-
-NOINST_LDFLAGS=
-
-static_nss=""
-STATIC_NSS_FLAGS=""
-OTHER_LIBC_LIB=""
-AC_ARG_WITH(other-libc,
- [ --with-other-libc=DIR Link against libc and other standard libraries
- installed in the specified non-standard location
- overriding default. Originally added to be able to
- link against glibc 2.2 without making the user
- upgrade the standard libc installation.],
- [
- other_libc_include="$withval/include"
- other_libc_lib="$withval/lib"
- with_other_libc="yes"
- enable_shared="no"
- all_is_static="yes"
- CFLAGS="$CFLAGS -I$other_libc_include"
- # There seems to be a feature in gcc that treats system and libc headers
- # silently when they violatate ANSI C++ standard, but it is strict otherwise
- # since gcc cannot now recognize that our headers are libc, we work around
- # by telling it to be permissive. Note that this option only works with
- # new versions of gcc (2.95.x and above)
- CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include"
- if test -f "$other_libc_lib/libnss_files.a"
- then
- # libc has been compiled with --enable-static-nss
- # we need special flags, but we will have to add those later
- STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
- STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
- OTHER_LIBC_LIB="-static -L$other_libc_lib"
- static_nss=1
- else
- # this is a dirty hack. We if we detect static nss glibc in the special
- # location, we do not re-direct the linker to get libraries from there
- # during check. The reason is that if we did, we would have to find a
- # way to append the special static nss flags to LIBS every time we do
- # any check - this is definitely feasible, but not worthwhile the risk
- # of breaking other things. So for our purposes it would be sufficient
- # to assume that whoever is using static NSS knows what he is doing and
- # has sensible libraries in the regular location
- LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
- fi
-
- # When linking against custom libc installed separately, we want to force
- # all binary builds to be static, including the build done by configure
- # itself to test for system features.
- with_mysqld_ldflags="-all-static"
- with_client_ldflags="-all-static"
- NOINST_LDFLAGS="-all-static"
- ],
- [
- other_libc_include=
- other_libc_lib=
- with_other_libc="no"
- ]
-)
-AC_SUBST(NOINST_LDFLAGS)
-
-#
-# Check if we are using Linux and a glibc compiled with static nss
-# (this is true on the MySQL build machines to avoid NSS problems)
-#
-
-if test "$IS_LINUX" = "true" -a "$static_nss" = ""
-then
- tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r`
- if test -n "$tmp"
- then
- STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
- STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
- static_nss=1
- fi
-fi
-
-
-AC_ARG_WITH(server-suffix,
- [ --with-server-suffix Append value to the version string.],
- [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
- [ MYSQL_SERVER_SUFFIX= ]
- )
-AC_SUBST(MYSQL_SERVER_SUFFIX)
-
-# Set flags if we wants to have MIT threads.
-AC_ARG_WITH(mit-threads,
- [ --with-mit-threads Always use included thread lib.],
- [ with_mit_threads=$withval ],
- [ with_mit_threads=no ]
- )
-
-if test "$with_mit_threads" = "yes"
-then
- enable_largefile="no" # Will not work on Linux.
-fi
-
-# Set flags if we want to force to use pthreads
-AC_ARG_WITH(pthread,
- [ --with-pthread Force use of pthread library.],
- [ with_pthread=$withval ],
- [ with_pthread=no ]
- )
-
-# Force use of thread libs LIBS
-AC_ARG_WITH(named-thread-libs,
- [ --with-named-thread-libs=ARG
- Use specified thread libraries instead of
- those automatically found by configure.],
- [ with_named_thread=$withval ],
- [ with_named_thread=no ]
- )
-
-# Force use of a curses libs
-AC_ARG_WITH(named-curses-libs,
- [ --with-named-curses-libs=ARG
- Use specified curses libraries instead of
- those automatically found by configure.],
- [ with_named_curses=$withval ],
- [ with_named_curses=no ]
- )
-
-# Force use of a zlib (compress)
-AC_ARG_WITH(named-z-libs,
- [ --with-named-z-libs=ARG
- Use specified zlib libraries instead of
- those automatically found by configure.],
- [ with_named_zlib=$withval ],
- [ with_named_zlib=z ]
- )
-
-# Make thread safe client
-AC_ARG_ENABLE(thread-safe-client,
- [ --enable-thread-safe-client
- Compile the client with threads.],
- [ THREAD_SAFE_CLIENT=$enableval ],
- [ THREAD_SAFE_CLIENT=no ]
- )
-
-# compile with strings functions in assembler
-AC_ARG_ENABLE(assembler,
- [ --enable-assembler Use assembler versions of some string
- functions if available.],
- [ ENABLE_ASSEMBLER=$enableval ],
- [ ENABLE_ASSEMBLER=no ]
- )
-
-AC_MSG_CHECKING(if we should use assembler functions)
-# For now we only support assembler on i386 and sparc systems
-AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386")
-AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
-AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
-AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
-
-if test "$ASSEMBLER_TRUE" = ""
-then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-
-AC_MSG_CHECKING(if we should use RAID)
-AC_ARG_WITH(raid,
- [ --with-raid Enable RAID Support],
- [ USE_RAID=$withval ],
- [ USE_RAID=no ]
- )
-if test "$USE_RAID" = "yes"
-then
- AC_MSG_RESULT([yes])
- AC_DEFINE([USE_RAID])
-else
- AC_MSG_RESULT([no])
-fi
-
-# Use this to set the place used for unix socket used to local communication.
-AC_ARG_WITH(unix-socket-path,
- [ --with-unix-socket-path=SOCKET
- Where to put the unix-domain socket. SOCKET must be
- an absolute file name.],
- [ MYSQL_UNIX_ADDR=$withval ],
- [ MYSQL_UNIX_ADDR=$MYSQL_UNIX_ADDR_DEFAULT ]
- )
-AC_SUBST(MYSQL_UNIX_ADDR)
-
-AC_ARG_WITH(tcp-port,
- [ --with-tcp-port=port-number
- Which port to use for MySQL services (default 3306)],
- [ MYSQL_TCP_PORT=$withval ],
- [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT ]
- )
-AC_SUBST(MYSQL_TCP_PORT)
-# We might want to document the assigned port in the manual.
-AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
-
-# Use this to set the place used for unix socket used to local communication.
-AC_ARG_WITH(mysqld-user,
- [ --with-mysqld-user=username
- What user the mysqld daemon shall be run as.],
- [ MYSQLD_USER=$withval ],
- [ MYSQLD_USER=mysql ]
- )
-AC_SUBST(MYSQLD_USER)
-
-# If we should allow LOAD DATA LOCAL
-AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
-AC_ARG_ENABLE(local-infile,
- [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
- [ ENABLED_LOCAL_INFILE=$enableval ],
- [ ENABLED_LOCAL_INFILE=no ]
- )
-if test "$ENABLED_LOCAL_INFILE" = "yes"
-then
- AC_MSG_RESULT([yes])
- AC_DEFINE([ENABLED_LOCAL_INFILE])
-else
- AC_MSG_RESULT([no])
-fi
-
-MYSQL_SYS_LARGEFILE
-
-# Types that must be checked AFTER large file support is checked
-AC_TYPE_SIZE_T
-
-#--------------------------------------------------------------------
-# Check for system header files
-#--------------------------------------------------------------------
-
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
- memory.h pwd.h select.h \
- stdlib.h stddef.h \
- strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
- sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
- unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
- sys/ioctl.h malloc.h sys/malloc.h linux/config.h)
-
-#--------------------------------------------------------------------
-# Check for system libraries. Adds the library to $LIBS
-# and defines HAVE_LIBM etc
-#--------------------------------------------------------------------
-
-AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
-
-AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
- AC_CHECK_LIB(nsl, gethostbyname_r))
-AC_CHECK_FUNC(gethostbyname_r)
-
-AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
-AC_CHECK_FUNC(yp_get_default_domain, ,
- AC_CHECK_LIB(nsl, yp_get_default_domain))
-AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
-# This may get things to compile even if bind-8 is installed
-AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
-# For crypt() on Linux
-AC_CHECK_LIB(crypt, crypt)
-AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
-
-# For sem_xxx functions on Solaris 2.6
-AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init))
-
-# For compress in zlib
-MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
-
-#--------------------------------------------------------------------
-# Check for TCP wrapper support
-#--------------------------------------------------------------------
-
-AC_ARG_WITH(libwrap,
-[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
- case "$with_libwrap" in
- no) : ;;
- yes|*)
- _cppflags=${CPPFLAGS}
- _ldflags=${LDFLAGS}
-
- if test "$with_libwrap" != "yes"; then
- CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
- LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
- fi
-
- _libs=${LIBS}
- AC_CHECK_HEADER(tcpd.h,
- LIBS="-lwrap $LIBS"
- AC_MSG_CHECKING(for TCP wrappers library -lwrap)
- AC_TRY_LINK([#include <tcpd.h>
-int allow_severity = 0;
-int deny_severity = 0;
-
-struct request_info *req;
-],[hosts_access (req)],
- AC_MSG_RESULT(yes)
- AC_DEFINE(LIBWRAP)
- AC_DEFINE(HAVE_LIBWRAP)
- if test "$with_libwrap" != "yes"; then
- WRAPLIBS="-L${with_libwrap}/lib"
- fi
- WRAPLIBS="${WRAPLIBS} -lwrap",
- AC_MSG_RESULT(no)
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
- LDFLAGS=${_ldflags} LIBS=${_libs}
- ;;
- esac
-])
-AC_SUBST(WRAPLIBS)
-
-if test "$IS_LINUX" = "true"; then
- AC_MSG_CHECKING([for atomic operations])
-
- atom_ops=
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_add(5, &v);
- return atomic_read(&v) == 28 ? 0 : -1;
-}
- ], AC_DEFINE(HAVE_ATOMIC_ADD) atom_ops="${atom_ops}atomic_add ",
- )
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_sub(5, &v);
- return atomic_read(&v) == 18 ? 0 : -1;
-}
- ], AC_DEFINE(HAVE_ATOMIC_SUB) atom_ops="${atom_ops}atomic_sub ",
- )
-
- if test -z "$atom_ops"; then atom_ops="no"; fi
- AC_MSG_RESULT($atom_ops)
-
- AC_ARG_WITH(pstack,
- [ --with-pstack Use the pstack backtrace library],
- [ USE_PSTACK=$withval ],
- [ USE_PSTACK=no ])
- pstack_libs=
- pstack_dirs=
- if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no"
- then
- have_libiberty= have_libbfd=
- my_save_LIBS="$LIBS"
-dnl I have no idea if this is a good test - can not find docs for libiberty
- AC_CHECK_LIB([iberty], [fdmatch],
- [have_libiberty=yes
- AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])])
- LIBS="$my_save_LIBS"
-
- if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
- then
- pstack_dirs='$(top_srcdir)'/pstack
- pstack_libs="../pstack/libpstack.a -lbfd -liberty"
- # We must link staticly when using pstack
- with_mysqld_ldflags="-all-static"
- AC_SUBST([pstack_dirs])
- AC_SUBST([pstack_libs])
- AC_DEFINE([USE_PSTACK])
-dnl This check isn't needed, but might be nice to give some feedback....
-dnl AC_CHECK_HEADER(libiberty.h,
-dnl have_libiberty_h=yes,
-dnl have_libiberty_h=no)
- else
- USE_PSTACK="no"
- fi
- else
- USE_PSTACK="no"
- fi
-fi
-AM_CONDITIONAL(COMPILE_PSTACK, test "$USE_PSTACK" = "yes")
-AC_MSG_CHECKING([if we should use pstack])
-AC_MSG_RESULT([$USE_PSTACK])
-
-# Check for gtty if termio.h doesn't exists
-if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
-then
- AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
-fi
-# We make a special variable for client library's to avoid including
-# thread libs in the client.
-NON_THREADED_CLIENT_LIBS="$LIBS"
-
-AC_MSG_CHECKING([for int8])
-case $SYSTEM_TYPE in
- *netware)
- AC_MSG_RESULT([no])
- ;;
- *)
-AC_TRY_RUN([
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-int main()
-{
- int8 i;
- return 0;
-}
-], AC_DEFINE(HAVE_INT_8_16_32) AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])
-)
- ;;
-esac
-
-#
-# Some system specific hacks
-#
-
-MAX_C_OPTIMIZE="-O3"
-MAX_CXX_OPTIMIZE="-O3"
-
-case $SYSTEM_TYPE in
- *solaris2.7*)
- # Solaris 2.7 has a broken /usr/include/widec.h
- # Make a fixed copy in ./include
- echo "Fixing broken include files for $SYSTEM_TYPE"
- echo " - Creating local copy of widec.h"
- if test ! -d include
- then
- mkdir ./include
- fi
- builddir=`pwd`
- sed -e "s|^#if[ ]*!defined(lint) && !defined(__lint)|#if !defined\(lint\) \&\& !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
- CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- ;;
- *solaris2.8*)
- # Solaris 2.8 has a broken /usr/include/widec.h
- # Make a fixed copy in ./include
- echo "Fixing broken include files for $SYSTEM_TYPE"
- echo " - Creating local copy of widec.h"
- if test ! -d include
- then
- mkdir ./include
- fi
- builddir=`pwd`
- sed -e "s|^#if[ ]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
- CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- ;;
- *solaris2.5.1*)
- echo "Enabling getpass() workaround for Solaris 2.5.1"
- CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T";
- CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T -DSOLARIS"
- ;;
- *solaris*)
- CFLAGS="$CFLAGS -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T"
- ;;
- *SunOS*)
- echo "Enabling getpass() workaround for SunOS"
- CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS";
- ;;
- *hpux10.20*)
- echo "Enabling workarounds for hpux 10.20"
- CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
- CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
- if test "$with_named_thread" = "no"
- then
- echo "Using --with-named-thread=-lpthread"
- with_named_thread="-lcma"
- fi
- ;;
- *hpux11.*)
- echo "Enabling workarounds for hpux 11"
- CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
- CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
- if test "$with_named_thread" = "no"
- then
- echo "Using --with-named-thread=-lpthread"
- with_named_thread="-lpthread"
- fi
- # Fixes for HPUX 11.0 compiler
- if test "$ac_cv_prog_gcc" = "no"
- then
- CFLAGS="$CFLAGS -DHAVE_BROKEN_INLINE"
- CXXFLAGS="$CXXFLAGS +O2"
- MAX_C_OPTIMIZE=""
- MAX_CXX_OPTIMIZE=""
- fi
- ;;
- *rhapsody*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- CPPFLAGS="$CPPFLAGS -traditional-cpp "
- CFLAGS="-DHAVE_CTHREADS_WRAPPER -DDO_NOT_REMOVE_THREAD_WRAPPERS"
- CXXFLAGS="-DHAVE_CTHREADS_WRAPPER"
- if test $with_named_curses = "no"
- then
- with_named_curses=""
- fi
- fi
- ;;
- *darwin5*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- with_named_curses=""
- fi
- ;;
- *darwin6*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- fi
- ;;
- *darwin7*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- fi
- ;;
- *freebsd*)
- echo "Adding fix for interrupted reads"
- OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
- if test "$OSVERSION" -gt "480100" && \
- test "$OSVERSION" -lt "500000" || \
- test "$OSVERSION" -gt "500109"
- then
- CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
- else
- CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
- CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH"
- fi
- ;;
- *netbsd*)
- echo "Adding flag -Dunix"
- CFLAGS="$CFLAGS -Dunix"
- CXXFLAGS="$CXXFLAGS -Dunix"
- OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a"
- ;;
- *bsdi*)
- echo "Adding fix for BSDI"
- CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH"
- AC_DEFINE_UNQUOTED(SOCKOPT_OPTLEN_TYPE, size_t)
- ;;
- *sgi-irix6*)
- if test "$with_named_thread" = "no"
- then
- echo "Using --with-named-thread=-lpthread"
- with_named_thread="-lpthread"
- fi
- CXXFLAGS="$CXXFLAGS -D_BOOL"
- ;;
- *aix4.3*)
- echo "Adding defines for AIX"
- CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
- CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
- ;;
-dnl Is this the right match for DEC OSF on alpha?
- *dec-osf*)
- if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha"
- then
- echo "Adding defines for DEC OSF on alpha"
- CFLAGS="$CFLAGS -mieee"
- CXXFLAGS="$CXXFLAGS -mieee"
- fi
- echo "Adding defines for OSF1"
- # gethostbyname_r is deprecated and doesn't work ok on OSF1
- CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
- CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
- ;;
- *netware*)
- # No need for curses library so set it to null
- with_named_curses=""
-
- # No thread library - in LibC
- with_named_thread=""
-
- #
- # Edit Makefile.in files.
- #
- echo -n "configuring Makefile.in files for NetWare... "
- for file in sql/Makefile.in libmysql/Makefile.in libmysql_r/Makefile.in sql/share/Makefile.in strings/Makefile.in client/Makefile.in
- do
- # echo "#### $file ####"
- filedir="`dirname $file`"
- filebase="`basename $file`"
- filesed=$filedir/$filebase.sed
- #
- # Backup and always use original file
- #
- if test -f $file.bk
- then
- cp -fp $file.bk $file
- else
- cp -fp $file $file.bk
- fi
- case $file in
- sql/Makefile.in)
- # Use gen_lex_hash.linux instead of gen_lex_hash
- # Add library dependencies to mysqld_DEPENDENCIES
- lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
- cat > $filesed << EOF
-s,\(^.*\$(MAKE) gen_lex_hash\),#\1,
-s,\(\./gen_lex_hash\),\1.linux,
-s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
-EOF
- ;;
- sql/share/Makefile.in)
- cat > $filesed << EOF
-s,\(extra/comp_err\),\1.linux,
-EOF
- ;;
- libmysql/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
-EOF
- ;;
- libmysql_r/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
-EOF
- ;;
- strings/Makefile.in)
- cat > $filesed << EOF
-s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
-s,\(: conf_to_src\),\1.linux,
-EOF
- ;;
- client/Makefile.in)
- #
- cat > $filesed << EOF
-s,libmysqlclient.la,.libs/libmysqlclient.a,
-EOF
- ;;
- esac
- if `sed -f $filesed $file > $file.nw`;\
- then
- mv -f $file.nw $file
- rm -f $filesed
- else
- exit 1
- fi
- # wait for file system changes to complete
- sleep 1
- done
- echo "done"
-
- #
- # Make sure the following files are writable.
- #
- # When the files are retrieved from some source code control systems they are read-only.
- #
- echo -n "making sure specific build files are writable... "
- for file in \
- Docs/include.texi \
- Docs/mysql.info \
- Docs/manual.txt \
- Docs/manual_toc.html \
- Docs/manual.html \
- Docs/INSTALL-BINARY \
- INSTALL-SOURCE \
- COPYING \
- COPYING.LIB \
- MIRRORS
- do
- if test -e $file; then
- chmod +w $file
- fi
- done
- echo "done"
-
- ;;
-esac
-
-
-#---START: Used in for client configure
-# Check if we threads are in libc or if we should use
-# -lpthread, -lpthreads or mit-pthreads
-# We have to check libc last because else it fails on Solaris 2.6
-
-with_posix_threads="no"
-# Hack for DEC-UNIX (OSF1)
-if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-then
- # Look for LinuxThreads.
- AC_MSG_CHECKING("LinuxThreads")
- res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
- if test "$res" -gt 0
- then
- AC_MSG_RESULT("Found")
- AC_DEFINE(HAVE_LINUXTHREADS)
- # Linux 2.0 sanity check
- AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
- AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
- # RedHat 5.0 does not work with dynamic linking of this. -static also
- # gives a speed increase in linux so it does not hurt on other systems.
- with_named_thread="-lpthread"
- else
- AC_MSG_RESULT("Not found")
- # If this is a linux machine we should barf
- if test "$IS_LINUX" = "true"
- then
- AC_MSG_ERROR([This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used. Please install Linuxthreads
-(or a new glibc) and try again. See the Installation chapter in the
-Reference Manual for more information.])
- else
- AC_MSG_CHECKING("DEC threads")
- if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
- then
- with_named_thread="-lpthread -lmach -lexc"
- CFLAGS="$CFLAGS -D_REENTRANT"
- CXXFLAGS="$CXXFLAGS -D_REENTRANT"
- AC_DEFINE(HAVE_DEC_THREADS)
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- AC_MSG_CHECKING("DEC 3.2 threads")
- if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
- then
- with_named_thread="-lpthreads -lmach -lc_r"
- AC_DEFINE(HAVE_DEC_THREADS)
- AC_DEFINE(HAVE_DEC_3_2_THREADS)
- with_osf32_threads="yes"
- MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority"
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi
- fi
- fi
- fi
-fi
-
-
-dnl This is needed because -lsocket has to come after the thread
-dnl library on SCO.
-AC_DEFUN([MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK], [
- LIBS=`echo " $LIBS " | sed -e 's/ -lsocket / /g'`
-])
-# Hack for SCO UNIX
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("SCO threads")
- if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
- then
- if test -f /usr/lib/libgthreads.a -o -f /usr/lib/libgthreads.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- with_named_thread="-lgthreads -lsocket -lgthreads"
- # sched.h conflicts with fsu-threads
- touch ./include/sched.h
-
- # We must have gcc
- if expr "$CC" : ".*gcc.*"
- then
- AC_MSG_RESULT("yes")
- else
- AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]);
- fi
- AC_MSG_RESULT("yes")
- elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- with_named_thread="-lpthread -lsocket"
- # sched.h conflicts with fsu-threads
- # touch ./include/sched.h
-
- AC_MSG_CHECKING("for gcc")
- # We must have gcc
- if expr "$CC" : ".*gcc.*"
- then
- AC_MSG_RESULT("yes")
- else
- AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]);
- fi
- AC_MSG_RESULT("yes")
- # Hack for SCO UnixWare 7.1.x
- #
- elif test "$with_named_thread" = "no"
- then
- AC_MSG_RESULT("no")
- AC_MSG_CHECKING("SCO UnixWare 7.1.x native threads")
- if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
- then
- with_named_thread="-pthread -lsocket -lnsl"
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS)
- else
- AC_DEFINE(HAVE_UNIXWARE7_POSIX)
- fi
- AC_MSG_RESULT("yes")
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- fi
- else
- { echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
- fi
- else
- AC_MSG_RESULT("no")
- fi
- else
- AC_MSG_ERROR([On SCO UNIX MySQL requires that the FSUThreads package is installed. See the Installation chapter in the Reference Manual.]);
- fi
- else
- AC_MSG_RESULT("no")
- fi
-fi
-# Hack for SCO UnixWare7
-#
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("SCO UnixWare7 native threads")
- if expr "$SYSTEM_TYPE" : ".*UnixWare*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
- then
- with_named_thread="-pthread -lsocket -lnsl"
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS)
- else
- AC_DEFINE(HAVE_UNIXWARE7_POSIX)
- fi
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- fi
- AC_MSG_RESULT("yes")
- else
- { echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
- fi
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-# Hack for Caldera OpenUNIX8
-#
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("OpenUNIX8 native threads")
- if expr "$SYSTEM_TYPE" : ".*OpenUNIX*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
- then
- with_named_thread="-pthread -lsocket -lnsl"
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS)
- else
- AC_DEFINE(HAVE_UNIXWARE7_POSIX)
- fi
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- fi
- AC_MSG_RESULT("yes")
- else
- { echo "configure: error: Can't find thread libs on Caldera OpenUNIX 8. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
- fi
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-# Hack for Siemens UNIX
-if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-then
- AC_MSG_CHECKING("Siemens threads")
- if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4"
- then
- LIBS="-lxnet $LIBS"
- NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS -lxnet"
- with_named_thread="-Kthread $LDFLAGS -lxnet"
- LD_FLAGS=""
- CFLAGS="-Kthread $CFLAGS"
- CXXFLAGS="-Kthread $CXXFLAGS"
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-# Use library named -lpthread
-if test "$with_named_thread" = "no" -a "$with_pthread" = "yes"
-then
- with_named_thread="-lpthread"
-fi
-
-#---END:
-
-# Hack for Solaris >= 2.5
-# We want both the new and the old interface
-
-if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-then
- AC_MSG_CHECKING("Solaris threads")
- if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so
- then
- with_named_thread="-lpthread -lthread"
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS"
-
-# Should we use named pthread library ?
-AC_MSG_CHECKING("named thread libs:")
-if test "$with_named_thread" != "no"
-then
- LIBS="$with_named_thread $LIBS $with_named_thread"
- TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread"
- with_posix_threads="yes"
- with_mit_threads="no"
- AC_MSG_RESULT("$with_named_thread")
-else
- AC_MSG_RESULT("no")
- if test "$with_mit_threads" = "no"
- then
- # pthread_create is in standard libraries (As in BSDI 3.0)
- AC_MSG_CHECKING("for pthread_create in -libc");
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- AC_MSG_CHECKING("for pthread_create in -lpthread");
- ac_save_LIBS="$LIBS"
- ac_save_TOOLS_LIBS="$TOOLS_LIBS"
- LIBS="$LIBS -lpthread"
- TOOLS_LIBS="$TOOLS_LIBS -lpthread"
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- LIBS=" $ac_save_LIBS -lpthreads"
- TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads"
- AC_MSG_CHECKING("for pthread_create in -lpthreads");
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- # This is for FreeBSD
- LIBS="$ac_save_LIBS -pthread"
- TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread"
- AC_MSG_CHECKING("for pthread_create in -pthread");
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- with_mit_threads="yes"
- LIBS="$ac_save_LIBS"
- TOOLS_LIBS="$ac_save_TOOLS_LIBS"
- fi
- fi
- fi
- fi
- fi
-fi
-
-#---START: Used in for client configure
-# Must be checked after, because strtok_r may be in -lpthread
-# On AIX strtok_r is in libc_r
-
-my_save_LIBS="$LIBS"
-AC_CHECK_LIB(pthread,strtok_r)
-LIBS="$my_save_LIBS"
-if test "$ac_cv_lib_pthread_strtok_r" = "no"
-then
- AC_CHECK_LIB(c_r,strtok_r)
- case "$with_osf32_threads---$target_os" in
- # Don't keep -lc_r in LIBS; -pthread handles it magically
- yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;;
-
- esac
- AC_CHECK_FUNCS(strtok_r pthread_init)
-else
- AC_CHECK_FUNCS(strtok_r)
-fi
-#---END:
-
-# Check for dlopen, needed for user definable functions
-# This must be checked after threads on AIX
-# We only need this for mysqld, not for the clients.
-
-my_save_LIBS="$LIBS"
-LIBS=""
-AC_CHECK_LIB(dl,dlopen)
-LIBDL=$LIBS
-LIBS="$my_save_LIBS"
-AC_SUBST(LIBDL)
-
-# System characteristics
-case $SYSTEM_TYPE in
- *netware* | *modesto*) ;;
- *)
-AC_SYS_RESTARTABLE_SYSCALLS
- ;;
-esac
-
-# Build optimized or debug version ?
-# First check for gcc and g++
-if test "$ac_cv_prog_gcc" = "yes"
-then
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC="-O"
- OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
-else
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC=""
- OPTIMIZE_CFLAGS="-O"
-fi
-if test "$ac_cv_prog_cxx_g" = "yes"
-then
- DEBUG_CXXFLAGS="-g"
- DEBUG_OPTIMIZE_CXX="-O"
- OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
-else
- DEBUG_CXXFLAGS="-g"
- DEBUG_OPTIMIZE_CXX=""
- OPTIMIZE_CXXFLAGS="-O"
-fi
-
-if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
- DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG -sym internal,codeview4"
- DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -DDEBUG -sym internal,codeview4"
- OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -DNDEBUG"
- OPTIMIZE_CXXFLAGS="$OPTIMIZE_CXXFLAGS -DNDEBUG"
-fi
-
-AC_ARG_WITH(debug,
- [ --without-debug Build a production version without debugging code],
- [with_debug=$withval],
- [with_debug=no])
-if test "$with_debug" = "yes"
-then
- # Medium debug.
- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
-elif test "$with_debug" = "full"
-then
- # Full debug. Very slow in some cases
- CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
-else
- # Optimized version. No debug
- CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
- CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
-fi
-
-# Force static compilation to avoid linking problems/get more speed
-AC_ARG_WITH(mysqld-ldflags,
- [ --with-mysqld-ldflags Extra linking arguments for mysqld],
- [MYSQLD_EXTRA_LDFLAGS=$withval],
- [MYSQLD_EXTRA_LDFLAGS=])
-AC_SUBST(MYSQLD_EXTRA_LDFLAGS)
-
-AC_ARG_WITH(client-ldflags,
- [ --with-client-ldflags Extra linking arguments for clients],
- [CLIENT_EXTRA_LDFLAGS=$withval],
- [CLIENT_EXTRA_LDFLAGS=])
-AC_SUBST(CLIENT_EXTRA_LDFLAGS)
-
-AC_ARG_WITH(lib-ccflags,
- [ --with-lib-ccflags Extra CC options for libraries],
- [LIB_EXTRA_CCFLAGS=$withval],
- [LIB_EXTRA_CCFLAGS=])
-AC_SUBST(LIB_EXTRA_CCFLAGS)
-
-# Avoid stupid bug on some OS
-AC_ARG_WITH(low-memory,
- [ --with-low-memory Try to use less memory to compile to avoid
- memory limitations.],
- [with_lowmem=$withval],
- [with_lowmem=no])
-if test "$with_lowmem" = "yes"
-then
- if test "$ac_cv_prog_gcc" = "yes"
- then
- LM_CFLAGS="-fno-inline"
- else
- LM_CFLAGS="-O0"
- fi
-else
- LM_CFLAGS=""
-fi
-AC_SUBST(LM_CFLAGS)
-
-AC_ARG_WITH(comment,
- [ --with-comment Comment about compilation environment.],
- [with_comment=$withval],
- [with_comment=no])
-if test "$with_comment" != "no"
-then
- COMPILATION_COMMENT=$with_comment
-else
- COMPILATION_COMMENT="Source distribution"
-fi
-AC_SUBST(COMPILATION_COMMENT)
-
-AC_MSG_CHECKING("need of special linking flags")
-if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
-then
- LDFLAGS="$LDFLAGS -rdynamic"
- AC_MSG_RESULT("-rdynamic")
-else
- AC_MSG_RESULT("none")
-fi
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_OFF_T
-AC_STRUCT_ST_RDEV
-AC_HEADER_TIME
-AC_STRUCT_TM
-# AC_CHECK_SIZEOF return 0 when it does not find the size of a
-# type. We want a error instead.
-AC_CHECK_SIZEOF(char, 1)
-if test "$ac_cv_sizeof_char" -eq 0
-then
- AC_MSG_ERROR([No size for char type.
-A likely cause for this could be that there isn't any
-static libraries installed. You can verify this by checking if you have libm.a
-in /lib, /usr/lib or some other standard place. If this is the problem,
-install the static libraries and try again. If this isn't the problem,
-examine config.log for possible errors. If you want to report this, use
-'scripts/mysqlbug' and include at least the last 20 rows from config.log!])
-fi
-AC_CHECK_SIZEOF(char*, 4)
-AC_CHECK_SIZEOF(int, 4)
-if test "$ac_cv_sizeof_int" -eq 0
-then
- AC_MSG_ERROR("No size for int type.")
-fi
-AC_CHECK_SIZEOF(long, 4)
-if test "$ac_cv_sizeof_long" -eq 0
-then
- AC_MSG_ERROR("No size for long type.")
-fi
-AC_CHECK_SIZEOF(long long, 8)
-if test "$ac_cv_sizeof_long_long" -eq 0
-then
- AC_MSG_ERROR("MySQL needs a long long type.")
-fi
-# off_t is not a builtin type
-MYSQL_CHECK_SIZEOF(off_t, 4)
-if test "$ac_cv_sizeof_off_t" -eq 0
-then
- AC_MSG_ERROR("MySQL needs a off_t type.")
-fi
-# This always gives a warning. Ignore it unless you are cross compiling
-AC_C_BIGENDIAN
-#---START: Used in for client configure
-# Check base type of last arg to accept
-MYSQL_TYPE_ACCEPT
-
-#---END:
-# Find where the stack goes
-MYSQL_STACK_DIRECTION
-# We want to skip alloca on irix unconditionally. It may work on some version..
-MYSQL_FUNC_ALLOCA
-# Do struct timespec have members tv_sec or ts_sec
-MYSQL_TIMESPEC_TS
-# Do we have the tzname variable
-MYSQL_TZNAME
-# Do the system files define ulong
-MYSQL_CHECK_ULONG
-# Do the system files define uchar
-MYSQL_CHECK_UCHAR
-# Do the system files define uint
-MYSQL_CHECK_UINT
-# Check for fp_except in ieeefp.h
-MYSQL_CHECK_FP_EXCEPT
-# Check for IN_ADDR_T
-MYSQL_CHECK_IN_ADDR_T
-# Do the c++ compiler have a bool type
-MYSQL_CXX_BOOL
-# Check some common bugs with gcc 2.8.# on sparc
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-MYSQL_CHECK_LONGLONG_TO_FLOAT
-if test "$ac_cv_conv_longlong_to_float" != "yes"
-then
- AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
-If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
-again]);
-fi
-fi
-MYSQL_PTHREAD_YIELD
-
-######################################################################
-# For readline/libedit (We simply move the mimimum amount of stuff from
-# the readline/libedit configure.in here)
-
-dnl Checks for header files.
-AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
-
-dnl Checks for library functions.
-AC_FUNC_ALLOCA
-AC_PROG_GCC_TRADITIONAL
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(re_comp regcomp strdup)
-
-AC_CHECK_HEADERS(vis.h)
-AC_CHECK_FUNCS(strlcat strlcpy)
-AC_CHECK_FUNCS(issetugid)
-AC_CHECK_FUNCS(fgetln)
-AC_CHECK_FUNCS(getline flockfile)
-
-# from old readline settting:
-
-MAKE_SHELL=/bin/sh
-AC_SUBST(MAKE_SHELL)
-
-# Already-done: stdlib.h string.h unistd.h termios.h
-AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
- sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
- sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
-paths.h semaphore.h)
-
-# Already-done: strcasecmp
-AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
-
-AC_STAT_MACROS_BROKEN
-MYSQL_SIGNAL_CHECK
-MYSQL_CHECK_GETPW_FUNCS
-MYSQL_HAVE_TIOCGWINSZ
-MYSQL_HAVE_FIONREAD
-MYSQL_HAVE_TIOCSTAT
-MYSQL_STRUCT_DIRENT_D_INO
-MYSQL_TYPE_SIGHANDLER
-if test "$with_named_curses" = "no"
-then
- MYSQL_CHECK_LIB_TERMCAP
-else
- TERMCAP_LIB="$with_named_curses"
-fi
-AC_SUBST(TERMCAP_LIB)
-
-# End of readline/libedit stuff
-#########################################################################
-
-dnl Checks for library functions.
-
-#
-# The following code disables intrinsic function support while we test for
-# library functions. This is to avoid configure problems with Intel ecc
-# compiler
-
-ORG_CFLAGS="$CFLAGS"
-if test "$GCC" != "yes"; then
- AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
-fi
-
-AC_FUNC_MMAP
-AC_TYPE_SIGNAL
-MYSQL_TYPE_QSORT
-AC_FUNC_UTIME_NULL
-AC_FUNC_VPRINTF
-
-AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
- fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
- getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
- getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
- localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
- mkstemp mlockall perror poll pread pthread_attr_create clock_gettime \
- pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
- pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
- pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
- pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
- realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \
- snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
- strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
-
-# isinf() could be a function or a macro (HPUX)
-AC_MSG_CHECKING(for isinf with <math.h>)
-AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],
- AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISINF,,[isinf() macro or function]),
- AC_MSG_RESULT(no))
-
-CFLAGS="$ORG_CFLAGS"
-
-# Sanity check: We chould not have any fseeko symbol unless
-# large_file_support=yes
-AC_CHECK_FUNC(fseeko,
-[if test "$large_file_support" = no -a "$IS_LINUX" = "true";
-then
- AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!");
-fi]
-)
-
-my_save_LIBS="$LIBS"
-LIBS="$LIBS $LIBDL"
-AC_CHECK_FUNCS(dlopen dlerror)
-LIBS="$my_save_LIBS"
-
-# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-# Do not treat warnings as errors if we are linking against other libc
-# this is to work around gcc not being permissive on non-system includes
-# with respect to ANSI C++
-# We also remove the -fbranch-probabilities option as this will give warnings
-# about not profiled code, which confuses configure
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
-fi
-
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
- struct hostent *foo = gethostbyaddr_r((const char *) 0,
- 0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);],
-mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethost_style" = "solaris"
-then
- AC_DEFINE(HAVE_SOLARIS_STYLE_GETHOST)
-fi
-
-#---START: Used in for client configure
-
-# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
-fi
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
-
- skr = gethostbyname_r((const char *) 0,
- (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
-mysql_cv_gethostname_style=glibc2, mysql_cv_gethostname_style=other))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostname_style" = "glibc2"
-then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
-fi
-
-# Check 3rd argument of getthostbyname_r
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([3 argument to gethostname_r routines], mysql_cv_gethostname_arg,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
-fi
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
-
- skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
-mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostname_arg" = "hostent_data"
-then
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_RETURN_INT)
-fi
-
-
-if test "$with_mit_threads" = "no"
-then
- # Check definition of pthread_getspecific
- AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
- AC_TRY_COMPILE(
-[#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h> ],
-[ void *pthread_getspecific(pthread_key_t key);
-pthread_getspecific((pthread_key_t) NULL); ],
-mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
- if test "$mysql_cv_getspecific_args" = "other"
- then
- AC_DEFINE(HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
- fi
-
- # Check definition of pthread_mutex_init
- AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
- AC_TRY_COMPILE(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h> ],
-[
- pthread_mutexattr_t attr;
- pthread_mutex_t mp;
- pthread_mutex_init(&mp,&attr); ],
-mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
- if test "$mysql_cv_mutex_init_args" = "other"
- then
- AC_DEFINE(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT)
- fi
-fi
-#---END:
-
-#---START: Used in for client configure
-# Check definition of readdir_r
-AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <dirent.h>],
-[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
-readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
-mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
-if test "$mysql_cv_readdir_r" = "POSIX"
-then
- AC_DEFINE(HAVE_READDIR_R)
-fi
-
-# Check definition of posix sigwait()
-AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <signal.h>],
-[#ifndef _AIX
-sigset_t set;
-int sig;
-sigwait(&set,&sig);
-#endif],
-mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
-if test "$mysql_cv_sigwait" = "POSIX"
-then
- AC_DEFINE(HAVE_SIGWAIT)
-fi
-
-if test "$mysql_cv_sigwait" != "POSIX"
-then
-unset mysql_cv_sigwait
-# Check definition of posix sigwait()
-AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <signal.h>],
-[sigset_t set;
-int sig;
-sigwait(&set);],
-mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
-if test "$mysql_cv_sigwait" = "NONPOSIX"
-then
- AC_DEFINE(HAVE_NONPOSIX_SIGWAIT)
-fi
-fi
-#---END:
-
-# Check if pthread_attr_setscope() exists
-AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>],
-[pthread_attr_t thr_attr;
-pthread_attr_setscope(&thr_attr,0);],
-mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no))
-if test "$mysql_cv_pthread_attr_setscope" = "yes"
-then
- AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE)
-fi
-
-# Check for bad includes
-AC_MSG_CHECKING("can netinet files be included")
-AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/tcp.h>],
-[ printf("1\n"); ],
-netinet_inc=yes, netinet_inc=no)
-if test "$netinet_inc" = "no"
-then
- AC_DEFINE(HAVE_BROKEN_NETINET_INCLUDES)
-fi
-AC_MSG_RESULT("$netinet_inc")
-
-# Some usefull subst
-AC_SUBST(CC)
-AC_SUBST(GXX)
-
-# Output results
-AC_OUTPUT(Makefile dnl
- , , [
- test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
- ])
diff --git a/ndb/config/type_kernel.mk.am b/ndb/config/type_kernel.mk.am
new file mode 100644
index 00000000000..703876ee2e9
--- /dev/null
+++ b/ndb/config/type_kernel.mk.am
@@ -0,0 +1,18 @@
+
+INCLUDES += \
+ -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/ndb/include \
+ -I$(top_srcdir)/ndb/src/kernel/vm \
+ -I$(top_srcdir)/ndb/src/kernel/error \
+ -I$(top_srcdir)/ndb/src/kernel \
+ -I$(top_srcdir)/ndb/include/kernel \
+ -I$(top_srcdir)/ndb/include/transporter \
+ -I$(top_srcdir)/ndb/include/debugger \
+ -I$(top_srcdir)/ndb/include/mgmapi \
+ -I$(top_srcdir)/ndb/include/mgmcommon \
+ -I$(top_srcdir)/ndb/include/ndbapi \
+ -I$(top_srcdir)/ndb/include/util \
+ -I$(top_srcdir)/ndb/include/portlib \
+ -I$(top_srcdir)/ndb/include/logger
+
+#AM_LDFLAGS = @ndb_ldflags@
diff --git a/ndb/config/type_mgmapiclient.mk.am b/ndb/config/type_mgmapiclient.mk.am
new file mode 100644
index 00000000000..1ef4a81d67e
--- /dev/null
+++ b/ndb/config/type_mgmapiclient.mk.am
@@ -0,0 +1,2 @@
+
+INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi
diff --git a/ndb/config/type_ndbapi.mk.am b/ndb/config/type_ndbapi.mk.am
new file mode 100644
index 00000000000..ed648273aea
--- /dev/null
+++ b/ndb/config/type_ndbapi.mk.am
@@ -0,0 +1,12 @@
+
+INCLUDES += \
+ -I$(srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include \
+ -I$(top_srcdir)/ndb/include/kernel \
+ -I$(top_srcdir)/ndb/include/transporter \
+ -I$(top_srcdir)/ndb/include/debugger \
+ -I$(top_srcdir)/ndb/include/mgmapi \
+ -I$(top_srcdir)/ndb/include/mgmcommon \
+ -I$(top_srcdir)/ndb/include/ndbapi \
+ -I$(top_srcdir)/ndb/include/util \
+ -I$(top_srcdir)/ndb/include/portlib \
+ -I$(top_srcdir)/ndb/include/logger
diff --git a/ndb/config/type_ndbapiclient.mk.am b/ndb/config/type_ndbapiclient.mk.am
new file mode 100644
index 00000000000..88b57e49e19
--- /dev/null
+++ b/ndb/config/type_ndbapiclient.mk.am
@@ -0,0 +1,2 @@
+
+INCLUDES += -I$(top_srcdir)/ndb/include/ndbapi
diff --git a/ndb/config/type_ndbapitest.mk.am b/ndb/config/type_ndbapitest.mk.am
new file mode 100644
index 00000000000..3132dd30f0b
--- /dev/null
+++ b/ndb/config/type_ndbapitest.mk.am
@@ -0,0 +1,11 @@
+
+LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \
+ $(top_builddir)/ndb/src/libndbclient.la
+
+INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/ndb/include \
+ -I$(top_srcdir)/ndb/include/ndbapi \
+ -I$(top_srcdir)/ndb/include/util \
+ -I$(top_srcdir)/ndb/include/portlib \
+ -I$(top_srcdir)/ndb/test/include \
+ -I$(top_srcdir)/ndb/include/mgmapi
diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am
new file mode 100644
index 00000000000..a8b511d3637
--- /dev/null
+++ b/ndb/config/type_ndbapitools.mk.am
@@ -0,0 +1,10 @@
+
+LDADD += $(top_builddir)/ndb/src/libndbclient.la
+
+INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/ndb/include \
+ -I$(top_srcdir)/ndb/include/ndbapi \
+ -I$(top_srcdir)/ndb/include/util \
+ -I$(top_srcdir)/ndb/include/portlib \
+ -I$(top_srcdir)/ndb/test/include \
+ -I$(top_srcdir)/ndb/include/mgmapi
diff --git a/ndb/config/type_util.mk.am b/ndb/config/type_util.mk.am
new file mode 100644
index 00000000000..0dfa77b7a7c
--- /dev/null
+++ b/ndb/config/type_util.mk.am
@@ -0,0 +1,6 @@
+
+INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/ndb/include \
+ -I$(top_srcdir)/ndb/include/util \
+ -I$(top_srcdir)/ndb/include/portlib \
+ -I$(top_srcdir)/ndb/include/logger
diff --git a/ndb/configure b/ndb/configure
deleted file mode 100755
index f0fc197f45e..00000000000
--- a/ndb/configure
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/sh
-
-if [ $# -gt 0 -a "$1" = "-p" ]
-then
- shift
- NDB_TOP=$1
- shift
-else
- NDB_TOP=`pwd`
-fi
-
-cd $NDB_TOP
-NDB_TOP=`pwd`
-
-for i in `find . -name 'Makefile' -exec dirname {} \;`
-do
- cd $i
- rel_path=.
- while [ $NDB_TOP != `pwd` ]
- do
- rel_path=$rel_path"/.."
- cd ..
- done
-
- (
- echo "NDB_TOP=$rel_path"
- echo "include $rel_path/Defs.mk"
- ) > $i/.defs.mk
-done
-
-( cd config ; aclocal ; automake ; aclocal ; autoconf ; ./configure )
-export NDB_TOP
-. config/GuessConfig.sh $*
diff --git a/ndb/docs/Makefile b/ndb/docs/Makefile
deleted file mode 100644
index a2139b66044..00000000000
--- a/ndb/docs/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-include .defs.mk
-#
-# hack before full autoconf
-replace-targets := all clean
-first-docs: all
-
-include $(NDB_TOP)/Epilogue.mk
-
-all: ndbapidoc mgmapidoc
-
-DOXYGEN = doxygen
-DOXYTOP = $(shell cd $(NDB_TOP); pwd)/docs
-DOXYDIR = $(DOXYTOP)/doxygen
-DOXYTMP = $(DOXYTOP)/.doxytmp
-DOXYOUT = $(DOXYTOP)/.doxyout
-
-clean:
- rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html
- rm -rf $(DOXYTMP) $(DOXYOUT)
-
-###
-#
-# NDB API Programmer's Guide
-#
-ndbapidoc: ndbapi.pdf
-
-ndbapi.pdf: $(NDB_TOP)/include/ndb_version.h
- @set -x; \
- rm -rf ndbapi.pdf ndbapi.html; \
- rm -rf $(DOXYTMP) $(DOXYOUT); \
- mkdir -p $(DOXYTMP) $(DOXYOUT); \
- (cd $(NDB_TOP)/include/ndbapi && \
- find . -type f -print | \
- grep -v /SCCS | \
- cpio -pdm $(DOXYTMP)); \
- (cd $(NDB_TOP)/examples && \
- cp -p */*.[ch]pp $(DOXYTMP)); \
- $(DOXYDIR)/predoxy.pl; \
- mv footer.html $(DOXYTMP); \
- (cd $(DOXYTMP) && \
- $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndbapi); \
- $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/ndbapi.latex "NDB API Programmer Guide"; \
- (cd $(DOXYOUT) && \
- find ndbapi.html -print | cpio -pdm $(DOXYTOP)); \
- (cd $(DOXYOUT)/ndbapi.latex && \
- pdflatex refman.tex && makeindex refman && pdflatex refman.tex && \
- cp -p refman.pdf $(DOXYTOP)/ndbapi.pdf);
-
-###
-#
-# MGM API Guide
-#
-mgmapidoc: mgmapi.pdf
-
-mgmapi.pdf: $(NDB_TOP)/include/ndb_version.h
- @set -x; \
- rm -rf mgmapi.pdf mgmapi.html; \
- rm -rf $(DOXYTMP) $(DOXYOUT); \
- mkdir -p $(DOXYTMP) $(DOXYOUT); \
- (cd $(NDB_TOP)/include/mgmapi && \
- find . -type f -print | \
- grep -v /SCCS | \
- cpio -pdm $(DOXYTMP)); \
- $(DOXYDIR)/predoxy.pl; \
- mv footer.html $(DOXYTMP); \
- (cd $(DOXYTMP) && \
- $(DOXYGEN) $(DOXYDIR)/Doxyfile.mgmapi); \
- $(DOXYDIR)/postdoxy.pl $(OUTDIR)/mgmapi.latex "NDB Cluster MGM API Guide"; \
- (cd $(DOXYOUT) && \
- find mgmapi.html -print | cpio -pdm $(DOXYTOP)); \
- (cd $(DOXYOUT)/mgmapi.latex && \
- pdflatex refman.tex && makeindex refman && pdflatex refman.tex && \
- cp -p refman.pdf $(DOXYTOP)/mgmapi.pdf);
-
-###
-#
-# Complete Source Browser except for
-# ndbapi odbc test tools win32 lib examples docs CVS config bin
-# include/ndbapi
-# include/newtonapi src/newtonapi
-# include/mgmapi src/mgmapi
-# src/client
-ndbdoc: DUMMY
- mkdir -p $(OUTDIR)
- cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndb
-
-###
-#
-# odbcdoc - Complete Source Browser for NDB ODBC (src/client/odbc)
-
-odbcdoc: DUMMY
- mkdir -p $(OUTDIR)
- cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.odbc
-
-testdoc: DUMMY
- mkdir -p $(OUTDIR)
- cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test
diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am
new file mode 100644
index 00000000000..554b2fb256e
--- /dev/null
+++ b/ndb/docs/Makefile.am
@@ -0,0 +1,102 @@
+DOXYDIR = doxygen
+noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi $(DOXYDIR)/header.ndbapi.tex $(DOXYDIR)/header.mgmapi.tex
+
+all: do-check ndbapidoc mgmapidoc
+
+DOXYTMP = .doxytmp
+DOXYOUT = .doxyout
+
+NDB_RELEASE = @NDB_VERSION_MAJOR@.@NDB_VERSION_MINOR@.@NDB_VERSION_BUILD@-@NDB_VERSION_STATUS@
+
+clean:
+ rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html
+ rm -rf $(DOXYTMP) $(DOXYOUT)
+
+do-check:
+ @set -x; \
+ if test @PERL@ = no ; then \
+ echo "Perl needed to make docs"; \
+ exit 1; \
+ fi; \
+ if test @DOXYGEN@ = no ; then \
+ echo "Doxygen needed to make docs"; \
+ exit 1; \
+ fi; \
+ if test @PDFLATEX@ = no ; then \
+ echo "Pdflatex needed to make docs"; \
+ exit 1; \
+ fi; \
+ if test @MAKEINDEX@ = no ; then \
+ echo "Makeindex needed to make docs"; \
+ exit 1; \
+ fi;
+###
+#
+# NDB API Programmer's Guide
+#
+ndbapidoc: ndbapi.pdf
+
+ndbapi.pdf: $(noinst_HEADERS)
+ @set -x; \
+ export NDB_RELEASE=$(NDB_RELEASE) \
+ @RM@ -f ndbapi.pdf ndbapi.html; \
+ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \
+ mkdir -p $(DOXYTMP) $(DOXYOUT); \
+ @CP@ $(top_srcdir)/ndb/include/ndbapi/* $(DOXYTMP); \
+ @CP@ $(top_srcdir)/ndb/examples/*/*.[ch]pp $(DOXYTMP); \
+ @PERL@ $(DOXYDIR)/predoxy.pl; \
+ mv footer.html $(DOXYTMP); \
+ (cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.ndbapi); \
+ @PERL@ $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/ndbapi.latex "NDB API Programmer Guide"; \
+ (cd $(DOXYOUT) && \
+ find ndbapi.html -print | cpio -pdm ..); \
+ (cd $(DOXYOUT)/ndbapi.latex && \
+ @PDFLATEX@ refman.tex && @MAKEINDEX@ refman && @PDFLATEX@ refman.tex && \
+ cp -p refman.pdf ../../ndbapi.pdf);
+
+###
+#
+# MGM API Guide
+#
+mgmapidoc: mgmapi.pdf
+
+mgmapi.pdf: $(noinst_HEADERS)
+ @set -x; \
+ export NDB_RELEASE=$(NDB_RELEASE) \
+ @RM@ -f mgmapi.pdf mgmapi.html; \
+ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \
+ mkdir -p $(DOXYTMP) $(DOXYOUT); \
+ @CP@ $(top_srcdir)/ndb/include/mgmapi/* $(DOXYTMP); \
+ @PERL@ $(DOXYDIR)/predoxy.pl; \
+ mv footer.html $(DOXYTMP); \
+ (cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.mgmapi); \
+ @PERL@ $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/mgmapi.latex "NDB Cluster MGM API Guide"; \
+ (cd $(DOXYOUT) && \
+ find mgmapi.html -print | cpio -pdm ..); \
+ (cd $(DOXYOUT)/mgmapi.latex && \
+ @PDFLATEX@ refman.tex && @MAKEINDEX@ refman && @PDFLATEX@ refman.tex && \
+ cp -p refman.pdf ../../mgmapi.pdf);
+
+###
+#
+# Complete Source Browser except for
+# ndbapi odbc test tools win32 lib examples docs CVS config bin
+# include/ndbapi
+# include/newtonapi src/newtonapi
+# include/mgmapi src/mgmapi
+# src/client
+ndbdoc: DUMMY
+ mkdir -p $(OUTDIR)
+ cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndb
+
+###
+#
+# odbcdoc - Complete Source Browser for NDB ODBC (src/client/odbc)
+
+odbcdoc: DUMMY
+ mkdir -p $(OUTDIR)
+ cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.odbc
+
+testdoc: DUMMY
+ mkdir -p $(OUTDIR)
+ cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test
diff --git a/ndb/docs/doxygen/postdoxy.pl b/ndb/docs/doxygen/postdoxy.pl
index 95062d1899f..ad0edb44a31 100755
--- a/ndb/docs/doxygen/postdoxy.pl
+++ b/ndb/docs/doxygen/postdoxy.pl
@@ -1,4 +1,3 @@
-#!/usr/local/bin/perl
#
# Written by Lars Thalmann, lars@mysql.com, 2003.
#
diff --git a/ndb/docs/doxygen/predoxy.pl b/ndb/docs/doxygen/predoxy.pl
index 461ad02478a..8dad1d964d0 100755
--- a/ndb/docs/doxygen/predoxy.pl
+++ b/ndb/docs/doxygen/predoxy.pl
@@ -1,4 +1,3 @@
-#!/usr/local/bin/perl
#
# Written by Lars Thalmann, lars@mysql.com, 2003.
#
diff --git a/ndb/env.sh b/ndb/env.sh
deleted file mode 100644
index c84a61b2c6f..00000000000
--- a/ndb/env.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-
-NDB_TOP=`pwd`
-export NDB_TOP
-
-NDB_PROJ_HOME=$NDB_TOP/home
-export NDB_PROJ_HOME
-
diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am
new file mode 100644
index 00000000000..2565a78238b
--- /dev/null
+++ b/ndb/include/Makefile.am
@@ -0,0 +1,42 @@
+
+include $(top_srcdir)/ndb/config/common.mk.am
+
+ndbinclude_HEADERS = \
+ndb_types.h \
+ndb_version.h
+
+ndbapiinclude_HEADERS = \
+ndbapi/ndbapi_limits.h \
+ndbapi/Ndb.hpp \
+ndbapi/NdbApi.hpp \
+ndbapi/NdbConnection.hpp \
+ndbapi/NdbCursorOperation.hpp \
+ndbapi/NdbDictionary.hpp \
+ndbapi/NdbError.hpp \
+ndbapi/NdbEventOperation.hpp \
+ndbapi/NdbIndexOperation.hpp \
+ndbapi/NdbOperation.hpp \
+ndbapi/NdbBlob.hpp \
+ndbapi/NdbPool.hpp \
+ndbapi/NdbRecAttr.hpp \
+ndbapi/NdbReceiver.hpp \
+ndbapi/NdbResultSet.hpp \
+ndbapi/NdbScanFilter.hpp \
+ndbapi/NdbScanOperation.hpp \
+ndbapi/ndberror.h
+
+mgmapiinclude_HEADERS = \
+mgmapi/mgmapi.h \
+mgmapi/mgmapi_debug.h
+
+noinst_HEADERS = \
+ndb_global.h \
+ndb_net.h \
+mgmapi/mgmapi_config_parameters.h \
+mgmapi/mgmapi_config_parameters_debug.h
+
+EXTRA_DIST = debugger editline kernel logger mgmcommon \
+portlib transporter util
+
+dist-hook:
+ -rm -rf `find $(distdir) -type d -name SCCS`
diff --git a/ndb/include/kernel/BlockNumbers.h b/ndb/include/kernel/BlockNumbers.h
index 84c3fc656a9..e89a82ee0cb 100644
--- a/ndb/include/kernel/BlockNumbers.h
+++ b/ndb/include/kernel/BlockNumbers.h
@@ -37,6 +37,7 @@
#define DBTUP 0xF9
#define DBDICT 0xFA
#define NDBCNTR 0xFB
+#define CNTR 0xFB
#define QMGR 0xFC
#define NDBFS 0xFD
#define CMVMI 0xFE
diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h
index 87385de1f14..7b70f4c3ac0 100644
--- a/ndb/include/kernel/GlobalSignalNumbers.h
+++ b/ndb/include/kernel/GlobalSignalNumbers.h
@@ -177,43 +177,43 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_API_FAILCONF 113
#define GSN_API_FAILREQ 114
-#define GSN_APPL_CHANGEREP 115
+#define GSN_CNTR_START_REQ 115
// 116 not unused
-#define GSN_APPL_HB 117
-#define GSN_APPL_HBREQ 118
-#define GSN_APPL_REGCONF 119
-#define GSN_APPL_REGREF 120
-#define GSN_APPL_REGREQ 121
-#define GSN_APPL_RUN 122
-#define GSN_APPL_STARTCONF 123
-#define GSN_APPL_STARTREG 124
+#define GSN_CNTR_START_REF 117
+#define GSN_CNTR_START_CONF 118
+#define GSN_CNTR_START_REP 119
+// 120 unused
+// 121 unused
+// 122 unused
+// 123 unused
+// 124 unused
#define GSN_CHECK_LCP_STOP 125
-#define GSN_CLOSE_COMCONF 126
-#define GSN_CLOSE_COMREQ 127
-#define GSN_CM_ACKADD 128
-#define GSN_CM_ACKALARM 129
-#define GSN_CM_ADD 130
-#define GSN_CM_APPCHG 131
+#define GSN_CLOSE_COMCONF 126 // local
+#define GSN_CLOSE_COMREQ 127 // local
+#define GSN_CM_ACKADD 128 // distr.
+// 129 unused
+#define GSN_CM_ADD 130 // distr.
+// 131 unused
// 132 not unused
// 133 not unused
-#define GSN_CM_HEARTBEAT 134
-#define GSN_CM_INFOCONF 135
-#define GSN_CM_INFOREQ 136
-#define GSN_CM_INIT 137
-#define GSN_CM_NODEINFOCONF 138
-#define GSN_CM_NODEINFOREF 139
-#define GSN_CM_NODEINFOREQ 140
-#define GSN_CM_REGCONF 141
-#define GSN_CM_REGREF 142
-#define GSN_CM_REGREQ 143
-#define GSN_CM_RUN 144
-#define GSN_CMVMI_CFGCONF 145
-#define GSN_CMVMI_CFGREQ 146
-#define GSN_CNTR_CHANGEREP 147
-#define GSN_CNTR_MASTERCONF 148
-#define GSN_CNTR_MASTERREF 149
-#define GSN_CNTR_MASTERREQ 150
-#define GSN_CNTR_WAITREP 151
+#define GSN_CM_HEARTBEAT 134 // distr.
+// 135 unused
+// 136 unused
+// 137 unused
+#define GSN_CM_NODEINFOCONF 138 // distr.
+#define GSN_CM_NODEINFOREF 139 // distr.
+#define GSN_CM_NODEINFOREQ 140 // distr.
+#define GSN_CM_REGCONF 141 // distr.
+#define GSN_CM_REGREF 142 // distr.
+#define GSN_CM_REGREQ 143 // distr.
+// 144 unused
+// 145 unused
+// 146 unused
+#define GSN_CM_ADD_REP 147 // local
+// 148 unused
+// 149 unused
+// 150 unused
+#define GSN_CNTR_WAITREP 151 // distr.
#define GSN_COMMIT 152
#define GSN_COMMIT_FAILCONF 153
#define GSN_COMMIT_FAILREQ 154
@@ -426,11 +426,13 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_NEXT_SCANREF 331
#define GSN_NEXT_SCANREQ 332
#define GSN_NEXTOPERATION 333
-#define GSN_SIZEALT_ACK 334
-#define GSN_SIZEALT_REP 335
-#define GSN_NODE_STATESCONF 336
-#define GSN_NODE_STATESREF 337
-#define GSN_NODE_STATESREQ 338
+
+#define GSN_READ_CONFIG_REQ 334 // new name for sizealt, local
+#define GSN_READ_CONFIG_CONF 335 // new name for sizealt, local
+
+// 336 unused
+// 337 unused
+// 338 unused
#define GSN_OPEN_COMCONF 339
#define GSN_OPEN_COMREF 340
#define GSN_OPEN_COMREQ 341
@@ -511,8 +513,8 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_TEST_ORD 407
#define GSN_TESTSIG 408
#define GSN_TIME_SIGNAL 409
-#define GSN_VOTE_MASTERORD 410
-// 411 unused
+// 410 unused
+// 411 unused
// 412 unused
#define GSN_TUP_ABORTREQ 414
#define GSN_TUP_ADD_ATTCONF 415
@@ -580,7 +582,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_CHECKNODEGROUPSREQ 471
#define GSN_CHECKNODEGROUPSCONF 472
-#define GSN_ARBIT_CFG 473
+// 473 unused
#define GSN_ARBIT_PREPREQ 474
#define GSN_ARBIT_PREPCONF 475
#define GSN_ARBIT_PREPREF 476
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 3363dc2befd..10cd0d43bee 100644
--- a/ndb/include/kernel/LogLevel.hpp
+++ b/ndb/include/kernel/LogLevel.hpp
@@ -18,6 +18,7 @@
#define _LOG_LEVEL_HPP
#include <ndb_global.h>
+#include <mgmapi_config_parameters.h>
/**
*
@@ -45,53 +46,60 @@ public:
*/
LogLevel & operator= (const LogLevel &);
+ static const Uint32 MIN_LOGLEVEL_ID = CFG_LOGLEVEL_STARTUP;
+
enum EventCategory {
/**
* Events during all kind of startups
*/
- llStartUp = 0,
+ llStartUp = CFG_LOGLEVEL_STARTUP - MIN_LOGLEVEL_ID,
/**
* Events during shutdown
*/
- llShutdown = 1,
+ llShutdown = CFG_LOGLEVEL_SHUTDOWN - MIN_LOGLEVEL_ID,
/**
* Transaction statistics
* Job level
* TCP/IP speed
*/
- llStatistic = 2,
+ llStatistic = CFG_LOGLEVEL_STATISTICS - MIN_LOGLEVEL_ID,
/**
* Checkpoints
*/
- llCheckpoint = 3,
+ llCheckpoint = CFG_LOGLEVEL_CHECKPOINT - MIN_LOGLEVEL_ID,
/**
* Events during node restart
*/
- llNodeRestart = 4,
+ llNodeRestart = CFG_LOGLEVEL_NODERESTART - MIN_LOGLEVEL_ID,
/**
* Events related to connection / communication
*/
- llConnection = 5,
+ llConnection = CFG_LOGLEVEL_CONNECTION - MIN_LOGLEVEL_ID,
/**
* Assorted event w.r.t unexpected happenings
*/
- llError = 6,
+ llError = CFG_LOGLEVEL_ERROR - MIN_LOGLEVEL_ID,
+
+ /**
+ * Assorted event w.r.t warning
+ */
+ llWarning = CFG_LOGLEVEL_WARNING - MIN_LOGLEVEL_ID,
/**
* Assorted event w.r.t information
*/
- llInfo = 7,
+ llInfo = CFG_LOGLEVEL_INFO - MIN_LOGLEVEL_ID,
/**
* Events related to global replication
*/
- llGrep = 8
+ llGrep = CFG_LOGLEVEL_GREP - MIN_LOGLEVEL_ID
};
struct LogLevelCategoryName {
@@ -107,7 +115,7 @@ public:
/**
* No of categories
*/
-#define _LOGLEVEL_CATEGORIES 9
+#define _LOGLEVEL_CATEGORIES 10
static const Uint32 LOGLEVEL_CATEGORIES = _LOGLEVEL_CATEGORIES;
void clear();
diff --git a/ndb/include/kernel/kernel_config_parameters.h b/ndb/include/kernel/kernel_config_parameters.h
new file mode 100644
index 00000000000..2f63efa4b6c
--- /dev/null
+++ b/ndb/include/kernel/kernel_config_parameters.h
@@ -0,0 +1,56 @@
+#ifndef DB_CONFIG_PARAMTERS_H
+#define DB_CONFIG_PARAMTERS_H
+
+#define PRIVATE_BASE 14000
+
+#define CFG_ACC_DIR_RANGE (PRIVATE_BASE + 1)
+#define CFG_ACC_DIR_ARRAY (PRIVATE_BASE + 2)
+#define CFG_ACC_FRAGMENT (PRIVATE_BASE + 3)
+#define CFG_ACC_OP_RECS (PRIVATE_BASE + 4)
+#define CFG_ACC_OVERFLOW_RECS (PRIVATE_BASE + 5)
+#define CFG_ACC_PAGE8 (PRIVATE_BASE + 6)
+#define CFG_ACC_ROOT_FRAG (PRIVATE_BASE + 7)
+#define CFG_ACC_TABLE (PRIVATE_BASE + 8)
+#define CFG_ACC_SCAN (PRIVATE_BASE + 9)
+
+#define CFG_DICT_ATTRIBUTE (PRIVATE_BASE + 10)
+#define CFG_DICT_CONNECT (PRIVATE_BASE + 11)
+#define CFG_DICT_FRAG_CONNECT (PRIVATE_BASE + 12)
+#define CFG_DICT_TABLE (PRIVATE_BASE + 13)
+#define CFG_DICT_TC_CONNECT (PRIVATE_BASE + 14)
+
+#define CFG_DIH_API_CONNECT (PRIVATE_BASE + 15)
+#define CFG_DIH_CONNECT (PRIVATE_BASE + 16)
+#define CFG_DIH_FRAG_CONNECT (PRIVATE_BASE + 17)
+#define CFG_DIH_MORE_NODES (PRIVATE_BASE + 18)
+#define CFG_DIH_REPLICAS (PRIVATE_BASE + 19)
+#define CFG_DIH_TABLE (PRIVATE_BASE + 20)
+
+#define CFG_LQH_FRAG (PRIVATE_BASE + 21)
+#define CFG_LQH_CONNECT (PRIVATE_BASE + 22)
+#define CFG_LQH_TABLE (PRIVATE_BASE + 23)
+#define CFG_LQH_TC_CONNECT (PRIVATE_BASE + 24)
+#define CFG_LQH_REPLICAS (PRIVATE_BASE + 25)
+#define CFG_LQH_LOG_FILES (PRIVATE_BASE + 26)
+#define CFG_LQH_SCAN (PRIVATE_BASE + 27)
+
+#define CFG_TC_API_CONNECT (PRIVATE_BASE + 28)
+#define CFG_TC_TC_CONNECT (PRIVATE_BASE + 29)
+#define CFG_TC_TABLE (PRIVATE_BASE + 30)
+#define CFG_TC_SCAN (PRIVATE_BASE + 31)
+#define CFG_TC_LOCAL_SCAN (PRIVATE_BASE + 32)
+
+#define CFG_TUP_FRAG (PRIVATE_BASE + 33)
+#define CFG_TUP_OP_RECS (PRIVATE_BASE + 34)
+#define CFG_TUP_PAGE (PRIVATE_BASE + 35)
+#define CFG_TUP_PAGE_RANGE (PRIVATE_BASE + 36)
+#define CFG_TUP_TABLE (PRIVATE_BASE + 37)
+#define CFG_TUP_TABLE_DESC (PRIVATE_BASE + 38)
+#define CFG_TUP_STORED_PROC (PRIVATE_BASE + 39)
+
+#define CFG_TUX_INDEX (PRIVATE_BASE + 40)
+#define CFG_TUX_FRAGMENT (PRIVATE_BASE + 41)
+#define CFG_TUX_ATTRIBUTE (PRIVATE_BASE + 42)
+#define CFG_TUX_SCAN_OP (PRIVATE_BASE + 43)
+
+#endif
diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h
index 65f729af1f2..68ffe310328 100644
--- a/ndb/include/kernel/ndb_limits.h
+++ b/ndb/include/kernel/ndb_limits.h
@@ -91,4 +91,9 @@
#define MAX_TTREE_PREF_SIZE 4 // words in min/max prefix each
#define MAX_TTREE_NODE_SLACK 3 // diff between max and min occupancy
+/*
+ * Blobs.
+ */
+#define NDB_BLOB_HEAD_SIZE 2 // sizeof(NdbBlob::Head) >> 2
+
#endif
diff --git a/ndb/include/kernel/signaldata/CheckNodeGroups.hpp b/ndb/include/kernel/signaldata/CheckNodeGroups.hpp
index 9b2f847e128..b3e79949c68 100644
--- a/ndb/include/kernel/signaldata/CheckNodeGroups.hpp
+++ b/ndb/include/kernel/signaldata/CheckNodeGroups.hpp
@@ -37,13 +37,11 @@ public:
Uint32 requestType; // direct flag, output code
Uint32 output;
};
- union {
- Uint32 nodeId; // nodeId input for GetNodeGroupMembers
- NodeBitmask mask; /* set of NDB nodes, input for ArbitCheck,
- * output for GetNodeGroupMembers
- */
- };
+ Uint32 nodeId; // nodeId input for GetNodeGroupMembers
+ NodeBitmask mask; /* set of NDB nodes, input for ArbitCheck,
+ * output for GetNodeGroupMembers
+ */
enum RequestType {
Direct = 0x1,
ArbitCheck = 0x2,
@@ -57,7 +55,7 @@ public:
Partitioning = 3 // possible network partitioning
};
- STATIC_CONST( SignalLength = 2 + NodeBitmask::Size );
+ STATIC_CONST( SignalLength = 3 + NodeBitmask::Size );
};
#endif
diff --git a/ndb/include/kernel/signaldata/CntrStart.hpp b/ndb/include/kernel/signaldata/CntrStart.hpp
new file mode 100644
index 00000000000..abdd1003c0f
--- /dev/null
+++ b/ndb/include/kernel/signaldata/CntrStart.hpp
@@ -0,0 +1,69 @@
+#ifndef CNTR_START_HPP
+#define CNTR_START_HPP
+
+#include <NodeBitmask.hpp>
+
+/**
+ *
+ */
+class CntrStartReq {
+ /**
+ * Sender(s) / Reciver(s)
+ */
+ friend class Ndbcntr;
+
+ friend bool printCNTR_START_REQ(FILE*, const Uint32 *, Uint32, Uint16);
+
+public:
+ STATIC_CONST( SignalLength = 3 );
+private:
+
+ Uint32 nodeId;
+ Uint32 startType;
+ Uint32 lastGci;
+};
+
+class CntrStartRef {
+ /**
+ * Sender(s) / Reciver(s)
+ */
+ friend class Ndbcntr;
+
+ friend bool printCNTR_START_REF(FILE*, const Uint32 *, Uint32, Uint16);
+public:
+ STATIC_CONST( SignalLength = 2 );
+
+ enum ErrorCode {
+ OK = 0,
+ NotMaster = 1,
+ StopInProgress = 2
+ };
+private:
+
+ Uint32 errorCode;
+ Uint32 masterNodeId;
+};
+
+class CntrStartConf {
+ /**
+ * Sender(s) / Reciver(s)
+ */
+ friend class Ndbcntr;
+ friend struct UpgradeStartup;
+
+ friend bool printCNTR_START_CONF(FILE*, const Uint32 *, Uint32, Uint16);
+
+public:
+ STATIC_CONST( SignalLength = 4 + 2 * NdbNodeBitmask::Size );
+
+private:
+
+ Uint32 startType;
+ Uint32 startGci;
+ Uint32 masterNodeId;
+ Uint32 noStartNodes;
+ Uint32 startedNodes[NdbNodeBitmask::Size];
+ Uint32 startingNodes[NdbNodeBitmask::Size];
+};
+
+#endif
diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp
index 7398fb6d8cc..65a07c122a2 100644
--- a/ndb/include/kernel/signaldata/CreateEvnt.hpp
+++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp
@@ -250,7 +250,7 @@ struct CreateEvntReq {
return tmp;
}
void setAttrListBitmask(const AttributeMask & val) {
- m_attrListBitmask = val;
+ AttributeMask::assign(m_attrListBitmask.data, val);
}
Uint32 getEventType() const {
return m_eventType;
diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp
index 791388d5df8..67610f9d2be 100644
--- a/ndb/include/kernel/signaldata/DictTabInfo.hpp
+++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp
@@ -307,7 +307,9 @@ public:
ExtBinary = NdbSqlUtil::Type::Binary,
ExtVarbinary = NdbSqlUtil::Type::Varbinary,
ExtDatetime = NdbSqlUtil::Type::Datetime,
- ExtTimespec = NdbSqlUtil::Type::Timespec
+ ExtTimespec = NdbSqlUtil::Type::Timespec,
+ ExtBlob = NdbSqlUtil::Type::Blob,
+ ExtClob = NdbSqlUtil::Type::Clob
};
// Attribute data interpretation
@@ -430,6 +432,13 @@ public:
AttributeSize = DictTabInfo::an8Bit;
AttributeArraySize = 12 * AttributeExtLength;
return true;
+ case DictTabInfo::ExtBlob:
+ case DictTabInfo::ExtClob:
+ AttributeType = DictTabInfo::StringType;
+ AttributeSize = DictTabInfo::an8Bit;
+ // head + inline part [ attr precision ]
+ AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + AttributeExtPrecision;
+ return true;
};
return false;
}
diff --git a/ndb/include/kernel/signaldata/EventSubscribeReq.hpp b/ndb/include/kernel/signaldata/EventSubscribeReq.hpp
index 2ac62be19a3..fd2821ea31d 100644
--- a/ndb/include/kernel/signaldata/EventSubscribeReq.hpp
+++ b/ndb/include/kernel/signaldata/EventSubscribeReq.hpp
@@ -39,7 +39,7 @@ class EventSubscribeReq {
friend class MgmtSrvr;
public:
- STATIC_CONST( SignalLength = 14 );
+ STATIC_CONST( SignalLength = 22 );
private:
/**
* Note: If you use the same blockRef as you have used earlier,
@@ -53,8 +53,8 @@ private:
*/
Uint32 noOfEntries;
- Uint32 theCategories[6];
- Uint32 theLevels[6];
+ Uint32 theCategories[10];
+ Uint32 theLevels[10];
};
#endif
diff --git a/ndb/include/kernel/signaldata/FsOpenReq.hpp b/ndb/include/kernel/signaldata/FsOpenReq.hpp
index b84d78ba9dd..906bb947128 100644
--- a/ndb/include/kernel/signaldata/FsOpenReq.hpp
+++ b/ndb/include/kernel/signaldata/FsOpenReq.hpp
@@ -39,6 +39,7 @@ class FsOpenReq {
friend class Backup;
friend class Dbdict;
friend class Ndbcntr; // For initial start...
+ friend class Dbdih;
/**
* For printing
diff --git a/ndb/include/kernel/signaldata/ReadConfig.hpp b/ndb/include/kernel/signaldata/ReadConfig.hpp
new file mode 100644
index 00000000000..0835b252a32
--- /dev/null
+++ b/ndb/include/kernel/signaldata/ReadConfig.hpp
@@ -0,0 +1,24 @@
+#ifndef READ_CONFIG_HPP
+#define READ_CONFIG_HPP
+
+/**
+ */
+class ReadConfigReq {
+public:
+ STATIC_CONST( SignalLength = 3 );
+
+ Uint32 senderRef;
+ Uint32 senderData;
+ Uint32 noOfParameters; // 0 Means read all relevant for block
+ Uint32 parameters[1]; // see mgmapi_config_parameters.h
+};
+
+class ReadConfigConf {
+public:
+ STATIC_CONST( SignalLength = 2 );
+
+ Uint32 senderRef;
+ Uint32 senderData;
+};
+
+#endif
diff --git a/ndb/include/kernel/signaldata/ReadNodesConf.hpp b/ndb/include/kernel/signaldata/ReadNodesConf.hpp
index f3176cbf0e8..0507007f71a 100644
--- a/ndb/include/kernel/signaldata/ReadNodesConf.hpp
+++ b/ndb/include/kernel/signaldata/ReadNodesConf.hpp
@@ -48,11 +48,13 @@ class ReadNodesConf {
friend class Suma;
friend class Grep;
+ friend bool printREAD_NODES_CONF(FILE*, const Uint32 *, Uint32, Uint16);
public:
- STATIC_CONST( SignalLength = 2 + 6*NodeBitmask::Size );
+ STATIC_CONST( SignalLength = 3 + 5*NdbNodeBitmask::Size );
private:
Uint32 noOfNodes;
+ Uint32 ndynamicId;
/**
*
@@ -63,47 +65,21 @@ private:
/**
* This array defines all the ndb nodes in the system
*/
- Uint32 allNodes[NodeBitmask::Size];
-
- /**
- * This array describes wheather the nodes are currently active
- *
- * NOTE Not valid when send from Qmgr
- */
- Uint32 inactiveNodes[NodeBitmask::Size];
+ union {
+ Uint32 allNodes[NdbNodeBitmask::Size];
+ Uint32 definedNodes[NdbNodeBitmask::Size];
+ };
/**
- * This array describes the version id of the nodes
- * The version id is a 4 bit number
+ * This array describes wheather the nodes are currently active
*
* NOTE Not valid when send from Qmgr
*/
- Uint32 theVersionIds[4*NodeBitmask::Size];
+ Uint32 inactiveNodes[NdbNodeBitmask::Size];
- static void setVersionId(NodeId, Uint8 versionId, Uint32 theVersionIds[]);
- static Uint8 getVersionId(NodeId, const Uint32 theVersionIds[]);
+ Uint32 clusterNodes[NdbNodeBitmask::Size]; // From Qmgr
+ Uint32 startingNodes[NdbNodeBitmask::Size]; // From Cntr
+ Uint32 startedNodes[NdbNodeBitmask::Size]; // From Cntr
};
-inline
-void
-ReadNodesConf::setVersionId(NodeId nodeId, Uint8 versionId,
- Uint32 theVersionIds[]){
- const int word = nodeId >> 3;
- const int shift = (nodeId & 7) << 2;
-
- const Uint32 mask = ~(((Uint32)15) << shift);
- const Uint32 tmp = theVersionIds[word];
-
- theVersionIds[word] = (tmp & mask) | ((((Uint32)versionId) & 15) << shift);
-}
-
-inline
-Uint8
-ReadNodesConf::getVersionId(NodeId nodeId, const Uint32 theVersionIds[]){
- const int word = nodeId >> 3;
- const int shift = (nodeId & 7) << 2;
-
- return (theVersionIds[word] >> shift) & 15;
-}
-
#endif
diff --git a/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp b/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
index 680e9b25a49..c3be808cc41 100644
--- a/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
+++ b/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
@@ -18,6 +18,7 @@
#define SET_LOGLEVEL_ORD_HPP
#include <LogLevel.hpp>
+#include "SignalData.hpp"
/**
*
diff --git a/ndb/include/kernel/signaldata/TcKeyConf.hpp b/ndb/include/kernel/signaldata/TcKeyConf.hpp
index bfd684b4af4..27ff344f793 100644
--- a/ndb/include/kernel/signaldata/TcKeyConf.hpp
+++ b/ndb/include/kernel/signaldata/TcKeyConf.hpp
@@ -111,7 +111,7 @@ inline
void
TcKeyConf::setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps){
ASSERT_MAX(noOfOps, 65535, "TcKeyConf::setNoOfOperations");
- confInfo |= noOfOps;
+ confInfo = (confInfo & 0xFFFF0000) | noOfOps;
}
inline
diff --git a/ndb/include/kernel/signaldata/TupAccess.hpp b/ndb/include/kernel/signaldata/TupAccess.hpp
index 5cfb8c0d153..ab56a73322c 100644
--- a/ndb/include/kernel/signaldata/TupAccess.hpp
+++ b/ndb/include/kernel/signaldata/TupAccess.hpp
@@ -129,6 +129,8 @@ private:
/*
* Operate on entire tuple. Used by TUX where the table has a single
* Uint32 array attribute representing an index tree node.
+ *
+ * XXX this signal is no longer used by TUX and can be removed
*/
class TupStoreTh {
friend class Dbtup;
diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp
index ffde2217893..fc88dacd48f 100644
--- a/ndb/include/kernel/signaldata/TupFrag.hpp
+++ b/ndb/include/kernel/signaldata/TupFrag.hpp
@@ -69,7 +69,7 @@ class TuxFragReq {
friend class Dblqh;
friend class Dbtux;
public:
- STATIC_CONST( SignalLength = 9 );
+ STATIC_CONST( SignalLength = 14 );
private:
Uint32 userPtr;
Uint32 userRef;
@@ -80,6 +80,9 @@ private:
Uint32 fragOff;
Uint32 tableType;
Uint32 primaryTableId;
+ Uint32 tupIndexFragPtrI;
+ Uint32 tupTableFragPtrI[2];
+ Uint32 accTableFragPtrI[2];
};
class TuxFragConf {
diff --git a/ndb/include/kernel/signaldata/TuxMaint.hpp b/ndb/include/kernel/signaldata/TuxMaint.hpp
index 44deb33be80..9fee031dc41 100644
--- a/ndb/include/kernel/signaldata/TuxMaint.hpp
+++ b/ndb/include/kernel/signaldata/TuxMaint.hpp
@@ -39,7 +39,7 @@ public:
SearchError = 895, // add + found or remove + not found
NoMemError = 827
};
- STATIC_CONST( SignalLength = 7 );
+ STATIC_CONST( SignalLength = 8 );
private:
/*
* Error code set by TUX. Zero means no error.
@@ -52,10 +52,11 @@ private:
Uint32 indexId;
Uint32 fragId;
/*
- * Tuple version identified by logical address of "original" tuple and
- * version number.
+ * Tuple version identified by physical address of "original" tuple
+ * and version number.
*/
- Uint32 tupAddr;
+ Uint32 pageId;
+ Uint32 pageOffset;
Uint32 tupVersion;
/*
* Operation code and flags.
diff --git a/ndb/include/kernel/signaldata/UpgradeStartup.hpp b/ndb/include/kernel/signaldata/UpgradeStartup.hpp
new file mode 100644
index 00000000000..badc7ca0e4d
--- /dev/null
+++ b/ndb/include/kernel/signaldata/UpgradeStartup.hpp
@@ -0,0 +1,36 @@
+#ifndef NDB_UPGRADE_STARTUP
+#define NDB_UPGRADE_STARTUP
+
+struct UpgradeStartup {
+
+ static void installEXEC(SimulatedBlock*);
+
+ static const Uint32 GSN_CM_APPCHG = 131;
+ static const Uint32 GSN_CNTR_MASTERCONF = 148;
+ static const Uint32 GSN_CNTR_MASTERREF = 149;
+ static const Uint32 GSN_CNTR_MASTERREQ = 150;
+
+ static void sendCmAppChg(Ndbcntr&, Signal *, Uint32 startLevel);
+ static void execCM_APPCHG(SimulatedBlock& block, Signal*);
+ static void sendCntrMasterReq(Ndbcntr& cntr, Signal* signal, Uint32 n);
+ static void execCNTR_MASTER_REPLY(SimulatedBlock & block, Signal* signal);
+
+ struct CntrMasterReq {
+ STATIC_CONST( SignalLength = 4 + NdbNodeBitmask::Size );
+
+ Uint32 userBlockRef;
+ Uint32 userNodeId;
+ Uint32 typeOfStart;
+ Uint32 noRestartNodes;
+ Uint32 theNodes[NdbNodeBitmask::Size];
+ };
+
+ struct CntrMasterConf {
+ STATIC_CONST( SignalLength = 1 + NdbNodeBitmask::Size );
+
+ Uint32 noStartNodes;
+ Uint32 theNodes[NdbNodeBitmask::Size];
+ };
+};
+
+#endif
diff --git a/ndb/include/kernel/trigger_definitions.h b/ndb/include/kernel/trigger_definitions.h
index a5e7fb1953c..439d65c6c30 100644
--- a/ndb/include/kernel/trigger_definitions.h
+++ b/ndb/include/kernel/trigger_definitions.h
@@ -17,6 +17,7 @@
#ifndef NDB_TRIGGER_DEFINITIONS_H
#define NDB_TRIGGER_DEFINITIONS_H
+#include <ndb_global.h>
#include "ndb_limits.h"
#ifndef MIN
diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h
index 0ecb19eaa76..7b2f728bda8 100644
--- a/ndb/include/mgmapi/mgmapi.h
+++ b/ndb/include/mgmapi/mgmapi.h
@@ -84,9 +84,10 @@ extern "C" {
NDB_MGM_NODE_TYPE_API = 0, /*/< An application node (API)*/
NDB_MGM_NODE_TYPE_NDB = 1, /*/< A database node (DB)*/
NDB_MGM_NODE_TYPE_MGM = 2, /*/< A management server node (MGM)*/
+ NDB_MGM_NODE_TYPE_REP = 3, ///< A replication node
NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/
- NDB_MGM_NODE_TYPE_MAX = 2 /*/< Max valid value*/
+ NDB_MGM_NODE_TYPE_MAX = 3 /*/< Max valid value*/
};
/**
@@ -199,6 +200,8 @@ extern "C" {
int node_group; ///< Node group of node
///< (only valid for DB nodes)
int version; ///< Internal version number
+ int connect_count; ///< No of times node has connected
+ ///< or disconnected to the mgm srv
};
/**
@@ -654,6 +657,36 @@ extern "C" {
int ndb_mgm_exit_single_user(NdbMgmHandle handle,
struct ndb_mgm_reply* reply);
+ /**
+ * Get configuration
+ * @param handle NDB management handle.
+ * @param version Version of configuration, 0 means latest
+ * @see MAKE_VERSION
+ * @Note the caller must free the pointer returned.
+ */
+ struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
+ unsigned version);
+ /**
+ * Config iterator
+ */
+ typedef struct ndb_mgm_configuration_iterator ndb_mgm_configuration_iterator;
+
+ ndb_mgm_configuration_iterator* ndb_mgm_create_configuration_iterator
+ (struct ndb_mgm_configuration *, unsigned type_of_section);
+ void ndb_mgm_destroy_iterator(ndb_mgm_configuration_iterator*);
+
+ int ndb_mgm_first(ndb_mgm_configuration_iterator*);
+ int ndb_mgm_next(ndb_mgm_configuration_iterator*);
+ int ndb_mgm_valid(const ndb_mgm_configuration_iterator*);
+ int ndb_mgm_find(ndb_mgm_configuration_iterator*,
+ int param, unsigned value);
+
+ int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
+ int param, unsigned * value);
+ int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
+ int param, unsigned long long * value);
+ int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
+ int param, const char ** value);
#ifdef __cplusplus
}
#endif
diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h
new file mode 100644
index 00000000000..d3bb44c1523
--- /dev/null
+++ b/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -0,0 +1,144 @@
+#ifndef MGMAPI_CONFIG_PARAMTERS_H
+#define MGMAPI_CONFIG_PARAMTERS_H
+
+
+#define CFG_SYS_NAME 3
+#define CFG_SYS_PRIMARY_MGM_NODE 1
+#define CFG_SYS_CONFIG_GENERATION 2
+#define CFG_SYS_REPLICATION_ROLE 7
+
+#define CFG_NODE_ID 3
+#define CFG_NODE_BYTE_ORDER 4
+#define CFG_NODE_HOST 5
+#define CFG_NODE_SYSTEM 6
+
+/**
+ * DB config parameters
+ */
+#define CFG_DB_NO_SAVE_MSGS 100
+
+#define CFG_DB_NO_REPLICAS 101
+#define CFG_DB_NO_TABLES 102
+#define CFG_DB_NO_ATTRIBUTES 103
+#define CFG_DB_NO_INDEXES 104
+#define CFG_DB_NO_TRIGGERS 105
+
+#define CFG_DB_NO_TRANSACTIONS 106
+#define CFG_DB_NO_OPS 107
+#define CFG_DB_NO_SCANS 108
+#define CFG_DB_NO_TRIGGER_OPS 109
+#define CFG_DB_NO_INDEX_OPS 110
+
+#define CFG_DB_TRANS_BUFFER_MEM 111
+#define CFG_DB_DATA_MEM 112
+#define CFG_DB_INDEX_MEM 113
+#define CFG_DB_MEMLOCK 114
+
+#define CFG_DB_START_PARTIAL_TIMEOUT 115
+#define CFG_DB_START_PARTITION_TIMEOUT 116
+#define CFG_DB_START_FAILURE_TIMEOUT 117
+
+#define CFG_DB_HEARTBEAT_INTERVAL 118
+#define CFG_DB_API_HEARTBEAT_INTERVAL 119
+#define CFG_DB_LCP_INTERVAL 120
+#define CFG_DB_GCP_INTERVAL 121
+#define CFG_DB_ARBIT_TIMEOUT 122
+
+#define CFG_DB_WATCHDOG_INTERVAL 123
+#define CFG_DB_STOP_ON_ERROR 124
+
+#define CFG_DB_FILESYSTEM_PATH 125
+#define CFG_DB_NO_REDOLOG_FILES 126
+#define CFG_DB_DISC_BANDWIDTH 127
+#define CFG_DB_SR_DISC_BANDWITH 128
+
+#define CFG_DB_TRANSACTION_CHECK_INTERVAL 129
+#define CFG_DB_TRANSACTION_INACTIVE_TIMEOUT 130
+#define CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT 131
+
+#define CFG_DB_PARALLEL_BACKUPS 132
+#define CFG_DB_BACKUP_MEM 133
+#define CFG_DB_BACKUP_DATA_BUFFER_MEM 134
+#define CFG_DB_BACKUP_LOG_BUFFER_MEM 135
+#define CFG_DB_BACKUP_WRITE_SIZE 136
+
+#define CFG_LOGLEVEL_STARTUP 137
+#define CFG_LOGLEVEL_SHUTDOWN 138
+#define CFG_LOGLEVEL_STATISTICS 139
+#define CFG_LOGLEVEL_CHECKPOINT 140
+#define CFG_LOGLEVEL_NODERESTART 141
+#define CFG_LOGLEVEL_CONNECTION 142
+#define CFG_LOGLEVEL_INFO 143
+#define CFG_LOGLEVEL_WARNING 144
+#define CFG_LOGLEVEL_ERROR 145
+#define CFG_LOGLEVEL_GREP 146
+#define CFG_LOG_DESTINATION 147
+
+#define CFG_DB_DISCLESS 148
+
+#define CFG_NODE_ARBIT_RANK 200
+#define CFG_NODE_ARBIT_DELAY 201
+
+#define CFG_MGM_PORT 300
+
+#define CFG_CONNECTION_NODE_1 400
+#define CFG_CONNECTION_NODE_2 401
+#define CFG_CONNECTION_SEND_SIGNAL_ID 402
+#define CFG_CONNECTION_CHECKSUM 403
+#define CFG_CONNECTION_NODE_1_SYSTEM 404
+#define CFG_CONNECTION_NODE_2_SYSTEM 405
+
+#define CFG_TCP_HOSTNAME_1 450
+#define CFG_TCP_HOSTNAME_2 451
+#define CFG_TCP_SERVER 452
+#define CFG_TCP_SERVER_PORT 453
+#define CFG_TCP_SEND_BUFFER_SIZE 454
+#define CFG_TCP_RECEIVE_BUFFER_SIZE 455
+#define CFG_TCP_PROXY 456
+
+#define CFG_SHM_SEND_SIGNAL_ID 500
+#define CFG_SHM_CHECKSUM 501
+#define CFG_SHM_KEY 502
+#define CFG_SHM_BUFFER_MEM 503
+
+#define CFG_SCI_ID_0 550
+#define CFG_SCI_ID_1 551
+#define CFG_SCI_SEND_LIMIT 552
+#define CFG_SCI_BUFFER_MEM 553
+#define CFG_SCI_NODE1_ADAPTERS 554
+#define CFG_SCI_NODE1_ADAPTER0 555
+#define CFG_SCI_NODE1_ADAPTER1 556
+#define CFG_SCI_NODE2_ADAPTERS 554
+#define CFG_SCI_NODE2_ADAPTER0 555
+#define CFG_SCI_NODE2_ADAPTER1 556
+
+#define CFG_OSE_HOSTNAME_1 600
+#define CFG_OSE_HOSTNAME_2 601
+#define CFG_OSE_PRIO_A_SIZE 602
+#define CFG_OSE_PRIO_B_SIZE 603
+#define CFG_OSE_RECEIVE_ARRAY_SIZE 604
+
+#define CFG_REP_HEARTBEAT_INTERVAL 700
+
+/**
+ * Internal
+ */
+#define CFG_DB_STOP_ON_ERROR_INSERT 1
+
+#define CFG_TYPE_OF_SECTION 999
+#define CFG_SECTION_SYSTEM 1000
+#define CFG_SECTION_NODE 2000
+#define CFG_SECTION_CONNECTION 3000
+
+#define NODE_TYPE_DB 0
+#define NODE_TYPE_API 1
+#define NODE_TYPE_MGM 2
+#define NODE_TYPE_REP 3
+#define NODE_TYPE_EXT_REP 4
+
+#define CONNECTION_TYPE_TCP 0
+#define CONNECTION_TYPE_SHM 1
+#define CONNECTION_TYPE_SCI 2
+#define CONNECTION_TYPE_OSE 3
+
+#endif
diff --git a/ndb/include/mgmapi/mgmapi_config_parameters_debug.h b/ndb/include/mgmapi/mgmapi_config_parameters_debug.h
new file mode 100644
index 00000000000..0241dca90ef
--- /dev/null
+++ b/ndb/include/mgmapi/mgmapi_config_parameters_debug.h
@@ -0,0 +1,8 @@
+#ifndef MGMAPI_CONFIG_PARAMTERS_DEBUG_H
+#define MGMAPI_CONFIG_PARAMTERS_DEBUG_H
+
+#include "mgmapi_config_parameters.h"
+
+#define CFG_DB_STOP_ON_ERROR_INSERT 1
+
+#endif
diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp
index ff60e730d45..50d333b54dd 100644
--- a/ndb/include/mgmcommon/ConfigRetriever.hpp
+++ b/ndb/include/mgmcommon/ConfigRetriever.hpp
@@ -18,7 +18,7 @@
#define ConfigRetriever_H
#include <ndb_types.h>
-#include <Properties.hpp>
+#include <mgmapi.h>
/**
* @class ConfigRetriever
@@ -44,11 +44,11 @@ public:
* to establish a connection. This is repeated until a connection is
* established, so the function hangs until a connection is established.
*
- * @return Properties object if succeeded,
+ * @return ndb_mgm_configuration object if succeeded,
* NULL if erroneous local config file or configuration error.
*/
- class Properties * getConfig(const char * nodeType, int versionId);
-
+ struct ndb_mgm_configuration * getConfig(int versionId, int nodeType);
+
const char * getErrorString();
/**
@@ -71,22 +71,17 @@ public:
* @return Node id of this node (as stated in local config or connectString)
*/
inline Uint32 getOwnNodeId() { return _ownNodeId; }
-
- /**
- * Get configuration object
- */
- class Properties * getConfig(int versionId);
+
/**
* Get config using socket
*/
- class Properties * getConfig(const char * mgmhost, unsigned int port,
- Uint32 nodeId, int versionId);
+ struct ndb_mgm_configuration * getConfig(const char * mgmhost, short port,
+ int versionId);
/**
* Get config from file
*/
- class Properties * getConfig(const char * filename, Uint32 nodeId,
- int versionId);
+ struct ndb_mgm_configuration * getConfig(const char * file, int versionId);
private:
char * errorString;
enum ErrorType {
@@ -97,18 +92,17 @@ private:
void setError(ErrorType, const char * errorMsg);
- /**
- * Verifies that received configuration is correct
- */
- bool verifyProperties(const char* nodeType, Properties *p,
- Uint32 nodeId, int versionId);
-
char * _localConfigFileName;
struct LocalConfig * _localConfig;
int _ownNodeId;
char * m_connectString;
char * m_defaultConnectString;
+
+ /**
+ * Verify config
+ */
+ bool verifyConfig(const struct ndb_mgm_configuration *, int type);
};
#endif
diff --git a/ndb/include/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp
index 626242865cb..ebe65b53b59 100644
--- a/ndb/include/mgmcommon/IPCConfig.hpp
+++ b/ndb/include/mgmcommon/IPCConfig.hpp
@@ -58,6 +58,10 @@ public:
void print() const { props->print(); }
+ static Uint32 configureTransporters(Uint32 nodeId,
+ const class ndb_mgm_configuration &,
+ class TransporterRegistry &);
+
private:
NodeId the_ownId;
Properties * props;
diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h
index 5e03b972268..f871acbc075 100644
--- a/ndb/include/ndb_global.h
+++ b/ndb/include/ndb_global.h
@@ -25,7 +25,13 @@
#endif
#include <sys/param.h>
#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
+ #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE)
+ #undef _INCLUDE_AES_SOURCE
+ #include <sys/stat.h>
+ #define _INCLUDE_AES_SOURCE
+ #else
+ #include <sys/stat.h>
+ #endif
#endif
#include <sys/resource.h>
#ifdef HAVE_SYS_WAIT_H
@@ -49,6 +55,8 @@
#endif
+static const char table_name_separator = '/';
+
#ifdef NDB_VC98
#define STATIC_CONST(x) enum { x }
#else
diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h
index 5e7b952cfc5..87ebd3d6c6b 100644
--- a/ndb/include/ndb_types.h
+++ b/ndb/include/ndb_types.h
@@ -33,7 +33,7 @@ typedef unsigned int UintR;
#ifdef __SIZE_TYPE__
typedef __SIZE_TYPE__ UintPtr;
#else
-#include <my_config.h>
+#include <my_global.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h
index 9bb6af59590..56362020ebf 100644
--- a/ndb/include/ndb_version.h
+++ b/ndb/include/ndb_version.h
@@ -17,19 +17,11 @@
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
+#include <ndb_global.h>
#include <version.h>
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
-/**
- * version of this build
- */
-
-#define NDB_VERSION_MAJOR 3
-#define NDB_VERSION_MINOR 5
-#define NDB_VERSION_BUILD 0
-#define NDB_VERSION_STATUS "alpha"
-
#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS))
diff --git a/ndb/include/ndbapi/AttrType.hpp b/ndb/include/ndbapi/AttrType.hpp
deleted file mode 100644
index e6e00c77130..00000000000
--- a/ndb/include/ndbapi/AttrType.hpp
+++ /dev/null
@@ -1,329 +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 */
-
-/**
- * @file AttrType.hpp
- */
-
-#ifndef AttrType_H
-#define AttrType_H
-
-/**
- * Max number of Ndb objects in different threads.
- * (Ndb objects should not be shared by different threads.)
- */
-const unsigned MAX_NO_THREADS = 4711;
-
-/**
- * Max number of attributes in a table.
- */
-const unsigned MAXNROFATTRIBUTES = 128;
-
-/**
- * Max number of tuple keys for a table in NDB Cluster.
- *
- * A <em>tuple key</em> of a table is an attribute
- * which is either part of the
- * <em>primary key</em> or the <em>tuple id</em> of a table.
- */
-const unsigned MAXNROFTUPLEKEY = 16;
-
-/**
- * Max number of words in a tuple key attribute.
- *
- * Tuple keys can not have values larger than
- * 4092 bytes (i.e. 1023 words).
- */
-const unsigned MAXTUPLEKEYLENOFATTERIBUTEINWORD = 1023;
-
-/**
- * Max number of ErrorCode in NDB Cluster range 0 - 1999.
- */
-const unsigned MAXNDBCLUSTERERROR = 1999;
-
-/**
- * Max number of theErrorCode NDB API range 4000 - 4999.
- */
-const unsigned MAXNROFERRORCODE = 5000;
-
-/**
- * <i>Missing explanation</i>
- */
-enum ReturnType {
- ReturnSuccess, ///< <i>Missing explanation</i>
- ReturnFailure ///< <i>Missing explanation</i>
-};
-
-/**
- *
- */
-enum SendStatusType {
- NotInit, ///< <i>Missing explanation</i>
- InitState, ///< <i>Missing explanation</i>
- sendOperations, ///< <i>Missing explanation</i>
- sendCompleted, ///< <i>Missing explanation</i>
- sendCOMMITstate, ///< <i>Missing explanation</i>
- sendABORT, ///< <i>Missing explanation</i>
- sendABORTfail, ///< <i>Missing explanation</i>
- sendTC_ROLLBACK, ///< <i>Missing explanation</i>
- sendTC_COMMIT, ///< <i>Missing explanation</i>
- sendTC_OP ///< <i>Missing explanation</i>
-};
-
-/**
- * <i>Missing explanation</i>
- */
-enum ListState {
- NotInList, ///< <i>Missing explanation</i>
- InPreparedList, ///< <i>Missing explanation</i>
- InSendList, ///< <i>Missing explanation</i>
- InCompletedList ///< <i>Missing explanation</i>
-};
-
-/**
- * Commit status of the transaction
- */
-enum CommitStatusType {
- NotStarted, ///< Transaction not yet started
- Started, ///< <i>Missing explanation</i>
- Committed, ///< Transaction has been committed
- Aborted, ///< Transaction has been aborted
- NeedAbort ///< <i>Missing explanation</i>
-};
-
-/**
- * Commit type of transaction
- */
-enum AbortOption {
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
- CommitIfFailFree = 0,
- CommitAsMuchAsPossible = 2, ///< Commit transaction with as many
- TryCommit = 0, ///< <i>Missing explanation</i>
-#endif
- AbortOnError = 0, ///< Abort transaction on failed operation
- IgnoreError = 2 ///< Transaction continues on failed operation
-};
-
-typedef AbortOption CommitType;
-
-/**
- * <i>Missing explanation</i>
- */
-enum InitType {
- NotConstructed, ///< <i>Missing explanation</i>
- NotInitialised, ///< <i>Missing explanation</i>
- StartingInit, ///< <i>Missing explanation</i>
- Initialised, ///< <i>Missing explanation</i>
- InitConfigError ///< <i>Missing explanation</i>
-};
-
-/**
- * Type of attribute
- */
-enum AttrType {
- Signed, ///< Attributes of this type can be read with:
- ///< NdbRecAttr::int64_value,
- ///< NdbRecAttr::int32_value,
- ///< NdbRecAttr::short_value,
- ///< NdbRecAttr::char_value
- UnSigned, ///< Attributes of this type can be read with:
- ///< NdbRecAttr::u_64_value,
- ///< NdbRecAttr::u_32_value,
- ///< NdbRecAttr::u_short_value,
- ///< NdbRecAttr::u_char_value
- Float, ///< Attributes of this type can be read with:
- ///< NdbRecAttr::float_value and
- ///< NdbRecAttr::double_value
- String, ///< Attributes of this type can be read with:
- ///< NdbRecAttr::aRef,
- ///< NdbRecAttr::getAttributeObject
- NoAttrTypeDef ///< Used for debugging only
-};
-
-/**
- * Execution type of transaction
- */
-enum ExecType {
- NoExecTypeDef = -1, ///< Erroneous type (Used for debugging only)
- Prepare, ///< <i>Missing explanation</i>
- NoCommit, ///< Execute the transaction as far as it has
- ///< been defined, but do not yet commit it
- Commit, ///< Execute and try to commit the transaction
- Rollback ///< Rollback transaction
-};
-
-/**
- * Indicates whether the attribute is part of a primary key or not
- */
-enum KeyType {
- Undefined = -1, ///< Used for debugging only
- NoKey, ///< Attribute is not part of primary key
- ///< or tuple identity
- TupleKey, ///< Attribute is part of primary key
- TupleId ///< Attribute is part of tuple identity
- ///< (This type of attribute is created
- ///< internally, and should not be
- ///< manually created.)
-};
-
-/**
- * Indicate whether the attribute should be stored on disk or not
- */
-enum StorageMode {
- MMBased = 0, ///< Main memory
- DiskBased = 1, ///< Disk (Not yet supported.)
- NoStorageTypeDef ///< Used for debugging only
-};
-
-/**
- * Where attribute is stored.
- *
- * This is used to indicate whether a primary key
- * should only be stored in the index storage and not in the data storage
- * or if it should be stored in both places.
- * The first alternative makes the attribute take less space,
- * but makes it impossible to scan using attribute.
- *
- * @note Use NormalStorageAttribute for most cases.
- * (IndexStorageAttribute should only be used on primary key
- * attributes and only if you do not want to scan using the attribute.)
- */
-enum StorageAttributeType {
- NoStorageAttributeTypeDefined = -1, ///< <i>Missing explanation</i>
- IndexStorageAttribute, ///< Attribute is only stored in
- ///< index storage (ACC)
- NormalStorageAttribute ///< Attribute values are stored
- ///< both in the index (ACC) and
- ///< in the data storage (TUP)
-};
-
-/**
- * <i>Missing explanation</i>
- */
-enum OperationStatus{
- Init, ///< <i>Missing explanation</i>
- OperationDefined, ///< <i>Missing explanation</i>
- TupleKeyDefined, ///< <i>Missing explanation</i>
- GetValue, ///< <i>Missing explanation</i>
- SetValue, ///< <i>Missing explanation</i>
- ExecInterpretedValue, ///< <i>Missing explanation</i>
- SetValueInterpreted, ///< <i>Missing explanation</i>
- FinalGetValue, ///< <i>Missing explanation</i>
- SubroutineExec, ///< <i>Missing explanation</i>
- SubroutineEnd, ///< <i>Missing explanation</i>
- SetBound, ///< Setting bounds in range scan
- WaitResponse, ///< <i>Missing explanation</i>
- WaitCommitResponse, ///< <i>Missing explanation</i>
- Finished, ///< <i>Missing explanation</i>
- ReceiveFinished ///< <i>Missing explanation</i>
-};
-
-/**
- * Type of operation
- */
-enum OperationType {
- ReadRequest = 0, ///< Read operation
- UpdateRequest = 1, ///< Update Operation
- InsertRequest = 2, ///< Insert Operation
- DeleteRequest = 3, ///< Delete Operation
- WriteRequest = 4, ///< Write Operation
- ReadExclusive = 5, ///< Read exclusive
- OpenScanRequest, ///< Scan Operation
- OpenRangeScanRequest, ///< Range scan operation
- NotDefined2, ///< <i>Missing explanation</i>
- NotDefined ///< <i>Missing explanation</i>
-};
-
-/**
- * <i>Missing explanation</i>
- */
-enum ConStatusType {
- NotConnected, ///< <i>Missing explanation</i>
- Connecting, ///< <i>Missing explanation</i>
- Connected, ///< <i>Missing explanation</i>
- DisConnecting, ///< <i>Missing explanation</i>
- ConnectFailure ///< <i>Missing explanation</i>
-};
-
-/**
- * <i>Missing explanation</i>
- */
-enum CompletionStatus {
- NotCompleted, ///< <i>Missing explanation</i>
- CompletedSuccess, ///< <i>Missing explanation</i>
- CompletedFailure, ///< <i>Missing explanation</i>
- DefinitionFailure ///< <i>Missing explanation</i>
-};
-
-/**
- * Type of fragmentation used for a table
- */
-enum FragmentType {
- Default = 0, ///< (All is default!)
- Single = 1, ///< Only one fragment
- All = 2, ///< Default value. One fragment per node group
- DistributionGroup = 3, ///< Distribution Group used for fragmentation.
- ///< One fragment per node group
- DistributionKey = 4, ///< Distribution Key used for fragmentation.
- ///< One fragment per node group.
- AllLarge = 5, ///< Sixten fragments per node group.
- DGroupLarge = 6, ///< Distribution Group used for fragmentation.
- ///< Sixten fragments per node group
- DKeyLarge = 7 ///< Distribution Key used for fragmentation.
- ///< Sixten fragments per node group
-};
-
-/**
- * Type of table or index.
- */
-enum TableType {
- UndefTableType = 0,
- SystemTable = 1, ///< Internal. Table cannot be updated by user
- UserTable = 2, ///< Normal application table
- UniqueHashIndex = 3, ///< Unique un-ordered hash index
- HashIndex = 4, ///< Non-unique un-ordered hash index
- UniqueOrderedIndex = 5, ///< Unique ordered index
- OrderedIndex = 6 ///< Non-unique ordered index
-};
-
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-/**
- * Different types of tampering with the NDB Cluster.
- * <b>Only for debugging purposes only.</b>
- */
-enum TamperType {
- LockGlbChp = 1, ///< Lock GCP
- UnlockGlbChp, ///< Unlock GCP
- CrashNode, ///< Crash an NDB node
- ReadRestartGCI, ///< Request the restart GCI id from NDB Cluster
- InsertError ///< Execute an error in NDB Cluster
- ///< (may crash system)
-};
-#endif
-
-#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
-/**
- * @deprecated
- */
-enum NullAttributeType {
- NoNullTypeDefined = -1,
- NotNullAttribute,
- NullAttribute,
- AttributeDefined
-};
-#endif
-
-#endif
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index fd6e827ceb4..27da5c3fa39 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -860,7 +860,6 @@
#include <ndb_types.h>
#include <ndbapi_limits.h>
-#include <AttrType.hpp>
#include <NdbError.hpp>
#include <NdbDictionary.hpp>
@@ -870,8 +869,6 @@ class NdbEventOperationImpl;
class NdbScanOperation;
class NdbIndexOperation;
class NdbConnection;
-class NdbSchemaOp;
-class NdbSchemaCon;
class NdbApiSignal;
class NdbRecAttr;
class NdbLabel;
@@ -882,6 +879,7 @@ class NdbScanReceiver;
class Table;
class BaseString;
class NdbEventOperation;
+class NdbBlob;
typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
@@ -961,14 +959,13 @@ class Ndb
friend class NdbOperation;
friend class NdbEventOperationImpl;
friend class NdbConnection;
- friend class NdbSchemaOp;
- friend class NdbSchemaCon;
friend class Table;
friend class NdbApiSignal;
friend class NdbScanReceiver;
friend class NdbIndexOperation;
friend class NdbDictionaryImpl;
friend class NdbDictInterface;
+ friend class NdbBlob;
public:
/**
@@ -1064,8 +1061,6 @@ public:
* A value larger than 1024 will be downgraded to 1024.
* This means that one Ndb object can handle at most 1024 parallel
* transactions.
- * There is a maximum of 128 simultaneous
- * Ndb object within one application process.
* @return 0 if successful, -1 otherwise.
*
* @note The internal implementation multiplies this value
@@ -1245,22 +1240,6 @@ public:
*/
void closeTransaction(NdbConnection* aConnection);
-#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
- /**
- * To create a table it is necessary to obtain a schema transaction
- * object.
- * All schema transactions need to closed when they are
- * completed.
- *
- * @return NdbSchemaCon
- */
- NdbSchemaCon* startSchemaTransaction();
-
- /**
- * Close schema transaction when finished.
- */
- void closeSchemaTransaction(NdbSchemaCon* aSchemaCon);
-#endif
/** @} *********************************************************************/
@@ -1384,13 +1363,27 @@ public:
* index names as DATABASENAME/SCHEMANAME/TABLENAME/INDEXNAME
* @param turnNamingOn bool true - turn naming on, false - turn naming off
*/
- static void useFullyQualifiedNames(bool turnNamingOn = true);
+ void useFullyQualifiedNames(bool turnNamingOn = true);
- static bool usingFullyQualifiedNames();
+ bool usingFullyQualifiedNames();
/** @} *********************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+
+ /**
+ * Different types of tampering with the NDB Cluster.
+ * <b>Only for debugging purposes only.</b>
+ */
+ enum TamperType {
+ LockGlbChp = 1, ///< Lock GCP
+ UnlockGlbChp, ///< Unlock GCP
+ CrashNode, ///< Crash an NDB node
+ ReadRestartGCI, ///< Request the restart GCI id from NDB Cluster
+ InsertError ///< Execute an error in NDB Cluster
+ ///< (may crash system)
+ };
+
/**
* For testing purposes it is possible to tamper with the NDB Cluster
* (i.e. send a special signal to DBDIH, the NDB distribution handler).
@@ -1398,14 +1391,7 @@ public:
* In a release versions of NDB Cluster,
* this call always return -1 and does nothing.
*
- * @param aAction Action to be taken
- * - 1: Lock global checkpointing
- * (Can only be sent to master DIH,
- * Parameter aNode ignored).
- * - 2: UnLock global checkpointing
- * (Can only be sent to master DIH,
- * Parameter aNode ignored).
- * - 3: Crash node.
+ * @param aAction Action to be taken according to TamperType above
*
* @param aNode Which node the action will be taken
* -1: Master DIH.
@@ -1468,6 +1454,7 @@ private:
NdbIndexOperation* getIndexOperation();// Get an index operation from idle
class NdbGlobalEventBufferHandle* getGlobalEventBufferHandle();
+ NdbBlob* getNdbBlob();// Get a blob handle etc
void releaseSignal(NdbApiSignal* anApiSignal);
void releaseSignalsInList(NdbApiSignal** pList);
@@ -1479,6 +1466,7 @@ private:
void releaseRecAttr (NdbRecAttr* aRecAttr);
void releaseOperation(NdbOperation* anOperation);
void releaseScanOperation(NdbScanOperation* aScanOperation);
+ void releaseNdbBlob(NdbBlob* aBlob);
void check_send_timeout();
void remove_sent_list(Uint32);
@@ -1521,6 +1509,7 @@ private:
void freeNdbSubroutine();// Free the first idle NdbSubroutine obj
void freeNdbCall(); // Free the first idle NdbCall obj
void freeNdbScanRec(); // Free the first idle NdbScanRec obj
+ void freeNdbBlob(); // Free the first etc
NdbConnection* getNdbCon(); // Get a connection from idle list
@@ -1558,10 +1547,12 @@ private:
void abortTransactionsAfterNodeFailure(Uint16 aNodeId);
static
+ const char * externalizeTableName(const char * internalTableName, bool fullyQualifiedNames);
const char * externalizeTableName(const char * internalTableName);
const char * internalizeTableName(const char * externalTableName);
static
+ const char * externalizeIndexName(const char * internalIndexName, bool fullyQualifiedNames);
const char * externalizeIndexName(const char * internalIndexName);
const char * internalizeIndexName(const NdbTableImpl * table,
const char * externalIndexName);
@@ -1598,6 +1589,8 @@ private:
NdbWaiter theWaiter;
+ bool fullyQualifiedNames;
+
// Ndb database name.
char theDataBase[NDB_MAX_DATABASE_NAME_SIZE];
// Ndb database schema name.
@@ -1616,9 +1609,6 @@ private:
NdbScanOperation* theScanOpIdleList; // First scan operation in the idle list.
NdbIndexOperation* theIndexOpIdleList; // First index operation in the idle list.
- NdbSchemaCon* theSchemaConIdleList; // First schemaCon in idle list.
-
- NdbSchemaCon* theSchemaConToNdbList; // Connected schemaCon object.
NdbConnection* theTransactionList;
NdbConnection** theConnectionArray;
NdbRecAttr* theRecAttrIdleList;
@@ -1628,6 +1618,7 @@ private:
NdbSubroutine* theSubroutineList; // First subroutine descriptor in
NdbCall* theCallList; // First call descriptor in list
NdbScanReceiver* theScanList;
+ NdbBlob* theNdbBlobIdleList;
Uint32 theMyRef; // My block reference
Uint32 theNode; // The node number of our node
@@ -1649,7 +1640,14 @@ private:
NdbError theError;
Int32 theNdbBlockNumber;
- InitType theInitState;
+
+ enum InitType {
+ NotConstructed,
+ NotInitialised,
+ StartingInit,
+ Initialised,
+ InitConfigError
+ } theInitState;
// Ensure good distribution of connects
Uint32 theCurrentConnectIndex;
diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp
index e5efc9756ce..515f39433e4 100644
--- a/ndb/include/ndbapi/NdbApi.hpp
+++ b/ndb/include/ndbapi/NdbApi.hpp
@@ -17,17 +17,16 @@
#ifndef NdbApi_H
#define NdbApi_H
+#include "ndbapi_limits.h"
#include "Ndb.hpp"
-#include "AttrType.hpp"
#include "NdbConnection.hpp"
#include "NdbOperation.hpp"
#include "NdbScanOperation.hpp"
#include "NdbIndexOperation.hpp"
-#include "NdbSchemaCon.hpp"
-#include "NdbSchemaOp.hpp"
#include "NdbRecAttr.hpp"
#include "NdbResultSet.hpp"
#include "NdbDictionary.hpp"
#include "NdbEventOperation.hpp"
#include "NdbPool.hpp"
+#include "NdbBlob.hpp"
#endif
diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp
new file mode 100644
index 00000000000..9398f77c474
--- /dev/null
+++ b/ndb/include/ndbapi/NdbBlob.hpp
@@ -0,0 +1,293 @@
+/* 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 NdbBlob_H
+#define NdbBlob_H
+
+#include <ndb_types.h>
+#include <NdbDictionary.hpp>
+#include <NdbConnection.hpp>
+#include <NdbError.hpp>
+
+class Ndb;
+class NdbConnection;
+class NdbOperation;
+class NdbRecAttr;
+class NdbTableImpl;
+class NdbColumnImpl;
+
+/**
+ * @class NdbBlob
+ * @brief Blob handle
+ *
+ * Blob data is stored in 2 places:
+ *
+ * - "header" and "inline bytes" stored in the blob attribute
+ * - "blob parts" stored in a separate table NDB$BLOB_<t>_<v>_<c>
+ *
+ * Inline and part sizes can be set via NdbDictionary::Column methods
+ * when the table is created.
+ *
+ * NdbBlob is a blob handle. To access blob data, the handle must be
+ * created using NdbOperation::getBlobHandle in operation prepare phase.
+ * The handle has following states:
+ *
+ * - prepared: before the operation is executed
+ * - active: after execute or next result but before transaction commit
+ * - closed: after transaction commit
+ * - invalid: after rollback or transaction close
+ *
+ * NdbBlob supports 2 styles of data access:
+ *
+ * - in prepare phase, NdbBlob methods getValue and setValue are used to
+ * prepare a read or write of a single blob value of known size
+ *
+ * - in active phase, NdbBlob methods readData and writeData are used to
+ * read or write blob data of undetermined size
+ *
+ * NdbBlob methods return -1 on error and 0 on success, and use output
+ * parameters when necessary.
+ *
+ * Notes:
+ * - table and its blob part tables are not created atomically
+ * - blob data operations take effect at next transaction execute
+ * - NdbBlob may need to do implicit executes on the transaction
+ * - read and write of complete parts is much more efficient
+ * - scan must use the "new" interface NdbScanOperation
+ * - scan with blobs applies hold-read-lock (at minimum)
+ * - to update a blob in a read op requires exclusive tuple lock
+ * - update op in scan must do its own getBlobHandle
+ * - delete creates implicit, not-accessible blob handles
+ * - NdbOperation::writeTuple does not support blobs
+ * - there is no support for an asynchronous interface
+ *
+ * Bugs / limitations:
+ * - scan must use exclusive locking for now
+ *
+ * Todo:
+ * - add scan method hold-read-lock-until-next + return-keyinfo
+ * - better check of keyinfo length when setting keys
+ * - better check of allowed blob op vs locking mode
+ */
+class NdbBlob {
+public:
+ enum State {
+ Idle = 0,
+ Prepared = 1,
+ Active = 2,
+ Closed = 3,
+ Invalid = 9
+ };
+ State getState();
+ /**
+ * Prepare to read blob value. The value is available after execute.
+ * Use isNull to check for NULL and getLength to get the real length
+ * and to check for truncation. Sets current read/write position to
+ * after the data read.
+ */
+ int getValue(void* data, Uint32 bytes);
+ /**
+ * Prepare to insert or update blob value. An existing longer blob
+ * value will be truncated. The data buffer must remain valid until
+ * execute. Sets current read/write position to after the data. Set
+ * data to null pointer (0) to create a NULL value.
+ */
+ int setValue(const void* data, Uint32 bytes);
+ /**
+ * Check if blob is null.
+ */
+ int getNull(bool& isNull);
+ /**
+ * Set blob to NULL.
+ */
+ int setNull();
+ /**
+ * Get current length in bytes. Use isNull to distinguish between
+ * length 0 blob and NULL blob.
+ */
+ int getLength(Uint64& length);
+ /**
+ * Truncate blob to given length. Has no effect if the length is
+ * larger than current length.
+ */
+ int truncate(Uint64 length = 0);
+ /**
+ * Get current read/write position.
+ */
+ int getPos(Uint64& pos);
+ /**
+ * Set read/write position. Must be between 0 and current length.
+ * "Sparse blobs" are not supported.
+ */
+ int setPos(Uint64 pos);
+ /**
+ * Read at current position and set new position to first byte after
+ * the data read. A read past blob end returns actual number of bytes
+ * read in the in/out bytes parameter.
+ */
+ int readData(void* data, Uint32& bytes);
+ /**
+ * Read at given position. Does not use or update current position.
+ */
+ int readData(Uint64 pos, void* data, Uint32& bytes);
+ /**
+ * Write at current position and set new position to first byte after
+ * the data written. A write past blob end extends the blob value.
+ */
+ int writeData(const void* data, Uint32 bytes);
+ /**
+ * Write at given position. Does not use or update current position.
+ */
+ int writeData(Uint64 pos, const void* data, Uint32 bytes);
+ /**
+ * Return the blob column.
+ */
+ const NdbDictionary::Column* getColumn();
+ /**
+ * Get blob parts table name. Useful only to test programs.
+ */
+ static const unsigned BlobTableNameSize = 40;
+ static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName);
+ /**
+ * Return error object. The error may be blob specific (below) or may
+ * be copied from a failed implicit operation.
+ */
+ const NdbError& getNdbError() const;
+ // "Invalid blob attributes or invalid blob parts table"
+ static const int ErrTable = 4263;
+ // "Invalid usage of blob attribute"
+ static const int ErrUsage = 4264;
+ // "Method is not valid in current blob state"
+ static const int ErrState = 4265;
+ // "Invalid blob seek position"
+ static const int ErrSeek = 4266;
+ // "Corrupted blob value"
+ static const int ErrCorrupt = 4267;
+ // "Error in blob head update forced rollback of transaction"
+ static const int ErrAbort = 4268;
+ // "Unknown blob error"
+ static const int ErrUnknown = 4269;
+
+private:
+ friend class Ndb;
+ friend class NdbConnection;
+ friend class NdbOperation;
+ friend class NdbScanOperation;
+ friend class NdbDictionaryImpl;
+ // state
+ State theState;
+ void setState(State newState);
+ // define blob table
+ static void getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c);
+ static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c);
+ // table name
+ char theBlobTableName[BlobTableNameSize];
+ // ndb api stuff
+ Ndb* theNdb;
+ NdbConnection* theNdbCon;
+ NdbOperation* theNdbOp;
+ NdbTableImpl* theTable;
+ NdbTableImpl* theAccessTable;
+ const NdbColumnImpl* theColumn;
+ char theFillChar;
+ // sizes
+ Uint32 theInlineSize;
+ Uint32 thePartSize;
+ Uint32 theStripeSize;
+ // getValue/setValue
+ bool theGetFlag;
+ char* theGetBuf;
+ bool theSetFlag;
+ const char* theSetBuf;
+ Uint32 theGetSetBytes;
+ // head
+ struct Head {
+ Uint64 length;
+ };
+ // buffers
+ struct Buf {
+ char* data;
+ unsigned size;
+ unsigned maxsize;
+ Buf();
+ ~Buf();
+ void alloc(unsigned n);
+ };
+ Buf theKeyBuf;
+ Buf theAccessKeyBuf;
+ Buf theHeadInlineBuf;
+ Buf thePartBuf;
+ Head* theHead;
+ char* theInlineData;
+ NdbRecAttr* theHeadInlineRecAttr;
+ bool theHeadInlineUpdateFlag;
+ bool theNewPartFlag;
+ // length and read/write position
+ int theNullFlag;
+ Uint64 theLength;
+ Uint64 thePos;
+ // errors
+ NdbError theError;
+ // for keeping in lists
+ NdbBlob* theNext;
+ // initialization
+ NdbBlob();
+ void init();
+ void release();
+ // classify operations
+ bool isTableOp();
+ bool isIndexOp();
+ bool isKeyOp();
+ bool isReadOp();
+ bool isInsertOp();
+ bool isUpdateOp();
+ bool isDeleteOp();
+ bool isScanOp();
+ // computations
+ Uint32 getPartNumber(Uint64 pos);
+ Uint32 getPartCount();
+ Uint32 getDistKey(Uint32 part);
+ // getters and setters
+ int getTableKeyValue(NdbOperation* anOp);
+ int setTableKeyValue(NdbOperation* anOp);
+ int setAccessKeyValue(NdbOperation* anOp);
+ int setPartKeyValue(NdbOperation* anOp, Uint32 part);
+ int getHeadInlineValue(NdbOperation* anOp);
+ void getHeadFromRecAttr();
+ int setHeadInlineValue(NdbOperation* anOp);
+ // data operations
+ int readDataPrivate(Uint64 pos, char* buf, Uint32& bytes);
+ int writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes);
+ int readParts(char* buf, Uint32 part, Uint32 count);
+ int insertParts(const char* buf, Uint32 part, Uint32 count);
+ int updateParts(const char* buf, Uint32 part, Uint32 count);
+ int deleteParts(Uint32 part, Uint32 count);
+ // blob handle maintenance
+ int atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn);
+ int preExecute(ExecType anExecType, bool& batch);
+ int postExecute(ExecType anExecType);
+ int preCommit();
+ int atNextResult();
+ // errors
+ void setErrorCode(int anErrorCode, bool invalidFlag = true);
+ void setErrorCode(NdbOperation* anOp, bool invalidFlag = true);
+ void setErrorCode(NdbConnection* aCon, bool invalidFlag = true);
+#ifdef VM_TRACE
+ friend class NdbOut& operator<<(NdbOut&, const NdbBlob&);
+#endif
+};
+
+#endif
diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp
index c775dd5e33d..c620578cabd 100644
--- a/ndb/include/ndbapi/NdbConnection.hpp
+++ b/ndb/include/ndbapi/NdbConnection.hpp
@@ -18,7 +18,6 @@
#define NdbConnection_H
#include <ndb_types.h>
-#include <AttrType.hpp>
#include <NdbError.hpp>
class NdbConnection;
@@ -29,6 +28,7 @@ class NdbIndexOperation;
class NdbApiSignal;
class Ndb;
class NdbScanReceiver;
+class NdbBlob;
/**
@@ -41,6 +41,35 @@ class NdbScanReceiver;
typedef void (* NdbAsynchCallback)(int, NdbConnection*, void*);
/**
+ * Commit type of transaction
+ */
+enum AbortOption {
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ CommitIfFailFree = 0,
+ CommitAsMuchAsPossible = 2, ///< Commit transaction with as many
+ TryCommit = 0, ///< <i>Missing explanation</i>
+#endif
+ AbortOnError = 0, ///< Abort transaction on failed operation
+ IgnoreError = 2 ///< Transaction continues on failed operation
+};
+
+typedef AbortOption CommitType;
+
+
+/**
+ * Execution type of transaction
+ */
+enum ExecType {
+ NoExecTypeDef = -1, ///< Erroneous type (Used for debugging only)
+ Prepare, ///< <i>Missing explanation</i>
+ NoCommit, ///< Execute the transaction as far as it has
+ ///< been defined, but do not yet commit it
+ Commit, ///< Execute and try to commit the transaction
+ Rollback ///< Rollback transaction
+};
+
+
+/**
* @class NdbConnection
* @brief Represents a transaction.
*
@@ -132,6 +161,7 @@ class NdbConnection
friend class NdbScanOperation;
friend class NdbIndexOperation;
friend class NdbScanReceiver;
+ friend class NdbBlob;
public:
@@ -419,6 +449,14 @@ public:
* @return The commit status of the transaction, i.e. one of
* { NotStarted, Started, TimeOut, Committed, Aborted, NeedAbort }
*/
+ enum CommitStatusType {
+ NotStarted, ///< Transaction not yet started
+ Started, ///< <i>Missing explanation</i>
+ Committed, ///< Transaction has been committed
+ Aborted, ///< Transaction has been aborted
+ NeedAbort ///< <i>Missing explanation</i>
+ };
+
CommitStatusType commitStatus();
/** @} *********************************************************************/
@@ -500,6 +538,10 @@ private:
~NdbConnection();
void init(); // Initialize connection object for new transaction
+
+ int executeNoBlobs(ExecType execType,
+ AbortOption abortOption = AbortOnError,
+ int force = 0 );
/**
* Set Connected node id
@@ -515,8 +557,17 @@ private:
Uint32 getBuddyConPtr(); // Gets Buddy Con Ptr
NdbConnection* next(); // Returns the next pointer
void next(NdbConnection*); // Sets the next pointer
- ConStatusType Status(); // Read the status information
- void Status(ConStatusType); // Set the status information
+
+ enum ConStatusType {
+ NotConnected,
+ Connecting,
+ Connected,
+ DisConnecting,
+ ConnectFailure
+ };
+ ConStatusType Status(); // Read the status information
+ void Status(ConStatusType); // Set the status information
+
Uint32 get_send_size(); // Get size to send
void set_send_size(Uint32); // Set size to send;
@@ -580,10 +631,12 @@ private:
void setOperationErrorCodeAbort(int anErrorCode);
int checkMagicNumber(); // Verify correct object
- NdbOperation* getNdbOperation(class NdbTableImpl* aTable);
+ NdbOperation* getNdbOperation(class NdbTableImpl* aTable,
+ NdbOperation* aNextOp = 0);
NdbScanOperation* getNdbScanOperation(class NdbTableImpl* aTable);
NdbIndexOperation* getNdbIndexOperation(class NdbIndexImpl* anIndex,
- class NdbTableImpl* aTable);
+ class NdbTableImpl* aTable,
+ NdbOperation* aNextOp = 0);
void handleExecuteCompletion();
@@ -595,6 +648,18 @@ private:
Uint32 theId;
// Keeps track of what the send method should do.
+ enum SendStatusType {
+ NotInit,
+ InitState,
+ sendOperations,
+ sendCompleted,
+ sendCOMMITstate,
+ sendABORT,
+ sendABORTfail,
+ sendTC_ROLLBACK,
+ sendTC_COMMIT,
+ sendTC_OP
+ };
SendStatusType theSendStatus;
NdbAsynchCallback theCallbackFunction; // Pointer to the callback function
void* theCallbackObject; // The callback object pointer
@@ -628,12 +693,18 @@ private:
Uint64 theTransactionId; // theTransactionId of the transaction
Uint32 theGlobalCheckpointId; // The gloabl checkpoint identity of the transaction
ConStatusType theStatus; // The status of the connection
-
- CompletionStatus theCompletionStatus; // The Completion status of the transaction
+ enum CompletionStatus {
+ NotCompleted,
+ CompletedSuccess,
+ CompletedFailure,
+ DefinitionFailure
+ } theCompletionStatus; // The Completion status of the transaction
CommitStatusType theCommitStatus; // The commit status of the transaction
Uint32 theMagicNumber; // Magic Number to verify correct object
Uint32 thePriority; // Transaction Priority
+
+ enum ReturnType { ReturnSuccess, ReturnFailure };
ReturnType theReturnStatus; // Did we have any read/update/delete failing
// to find the tuple.
bool theTransactionIsStarted;
@@ -641,7 +712,12 @@ private:
bool theSimpleState;
Uint8 m_abortOption; // Type of commit
- ListState theListState;
+ enum ListState {
+ NotInList,
+ InPreparedList,
+ InSendList,
+ InCompletedList
+ } theListState;
Uint32 theDBnode; // The database node we are connected to
Uint32 theNodeSequence; // The sequence no of the db node
@@ -662,6 +738,8 @@ private:
// nextScanResult.
NdbOperation* theScanningOp; // The operation actually performing the scan
Uint32 theBuddyConPtr;
+ // optim: any blobs
+ bool theBlobFlag;
static void sendTC_COMMIT_ACK(NdbApiSignal *,
Uint32 transId1, Uint32 transId2,
@@ -687,6 +765,10 @@ NdbConnection::set_send_size(Uint32 send_size)
return;
}
+#ifdef NDB_NO_DROPPED_SIGNAL
+#include <stdlib.h>
+#endif
+
inline
int
NdbConnection::checkMagicNumber()
@@ -830,7 +912,7 @@ Parameters: aStatus: The status.
Remark: Sets Connect status.
******************************************************************************/
inline
-ConStatusType
+NdbConnection::ConStatusType
NdbConnection::Status()
{
return theStatus;
@@ -849,6 +931,7 @@ NdbConnection::Status( ConStatusType aStatus )
theStatus = aStatus;
}
+
/******************************************************************************
void setGCI();
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index a8a3bc86786..3b38e33ec91 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -182,7 +182,8 @@ public:
Varbinary, ///< Max len
Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes )
- Blob ///< Binary large object (see NdbBlob)
+ Blob, ///< Binary large object (see NdbBlob)
+ Clob ///< Text blob
};
/**
@@ -297,7 +298,34 @@ public:
* Array length for column or max length for variable length arrays.
*/
int getLength() const;
-
+
+ /**
+ * For blob, set or get "inline size" i.e. number of initial bytes
+ * to store in table's blob attribute. This part is normally in
+ * main memory and can be indexed and interpreted.
+ */
+ void setInlineSize(int size) { setPrecision(size); }
+ int getInlineSize() const { return getPrecision(); }
+
+ /**
+ * For blob, set or get "part size" i.e. number of bytes to store in
+ * each tuple of the "blob table". Must be less than 64k.
+ */
+ void setPartSize(int size) { setScale(size); }
+ int getPartSize() const { return getScale(); }
+
+ /**
+ * For blob, set or get "stripe size" i.e. number of consecutive
+ * <em>parts</em> to store in each node group.
+ */
+ void setStripeSize(int size) { setLength(size); }
+ int getStripeSize() const { return getLength(); }
+
+ /**
+ * Get size of element
+ */
+ int Column::getSize() const;
+
/**
* Set distribution key
*
@@ -349,6 +377,7 @@ public:
#endif
private:
+ friend class NdbRecAttr;
friend class NdbColumnImpl;
class NdbColumnImpl & m_impl;
Column(NdbColumnImpl&);
@@ -1023,6 +1052,7 @@ public:
private:
friend class NdbDictionaryImpl;
friend class UtilTransactions;
+ friend class NdbBlob;
class NdbDictionaryImpl & m_impl;
Dictionary(NdbDictionaryImpl&);
const Table * getIndexTable(const char * indexName,
@@ -1030,4 +1060,6 @@ public:
};
};
+class NdbOut& operator <<(class NdbOut& ndbout, const NdbDictionary::Column::Type type);
+
#endif
diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp
index 3b8e5f7a888..baf31dca0ee 100644
--- a/ndb/include/ndbapi/NdbIndexOperation.hpp
+++ b/ndb/include/ndbapi/NdbIndexOperation.hpp
@@ -184,7 +184,7 @@ private:
// Private attributes
NdbIndexImpl* m_theIndex;
- Uint32 m_theIndexDefined[MAXNROFTUPLEKEY][3];
+ Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3];
Uint32 m_theIndexLen; // Length of the index in words
Uint32 m_theNoOfIndexDefined; // The number of index attributes
};
diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp
index 3c515fe84ef..cfa656cb2d5 100644
--- a/ndb/include/ndbapi/NdbOperation.hpp
+++ b/ndb/include/ndbapi/NdbOperation.hpp
@@ -18,10 +18,9 @@
#define NdbOperation_H
#include <ndb_types.h>
-
-#include <AttrType.hpp>
-#include <NdbError.hpp>
-#include <NdbReceiver.hpp>
+#include "ndbapi_limits.h"
+#include "NdbError.hpp"
+#include "NdbReceiver.hpp"
class Ndb;
class NdbApiSignal;
@@ -29,6 +28,7 @@ class NdbRecAttr;
class NdbOperation;
class NdbConnection;
class NdbColumnImpl;
+class NdbBlob;
/**
* @class NdbOperation
@@ -42,7 +42,8 @@ class NdbOperation
friend class NdbScanReceiver;
friend class NdbScanFilter;
friend class NdbScanFilterImpl;
-
+ friend class NdbBlob;
+
public:
/**
* @name Define Standard Operation Type
@@ -526,6 +527,17 @@ public:
virtual int setValue(Uint32 anAttrId, Int64 aValue);
virtual int setValue(Uint32 anAttrId, float aValue);
virtual int setValue(Uint32 anAttrId, double aValue);
+
+ /**
+ * This method replaces getValue/setValue for blobs. It creates
+ * a blob handle NdbBlob. A second call with same argument returns
+ * the previously created handle. The handle is linked to the
+ * operation and is maintained automatically.
+ *
+ * See NdbBlob for details.
+ */
+ virtual NdbBlob* getBlobHandle(const char* anAttrName);
+ virtual NdbBlob* getBlobHandle(Uint32 anAttrId);
/** @} *********************************************************************/
/**
@@ -833,8 +845,29 @@ public:
*/
int getNdbErrorLine();
+ /**
+ * Get table name of this operation.
+ */
+ const char* getTableName() const;
+
/** @} *********************************************************************/
+ /**
+ * Type of operation
+ */
+ enum OperationType {
+ ReadRequest = 0, ///< Read operation
+ UpdateRequest = 1, ///< Update Operation
+ InsertRequest = 2, ///< Insert Operation
+ DeleteRequest = 3, ///< Delete Operation
+ WriteRequest = 4, ///< Write Operation
+ ReadExclusive = 5, ///< Read exclusive
+ OpenScanRequest, ///< Scan Operation
+ OpenRangeScanRequest, ///< Range scan operation
+ NotDefined2, ///< Internal for debugging
+ NotDefined ///< Internal for debugging
+ };
+
protected:
/******************************************************************************
* These are the methods used to create and delete the NdbOperation objects.
@@ -865,11 +898,27 @@ protected:
NdbOperation* next(); // Get next pointer
+ enum OperationStatus{
+ Init,
+ OperationDefined,
+ TupleKeyDefined,
+ GetValue,
+ SetValue,
+ ExecInterpretedValue,
+ SetValueInterpreted,
+ FinalGetValue,
+ SubroutineExec,
+ SubroutineEnd,
+ SetBound,
+ WaitResponse,
+ WaitCommitResponse,
+ Finished,
+ ReceiveFinished
+ };
+
OperationStatus Status(); // Read the status information
void Status(OperationStatus); // Set the status information
-
- OperationType RequestType();
void NdbCon(NdbConnection*); // Set reference to connection
// object.
@@ -879,8 +928,6 @@ protected:
// the operations object.
void setStartIndicator();
- void setCommitIndicator(CommitType aCommitType);
-
/******************************************************************************
* The methods below is the execution part of the NdbOperation
* class. This is where the NDB signals are sent and received. The
@@ -924,6 +971,7 @@ protected:
Uint32 len);
NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0);
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
+ NdbBlob* getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* anAttrObject);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
@@ -968,6 +1016,10 @@ protected:
NdbOperation*
takeOverScanOp(OperationType opType, NdbConnection* updateTrans);
+ // get table or index key from prepared signals
+ int getKeyFromTCREQ(Uint32* data, unsigned size);
+ int getKeyFromKEYINFO20(Uint32* data, unsigned size);
+
/******************************************************************************
* These are the private variables that are defined in the operation objects.
*****************************************************************************/
@@ -1013,18 +1065,13 @@ protected:
Uint32 theCurrRecAI_Len; // The currently received length
Uint32 theAI_ElementLen; // How many words long is this element
Uint32* theCurrElemPtr; // The current pointer to the element
- //Uint32 theTableId; // Table id.
- //Uint32 theAccessTableId; // The id of table for initial access,
- // changed by NdbIndexOperation
- //Uint32 theSchemaVersion; // The schema version on the table.
class NdbTableImpl* m_currentTable; // The current table
class NdbTableImpl* m_accessTable;
// Set to TRUE when a tuple key attribute has been defined.
- // A tuple key is allowed to consist of 64 attributes.
- Uint32 theTupleKeyDefined[MAXNROFTUPLEKEY][3];
+ Uint32 theTupleKeyDefined[NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY][3];
- Uint32 theTotalNrOfKeyWordInSignal; // The total number of
+ Uint32 theTotalNrOfKeyWordInSignal; // The total number of
// keyword in signal.
Uint32 theTupKeyLen; // Length of the tuple key in words
@@ -1071,9 +1118,16 @@ protected:
// saveBoundATTRINFO() moves ATTRINFO here when setBound() is ready
NdbApiSignal* theBoundATTRINFO;
Uint32 theTotalBoundAI_Len;
+ // Blobs in this operation
+ NdbBlob* theBlobList;
};
+#ifdef NDB_NO_DROPPED_SIGNAL
+#include <stdlib.h>
+#endif
+
+
inline
int
NdbOperation::checkMagicNumber()
@@ -1094,16 +1148,6 @@ NdbOperation::setStartIndicator()
theStartIndicator = 1;
}
-#if 0
-inline
-void
-NdbOperation::setCommitIndicator(CommitType aTypeOfCommit)
-{
- theCommitIndicator = 1;
- theCommitType = (Uint8)aTypeOfCommit;
-}
-#endif
-
inline
int
NdbOperation::getNdbErrorLine()
@@ -1145,7 +1189,7 @@ Parameters: aStatus: The status.
Remark: Sets Operation status.
******************************************************************************/
inline
-OperationStatus
+NdbOperation::OperationStatus
NdbOperation::Status()
{
return theStatus;
@@ -1178,18 +1222,6 @@ NdbOperation::NdbCon(NdbConnection* aNdbCon)
theNdbCon = aNdbCon;
}
-/******************************************************************************
-OperationType RequestType();
-
-Remark: Return the request typ of the operation..
-******************************************************************************/
-inline
-OperationType
-NdbOperation::RequestType()
-{
- return theOperationType;
-}
-
inline
int
NdbOperation::equal(const char* anAttrName, Int32 aPar)
diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp
index 7eeff88671d..36b54035d96 100644
--- a/ndb/include/ndbapi/NdbRecAttr.hpp
+++ b/ndb/include/ndbapi/NdbRecAttr.hpp
@@ -18,10 +18,8 @@
#define NdbRecAttr_H
#include <NdbDictionary.hpp>
-#include "AttrType.hpp"
class NdbOperation;
-class AttrInfo;
/**
* @class NdbRecAttr
@@ -78,20 +76,19 @@ class NdbRecAttr
friend class NdbEventOperationImpl;
friend class NdbScanReceiver;
friend class Ndb;
-
+ friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&);
+
public:
/**
* @name Getting meta information
* @{
*/
const NdbDictionary::Column * getColumn() const;
-
+
/**
- * Get attribute type.
- *
- * @return Type of attribute: { Signed, UnSigned, Float, String }
+ * Get type of column
+ * @return Data type of the column
*/
- AttrType attrType() const ;
NdbDictionary::Column::Type getType() const;
/**
@@ -257,6 +254,7 @@ private:
void next(NdbRecAttr* aRecAttr);
NdbRecAttr* next() const;
+ int setup(const class NdbDictionary::Column* col, char* aValue);
int setup(const class NdbColumnImpl* anAttrInfo, char* aValue);
/* Set up attributes and buffers */
bool copyoutRequired() const; /* Need to copy data to application */
@@ -317,33 +315,6 @@ NdbRecAttr::attrSize() const {
}
inline
-AttrType
-NdbRecAttr::attrType() const {
- switch(getType()){
- case NdbDictionary::Column::Bigint:
- case NdbDictionary::Column::Int:
- return Signed;
- case NdbDictionary::Column::Bigunsigned:
- case NdbDictionary::Column::Unsigned:
- return UnSigned;
- case NdbDictionary::Column::Float:
- case NdbDictionary::Column::Decimal:
- case NdbDictionary::Column::Double:
- return Float;
- case NdbDictionary::Column::Char:
- case NdbDictionary::Column::Varchar:
- case NdbDictionary::Column::Binary:
- case NdbDictionary::Column::Varbinary:
- return String;
- case NdbDictionary::Column::Datetime:
- case NdbDictionary::Column::Timespec:
- case NdbDictionary::Column::Undefined:
- default:
- return NoAttrTypeDef;
- }
-}
-
-inline
Uint32
NdbRecAttr::arraySize() const
{
@@ -505,5 +476,7 @@ NdbRecAttr::isNULL() const
return theNULLind;
}
+class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &);
+
#endif
diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp
index bc11207a112..a1a08a9735a 100644
--- a/ndb/include/ndbapi/NdbReceiver.hpp
+++ b/ndb/include/ndbapi/NdbReceiver.hpp
@@ -56,6 +56,10 @@ private:
void* m_owner;
};
+#ifdef NDB_NO_DROPPED_SIGNAL
+#include <stdlib.h>
+#endif
+
inline
bool
NdbReceiver::checkMagicNumber() const {
diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp
index f83669fb616..151dc5bb99f 100644
--- a/ndb/include/ndbapi/NdbScanOperation.hpp
+++ b/ndb/include/ndbapi/NdbScanOperation.hpp
@@ -33,6 +33,8 @@
#include <NdbOperation.hpp>
#include <NdbCursorOperation.hpp>
+class NdbBlob;
+
/**
* @class NdbScanOperation
* @brief Class of scan operations for use in transactions.
@@ -82,6 +84,10 @@ public:
int setValue(Uint32 anAttrId, float aValue);
int setValue(Uint32 anAttrId, double aValue);
#endif
+
+ NdbBlob* getBlobHandle(const char* anAttrName);
+ NdbBlob* getBlobHandle(Uint32 anAttrId);
+
private:
NdbScanOperation(Ndb* aNdb);
diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h
index bcfba7d3f9d..1cf2d9b342d 100644
--- a/ndb/include/ndbapi/ndbapi_limits.h
+++ b/ndb/include/ndbapi/ndbapi_limits.h
@@ -18,30 +18,16 @@
#define NDBAPI_LIMITS_H
#define NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY 32
-#define NDB_MAX_TABLES 1600
+#define NDB_MAX_ATTRIBUTES_IN_INDEX NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY
#define NDB_MAX_DATABASE_NAME_SIZE 128
#define NDB_MAX_SCHEMA_NAME_SIZE 128
#define NDB_MAX_TAB_NAME_SIZE 128
-#define NDB_MAX_ATTR_NAME_SIZE 32
-#define NDB_MAX_ATTR_DEFAULT_VALUE_SIZE 128
#define NDB_MAX_ATTRIBUTES_IN_TABLE 91
-#define NDB_MAX_ATTRIBUTES_IN_INDEX NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY
+
#define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023
-#define NDB_MAX_FIXED_KEY_LENGTH_IN_WORDS 8
#define NDB_MAX_KEYSIZE_IN_WORDS 1023
#define NDB_MAX_KEY_SIZE NDB_MAX_KEYSIZE_IN_WORDS*sizeof(Uint32)
-#define NDB_MAX_TUPLE_SIZE 8191
-#define NDB_MAX_CONNECTIONS 127
-#define NDB_MAX_TRANSACTIONS 1024
-#define NDB_MAX_PARALLEL_SCANS 12
+#define NDB_MAX_TUPLE_SIZE NDB_MAX_TUPLE_SIZE_IN_WORDS*sizeof(uint32)
#define NDB_MAX_ACTIVE_EVENTS 100
-#ifndef MIN
-#define MIN(x,y) (((x)<(y))?(x):(y))
-#endif
-
-#ifndef MAX
-#define MAX(x,y) (((x)>(y))?(x):(y))
-#endif
-
#endif
diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h
index 6cd5be0149f..5e24e08ec61 100644
--- a/ndb/include/portlib/PortDefs.h
+++ b/ndb/include/portlib/PortDefs.h
@@ -49,7 +49,7 @@ int getopt(int, char **, char *opts);
#endif // NDB_WIN32
#ifdef NDB_ALPHA
-#ifdef NDB_GCC
+#ifdef NDB_GCC // only for NDB_ALPHA
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
diff --git a/ndb/include/util/Base64.hpp b/ndb/include/util/Base64.hpp
index a8678da946c..1156636eec8 100644
--- a/ndb/include/util/Base64.hpp
+++ b/ndb/include/util/Base64.hpp
@@ -20,7 +20,8 @@
#include <UtilBuffer.hpp>
#include <BaseString.hpp>
-int base64_encode(UtilBuffer &src, BaseString &dst);
-int base64_decode(BaseString &src, UtilBuffer &dst);
+int base64_encode(const UtilBuffer &src, BaseString &dst);
+int base64_decode(const BaseString &src, UtilBuffer &dst);
+int base64_decode(const char * s, size_t len, UtilBuffer &dst);
#endif /* !__BASE64_HPP_INCLUDED__ */
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index 75a1c291594..8755c13e9bb 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -203,13 +203,13 @@ BaseString::empty() const
inline void
BaseString::ndb_toupper() {
for(unsigned i = 0; i < length(); i++)
- m_chr[i] = ::toupper(m_chr[i]);
+ m_chr[i] = toupper(m_chr[i]);
}
inline void
BaseString::ndb_tolower() {
for(unsigned i = 0; i < length(); i++)
- m_chr[i] = ::tolower(m_chr[i]);
+ m_chr[i] = tolower(m_chr[i]);
}
inline bool
diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp
index ed981743512..7355742f845 100644
--- a/ndb/include/util/Bitmask.hpp
+++ b/ndb/include/util/Bitmask.hpp
@@ -134,7 +134,7 @@ public:
/**
* getText - Return as hex-digits (only for debug routines).
*/
- static void getText(unsigned size, const Uint32 data[], char* buf);
+ static char* getText(unsigned size, const Uint32 data[], char* buf);
};
inline bool
@@ -302,9 +302,10 @@ BitmaskImpl::setField(unsigned size, Uint32 data[],
set(size, data, pos + i, val & (1 << i));
}
-inline void
+inline char *
BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf)
{
+ char * org = buf;
const char* const hex = "0123456789abcdef";
for (int i = (size-1); i >= 0; i--) {
Uint32 x = data[i];
@@ -315,6 +316,7 @@ BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf)
buf += 8;
}
*buf = 0;
+ return org;
}
/**
@@ -331,11 +333,12 @@ public:
*/
struct Data {
Uint32 data[size];
-
+#if 0
Data & operator=(const Bitmask<size> & src) {
- src.assign(size, data);
+ src.copyto(size, data);
return *this;
}
+#endif
};
private:
@@ -345,21 +348,24 @@ public:
STATIC_CONST( NotFound = BitmaskImpl::NotFound );
STATIC_CONST( TextLength = size * 8 );
+ Bitmask() { clear();}
+
/**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
- void assign(const Bitmask<size>::Data & src);
+ void assign(const typename Bitmask<size>::Data & src);
/**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
static void assign(Uint32 dst[], const Uint32 src[]);
+ static void assign(Uint32 dst[], const Bitmask<size> & src);
void assign(const Bitmask<size> & src);
/**
- * assign <em>dst</em> of size <em>sz</em> to <em>this</em>
+ * copy this to <em>dst</em>
*/
- void assign(unsigned sz, Uint32 dst[]) const;
+ void copyto(unsigned sz, Uint32 dst[]) const;
/**
* assign <em>this</em> according to <em>src/em>
@@ -467,7 +473,7 @@ public:
/**
* getText - Return as hex-digits (only for debug routines).
*/
- static void getText(const Uint32 data[], char* buf);
+ static char* getText(const Uint32 data[], char* buf);
char* getText(char* buf) const;
};
@@ -480,7 +486,14 @@ Bitmask<size>::assign(Uint32 dst[], const Uint32 src[])
template <unsigned size>
inline void
-Bitmask<size>::assign(const Bitmask<size>::Data & src)
+Bitmask<size>::assign(Uint32 dst[], const Bitmask<size> & src)
+{
+ BitmaskImpl::assign(size, dst, src.rep.data);
+}
+
+template <unsigned size>
+inline void
+Bitmask<size>::assign(const typename Bitmask<size>::Data & src)
{
assign(rep.data, src.data);
}
@@ -489,12 +502,12 @@ template <unsigned size>
inline void
Bitmask<size>::assign(const Bitmask<size> & src)
{
- assign(rep.data, src);
+ assign(rep.data, src.rep.data);
}
template <unsigned size>
inline void
-Bitmask<size>::assign(unsigned sz, Uint32 dst[]) const
+Bitmask<size>::copyto(unsigned sz, Uint32 dst[]) const
{
BitmaskImpl::assign(sz, dst, rep.data);
}
@@ -707,18 +720,17 @@ Bitmask<size>::bitXOR(const Bitmask<size>& mask2)
}
template <unsigned size>
-void
+char *
Bitmask<size>::getText(const Uint32 data[], char* buf)
{
- BitmaskImpl::getText(size, data, buf);
+ return BitmaskImpl::getText(size, data, buf);
}
template <unsigned size>
inline char *
Bitmask<size>::getText(char* buf) const
{
- getText(rep.data, buf);
- return buf;
+ return getText(rep.data, buf);
}
template <unsigned size>
diff --git a/ndb/include/util/ConfigValues.hpp b/ndb/include/util/ConfigValues.hpp
new file mode 100644
index 00000000000..48e1363bf4a
--- /dev/null
+++ b/ndb/include/util/ConfigValues.hpp
@@ -0,0 +1,252 @@
+#ifndef __CONFIG_VALUES_HPP
+#define __CONFIG_VALUES_HPP
+
+#include <ndb_types.h>
+#include <UtilBuffer.hpp>
+
+class ConfigValues {
+ friend class ConfigValuesFactory;
+ ConfigValues(Uint32 sz, Uint32 data);
+
+public:
+ ~ConfigValues();
+
+ enum ValueType {
+ InvalidType = 0,
+ IntType = 1,
+ StringType = 2,
+ SectionType = 3,
+ Int64Type = 4
+ };
+
+ struct Entry {
+ Uint32 m_key;
+ ValueType m_type;
+ union {
+ Uint32 m_int;
+ const char * m_string;
+ Uint64 m_int64;
+ };
+ };
+
+ class ConstIterator {
+ friend class ConfigValuesFactory;
+ const ConfigValues & m_cfg;
+ protected:
+ Uint32 m_currentSection;
+ public:
+ ConstIterator(const ConfigValues&c) : m_cfg(c) { m_currentSection = 0;}
+
+ bool openSection(Uint32 key, Uint32 no);
+ bool closeSection();
+
+ bool get(Uint32 key, Entry *) const;
+
+ bool get(Uint32 key, Uint32 * value) const;
+ bool get(Uint32 key, Uint64 * value) const;
+ bool get(Uint32 key, const char ** value) const;
+ bool getTypeOf(Uint32 key, ValueType * type) const;
+
+ Uint32 get(Uint32 key, Uint32 notFound) const;
+ Uint64 get64(Uint32 key, Uint64 notFound) const;
+ const char * get(Uint32 key, const char * notFound) const;
+ ValueType getTypeOf(Uint32 key) const;
+ };
+
+ class Iterator : public ConstIterator {
+ ConfigValues & m_cfg;
+ public:
+ Iterator(ConfigValues&c) : ConstIterator(c), m_cfg(c) {}
+
+ bool set(Uint32 key, Uint32 value);
+ bool set(Uint32 key, Uint64 value);
+ bool set(Uint32 key, const char * value);
+ };
+
+ Uint32 getPackedSize() const; // get size in bytes needed to pack
+ Uint32 pack(UtilBuffer&) const;
+ Uint32 pack(void * dst, Uint32 len) const;// pack into dst(of len %d);
+
+private:
+ friend class Iterator;
+ friend class ConstIterator;
+
+ bool getByPos(Uint32 pos, Entry *) const;
+ Uint64 & get64(Uint32 index) const;
+ char * & getString(Uint32 index) const;
+
+ Uint32 m_size;
+ Uint32 m_dataSize;
+ Uint32 m_stringCount;
+ Uint32 m_int64Count;
+
+ Uint32 m_values[1];
+ void * m_data[1];
+};
+
+class ConfigValuesFactory {
+ Uint32 m_currentSection;
+public:
+ Uint32 m_sectionCounter;
+ Uint32 m_freeKeys;
+ Uint32 m_freeData;
+
+public:
+ ConfigValuesFactory(Uint32 keys = 50, Uint32 data = 10); // Initial
+ ConfigValuesFactory(ConfigValues * m_cfg); //
+
+ ConfigValues * m_cfg;
+ ConfigValues * getConfigValues();
+
+ bool openSection(Uint32 key, Uint32 no);
+ bool put(const ConfigValues::Entry & );
+ bool put(Uint32 key, Uint32 value);
+ bool put64(Uint32 key, Uint64 value);
+ bool put(Uint32 key, const char * value);
+ bool closeSection();
+
+ void expand(Uint32 freeKeys, Uint32 freeData);
+ void shrink();
+
+ bool unpack(const UtilBuffer&);
+ bool unpack(const void * src, Uint32 len);
+
+ static ConfigValues * extractCurrentSection(const ConfigValues::ConstIterator &);
+
+private:
+ static ConfigValues * create(Uint32 keys, Uint32 data);
+ void put(const ConfigValues & src);
+};
+
+inline
+bool
+ConfigValues::ConstIterator::get(Uint32 key, Uint32 * value) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == IntType){
+ * value = tmp.m_int;
+ return true;
+ }
+ return false;
+}
+
+inline
+bool
+ConfigValues::ConstIterator::get(Uint32 key, Uint64 * value) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == Int64Type){
+ * value = tmp.m_int64;
+ return true;
+ }
+ return false;
+}
+
+inline
+bool
+ConfigValues::ConstIterator::get(Uint32 key, const char ** value) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == StringType){
+ * value = tmp.m_string;
+ return true;
+ }
+ return false;
+}
+
+inline
+bool
+ConfigValues::ConstIterator::getTypeOf(Uint32 key, ValueType * type) const{
+ Entry tmp;
+ if(get(key, &tmp)){
+ * type = tmp.m_type;
+ return true;
+ }
+ return false;
+}
+
+inline
+Uint32
+ConfigValues::ConstIterator::get(Uint32 key, Uint32 notFound) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == IntType){
+ return tmp.m_int;
+ }
+ return notFound;
+}
+
+inline
+Uint64
+ConfigValues::ConstIterator::get64(Uint32 key, Uint64 notFound) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == Int64Type){
+ return tmp.m_int64;
+ }
+ return notFound;
+}
+
+inline
+const char *
+ConfigValues::ConstIterator::get(Uint32 key, const char * notFound) const {
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == StringType){
+ return tmp.m_string;
+ }
+ return notFound;
+}
+
+inline
+ConfigValues::ValueType
+ConfigValues::ConstIterator::getTypeOf(Uint32 key) const{
+ Entry tmp;
+ if(get(key, &tmp)){
+ return tmp.m_type;
+ }
+ return ConfigValues::InvalidType;
+}
+
+inline
+bool
+ConfigValuesFactory::put(Uint32 key, Uint32 val){
+ ConfigValues::Entry tmp;
+ tmp.m_key = key;
+ tmp.m_type = ConfigValues::IntType;
+ tmp.m_int = val;
+ return put(tmp);
+}
+
+inline
+bool
+ConfigValuesFactory::put64(Uint32 key, Uint64 val){
+ ConfigValues::Entry tmp;
+ tmp.m_key = key;
+ tmp.m_type = ConfigValues::Int64Type;
+ tmp.m_int64 = val;
+ return put(tmp);
+}
+
+inline
+bool
+ConfigValuesFactory::put(Uint32 key, const char * val){
+ ConfigValues::Entry tmp;
+ tmp.m_key = key;
+ tmp.m_type = ConfigValues::StringType;
+ tmp.m_string = val;
+ return put(tmp);
+}
+
+inline
+Uint32
+ConfigValues::pack(UtilBuffer& buf) const {
+ Uint32 len = getPackedSize();
+ void * tmp = buf.append(len);
+ if(tmp == 0){
+ return 0;
+ }
+ return pack(tmp, len);
+}
+
+inline
+bool
+ConfigValuesFactory::unpack(const UtilBuffer& buf){
+ return unpack(buf.get_data(), buf.length());
+}
+
+#endif
diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp
index bb573eea17b..841da513d4a 100644
--- a/ndb/include/util/NdbSqlUtil.hpp
+++ b/ndb/include/util/NdbSqlUtil.hpp
@@ -19,6 +19,7 @@
#include <string.h>
#include <ndb_types.h>
+#include <kernel/ndb_limits.h>
class NdbSqlUtil {
public:
@@ -77,7 +78,9 @@ public:
Binary, // Len
Varbinary, // Max len
Datetime, // Precision down to 1 sec (size 8 bytes)
- Timespec // Precision down to 1 nsec (size 12 bytes)
+ Timespec, // Precision down to 1 nsec (size 12 bytes)
+ Blob, // Blob
+ Clob // Text blob
};
Enum m_typeId;
Cmp* m_cmp; // set to NULL if cmp not implemented
@@ -121,6 +124,8 @@ private:
static Cmp cmpVarbinary;
static Cmp cmpDatetime;
static Cmp cmpTimespec;
+ static Cmp cmpBlob;
+ static Cmp cmpClob;
};
inline int
@@ -145,7 +150,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Tinyunsigned:
{
if (size >= 1) {
@@ -160,7 +164,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Smallint:
{
if (size >= 1) {
@@ -175,7 +178,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Smallunsigned:
{
if (size >= 1) {
@@ -190,7 +192,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Mediumint: // XXX fix these
break;
case Type::Mediumunsigned:
@@ -209,7 +210,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Unsigned:
{
if (size >= 1) {
@@ -224,7 +224,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Bigint:
{
if (size >= 2) {
@@ -241,7 +240,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Bigunsigned:
{
if (size >= 2) {
@@ -258,7 +256,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Float:
{
if (size >= 1) {
@@ -273,7 +270,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Double:
{
if (size >= 2) {
@@ -290,7 +286,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Decimal:
break;
case Type::Char:
@@ -305,7 +300,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
int k = memcmp(u1.v, u2.v, size << 2);
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
}
- break;
case Type::Varchar:
{
/*
@@ -323,7 +317,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Binary: // XXX fix these
break;
case Type::Varbinary:
@@ -347,9 +340,24 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
- break;
case Type::Timespec: // XXX fix this
break;
+ case Type::Blob: // XXX fix
+ break;
+ case Type::Clob:
+ {
+ // skip blob head, the rest is varchar
+ const unsigned skip = NDB_BLOB_HEAD_SIZE;
+ if (size >= skip + 1) {
+ union { const Uint32* p; const char* v; } u1, u2;
+ u1.p = p1 + skip;
+ u2.p = p2 + skip;
+ // length in first 2 bytes
+ int k = strncmp(u1.v + 2, u2.v + 2, ((size - skip) << 2) - 2);
+ return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
+ }
+ return CmpUnknown;
+ }
}
return CmpError;
}
diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp
index 9c2f02b6024..65cf24db633 100644
--- a/ndb/include/util/Parser.hpp
+++ b/ndb/include/util/Parser.hpp
@@ -165,6 +165,7 @@ Parser<T>::Parser(const ParserRow<T> rows[], class InputStream & in,
template<class T>
inline
Parser<T>::~Parser(){
+ delete impl;
}
template<class T>
diff --git a/ndb/include/util/Properties.hpp b/ndb/include/util/Properties.hpp
index ff5d1338c79..2c30f7f7e3c 100644
--- a/ndb/include/util/Properties.hpp
+++ b/ndb/include/util/Properties.hpp
@@ -22,9 +22,10 @@
#include <UtilBuffer.hpp>
enum PropertiesType {
- PropertiesType_Uint32,
- PropertiesType_char,
- PropertiesType_Properties
+ PropertiesType_Uint32 = 0,
+ PropertiesType_char = 1,
+ PropertiesType_Properties = 2,
+ PropertiesType_Uint64 = 3
};
/**
@@ -36,6 +37,7 @@ enum PropertiesType {
*/
struct Property {
Property(const char* name, Uint32 val);
+ Property(const char* name, Uint64 val);
Property(const char* name, const char * value);
Property(const char* name, const class Properties * value);
~Property();
@@ -75,6 +77,7 @@ public:
void put(const Property *, int len);
bool put(const char * name, Uint32 value, bool replace = false);
+ bool put64(const char * name, Uint64 value, bool replace = false);
bool put(const char * name, const char * value, bool replace = false);
bool put(const char * name, const Properties * value, bool replace = false);
@@ -84,6 +87,7 @@ public:
* Compare get(name, no)
*/
bool put(const char *, Uint32 no, Uint32, bool replace = false);
+ bool put64(const char *, Uint32 no, Uint64, bool replace = false);
bool put(const char *, Uint32 no, const char *, bool replace = false);
bool put(const char *, Uint32 no, const Properties *, bool replace = false);
@@ -94,6 +98,7 @@ public:
bool contains(const char * name) const;
bool get(const char * name, Uint32 * value) const;
+ bool get(const char * name, Uint64 * value) const;
bool get(const char * name, const char ** value) const;
bool get(const char * name, BaseString & value) const;
bool get(const char * name, const Properties ** value) const;
@@ -109,6 +114,7 @@ public:
bool contains(const char * name, Uint32 no) const;
bool get(const char * name, Uint32 no, Uint32 * value) const;
+ bool get(const char * name, Uint32 no, Uint64 * value) const;
bool get(const char * name, Uint32 no, const char ** value) const;
bool get(const char * name, Uint32 no, const Properties ** value) const;
@@ -230,11 +236,12 @@ Properties::unpack(UtilBuffer &buf) {
inline bool
Properties::pack(UtilBuffer &buf) const {
Uint32 size = getPackedSize();
- char *tmp_buf = new char[size];
+ void *tmp_buf = buf.append(size);
+ if(tmp_buf == 0)
+ return false;
bool ret = pack((Uint32 *)tmp_buf);
if(ret == false)
return false;
- buf.append(tmp_buf, size);
return true;
}
diff --git a/ndb/include/util/UtilBuffer.hpp b/ndb/include/util/UtilBuffer.hpp
index b357fa0fdf2..f43fc960a16 100644
--- a/ndb/include/util/UtilBuffer.hpp
+++ b/ndb/include/util/UtilBuffer.hpp
@@ -63,6 +63,15 @@ public:
return 0;
};
+ void * append(size_t l){
+ if(grow(len+l) != 0)
+ return 0;
+
+ void * ret = (char*)data+len;
+ len += l;
+ return ret;
+ }
+
int assign(const void * d, size_t l) {
if (data) free(data);
data = NULL;
diff --git a/ndb/mysqlclusterenv.sh b/ndb/mysqlclusterenv.sh
deleted file mode 100644
index e151186d01e..00000000000
--- a/ndb/mysqlclusterenv.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-# Sets necessary environment variables for mysqlcluster install scripts
-mytop=
-if [ -f bin/mysql ]; then
- mytop=`/bin/pwd`
-elif [ -f bin/ndb ]; then
- mytop=`dirname \`/bin/pwd\``
-fi
-if [ "$mytop" ]; then
- MYSQLCLUSTER_TOP=$mytop
- PATH=$MYSQLCLUSTER_TOP/bin:$MYSQLCLUSTER_TOP/ndb/bin:$PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/lib:$LD_LIBRARY_PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/ndb/lib:$LD_LIBRARY_PATH
- export MYSQLCLUSTER_TOP PATH LD_LIBRARY_PATH
-else
-if [ -d SCCS ]; then
-if [ -f ndb/mysqlclusterenv.sh ]; then
- mytop=`/bin/pwd`
-elif [ -f mysqlclusterenv.sh ]; then
- mytop=`dirname \`/bin/pwd\``
-fi
-fi
-if [ "$mytop" ]; then
-# we're in the development tree
- if [ "$REAL_EMAIL" ]; then :; else
-#Guessing REAL_EMAIL
- REAL_EMAIL=`whoami`@mysql.com
- export REAL_EMAIL
- echo Setting REAL_EMAIL=$REAL_EMAIL
- fi
-
- MYSQLCLUSTER_TOP=$mytop
-
- NDB_TOP=$MYSQLCLUSTER_TOP/ndb
- export NDB_TOP
-
- NDB_PROJ_HOME=$NDB_TOP/home
- export NDB_PROJ_HOME
-
- PATH=$MYSQLCLUSTER_TOP/ndb/bin:$MYSQLCLUSTER_TOP/ndb/home/bin:$PATH
- PATH=$MYSQLCLUSTER_TOP/client:$PATH
- PATH=$MYSQLCLUSTER_TOP/sql:$PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysql:$LD_LIBRARY_PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysqld:$LD_LIBRARY_PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/ndb/lib:$LD_LIBRARY_PATH
- LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysql_r/.libs:$LD_LIBRARY_PATH
- export MYSQLCLUSTER_TOP PATH LD_LIBRARY_PATH
-else
- echo "Please source this file (mysqlclusterenv.sh) from installation top directory"
-fi
-fi
-mytop=
diff --git a/ndb/src/Makefile b/ndb/src/Makefile
deleted file mode 100644
index 4f71eb46056..00000000000
--- a/ndb/src/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-include .defs.mk
-
-DIRS := \
- client \
- common \
- kernel \
- ndbapi \
- mgmsrv \
- mgmapi \
- rep \
- mgmclient \
- cw \
- newtonapi \
- ndbbaseclient
-ifneq ($(NDB_ODBC),N)
- DIRS += ndbclient
-endif
-ifeq ($(findstring OSE, $(NDB_OS)),)
- DIRS += scripts
-endif
-include $(NDB_TOP)/Epilogue.mk
-
-_bins_mgmsrv: _libs_ndbapi
-_bins_mgmsrv: _libs_mgmapi
-_bins_mgmclient: _libs_mgmapi
-_bins_mgmclient: _libs_common
-_bins_client: _bins_ndbapi
-_bins_common: _bins_mgmapi
-_bins_kernel: _bins_ndbapi
-_bins_newtonapi: _bins_ndbapi
-_bins_mgmapi : _libs_common
-_bins_rep: _libs_common
-_bins_rep: _libs_ndbapi
diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am
new file mode 100644
index 00000000000..bed43438e91
--- /dev/null
+++ b/ndb/src/Makefile.am
@@ -0,0 +1,18 @@
+SUBDIRS = common mgmapi ndbapi . kernel mgmsrv mgmclient cw
+
+include $(top_srcdir)/ndb/config/common.mk.am
+
+ndblib_LTLIBRARIES = libndbclient.la
+
+libndbclient_la_SOURCES =
+
+libndbclient_la_LIBADD = \
+ ndbapi/libndbapi.la \
+ common/transporter/libtransporter.la \
+ common/debugger/libtrace.la \
+ common/debugger/signaldata/libsignaldataprint.la \
+ common/mgmcommon/libmgmsrvcommon.la \
+ mgmapi/libmgmapi.la \
+ common/logger/liblogger.la \
+ common/portlib/libportlib.la \
+ common/util/libgeneral.la
diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am
new file mode 100644
index 00000000000..7fcf2cab636
--- /dev/null
+++ b/ndb/src/common/Makefile.am
@@ -0,0 +1,13 @@
+SUBDIRS = portlib debugger util logger transporter mgmcommon editline
+
+noinst_LTLIBRARIES = libcommon.la
+
+libcommon_la_SOURCES =
+libcommon_la_LIBADD = \
+ transporter/libtransporter.la \
+ debugger/libtrace.la \
+ debugger/signaldata/libsignaldataprint.la \
+ mgmcommon/libmgmsrvcommon.la \
+ portlib/libportlib.la \
+ logger/liblogger.la \
+ util/libgeneral.la
diff --git a/ndb/src/common/Makefile b/ndb/src/common/Makefile_old
index ebde75bf3ec..ebde75bf3ec 100644
--- a/ndb/src/common/Makefile
+++ b/ndb/src/common/Makefile_old
diff --git a/ndb/src/common/debugger/LogLevel.cpp b/ndb/src/common/debugger/LogLevel.cpp
index 5348924bbbb..f9e2f318432 100644
--- a/ndb/src/common/debugger/LogLevel.cpp
+++ b/ndb/src/common/debugger/LogLevel.cpp
@@ -17,13 +17,14 @@
#include <LogLevel.hpp>
const LogLevel::LogLevelCategoryName LogLevel::LOGLEVEL_CATEGORY_NAME[] = {
- {"LogLevelStartup"},
- {"LogLevelShutdown"},
- {"LogLevelStatistic"},
- {"LogLevelCheckpoint"},
- {"LogLevelNodeRestart"},
- {"LogLevelConnection"},
- {"LogLevelError"},
- {"LogLevelInfo"},
- {"LogLevelGrep"}
+ { "LogLevelStartup" },
+ { "LogLevelShutdown" },
+ { "LogLevelStatistic" },
+ { "LogLevelCheckpoint" },
+ { "LogLevelNodeRestart" },
+ { "LogLevelConnection" },
+ { "LogLevelError" },
+ { "LogLevelWarning" },
+ { "LogLevelInfo" },
+ { "LogLevelGrep" }
};
diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am
new file mode 100644
index 00000000000..0278d0d2ba0
--- /dev/null
+++ b/ndb/src/common/debugger/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS = signaldata
+
+noinst_LTLIBRARIES = libtrace.la
+
+libtrace_la_SOURCES = SignalLoggerManager.cpp DebuggerNames.cpp BlockNames.cpp LogLevel.cpp EventLogger.cpp GrepError.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/debugger/Makefile b/ndb/src/common/debugger/Makefile_old
index ac3a4475a54..ac3a4475a54 100644
--- a/ndb/src/common/debugger/Makefile
+++ b/ndb/src/common/debugger/Makefile_old
diff --git a/ndb/src/common/debugger/signaldata/BackupImpl.cpp b/ndb/src/common/debugger/signaldata/BackupImpl.cpp
index be9e43e3df1..bdc34d614cf 100644
--- a/ndb/src/common/debugger/signaldata/BackupImpl.cpp
+++ b/ndb/src/common/debugger/signaldata/BackupImpl.cpp
@@ -24,7 +24,7 @@ printDEFINE_BACKUP_REQ(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno){
sig->backupPtr, sig->backupId, sig->clientRef, sig->clientData);
fprintf(out, " backupKey: [ %08x%08x ] DataLength: %d\n",
sig->backupKey[0], sig->backupKey[1], sig->backupDataLen);
- char buf[sig->nodes.TextLength + 1];
+ char buf[_NDB_NODE_BITMASK_SIZE * 8 + 1];
fprintf(out, " Nodes: %s\n", sig->nodes.getText(buf));
return true;
}
diff --git a/ndb/src/common/debugger/signaldata/CntrStart.cpp b/ndb/src/common/debugger/signaldata/CntrStart.cpp
new file mode 100644
index 00000000000..154013f40b0
--- /dev/null
+++ b/ndb/src/common/debugger/signaldata/CntrStart.cpp
@@ -0,0 +1,37 @@
+#include <signaldata/CntrStart.hpp>
+
+bool
+printCNTR_START_REQ(FILE * output, const Uint32 * theData,
+ Uint32 len, Uint16 receiverBlockNo) {
+ const CntrStartReq * const sig = (CntrStartReq *)theData;
+ fprintf(output, " nodeId: %x\n", sig->nodeId);
+ fprintf(output, " startType: %x\n", sig->startType);
+ fprintf(output, " lastGci: %x\n", sig->lastGci);
+ return true;
+}
+
+bool
+printCNTR_START_REF(FILE * output, const Uint32 * theData,
+ Uint32 len, Uint16 receiverBlockNo) {
+ const CntrStartRef * const sig = (CntrStartRef *)theData;
+ fprintf(output, " errorCode: %x\n", sig->errorCode);
+ fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
+ return true;
+}
+
+bool
+printCNTR_START_CONF(FILE * output, const Uint32 * theData,
+ Uint32 len, Uint16 receiverBlockNo) {
+ const CntrStartConf * const sig = (CntrStartConf *)theData;
+ fprintf(output, " startType: %x\n", sig->startType);
+ fprintf(output, " startGci: %x\n", sig->startGci);
+ fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
+ fprintf(output, " noStartNodes: %x\n", sig->noStartNodes);
+
+ char buf[32*NdbNodeBitmask::Size+1];
+ fprintf(output, " startedNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startedNodes, buf));
+ fprintf(output, " startingNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startingNodes, buf));
+ return true;
+}
diff --git a/ndb/src/common/debugger/signaldata/CreateTrig.cpp b/ndb/src/common/debugger/signaldata/CreateTrig.cpp
index d8360dec4d5..ddd45080cba 100644
--- a/ndb/src/common/debugger/signaldata/CreateTrig.cpp
+++ b/ndb/src/common/debugger/signaldata/CreateTrig.cpp
@@ -87,7 +87,7 @@ bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uin
fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false");
const AttributeMask& attributeMask = sig->getAttributeMask();
- char buf[attributeMask.TextLength + 1];
+ char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
fprintf(output, "Attribute mask: %s", attributeMask.getText(buf));
fprintf(output, "\n");
diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
index ad9cb623c17..9b32fab87ba 100644
--- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
+++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp
@@ -59,10 +59,10 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
sig->numberOfPages);
fprintf(output, " pageData: ");
-
+ unsigned int i;
switch(sig->getFormatFlag(sig->operationFlag)){
case FsReadWriteReq::fsFormatListOfPairs:
- for (unsigned int i = 0; i < sig->numberOfPages*2; i += 2){
+ for (i= 0; i < sig->numberOfPages*2; i += 2){
fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[i],
sig->data.pageData[i + 1]);
}
@@ -72,7 +72,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
sig->data.pageData[1]);
break;
case FsReadWriteReq::fsFormatListOfMemPages:
- for (unsigned int i = 0; i < (sig->numberOfPages + 1); i++){
+ for (i= 0; i < (sig->numberOfPages + 1); i++){
fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
}
break;
diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am
new file mode 100644
index 00000000000..0d6ed45dcef
--- /dev/null
+++ b/ndb/src/common/debugger/signaldata/Makefile.am
@@ -0,0 +1,32 @@
+
+noinst_LTLIBRARIES = libsignaldataprint.la
+
+libsignaldataprint_la_SOURCES = \
+ TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \
+ TcRollbackRep.cpp \
+ TupKey.cpp TupCommit.cpp LqhKey.cpp \
+ FsOpenReq.cpp FsCloseReq.cpp FsRef.cpp FsConf.cpp FsReadWriteReq.cpp\
+ SignalDataPrint.cpp SignalNames.cpp \
+ ContinueB.cpp DihContinueB.cpp NdbfsContinueB.cpp \
+ CloseComReqConf.cpp PackedSignal.cpp PrepFailReqRef.cpp \
+ GCPSave.cpp DictTabInfo.cpp \
+ AlterTable.cpp AlterTab.cpp \
+ CreateTrig.cpp AlterTrig.cpp DropTrig.cpp \
+ FireTrigOrd.cpp TrigAttrInfo.cpp \
+ CreateIndx.cpp AlterIndx.cpp DropIndx.cpp TcIndx.cpp \
+ IndxKeyInfo.cpp IndxAttrInfo.cpp \
+ FsAppendReq.cpp ScanTab.cpp \
+ BackupImpl.cpp BackupSignalData.cpp \
+ UtilSequence.cpp UtilPrepare.cpp UtilDelete.cpp UtilExecute.cpp \
+ LqhFrag.cpp DropTab.cpp PrepDropTab.cpp LCP.cpp MasterLCP.cpp \
+ CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \
+ FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \
+ SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \
+ UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \
+ LqhTrans.cpp ReadNodesConf.cpp CntrStart.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/debugger/signaldata/Makefile b/ndb/src/common/debugger/signaldata/Makefile_old
index 5e86aaf97c0..bd00667b482 100644
--- a/ndb/src/common/debugger/signaldata/Makefile
+++ b/ndb/src/common/debugger/signaldata/Makefile_old
@@ -25,6 +25,7 @@ SOURCES = TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \
CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \
FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \
SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \
+ CntrStart.cpp ReadNodesConf.cpp \
UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \
LqhTrans.cpp
diff --git a/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp b/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp
new file mode 100644
index 00000000000..103f4a884f1
--- /dev/null
+++ b/ndb/src/common/debugger/signaldata/ReadNodesConf.cpp
@@ -0,0 +1,24 @@
+#include <signaldata/ReadNodesConf.hpp>
+
+bool
+printREAD_NODES_CONF(FILE * output, const Uint32 * theData,
+ Uint32 len, Uint16 receiverBlockNo) {
+ const ReadNodesConf * const sig = (ReadNodesConf *)theData;
+ fprintf(output, " noOfNodes: %x\n", sig->noOfNodes);
+ fprintf(output, " ndynamicId: %x\n", sig->ndynamicId);
+ fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
+
+ char buf[32*NdbNodeBitmask::Size+1];
+ fprintf(output, " allNodes(defined): %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->allNodes, buf));
+ fprintf(output, " inactiveNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->inactiveNodes, buf));
+ fprintf(output, " clusterNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->clusterNodes, buf));
+ fprintf(output, " startedNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startedNodes, buf));
+ fprintf(output, " startingNodes: %s\n",
+ BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startingNodes, buf));
+ return true;
+}
+
diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
index 2236d0c0af1..d49e316ad38 100644
--- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
+++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
@@ -70,6 +70,8 @@
#include <signaldata/NdbSttor.hpp>
#include <signaldata/CreateFragmentation.hpp>
#include <signaldata/UtilLock.hpp>
+#include <signaldata/CntrStart.hpp>
+#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/TuxMaint.hpp>
#include <signaldata/TupAccess.hpp>
#include <signaldata/AccLock.hpp>
@@ -240,6 +242,12 @@ SignalDataPrintFunctions[] = {
,{ GSN_UTIL_UNLOCK_REQ, printUTIL_UNLOCK_REQ }
,{ GSN_UTIL_UNLOCK_REF, printUTIL_UNLOCK_REF }
,{ GSN_UTIL_UNLOCK_CONF, printUTIL_UNLOCK_CONF }
+ ,{ GSN_CNTR_START_REQ, printCNTR_START_REQ }
+ ,{ GSN_CNTR_START_REF, printCNTR_START_REF }
+ ,{ GSN_CNTR_START_CONF, printCNTR_START_CONF }
+
+ ,{ GSN_READ_NODESCONF, printREAD_NODES_CONF }
+
,{ GSN_TUX_MAINT_REQ, printTUX_MAINT_REQ }
,{ GSN_TUP_READ_ATTRS, printTUP_READ_ATTRS }
,{ GSN_TUP_QUERY_TH, printTUP_QUERY_TH }
diff --git a/ndb/src/common/debugger/signaldata/SignalNames.cpp b/ndb/src/common/debugger/signaldata/SignalNames.cpp
index 4e5c8603db1..377a588dbb0 100644
--- a/ndb/src/common/debugger/signaldata/SignalNames.cpp
+++ b/ndb/src/common/debugger/signaldata/SignalNames.cpp
@@ -101,40 +101,23 @@ const GsnName SignalNames [] = {
,{ GSN_ADD_FRAGREQ, "ADD_FRAGREQ" }
,{ GSN_API_FAILCONF, "API_FAILCONF" }
,{ GSN_API_FAILREQ, "API_FAILREQ" }
- ,{ GSN_APPL_CHANGEREP, "APPL_CHANGEREP" }
- // ,{ GSN_APPL_ERROR, "APPL_ERROR" }
- ,{ GSN_APPL_HB, "APPL_HB" }
- ,{ GSN_APPL_HBREQ, "APPL_HBREQ" }
- ,{ GSN_APPL_REGCONF, "APPL_REGCONF" }
- ,{ GSN_APPL_REGREF, "APPL_REGREF" }
- ,{ GSN_APPL_REGREQ, "APPL_REGREQ" }
- ,{ GSN_APPL_RUN, "APPL_RUN" }
- ,{ GSN_APPL_STARTCONF, "APPL_STARTCONF" }
- ,{ GSN_APPL_STARTREG, "APPL_STARTREG" }
,{ GSN_CHECK_LCP_STOP, "CHECK_LCP_STOP" }
,{ GSN_CLOSE_COMCONF, "CLOSE_COMCONF" }
,{ GSN_CLOSE_COMREQ, "CLOSE_COMREQ" }
,{ GSN_CM_ACKADD, "CM_ACKADD" }
- ,{ GSN_CM_ACKALARM, "CM_ACKALARM" }
,{ GSN_CM_ADD, "CM_ADD" }
- ,{ GSN_CM_APPCHG, "CM_APPCHG" }
+ ,{ GSN_CM_ADD_REP, "CM_ADD_REP" }
,{ GSN_CM_HEARTBEAT, "CM_HEARTBEAT" }
- ,{ GSN_CM_INFOCONF, "CM_INFOCONF" }
- ,{ GSN_CM_INFOREQ, "CM_INFOREQ" }
- ,{ GSN_CM_INIT, "CM_INIT" }
,{ GSN_CM_NODEINFOCONF, "CM_NODEINFOCONF" }
,{ GSN_CM_NODEINFOREF, "CM_NODEINFOREF" }
,{ GSN_CM_NODEINFOREQ, "CM_NODEINFOREQ" }
,{ GSN_CM_REGCONF, "CM_REGCONF" }
,{ GSN_CM_REGREF, "CM_REGREF" }
,{ GSN_CM_REGREQ, "CM_REGREQ" }
- ,{ GSN_CM_RUN, "CM_RUN" }
- ,{ GSN_CMVMI_CFGCONF, "CMVMI_CFGCONF" }
- ,{ GSN_CMVMI_CFGREQ, "CMVMI_CFGREQ" }
- ,{ GSN_CNTR_CHANGEREP, "CNTR_CHANGEREP" }
- ,{ GSN_CNTR_MASTERCONF, "CNTR_MASTERCONF" }
- ,{ GSN_CNTR_MASTERREF, "CNTR_MASTERREF" }
- ,{ GSN_CNTR_MASTERREQ, "CNTR_MASTERREQ" }
+ ,{ GSN_CNTR_START_REQ, "CNTR_START_REQ" }
+ ,{ GSN_CNTR_START_REF, "CNTR_START_REF" }
+ ,{ GSN_CNTR_START_CONF, "CNTR_START_CONF" }
+ ,{ GSN_CNTR_START_REP, "CNTR_START_REP" }
,{ GSN_CNTR_WAITREP, "CNTR_WAITREP" }
,{ GSN_COMMIT, "COMMIT" }
,{ GSN_COMMIT_FAILCONF, "COMMIT_FAILCONF" }
@@ -294,9 +277,6 @@ const GsnName SignalNames [] = {
,{ GSN_NEXT_SCANREQ, "NEXT_SCANREQ" }
,{ GSN_NEXTOPERATION, "NEXTOPERATION" }
,{ GSN_NF_COMPLETEREP, "NF_COMPLETEREP" }
- ,{ GSN_NODE_STATESCONF, "NODE_STATESCONF" }
- ,{ GSN_NODE_STATESREF, "NODE_STATESREF" }
- ,{ GSN_NODE_STATESREQ, "NODE_STATESREQ" }
,{ GSN_OPEN_COMCONF, "OPEN_COMCONF" }
,{ GSN_OPEN_COMREF, "OPEN_COMREF" }
,{ GSN_OPEN_COMREQ, "OPEN_COMREQ" }
@@ -318,8 +298,8 @@ const GsnName SignalNames [] = {
,{ GSN_SEND_PACKED, "SEND_PACKED" }
,{ GSN_SET_LOGLEVELORD, "SET_LOGLEVELORD" }
,{ GSN_SHRINKCHECK2, "SHRINKCHECK2" }
- ,{ GSN_SIZEALT_ACK, "SIZEALT_ACK" }
- ,{ GSN_SIZEALT_REP, "SIZEALT_REP" }
+ ,{ GSN_READ_CONFIG_REQ, "READ_CONFIG_REQ" }
+ ,{ GSN_READ_CONFIG_CONF, "READ_CONFIG_CONF" }
,{ GSN_SR_FRAGIDCONF, "SR_FRAGIDCONF" }
,{ GSN_SR_FRAGIDREF, "SR_FRAGIDREF" }
,{ GSN_SR_FRAGIDREQ, "SR_FRAGIDREQ" }
@@ -396,7 +376,6 @@ const GsnName SignalNames [] = {
,{ GSN_UPDATE_TOCONF, "UPDATE_TOCONF" }
,{ GSN_UPDATE_TOREF, "UPDATE_TOREF" }
,{ GSN_UPDATE_TOREQ, "UPDATE_TOREQ" }
- ,{ GSN_VOTE_MASTERORD, "VOTE_MASTERORD" }
,{ GSN_TUP_ALLOCREQ, "TUP_ALLOCREQ" }
,{ GSN_LQH_ALLOCREQ, "LQH_ALLOCREQ" }
,{ GSN_TUP_DEALLOCREQ, "TUP_DEALLOCREQ" }
@@ -428,7 +407,6 @@ const GsnName SignalNames [] = {
,{ GSN_CHECKNODEGROUPSREQ, "CHECKNODEGROUPSREQ" }
,{ GSN_CHECKNODEGROUPSCONF, "CHECKNODEGROUPSCONF" }
- ,{ GSN_ARBIT_CFG, "ARBIT_CFG" }
,{ GSN_ARBIT_PREPREQ, "ARBIT_PREPREQ" }
,{ GSN_ARBIT_PREPCONF, "ARBIT_PREPCONF" }
,{ GSN_ARBIT_PREPREF, "ARBIT_PREPREF" }
diff --git a/ndb/src/common/debugger/signaldata/TuxMaint.cpp b/ndb/src/common/debugger/signaldata/TuxMaint.cpp
index 06ac475382c..ba6a299b77d 100644
--- a/ndb/src/common/debugger/signaldata/TuxMaint.cpp
+++ b/ndb/src/common/debugger/signaldata/TuxMaint.cpp
@@ -24,10 +24,10 @@ printTUX_MAINT_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
//const bool inOut = rbn & (1 << 15);
const TuxMaintReq* const sig = (const TuxMaintReq*)theData;
fprintf(output, " errorCode=%d\n", sig->errorCode);
- fprintf(output, " table: id=%d", sig->tableId);
- fprintf(output, " index: id=%d", sig->indexId);
- fprintf(output, " fragment: id=%d\n", sig->fragId);
- fprintf(output, " tuple: addr=0x%x version=%d\n", sig->tupAddr, sig->tupVersion);
+ fprintf(output, " table: id=%u", sig->tableId);
+ fprintf(output, " index: id=%u", sig->indexId);
+ fprintf(output, " fragment: id=%u\n", sig->fragId);
+ fprintf(output, " tuple: loc=%u.%u version=%u\n", sig->pageId, sig->pageOffset, sig->tupVersion);
const Uint32 opCode = sig->opInfo & 0xFF;
const Uint32 opFlag = sig->opInfo >> 8;
switch (opCode ) {
diff --git a/ndb/src/common/editline/Makefile.am b/ndb/src/common/editline/Makefile.am
new file mode 100644
index 00000000000..4f53bdc6326
--- /dev/null
+++ b/ndb/src/common/editline/Makefile.am
@@ -0,0 +1,10 @@
+
+noinst_LIBRARIES = libeditline.a
+
+libeditline_a_SOURCES = complete.c editline.c sysunix.c
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include
+DEFS = -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/editline/Makefile b/ndb/src/common/editline/Makefile_old
index 800df8f0f31..800df8f0f31 100644
--- a/ndb/src/common/editline/Makefile
+++ b/ndb/src/common/editline/Makefile_old
diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am
new file mode 100644
index 00000000000..0a48214c37c
--- /dev/null
+++ b/ndb/src/common/logger/Makefile.am
@@ -0,0 +1,11 @@
+
+noinst_LTLIBRARIES = liblogger.la
+
+liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \
+ ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/logger/Makefile b/ndb/src/common/logger/Makefile_old
index 994eb86ba35..994eb86ba35 100644
--- a/ndb/src/common/logger/Makefile
+++ b/ndb/src/common/logger/Makefile_old
diff --git a/ndb/src/common/mgmcommon/Config.cpp b/ndb/src/common/mgmcommon/Config.cpp
index 5492394ee4a..c0819b9f463 100644
--- a/ndb/src/common/mgmcommon/Config.cpp
+++ b/ndb/src/common/mgmcommon/Config.cpp
@@ -26,23 +26,17 @@
//*****************************************************************************
Config::Config() {
- m_info = new ConfigInfo();
-}
-
-Config::Config(const Config & org) :
- Properties(org) {
-
- m_info = new ConfigInfo();
-}
-
-Config::Config(const Properties & org) :
- Properties(org) {
-
- m_info = new ConfigInfo();
+ m_oldConfig = 0;
+ m_configValues = 0;
}
Config::~Config() {
- delete m_info;
+ if(m_configValues != 0){
+ free(m_configValues);
+ }
+
+ if(m_oldConfig != 0)
+ delete m_oldConfig;
}
/*****************************************************************************/
@@ -52,25 +46,33 @@ Config::printAllNameValuePairs(NdbOut &out,
const Properties *prop,
const char* s) const {
Properties::Iterator it(prop);
- const Properties * section = m_info->getInfo(s);
+ const Properties * section = m_info.getInfo(s);
for (const char* n = it.first(); n != NULL; n = it.next()) {
Uint32 int_value;
const char* str_value;
+ Uint64 int_64;
- if (m_info->getStatus(section, n) == ConfigInfo::INTERNAL)
+ if(!section->contains(n))
continue;
- if (m_info->getStatus(section, n) == ConfigInfo::DEPRICATED)
+ if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL)
continue;
- if (m_info->getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED)
+ if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED)
+ continue;
+ if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED)
continue;
out << n << ": ";
- switch (m_info->getType(section, n)) {
+ switch (m_info.getType(section, n)) {
case ConfigInfo::INT:
MGM_REQUIRE(prop->get(n, &int_value));
out << int_value;
break;
+
+ case ConfigInfo::INT64:
+ MGM_REQUIRE(prop->get(n, &int_64));
+ out << int_64;
+ break;
case ConfigInfo::BOOL:
MGM_REQUIRE(prop->get(n, &int_value));
@@ -92,6 +94,7 @@ Config::printAllNameValuePairs(NdbOut &out,
/*****************************************************************************/
void Config::printConfigFile(NdbOut &out) const {
+#if 0
Uint32 noOfNodes, noOfConnections, noOfComputers;
MGM_REQUIRE(get("NoOfNodes", &noOfNodes));
MGM_REQUIRE(get("NoOfConnections", &noOfConnections));
@@ -172,15 +175,12 @@ void Config::printConfigFile(NdbOut &out) const {
endl;
}
}
-}
-
-const
-ConfigInfo* Config::getConfigInfo() const {
- return m_info;
+#endif
}
Uint32
Config::getGenerationNumber() const {
+#if 0
Uint32 ret;
const Properties *prop = NULL;
@@ -191,10 +191,14 @@ Config::getGenerationNumber() const {
return ret;
return 0;
+#else
+ return 0;
+#endif
}
int
Config::setGenerationNumber(Uint32 gen) {
+#if 0
Properties *prop = NULL;
getCopy("SYSTEM", &prop);
@@ -205,12 +209,16 @@ Config::setGenerationNumber(Uint32 gen) {
return 0;
}
return -1;
+#else
+ return -1;
+#endif
}
bool
Config::change(const BaseString &section,
const BaseString &param,
const BaseString &value) {
+#if 0
const char *name;
Properties::Iterator it(this);
@@ -252,4 +260,7 @@ Config::change(const BaseString &section,
}
}
return true;
+#else
+ return false;
+#endif
}
diff --git a/ndb/src/common/mgmcommon/Config.hpp b/ndb/src/common/mgmcommon/Config.hpp
index 284256d9ed6..26fd53dbed2 100644
--- a/ndb/src/common/mgmcommon/Config.hpp
+++ b/ndb/src/common/mgmcommon/Config.hpp
@@ -17,7 +17,6 @@
#ifndef Config_H
#define Config_H
-#include <signaldata/ConfigParamId.hpp>
#include <LogLevel.hpp>
#include <kernel_types.h>
@@ -25,6 +24,9 @@
#include <NdbOut.hpp>
#include <ndb_limits.h>
#include <Properties.hpp>
+#include "ConfigInfo.hpp"
+
+class ConfigInfo;
/**
* @class Config
@@ -38,14 +40,14 @@
*
* The following categories (sections) of configuration parameters exists:
* - COMPUTER, DB, MGM, API, TCP, SCI, SHM, OSE
+ *
*/
-class Config : public Properties {
+
+class Config {
public:
/**
* Constructor which loads the object with an Properties object
*/
- Config(const Config & org);
- Config(const Properties & org);
Config();
virtual ~Config();
@@ -58,8 +60,6 @@ public:
printConfigFile(ndb);
}
- const class ConfigInfo* getConfigInfo() const;
-
Uint32 getGenerationNumber() const;
int setGenerationNumber(Uint32);
@@ -69,7 +69,13 @@ public:
const BaseString &param,
const BaseString &value);
+
+ /**
+ * Info
+ */
+ const ConfigInfo * getConfigInfo() const { return &m_info;}
private:
+ ConfigInfo m_info;
void printAllNameValuePairs(NdbOut &out,
const Properties *prop,
@@ -78,7 +84,9 @@ private:
/**
* Information about parameters (min, max values etc)
*/
- const class ConfigInfo* m_info;
+public:
+ Properties * m_oldConfig;
+ struct ndb_mgm_configuration * m_configValues;
};
#endif // Config_H
diff --git a/ndb/src/common/mgmcommon/ConfigInfo.cpp b/ndb/src/common/mgmcommon/ConfigInfo.cpp
index da6024d946f..c2b5fdabf01 100644
--- a/ndb/src/common/mgmcommon/ConfigInfo.cpp
+++ b/ndb/src/common/mgmcommon/ConfigInfo.cpp
@@ -15,7 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "ConfigInfo.hpp"
+#include <mgmapi_config_parameters.h>
+
#define MAX_LINE_LENGTH 255
+#define KEY_INTERNAL 0
/****************************************************************************
* Section names
@@ -56,9 +59,12 @@ bool fixPortNumber(InitConfigFileParser::Context & ctx, const char *);
bool fixShmkey(InitConfigFileParser::Context & ctx, const char *);
bool checkDbConstraints(InitConfigFileParser::Context & ctx, const char *);
bool checkConnectionConstraints(InitConfigFileParser::Context &, const char *);
+bool fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data);
bool fixHostname(InitConfigFileParser::Context & ctx, const char * data);
bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data);
bool fixExtConnection(InitConfigFileParser::Context & ctx, const char * data);
+bool fixDepricated(InitConfigFileParser::Context & ctx, const char *);
+bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *);
const ConfigInfo::SectionRule
ConfigInfo::m_SectionRules[] = {
@@ -79,21 +85,12 @@ ConfigInfo::m_SectionRules[] = {
{ "TCP", fixPortNumber, 0 },
//{ "SHM", fixShmKey, 0 },
-
- { "COMPUTER", applyDefaultValues, 0 },
-
- { "DB", applyDefaultValues, 0 },
- { "API", applyDefaultValues, 0 },
- { "MGM", applyDefaultValues, 0 },
- { "REP", applyDefaultValues, 0 },
- { "EXTERNAL REP", applyDefaultValues, 0 },
-
- { "TCP", applyDefaultValues, 0 },
- { "SHM", applyDefaultValues, 0 },
- { "SCI", applyDefaultValues, 0 },
- { "OSE", applyDefaultValues, 0 },
- { "DB", checkDbConstraints, 0 },
+ { "DB", fixNodeHostname, 0 },
+ { "API", fixNodeHostname, 0 },
+ { "MGM", fixNodeHostname, 0 },
+ { "REP", fixNodeHostname, 0 },
+ //{ "EXTERNAL REP", fixNodeHostname, 0 },
{ "TCP", fixNodeId, "NodeId1" },
{ "TCP", fixNodeId, "NodeId2" },
@@ -103,6 +100,11 @@ ConfigInfo::m_SectionRules[] = {
{ "SCI", fixNodeId, "NodeId2" },
{ "OSE", fixNodeId, "NodeId1" },
{ "OSE", fixNodeId, "NodeId2" },
+
+ { "TCP", fixHostname, "HostName1" },
+ { "TCP", fixHostname, "HostName2" },
+ { "OSE", fixHostname, "HostName1" },
+ { "OSE", fixHostname, "HostName2" },
/**
* fixExtConnection must be after fixNodeId
@@ -112,6 +114,12 @@ ConfigInfo::m_SectionRules[] = {
{ "SCI", fixExtConnection, 0 },
{ "OSE", fixExtConnection, 0 },
+ { "*", applyDefaultValues, "user" },
+ { "*", fixDepricated, 0 },
+ { "*", applyDefaultValues, "system" },
+
+ { "DB", checkDbConstraints, 0 },
+
/**
* checkConnectionConstraints must be after fixExtConnection
*/
@@ -120,24 +128,63 @@ ConfigInfo::m_SectionRules[] = {
{ "SCI", checkConnectionConstraints, 0 },
{ "OSE", checkConnectionConstraints, 0 },
- { "COMPUTER", checkMandatory, 0 },
- { "DB", checkMandatory, 0 },
- { "API", checkMandatory, 0 },
- { "MGM", checkMandatory, 0 },
- { "REP", checkMandatory, 0 },
+ { "*", checkMandatory, 0 },
+
+ { "DB", saveInConfigValues, 0 },
+ { "API", saveInConfigValues, 0 },
+ { "MGM", saveInConfigValues, 0 },
+ { "REP", saveInConfigValues, 0 },
+
+ { "TCP", saveInConfigValues, 0 },
+ { "SHM", saveInConfigValues, 0 },
+ { "SCI", saveInConfigValues, 0 },
+ { "OSE", saveInConfigValues, 0 }
+};
+const int ConfigInfo::m_NoOfRules = sizeof(m_SectionRules)/sizeof(SectionRule);
- { "TCP", checkMandatory, 0 },
- { "SHM", checkMandatory, 0 },
- { "SCI", checkMandatory, 0 },
- { "OSE", checkMandatory, 0 },
+/****************************************************************************
+ * Config Rules declarations
+ ****************************************************************************/
+bool addNodeConnections(Vector<ConfigInfo::ConfigRuleSection>&sections,
+ struct InitConfigFileParser::Context &ctx,
+ const char * ruleData);
+
+const ConfigInfo::ConfigRule
+ConfigInfo::m_ConfigRules[] = {
+ { addNodeConnections, 0 },
+ { 0, 0 }
+};
+
+struct DepricationTransform {
+ const char * m_section;
+ const char * m_oldName;
+ const char * m_newName;
+ double m_add;
+ double m_mul;
+};
- { "TCP", fixHostname, "HostName1" },
- { "TCP", fixHostname, "HostName2" },
- { "OSE", fixHostname, "HostName1" },
- { "OSE", fixHostname, "HostName2" },
+static
+const DepricationTransform f_deprication[] = {
+ { "DB", "NoOfIndexPages", "IndexMemory", 0, 8192 }
+ ,{ "DB", "MemorySpaceIndexes", "IndexMemory", 0, 8192 }
+ ,{ "DB", "NoOfDataPages", "DataMemory", 0, 8192 }
+ ,{ "DB", "MemorySpaceTuples", "DataMemory", 0, 8192 }
+ ,{ "DB", "TransactionInactiveTimeBeforeAbort", "TransactionInactiveTimeout",
+ 0, 1 }
+ ,{ "TCP", "ProcessId1", "NodeId1", 0, 1}
+ ,{ "TCP", "ProcessId2", "NodeId2", 0, 1}
+ ,{ "TCP", "SendBufferSize", "SendBufferMemory", 0, 16384 }
+ ,{ "TCP", "MaxReceiveSize", "ReceiveBufferMemory", 0, 16384 }
+
+ ,{ "SHM", "ProcessId1", "NodeId1", 0, 1}
+ ,{ "SHM", "ProcessId2", "NodeId2", 0, 1}
+ ,{ "SCI", "ProcessId1", "NodeId1", 0, 1}
+ ,{ "SCI", "ProcessId2", "NodeId2", 0, 1}
+ ,{ "OSE", "ProcessId1", "NodeId1", 0, 1}
+ ,{ "OSE", "ProcessId2", "NodeId2", 0, 1}
+ ,{ 0, 0, 0, 0, 0}
};
-const int ConfigInfo::m_NoOfRules = sizeof(m_SectionRules)/sizeof(SectionRule);
/**
* The default constructors create objects with suitable values for the
@@ -166,224 +213,340 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
/****************************************************************************
* COMPUTER
- ****************************************************************************/
-
- {"Id",
- "Id",
- "COMPUTER",
- "Name of computer",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0},
-
- {"HostName",
- "HostName",
- "COMPUTER",
- "Hostname of computer (e.g. mysql.com)",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ByteOrder",
- "ByteOrder",
- "COMPUTER",
- "Not yet implemented",
- ConfigInfo::USED, // Actually not used, but since it is MANDATORY,
- // we don't want any warning message
- false,
- ConfigInfo::STRING,
- MANDATORY, // Big == 0, Little == 1, NotSet == 2 (?)
- 0,
- 0x7FFFFFFF},
+ ***************************************************************************/
+ {
+ KEY_INTERNAL,
+ "COMPUTER",
+ "COMPUTER",
+ "Computer section",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::SECTION,
+ 0,
+ 0, 0 },
+
+ {
+ KEY_INTERNAL,
+ "Id",
+ "COMPUTER",
+ "Name of computer",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0 },
+
+ {
+ KEY_INTERNAL,
+ "HostName",
+ "COMPUTER",
+ "Hostname of computer (e.g. alzato.com)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_BYTE_ORDER,
+ "ByteOrder",
+ "COMPUTER",
+ "Not yet implemented",
+ ConfigInfo::USED, // Actually not used, but since it is MANDATORY,
+ // we don't want any warning message
+ false,
+ ConfigInfo::STRING,
+ MANDATORY, // Big == 0, Little == 1, NotSet == 2 (?)
+ 0,
+ 1 },
/****************************************************************************
- * DB
- ****************************************************************************/
-
- {"Id",
- "Id",
- "DB",
- "Number identifying the database node (DB)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- (MAX_NODES - 1)},
-
- {"Type",
- "Type",
- "DB",
- "Type of node (Should have value DB)",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"NoOfReplicas",
- "NoOfReplicas",
- "DB",
- "Number of copies of all data in the database (1-4)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- 4},
-
- {"MaxNoOfAttributes",
- "MaxNoOfAttributes",
- "DB",
- "Total number of attributes stored in database. I.e. sum over all tables",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1000,
- 32,
- 4096},
+ * SYSTEM
+ ***************************************************************************/
+ {
+ CFG_SECTION_SYSTEM,
+ "SYSTEM",
+ "SYSTEM",
+ "System section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ CFG_SECTION_SYSTEM,
+ 0,
+ 0 },
+
+ {
+ CFG_SYS_NAME,
+ "Name",
+ "SYSTEM",
+ "Name of system (NDB Cluster)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0 },
- {"MaxNoOfTables",
- "MaxNoOfTables",
- "DB",
- "Total number of tables stored in the database",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 32,
- 8,
- 128},
+ {
+ CFG_SYS_REPLICATION_ROLE,
+ "ReplicationRole",
+ "SYSTEM",
+ "Role in Global Replication (None, Primary, or Standby)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0 },
- {"MaxNoOfIndexes",
- "MaxNoOfIndexes",
- "DB",
- "Total number of indexes that can be defined in the system",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 128,
- 0,
- 2048},
-
- {"MaxNoOfConcurrentIndexOperations",
- "MaxNoOfConcurrentIndexOperations",
- "DB",
- "Total number of index operations that can execute simultaneously on one DB node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 8192,
- 0,
- 1000000
+ {
+ CFG_SYS_PRIMARY_MGM_NODE,
+ "PrimaryMGMNode",
+ "SYSTEM",
+ "Node id of Primary MGM node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_SYS_CONFIG_GENERATION,
+ "ConfigGenerationNumber",
+ "SYSTEM",
+ "Configuration generation number",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 0x7FFFFFFF },
+
+ /***************************************************************************
+ * DB
+ ***************************************************************************/
+ {
+ CFG_SECTION_NODE,
+ "DB",
+ "DB",
+ "Node section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ NODE_TYPE_DB,
+ 0, 0
},
- {"MaxNoOfTriggers",
- "MaxNoOfTriggers",
- "DB",
- "Total number of triggers that can be defined in the system",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 768,
- 0,
- 2432},
-
- {"MaxNoOfFiredTriggers",
- "MaxNoOfFiredTriggers",
- "DB",
- "Total number of triggers that can fire simultaneously in one DB node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1000,
- 0,
- 1000000},
-
- {"ExecuteOnComputer",
- "ExecuteOnComputer",
- "DB",
- "String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_NODE_HOST,
+ "HostName",
+ "DB",
+ "Name of computer for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_SYSTEM,
+ "System",
+ "DB",
+ "Name of system for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ID,
+ "Id",
+ "DB",
+ "Number identifying the database node (DB)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 1,
+ (MAX_NODES - 1) },
+
+ {
+ CFG_DB_NO_REPLICAS,
+ "NoOfReplicas",
+ "DB",
+ "Number of copies of all data in the database (1-4)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 1,
+ 2 },
+
+ {
+ CFG_DB_NO_ATTRIBUTES,
+ "MaxNoOfAttributes",
+ "DB",
+ "Total number of attributes stored in database. I.e. sum over all tables",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1000,
+ 32,
+ 4096 },
- {"MaxNoOfSavedMessages",
- "MaxNoOfSavedMessages",
- "DB",
- "Max number of error messages in error log and max number of trace files",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 25,
- 0,
- 0x7FFFFFFF},
-
- {"LockPagesInMainMemory",
- "LockPagesInMainMemory",
- "DB",
- "If set to yes, then NDB Cluster data will not be swapped out to disk",
- ConfigInfo::USED,
- true,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"SleepWhenIdle",
- "SleepWhenIdle",
- "DB",
- "?",
- ConfigInfo::DEPRICATED,
- true,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- {"NoOfSignalsToExecuteBetweenCommunicationInterfacePoll",
- "NoOfSignalsToExecuteBetweenCommunicationInterfacePoll",
- "DB",
- "?",
- ConfigInfo::DEPRICATED,
- true,
- ConfigInfo::INT,
- 20,
- 1,
- 0x7FFFFFFF},
+ {
+ CFG_DB_NO_TABLES,
+ "MaxNoOfTables",
+ "DB",
+ "Total number of tables stored in the database",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 32,
+ 8,
+ 128 },
- {"TimeBetweenWatchDogCheck",
- "TimeBetweenWatchDogCheck",
- "DB",
- "Time between execution checks inside a database node",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 4000,
- 70,
- 0x7FFFFFFF},
-
- {"StopOnError",
- "StopOnError",
- "DB",
- "If set to N, the DB automatically restarts/recovers in case of node failure",
- ConfigInfo::USED,
- true,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- { "RestartOnErrorInsert",
+ {
+ CFG_DB_NO_INDEXES,
+ "MaxNoOfIndexes",
+ "DB",
+ "Total number of indexes that can be defined in the system",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 128,
+ 0,
+ 2048 },
+
+ {
+ CFG_DB_NO_INDEX_OPS,
+ "MaxNoOfConcurrentIndexOperations",
+ "DB",
+ "Total number of index operations that can execute simultaneously on one DB node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 8192,
+ 0,
+ 1000000
+ },
+
+ {
+ CFG_DB_NO_TRIGGERS,
+ "MaxNoOfTriggers",
+ "DB",
+ "Total number of triggers that can be defined in the system",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 768,
+ 0,
+ 2432 },
+
+ {
+ CFG_DB_NO_TRIGGER_OPS,
+ "MaxNoOfFiredTriggers",
+ "DB",
+ "Total number of triggers that can fire simultaneously in one DB node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1000,
+ 0,
+ 1000000 },
+
+ {
+ KEY_INTERNAL,
+ "ExecuteOnComputer",
+ "DB",
+ "String referencing an earlier defined COMPUTER",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_NO_SAVE_MSGS,
+ "MaxNoOfSavedMessages",
+ "DB",
+ "Max number of error messages in error log and max number of trace files",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 25,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_MEMLOCK,
+ "LockPagesInMainMemory",
+ "DB",
+ "If set to yes, then NDB Cluster data will not be swapped out to disk",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "SleepWhenIdle",
+ "DB",
+ 0,
+ ConfigInfo::DEPRICATED,
+ true,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "NoOfSignalsToExecuteBetweenCommunicationInterfacePoll",
+ "DB",
+ 0,
+ ConfigInfo::DEPRICATED,
+ true,
+ ConfigInfo::INT,
+ 20,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_WATCHDOG_INTERVAL,
+ "TimeBetweenWatchDogCheck",
+ "DB",
+ "Time between execution checks inside a database node",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 4000,
+ 70,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_STOP_ON_ERROR,
+ "StopOnError",
+ "DB",
+ "If set to N, the DB automatically restarts/recovers in case of node failure",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_STOP_ON_ERROR_INSERT,
"RestartOnErrorInsert",
"DB",
"See src/kernel/vm/Emulator.hpp NdbRestartType for details",
@@ -394,41 +557,45 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
4 },
- {"MaxNoOfConcurrentOperations",
- "MaxNoOfConcurrentOperations",
- "DB",
- "Max no of op:s on DB (op:s within a transaction are concurrently executed)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 8192,
- 32,
- 1000000},
-
- {"MaxNoOfConcurrentTransactions",
- "MaxNoOfConcurrentTransactions",
- "DB",
- "Max number of transaction executing concurrently on the DB node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 4096,
- 32,
- 1000000},
-
- {"MaxNoOfConcurrentScans",
- "MaxNoOfConcurrentScans",
- "DB",
- "Max number of scans executing concurrently on the DB node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 25,
- 2,
- 500},
-
- {"TransactionBufferMemory",
- "TransactionBufferMemory",
+ {
+ CFG_DB_NO_OPS,
+ "MaxNoOfConcurrentOperations",
+ "DB",
+ "Max no of op:s on DB (op:s within a transaction are concurrently executed)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 8192,
+ 32,
+ 1000000 },
+
+ {
+ CFG_DB_NO_TRANSACTIONS,
+ "MaxNoOfConcurrentTransactions",
+ "DB",
+ "Max number of transaction executing concurrently on the DB node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 4096,
+ 32,
+ 1000000 },
+
+ {
+ CFG_DB_NO_SCANS,
+ "MaxNoOfConcurrentScans",
+ "DB",
+ "Max number of scans executing concurrently on the DB node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 25,
+ 2,
+ 500 },
+
+ {
+ CFG_DB_TRANS_BUFFER_MEM,
+ "TransactionBufferMemory",
"DB",
"Dynamic buffer space (in bytes) for key and attribute data allocated for each DB node",
ConfigInfo::USED,
@@ -436,437 +603,442 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::INT,
1024000,
1024,
- 0x7FFFFFFF},
+ 0x7FFFFFFF },
- {"NoOfIndexPages",
- "NoOfIndexPages",
- "DB",
- "Number of 8k byte pages on each DB node for storing indexes",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 3000,
- 128,
- 192000},
-
- {"MemorySpaceIndexes",
- "NoOfIndexPages",
- "DB",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 128,
- 192000},
-
- {"NoOfDataPages",
- "NoOfDataPages",
- "DB",
- "Number of 8k byte pages on each DB node for storing data",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 10000,
- 128,
- 400000},
-
- {"MemorySpaceTuples",
- "NoOfDataPages",
- "DB",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 128,
- 400000},
-
- {"NoOfDiskBufferPages",
- "NoOfDiskBufferPages",
- "DB",
- "?",
- ConfigInfo::NOTIMPLEMENTED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0},
-
- {"MemoryDiskPages",
- "NoOfDiskBufferPages",
- "DB",
- "?",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0},
-
- {"NoOfFreeDiskClusters",
- "NoOfFreeDiskClusters",
- "DB",
- "?",
- ConfigInfo::NOTIMPLEMENTED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0},
-
- {"NoOfDiskClusters",
- "NoOfDiskClusters",
- "DB",
- "?",
- ConfigInfo::NOTIMPLEMENTED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_DB_INDEX_MEM,
+ "IndexMemory",
+ "DB",
+ "Number bytes on each DB node allocated for storing indexes",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT64,
+ 3000 * 8192,
+ 128 * 8192,
+ ((Uint64)192000) * ((Uint64)8192) },
+
+ {
+ KEY_INTERNAL,
+ "NoOfIndexPages",
+ "DB",
+ "IndexMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ 3000,
+ 128,
+ 192000 },
+
+ {
+ KEY_INTERNAL,
+ "MemorySpaceIndexes",
+ "DB",
+ "IndexMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 128,
+ 192000 },
+
+ {
+ CFG_DB_DATA_MEM,
+ "DataMemory",
+ "DB",
+ "Number bytes on each DB node allocated for storing data",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT64,
+ 10000 * 8192,
+ 128 * 8192,
+ ((Uint64)400000) * ((Uint64)8192) },
+
+ {
+ KEY_INTERNAL,
+ "NoOfDataPages",
+ "DB",
+ "DataMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ 10000,
+ 128,
+ 400000 },
+
+ {
+ KEY_INTERNAL,
+ "MemorySpaceTuples",
+ "DB",
+ "DataMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 128,
+ 400000 },
- {"TimeToWaitAlive",
- "TimeToWaitAlive",
- "DB",
- "Time to wait for other nodes to become alive during initial system start",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 25,
- 2,
- 4000},
-
- {"HeartbeatIntervalDbDb",
- "HeartbeatIntervalDbDb",
- "DB",
- "Time between DB-to-DB heartbeats. DB considered dead after 3 missed HBs",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1500,
- 10,
- 0x7FFFFFFF},
-
- {"HeartbeatIntervalDbApi",
- "HeartbeatIntervalDbApi",
- "DB",
- "Time between API-to-DB heartbeats. API connection closed after 3 missed HBs",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1500,
- 100,
- 0x7FFFFFFF},
-
- {"TimeBetweenLocalCheckpoints",
- "TimeBetweenLocalCheckpoints",
- "DB",
- "Time between taking snapshots of the database (expressed in 2log of bytes)",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 20,
- 0,
- 31},
-
- {"TimeBetweenGlobalCheckpoints",
- "TimeBetweenGlobalCheckpoints",
- "DB",
- "Time between doing group commit of transactions to disk",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 2000,
- 10,
- 32000},
-
- {"NoOfFragmentLogFiles",
- "NoOfFragmentLogFiles",
- "DB",
- "No of 16 Mbyte Redo log files in each of 4 file sets belonging to DB node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 8,
- 1,
- 0x7FFFFFFF},
-
- {"MaxNoOfOpenFiles",
- "MaxNoOfOpenFiles",
- "DB",
- "Max number of files open per DB node.(One thread is created per file)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 40,
- 20,
- 256},
-
- {"NoOfConcurrentCheckpointsDuringRestart",
- "NoOfConcurrentCheckpointsDuringRestart",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1,
- 1,
- 4},
+ {
+ CFG_DB_START_PARTIAL_TIMEOUT,
+ "StartPartialTimeout",
+ "DB",
+ "Time to wait before trying to start wo/ all nodes. 0=Wait forever",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 30000,
+ 0,
+ ~0 },
+
+ {
+ CFG_DB_START_PARTITION_TIMEOUT,
+ "StartPartitionedTimeout",
+ "DB",
+ "Time to wait before trying to start partitioned. 0=Wait forever",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 60000,
+ 0,
+ ~0 },
- {"TimeBetweenInactiveTransactionAbortCheck",
- "TimeBetweenInactiveTransactionAbortCheck",
- "DB",
- "Time between inactive transaction checks",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1000,
- 1000,
- 0x7FFFFFFF},
+ {
+ CFG_DB_START_FAILURE_TIMEOUT,
+ "StartFailureTimeout",
+ "DB",
+ "Time to wait before terminating. 0=Wait forever",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 5*60000,
+ 0,
+ ~0 },
+
+ {
+ KEY_INTERNAL,
+ "TimeToWaitAlive",
+ "DB",
+ "Start{Partial/Partitioned/Failure}Time",
+ ConfigInfo::DEPRICATED,
+ true,
+ ConfigInfo::INT,
+ 25,
+ 2,
+ 4000 },
+
+ {
+ CFG_DB_HEARTBEAT_INTERVAL,
+ "HeartbeatIntervalDbDb",
+ "DB",
+ "Time between DB-DB heartbeats. DB considered dead after 3 missed HBs",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 1500,
+ 10,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_API_HEARTBEAT_INTERVAL,
+ "HeartbeatIntervalDbApi",
+ "DB",
+ "Time between API-DB heartbeats. API connection closed after 3 missed HBs",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 1500,
+ 100,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_LCP_INTERVAL,
+ "TimeBetweenLocalCheckpoints",
+ "DB",
+ "Time between taking snapshots of the database (expressed in 2log of bytes)",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 20,
+ 0,
+ 31 },
+
+ {
+ CFG_DB_GCP_INTERVAL,
+ "TimeBetweenGlobalCheckpoints",
+ "DB",
+ "Time between doing group commit of transactions to disk",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 2000,
+ 10,
+ 32000 },
+
+ {
+ CFG_DB_NO_REDOLOG_FILES,
+ "NoOfFragmentLogFiles",
+ "DB",
+ "No of 16 Mbyte Redo log files in each of 4 file sets belonging to DB node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 8,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "MaxNoOfOpenFiles",
+ "DB",
+ "Max number of files open per DB node.(One thread is created per file)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 40,
+ 20,
+ 256 },
+
- {"TransactionInactiveTimeout",
- "TransactionInactiveTimeout",
- "DB",
- "Time application can wait before executing another transaction part (ms).\n"
- "This is the time the transaction coordinator waits for the application\n"
- "to execute or send another part (query, statement) of the transaction.\n"
- "If the application takes too long time, the transaction gets aborted.\n"
- "Timeout set to 0 means that we don't timeout at all on application wait.",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 3000,
- 0,
- 0x7FFFFFFF},
-
- {"TransactionDeadlockDetectionTimeout",
- "TransactionDeadlockDetectionTimeout",
- "DB",
- "Time transaction can be executing in a DB node (ms).\n"
- "This is the time the transaction coordinator waits for each database node\n"
- "of the transaction to execute a request. If the database node takes too\n"
- "long time, the transaction gets aborted.",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 3000,
- 50,
- 0x7FFFFFFF},
-
- {"TransactionInactiveTimeBeforeAbort",
- "TransactionInactiveTimeBeforeAbort",
- "DB",
- "Time a transaction can be inactive before getting aborted (ms)",
- ConfigInfo::DEPRICATED,
- true,
- ConfigInfo::INT,
- 3000,
- 20,
- 0x7FFFFFFF},
-
- {"NoOfConcurrentProcessesHandleTakeover",
- "NoOfConcurrentProcessesHandleTakeover",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1,
- 1,
- 15},
+ {
+ CFG_DB_TRANSACTION_CHECK_INTERVAL,
+ "TimeBetweenInactiveTransactionAbortCheck",
+ "DB",
+ "Time between inactive transaction checks",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 1000,
+ 1000,
+ 0x7FFFFFFF },
- {"NoOfConcurrentCheckpointsAfterRestart",
- "NoOfConcurrentCheckpointsAfterRestart",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 1,
- 1,
- 4},
+ {
+ CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
+ "TransactionInactiveTimeout",
+ "DB",
+ "Time application can wait before executing another transaction part (ms).\n"
+ "This is the time the transaction coordinator waits for the application\n"
+ "to execute or send another part (query, statement) of the transaction.\n"
+ "If the application takes too long time, the transaction gets aborted.\n"
+ "Timeout set to 0 means that we don't timeout at all on application wait.",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 3000,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT,
+ "TransactionDeadlockDetectionTimeout",
+ "DB",
+ "Time transaction can be executing in a DB node (ms).\n"
+ "This is the time the transaction coordinator waits for each database node\n"
+ "of the transaction to execute a request. If the database node takes too\n"
+ "long time, the transaction gets aborted.",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 3000,
+ 50,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "TransactionInactiveTimeBeforeAbort",
+ "DB",
+ "TransactionInactiveTimeout",
+ ConfigInfo::DEPRICATED,
+ true,
+ ConfigInfo::INT,
+ 3000,
+ 20,
+ 0x7FFFFFFF },
- {"NoOfDiskPagesToDiskDuringRestartTUP",
- "NoOfDiskPagesToDiskDuringRestartTUP",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 50,
- 1,
- 0x7FFFFFFF},
-
- {"NoOfDiskPagesToDiskAfterRestartTUP",
- "NoOfDiskPagesToDiskAfterRestartTUP",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 10,
- 1,
- 0x7FFFFFFF},
-
- {"NoOfDiskPagesToDiskDuringRestartACC",
- "NoOfDiskPagesToDiskDuringRestartACC",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 25,
- 1,
- 0x7FFFFFFF},
-
- {"NoOfDiskPagesToDiskAfterRestartACC",
- "NoOfDiskPagesToDiskAfterRestartACC",
- "DB",
- "?",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 5,
- 1,
- 0x7FFFFFFF},
+ {
+ KEY_INTERNAL,
+ "NoOfDiskPagesToDiskDuringRestartTUP",
+ "DB",
+ "?",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 50,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "NoOfDiskPagesToDiskAfterRestartTUP",
+ "DB",
+ "?",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 10,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "NoOfDiskPagesToDiskDuringRestartACC",
+ "DB",
+ "?",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 25,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "NoOfDiskPagesToDiskAfterRestartACC",
+ "DB",
+ "?",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 5,
+ 1,
+ 0x7FFFFFFF },
- {"NoOfDiskClustersPerDiskFile",
- "NoOfDiskClustersPerDiskFile",
- "DB",
- "?",
- ConfigInfo::NOTIMPLEMENTED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
+
+ {
+ CFG_DB_DISCLESS,
+ "Discless",
+ "DB",
+ "Run wo/ disk",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::BOOL,
+ 0,
+ 0,
+ 1},
- {"NoOfDiskFiles",
- "NoOfDiskFiles",
- "DB",
- "?",
- ConfigInfo::NOTIMPLEMENTED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"ArbitrationTimeout",
- "ArbitrationTimeout",
- "DB",
- "Max time (milliseconds) database partion waits for arbitration signal",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1000,
- 10,
- 0x7FFFFFFF},
-
- {"FileSystemPath",
- "FileSystemPath",
- "DB",
- "Path to directory where the DB node stores its data (directory must exist)",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"LogLevelStartup",
- "LogLevelStartup",
- "DB",
- "Node startup info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1,
- 0,
- 15},
+ {
+ CFG_DB_ARBIT_TIMEOUT,
+ "ArbitrationTimeout",
+ "DB",
+ "Max time (milliseconds) database partion waits for arbitration signal",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1000,
+ 10,
+ 0x7FFFFFFF },
+
+ {
+ CFG_DB_FILESYSTEM_PATH,
+ "FileSystemPath",
+ "DB",
+ "Path to directory where the DB node stores its data (directory must exist)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_LOGLEVEL_STARTUP,
+ "LogLevelStartup",
+ "DB",
+ "Node startup info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1,
+ 0,
+ 15 },
- {"LogLevelShutdown",
- "LogLevelShutdown",
- "DB",
- "Node shutdown info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelStatistic",
- "LogLevelStatistic",
- "DB",
- "Transaction, operation, transporter info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelCheckpoint",
- "LogLevelCheckpoint",
- "DB",
- "Local and Global checkpoint info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelNodeRestart",
- "LogLevelNodeRestart",
- "DB",
- "Node restart, node failure info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelConnection",
- "LogLevelConnection",
- "DB",
- "Node connect/disconnect info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelError",
- "LogLevelError",
- "DB",
- "Transporter, heartbeat errors printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
-
- {"LogLevelInfo",
- "LogLevelInfo",
- "DB",
- "Heartbeat and log info printed on stdout",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 15},
+ {
+ CFG_LOGLEVEL_SHUTDOWN,
+ "LogLevelShutdown",
+ "DB",
+ "Node shutdown info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_STATISTICS,
+ "LogLevelStatistic",
+ "DB",
+ "Transaction, operation, transporter info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_CHECKPOINT,
+ "LogLevelCheckpoint",
+ "DB",
+ "Local and Global checkpoint info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_NODERESTART,
+ "LogLevelNodeRestart",
+ "DB",
+ "Node restart, node failure info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_CONNECTION,
+ "LogLevelConnection",
+ "DB",
+ "Node connect/disconnect info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_ERROR,
+ "LogLevelError",
+ "DB",
+ "Transporter, heartbeat errors printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
+
+ {
+ CFG_LOGLEVEL_INFO,
+ "LogLevelInfo",
+ "DB",
+ "Heartbeat and log info printed on stdout",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 15 },
/**
* Backup
*/
- { "ParallelBackups",
+ {
+ CFG_DB_PARALLEL_BACKUPS,
"ParallelBackups",
"DB",
"Maximum number of parallel backups",
@@ -877,7 +1049,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
1,
1 },
- { "BackupMemory",
+ {
+ CFG_DB_BACKUP_MEM,
"BackupMemory",
"DB",
"Total memory allocated for backups per node (in bytes)",
@@ -888,7 +1061,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
0x7FFFFFFF },
- { "BackupDataBufferSize",
+ {
+ CFG_DB_BACKUP_DATA_BUFFER_MEM,
"BackupDataBufferSize",
"DB",
"Default size of databuffer for a backup (in bytes)",
@@ -899,7 +1073,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
0x7FFFFFFF },
- { "BackupLogBufferSize",
+ {
+ CFG_DB_BACKUP_LOG_BUFFER_MEM,
"BackupLogBufferSize",
"DB",
"Default size of logbuffer for a backup (in bytes)",
@@ -910,7 +1085,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
0x7FFFFFFF },
- { "BackupWriteSize",
+ {
+ CFG_DB_BACKUP_WRITE_SIZE,
"BackupWriteSize",
"DB",
"Default size of filesystem writes made by backup (in bytes)",
@@ -921,967 +1097,1098 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
0x7FFFFFFF },
- /****************************************************************************
+ /***************************************************************************
* REP
- ****************************************************************************/
-
- {"Id",
- "Id",
- "REP",
- "Number identifying replication node (REP)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- (MAX_NODES - 1)},
-
- {"Type",
- "Type",
- "REP",
- "Type of node (Should have value REP)",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"ExecuteOnComputer",
- "ExecuteOnComputer",
- "REP",
- "String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
+ ***************************************************************************/
+ {
+ CFG_SECTION_NODE,
+ "REP",
+ "REP",
+ "Node section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ NODE_TYPE_REP,
+ 0, 0
+ },
- /****************************************************************************
- * EXTERNAL REP
- ****************************************************************************/
-
- {"Id",
- "Id",
- "EXTERNAL REP",
- "Number identifying external (i.e. in another NDB Cluster) replication node (REP)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- (MAX_NODES - 1)},
-
- {"Type",
- "Type",
- "EXTERNAL REP",
- "Type of node (Should have value REP)",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"System",
- "System",
- "EXTERNAL REP",
- "System name of system hosting node",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"HeartbeatIntervalRepRep",
- "HeartbeatIntervalRepRep",
- "EXTERNAL REP",
- "Time between REP-REP heartbeats. Connection closed after 3 missed HBs",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 3000,
- 100,
- 0x7FFFFFFF},
+ {
+ CFG_NODE_HOST,
+ "HostName",
+ "REP",
+ "Name of computer for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
- /****************************************************************************
+ {
+ CFG_NODE_SYSTEM,
+ "System",
+ "REP",
+ "Name of system for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ID,
+ "Id",
+ "REP",
+ "Number identifying replication node (REP)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 1,
+ (MAX_NODES - 1) },
+
+ {
+ KEY_INTERNAL,
+ "ExecuteOnComputer",
+ "REP",
+ "String referencing an earlier defined COMPUTER",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_REP_HEARTBEAT_INTERVAL,
+ "HeartbeatIntervalRepRep",
+ "REP",
+ "Time between REP-REP heartbeats. Connection closed after 3 missed HBs",
+ ConfigInfo::USED,
+ true,
+ ConfigInfo::INT,
+ 3000,
+ 100,
+ 0x7FFFFFFF },
+
+ /***************************************************************************
* API
- ****************************************************************************/
-
- {"Id",
- "Id",
- "API",
- "Number identifying application node (API)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- (MAX_NODES - 1)},
-
- {"Type",
- "Type",
- "API",
- "Type of node (Should have value API)",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"ExecuteOnComputer",
- "ExecuteOnComputer",
- "API",
- "String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"MaxNoOfSavedMessages",
- "MaxNoOfSavedMessages",
- "API",
- "Max number of error messages in error log and max number of trace files",
- ConfigInfo::USED,
- true,
- ConfigInfo::INT,
- 25,
- 0,
- 0x7FFFFFFF},
-
- {"SleepWhenIdle",
- "SleepWhenIdle",
- "API",
- "?",
- ConfigInfo::DEPRICATED,
- true,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- {"ArbitrationRank",
- "ArbitrationRank",
- "API",
- "If 0, then API is not arbitrator. Kernel selects arbitrators in order 1, 2",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 2,
- 0,
- 2},
-
- {"ArbitrationDelay",
- "ArbitrationDelay",
- "API",
- "When asked to arbitrate, arbitrator waits this long before voting (msec)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
+ ***************************************************************************/
+ {
+ CFG_SECTION_NODE,
+ "API",
+ "API",
+ "Node section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ NODE_TYPE_API,
+ 0, 0
+ },
+
+ {
+ CFG_NODE_HOST,
+ "HostName",
+ "API",
+ "Name of computer for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_SYSTEM,
+ "System",
+ "API",
+ "Name of system for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ID,
+ "Id",
+ "API",
+ "Number identifying application node (API)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 1,
+ (MAX_NODES - 1) },
+
+ {
+ KEY_INTERNAL,
+ "ExecuteOnComputer",
+ "API",
+ "String referencing an earlier defined COMPUTER",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ARBIT_RANK,
+ "ArbitrationRank",
+ "API",
+ "If 0, then API is not arbitrator. Kernel selects arbitrators in order 1, 2",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2,
+ 0,
+ 2 },
+
+ {
+ CFG_NODE_ARBIT_DELAY,
+ "ArbitrationDelay",
+ "API",
+ "When asked to arbitrate, arbitrator waits this long before voting (msec)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 0x7FFFFFFF },
/****************************************************************************
* MGM
- ****************************************************************************/
-
- {"Id",
- "Id",
- "MGM",
- "Number identifying the management server node (MGM)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 1,
- (MAX_NODES - 1)},
+ ***************************************************************************/
+ {
+ CFG_SECTION_NODE,
+ "MGM",
+ "MGM",
+ "Node section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ NODE_TYPE_MGM,
+ 0, 0
+ },
+
+ {
+ CFG_NODE_HOST,
+ "HostName",
+ "MGM",
+ "Name of computer for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_SYSTEM,
+ "System",
+ "MGM",
+ "Name of system for this node",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ID,
+ "Id",
+ "MGM",
+ "Number identifying the management server node (MGM)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 1,
+ (MAX_NODES - 1) },
+
+ {
+ CFG_LOG_DESTINATION,
+ "LogDestination",
+ "MGM",
+ "String describing where logmessages are sent",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ 0,
+ 0,
+ 0x7FFFFFFF },
- {"Type",
- "Type",
- "MGM",
- "Type of node (Should have value MGM)",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0},
-
- {"ExecuteOnComputer",
- "ExecuteOnComputer",
- "MGM",
- "String referencing an earlier defined COMPUTER",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- // SHOULD THIS REALLY BE DEFINABLE FOR MGM ???
- {"MaxNoOfSavedMessages",
- "MaxNoOfSavedMessages",
- "MGM",
- "Max number of error messages in error log and max number of trace files",
- ConfigInfo::DEPRICATED,
- true,
- ConfigInfo::INT,
- 25,
- 0,
- 0x7FFFFFFF},
+ {
+ KEY_INTERNAL,
+ "ExecuteOnComputer",
+ "MGM",
+ "String referencing an earlier defined COMPUTER",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
- {"MaxNoOfSavedEvents",
- "MaxNoOfSavedEvents",
- "MGM",
- "",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 100,
- 0,
- 0x7FFFFFFF},
-
- {"PortNumber",
- "PortNumber",
- "MGM",
- "Port number to give commands to/fetch configurations from management server",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 2200,
- 0,
- 0x7FFFFFFF},
-
- {"PortNumberStats",
- "PortNumberStats",
- "MGM",
- "Port number used to get statistical information from a management server",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 2199,
- 0,
- 0x7FFFFFFF},
-
- {"ArbitrationRank",
- "ArbitrationRank",
- "MGM",
- "If 0, then MGM is not arbitrator. Kernel selects arbitrators in order 1, 2",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 2,
- 0,
- 2},
-
- {"ArbitrationDelay",
- "ArbitrationDelay",
- "MGM",
- "",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
-
- /*****************************************************************************
- * SYSTEM
- ****************************************************************************/
-
- {"Name",
- "Name",
- "SYSTEM",
- "Name of system (NDB Cluster)",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0},
-
- {"ReplicationRole",
- "ReplicationRole",
- "SYSTEM",
- "Role in Global Replication (None, Primary, or Standby)",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0},
-
- {"LogDestination",
- "LogDestination",
- "MGM",
- "String describing where logmessages are sent",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"PrimaryMGMNode",
- "PrimaryMGMNode",
- "SYSTEM",
- "Node id of Primary MGM node",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"ConfigGenerationNumber",
- "ConfigGenerationNumber",
- "SYSTEM",
- "Configuration generation number",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"Name",
- "Name",
- "EXTERNAL SYSTEM",
- "Name of external system (another NDB Cluster)",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0},
-
- /*****************************************************************************
+ {
+ KEY_INTERNAL,
+ "MaxNoOfSavedEvents",
+ "MGM",
+ "",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 100,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_MGM_PORT,
+ "PortNumber",
+ "MGM",
+ "Port number to give commands to/fetch configurations from management server",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2200,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "PortNumberStats",
+ "MGM",
+ "Port number used to get statistical information from a management server",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2199,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_NODE_ARBIT_RANK,
+ "ArbitrationRank",
+ "MGM",
+ "If 0, then MGM is not arbitrator. Kernel selects arbitrators in order 1, 2",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2,
+ 0,
+ 2 },
+
+ {
+ CFG_NODE_ARBIT_DELAY,
+ "ArbitrationDelay",
+ "MGM",
+ "",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 0,
+ 0,
+ 0x7FFFFFFF },
+
+ /****************************************************************************
* TCP
- ****************************************************************************/
-
- {"Type",
- "Type",
- "TCP",
- "",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"HostName1",
- "HostName1",
- "TCP",
- "Name of computer on one side of the connection",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"HostName2",
- "HostName2",
- "TCP",
- "Name of computer on one side of the connection",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"NodeId1",
- "NodeId1",
- "TCP",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId1",
- "NodeId1",
- "TCP",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"NodeId2",
- "NodeId2",
- "TCP",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId2",
- "NodeId2",
- "TCP",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"IpAddress1",
- "HostName1",
- "TCP",
- "IP address of first node in connection.",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"IpAddress2",
- "HostName2",
- "TCP",
- "IP address of second node in connection.",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0},
-
- {"SendSignalId",
- "SendSignalId",
- "TCP",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- {"Compression",
- "Compression",
- "TCP",
- "If compression is enabled, then all signals between nodes are compressed",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"Checksum",
- "Checksum",
- "TCP",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"PortNumber",
- "PortNumber",
- "TCP",
- "Port used for this transporter",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"SendBufferSize",
- "SendBufferSize",
- "TCP",
- "Size of buffer for signals sent from this node (in no of signals)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 16,
- 1,
- 0x7FFFFFFF},
+ ***************************************************************************/
+ {
+ CFG_SECTION_CONNECTION,
+ "TCP",
+ "TCP",
+ "Connection section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ CONNECTION_TYPE_TCP,
+ 0, 0
+ },
+
+ {
+ CFG_TCP_HOSTNAME_1,
+ "HostName1",
+ "TCP",
+ "Name/IP of computer on one side of the connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_TCP_HOSTNAME_2,
+ "HostName2",
+ "TCP",
+ "Name/IP of computer on one side of the connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_1,
+ "NodeId1",
+ "TCP",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId1",
+ "TCP",
+ "NodeId1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2,
+ "NodeId2",
+ "TCP",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId2",
+ "TCP",
+ "NodeId2",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "IpAddress1",
+ "TCP",
+ "HostName1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "IpAddress2",
+ "TCP",
+ "HostName2",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0 },
+
+ {
+ CFG_CONNECTION_SEND_SIGNAL_ID,
+ "SendSignalId",
+ "TCP",
+ "Sends id in each signal. Used in trace files.",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
+
+
+ {
+ CFG_CONNECTION_CHECKSUM,
+ "Checksum",
+ "TCP",
+ "If checksum is enabled, all signals between nodes are checked for errors",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_TCP_SERVER_PORT,
+ "PortNumber",
+ "TCP",
+ "Port used for this transporter",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2202,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_TCP_SEND_BUFFER_SIZE,
+ "SendBufferMemory",
+ "TCP",
+ "Bytes of buffer for signals sent from this node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 16 * 16384,
+ 1 * 16384,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "SendBufferSize",
+ "TCP",
+ "SendBufferMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ 16,
+ 1,
+ 0x7FFFFFFF },
- {"MaxReceiveSize",
- "MaxReceiveSize",
- "TCP",
- "Size of buffer for signals received by this node (in no of signals)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 4,
- 1,
- 0x7FFFFFFF},
-
- {"Proxy",
- "Proxy",
- "TCP",
- "",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0},
-
- /*****************************************************************************
- * SHM
- ****************************************************************************/
-
- {"Type",
- "Type",
- "SHM",
- "",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_TCP_RECEIVE_BUFFER_SIZE,
+ "ReceiveBufferMemory",
+ "TCP",
+ "Bytes of buffer for signals received by this node",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 4 * 16384,
+ 1 * 16384,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "MaxReceiveSize",
+ "TCP",
+ "ReceiveBufferMemory",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ 4,
+ 1,
+ 0x7FFFFFFF },
+
+ {
+ CFG_TCP_PROXY,
+ "Proxy",
+ "TCP",
+ "",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0 },
+
+ {
+ KEY_INTERNAL,
+ "Compression",
+ "TCP",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+
+ {
+ CFG_CONNECTION_NODE_1_SYSTEM,
+ "NodeId1_System",
+ "TCP",
+ "System for node 1 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2_SYSTEM,
+ "NodeId2_System",
+ "TCP",
+ "System for node 2 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
- {"NodeId1",
- "NodeId1",
- "SHM",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
+
+ /****************************************************************************
+ * SHM
+ ***************************************************************************/
+ {
+ CFG_SECTION_CONNECTION,
+ "SHM",
+ "SHM",
+ "Connection section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ CONNECTION_TYPE_SHM,
+ 0, 0
+ },
+
+ {
+ CFG_CONNECTION_NODE_1,
+ "NodeId1",
+ "SHM",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
- {"ProcessId1",
- "NodeId1",
- "SHM",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
+ {
+ KEY_INTERNAL,
+ "ProcessId1",
+ "SHM",
+ "NodeId1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
- {"NodeId2",
- "NodeId2",
- "SHM",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_CONNECTION_NODE_2,
+ "NodeId2",
+ "SHM",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
- {"ProcessId2",
- "NodeId2",
- "SHM",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
+ {
+ KEY_INTERNAL,
+ "ProcessId2",
+ "SHM",
+ "NodeId1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
- {"SendSignalId",
- "SendSignalId",
- "SHM",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_CONNECTION_SEND_SIGNAL_ID,
+ "SendSignalId",
+ "SHM",
+ "Sends id in each signal. Used in trace files.",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
- {"Compression",
- "Compression",
- "SHM",
- "If compression is enabled, then all signals between nodes are compressed",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
- {"Checksum",
- "Checksum",
- "SHM",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
+ {
+ CFG_CONNECTION_CHECKSUM,
+ "Checksum",
+ "SHM",
+ "If checksum is enabled, all signals between nodes are checked for errors",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
- {"ShmKey",
- "ShmKey",
- "SHM",
- "A shared memory key",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF },
+ {
+ CFG_SHM_KEY,
+ "ShmKey",
+ "SHM",
+ "A shared memory key",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
- {"ShmSize",
- "ShmSize",
- "SHM",
- "Size of shared memory segment",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1048576,
- 4096,
- 0x7FFFFFFF},
+ {
+ CFG_SHM_BUFFER_MEM,
+ "ShmSize",
+ "SHM",
+ "Size of shared memory segment",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1048576,
+ 4096,
+ 0x7FFFFFFF },
- /*****************************************************************************
+ {
+ KEY_INTERNAL,
+ "Compression",
+ "SHM",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_1_SYSTEM,
+ "NodeId1_System",
+ "SHM",
+ "System for node 1 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2_SYSTEM,
+ "NodeId2_System",
+ "SHM",
+ "System for node 2 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ /****************************************************************************
* SCI
- ****************************************************************************/
-
- {"NodeId1",
- "NodeId1",
- "SCI",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId1",
- "NodeId1",
- "SCI",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"NodeId2",
- "NodeId2",
- "SCI",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId2",
- "NodeId2",
- "SCI",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"SciId0",
- "SciId0",
- "SCI",
- "Local SCI-node id for adapter 0 (a computer can have two adapters)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"SciId1",
- "SciId1",
- "SCI",
- "Local SCI-node id for adapter 1 (a computer can have two adapters)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"SendSignalId",
- "SendSignalId",
- "SCI",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- {"Compression",
- "Compression",
- "SCI",
- "If compression is enabled, then all signals between nodes are compressed",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"Checksum",
- "Checksum",
- "SCI",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"SendLimit",
- "SendLimit",
- "SCI",
- "Transporter send buffer contents are sent when this no of bytes is buffered",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 2048,
- 512,
- 0x7FFFFFFF},
-
- {"SharedBufferSize",
- "SharedBufferSize",
- "SCI",
- "Size of shared memory segment",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1048576,
- 262144,
- 0x7FFFFFFF},
-
- {"Node1_NoOfAdapters",
- "Node1_NoOfAdapters",
- "SCI",
- "",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"Node2_NoOfAdapters",
- "Node2_NoOfAdapters",
- "SCI",
- "",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"Node1_Adapter",
- "Node1_Adapter",
- "SCI",
- "",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"Node2_Adapter",
- "Node2_Adapter",
- "SCI",
- "",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- /*****************************************************************************
+ ***************************************************************************/
+ {
+ CFG_SECTION_CONNECTION,
+ "SCI",
+ "SCI",
+ "Connection section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ CONNECTION_TYPE_SCI,
+ 0, 0
+ },
+
+ {
+ CFG_CONNECTION_NODE_1,
+ "NodeId1",
+ "SCI",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId1",
+ "SCI",
+ "NodeId1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2,
+ "NodeId2",
+ "SCI",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId2",
+ "SCI",
+ "NodeId2",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_SCI_ID_0,
+ "SciId0",
+ "SCI",
+ "Local SCI-node id for adapter 0 (a computer can have two adapters)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_SCI_ID_1,
+ "SciId1",
+ "SCI",
+ "Local SCI-node id for adapter 1 (a computer can have two adapters)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_SEND_SIGNAL_ID,
+ "SendSignalId",
+ "SCI",
+ "Sends id in each signal. Used in trace files.",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_CHECKSUM,
+ "Checksum",
+ "SCI",
+ "If checksum is enabled, all signals between nodes are checked for errors",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_SCI_SEND_LIMIT,
+ "SendLimit",
+ "SCI",
+ "Transporter send buffer contents are sent when this no of bytes is buffered",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 2048,
+ 512,
+ 0x7FFFFFFF },
+
+ {
+ CFG_SCI_BUFFER_MEM,
+ "SharedBufferSize",
+ "SCI",
+ "Size of shared memory segment",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1048576,
+ 262144,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Node1_NoOfAdapters",
+ "SCI",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Node2_NoOfAdapters",
+ "SCI",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Node1_Adapter",
+ "SCI",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Node2_Adapter",
+ "SCI",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Compression",
+ "SCI",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_1_SYSTEM,
+ "NodeId1_System",
+ "SCI",
+ "System for node 1 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2_SYSTEM,
+ "NodeId2_System",
+ "SCI",
+ "System for node 2 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ /****************************************************************************
* OSE
- ****************************************************************************/
-
- {"Type",
- "Type",
- "OSE",
- "",
- ConfigInfo::INTERNAL,
- false,
- ConfigInfo::STRING,
- 0,
- 0,
- 0x7FFFFFFF},
-
- {"HostName1",
- "HostName1",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"HostName2",
- "HostName2",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::STRING,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"NodeId1",
- "NodeId1",
- "OSE",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId1",
- "NodeId1",
- "OSE",
- "Depricated",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"NodeId2",
- "NodeId2",
- "OSE",
- "Id of node (DB, API or MGM) on one side of the connection",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 0,
- 0x7FFFFFFF},
-
- {"ProcessId2",
- "NodeId2",
- "OSE",
- "Depricated",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- MANDATORY,
- 0,
- 0x7FFFFFFF},
-
- {"SendSignalId",
- "SendSignalId",
- "OSE",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- true,
- 0,
- 0x7FFFFFFF},
-
- {"Compression",
- "Compression",
- "OSE",
- "If compression is enabled, then all signals between nodes are compressed",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- {"Checksum",
- "Checksum",
- "OSE",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::USED,
- false,
- ConfigInfo::BOOL,
- false,
- 0,
- 0x7FFFFFFF},
-
- // Should not be part of OSE ?
- {"SharedBufferSize",
- "SharedBufferSize",
- "OSE",
- "?",
- ConfigInfo::DEPRICATED,
- false,
- ConfigInfo::INT,
- UNDEFINED,
- 2000,
- 0x7FFFFFFF},
-
- {"PrioASignalSize",
- "PrioASignalSize",
- "OSE",
- "Size of priority A signals (in bytes)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1000,
- 0,
- 0x7FFFFFFF},
-
- {"PrioBSignalSize",
- "PrioBSignalSize",
- "OSE",
- "Size of priority B signals (in bytes)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 1000,
- 0,
- 0x7FFFFFFF},
-
- {"ReceiveArraySize",
- "ReceiveArraySize",
- "OSE",
- "Number of OSE signals checked for correct ordering (in no of OSE signals)",
- ConfigInfo::USED,
- false,
- ConfigInfo::INT,
- 10,
- 0,
- 0x7FFFFFFF}
+ ***************************************************************************/
+ {
+ CFG_SECTION_CONNECTION,
+ "OSE",
+ "OSE",
+ "Connection section",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::SECTION,
+ CONNECTION_TYPE_OSE,
+ 0, 0
+ },
+
+ {
+ CFG_OSE_HOSTNAME_1,
+ "HostName1",
+ "OSE",
+ "Name of computer on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_OSE_HOSTNAME_2,
+ "HostName2",
+ "OSE",
+ "Name of computer on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_1,
+ "NodeId1",
+ "OSE",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId1",
+ "OSE",
+ "NodeId1",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2,
+ "NodeId2",
+ "OSE",
+ "Id of node (DB, API or MGM) on one side of the connection",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "ProcessId2",
+ "OSE",
+ "NodeId2",
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::INT,
+ MANDATORY,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_SEND_SIGNAL_ID,
+ "SendSignalId",
+ "OSE",
+ "Sends id in each signal. Used in trace files.",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ true,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_CHECKSUM,
+ "Checksum",
+ "OSE",
+ "If checksum is enabled, all signals between nodes are checked for errors",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_OSE_PRIO_A_SIZE,
+ "PrioASignalSize",
+ "OSE",
+ "Size of priority A signals (in bytes)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1000,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_OSE_PRIO_B_SIZE,
+ "PrioBSignalSize",
+ "OSE",
+ "Size of priority B signals (in bytes)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 1000,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_OSE_RECEIVE_ARRAY_SIZE,
+ "ReceiveArraySize",
+ "OSE",
+ "Number of OSE signals checked for correct ordering (in no of OSE signals)",
+ ConfigInfo::USED,
+ false,
+ ConfigInfo::INT,
+ 10,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ KEY_INTERNAL,
+ "Compression",
+ "OSE",
+ 0,
+ ConfigInfo::DEPRICATED,
+ false,
+ ConfigInfo::BOOL,
+ false,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_1_SYSTEM,
+ "NodeId1_System",
+ "OSE",
+ "System for node 1 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
+
+ {
+ CFG_CONNECTION_NODE_2_SYSTEM,
+ "NodeId2_System",
+ "OSE",
+ "System for node 2 in connection",
+ ConfigInfo::INTERNAL,
+ false,
+ ConfigInfo::STRING,
+ UNDEFINED,
+ 0,
+ 0x7FFFFFFF },
};
const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
@@ -1908,21 +2215,21 @@ ConfigInfo::ConfigInfo() {
newsection.setCaseInsensitiveNames(true);
m_info.put(param._section, &newsection);
}
-
+
// Get copy of section
m_info.getCopy(param._section, &section);
// Create pinfo (parameter info) entry
Properties pinfo;
+ pinfo.put("Id", param._paramId);
pinfo.put("Fname", param._fname);
- pinfo.put("Pname", param._pname);
pinfo.put("Description", param._description);
pinfo.put("Updateable", param._updateable);
pinfo.put("Type", param._type);
pinfo.put("Status", param._status);
- pinfo.put("Default", param._default);
- pinfo.put("Min", param._min);
- pinfo.put("Max", param._max);
+ pinfo.put64("Default", param._default);
+ pinfo.put64("Min", param._min);
+ pinfo.put64("Max", param._max);
// Check that pinfo is really new
if (section->get(param._fname, &oldpinfo)) {
@@ -1937,8 +2244,8 @@ ConfigInfo::ConfigInfo() {
// Replace section with modified section
m_info.put(param._section, section, true);
-
- {
+
+ if(param._type != ConfigInfo::SECTION){
Properties * p;
if(!m_systemDefaults.getCopy(param._section, &p)){
p = new Properties();
@@ -1947,26 +2254,28 @@ ConfigInfo::ConfigInfo() {
if(param._type != STRING &&
param._default != UNDEFINED &&
param._default != MANDATORY){
- require(p->put(param._pname, param._default));
+ require(p->put(param._fname, param._default));
}
require(m_systemDefaults.put(param._section, p, true));
delete p;
}
}
-
+
for (int i=0; i<m_NoOfParams; i++) {
if(m_ParamInfo[i]._section == NULL){
- ndbout << "Check that each pname has an fname failed." << endl;
- ndbout << "Parameter \"" << m_ParamInfo[i]._pname
- << "\" does not exist in section \""
- << m_ParamInfo[i]._section << "\"." << endl;
+ ndbout << "Check that each entry has a section failed." << endl;
+ ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl;
ndbout << "Edit file " << __FILE__ << "." << endl;
exit(-1);
}
+
+ if(m_ParamInfo[i]._type == ConfigInfo::SECTION)
+ continue;
+
const Properties * p = getInfo(m_ParamInfo[i]._section);
- if (!p || !p->contains(m_ParamInfo[i]._pname)) {
+ if (!p || !p->contains(m_ParamInfo[i]._fname)) {
ndbout << "Check that each pname has an fname failed." << endl;
- ndbout << "Parameter \"" << m_ParamInfo[i]._pname
+ ndbout << "Parameter \"" << m_ParamInfo[i]._fname
<< "\" does not exist in section \""
<< m_ParamInfo[i]._section << "\"." << endl;
ndbout << "Edit file " << __FILE__ << "." << endl;
@@ -2002,16 +2311,27 @@ ConfigInfo::getDefaults(const char * section) const {
}
static
-Uint32
+Uint64
getInfoInt(const Properties * section,
const char* fname, const char * type){
- Uint32 val;
+ Uint32 val32;
const Properties * p;
- if (section->get(fname, &p) && p->get(type, &val)) {
- return val;
+ if (section->get(fname, &p) && p->get(type, &val32)) {
+ return val32;
+ }
+
+ Uint64 val64;
+ if(p && p->get(type, &val64)){
+ return val64;
}
+
+ section->print();
+ if(section->get(fname, &p)){
+ p->print();
+ }
+
warning(type, fname);
- return val;
+ return 0;
}
static
@@ -2027,27 +2347,22 @@ getInfoString(const Properties * section,
return val;
}
-Uint32
+Uint64
ConfigInfo::getMax(const Properties * section, const char* fname) const {
return getInfoInt(section, fname, "Max");
}
-Uint32
+Uint64
ConfigInfo::getMin(const Properties * section, const char* fname) const {
return getInfoInt(section, fname, "Min");
}
-Uint32
+Uint64
ConfigInfo::getDefault(const Properties * section, const char* fname) const {
return getInfoInt(section, fname, "Default");
}
const char*
-ConfigInfo::getPName(const Properties * section, const char* fname) const {
- return getInfoString(section, fname, "Pname");
-}
-
-const char*
ConfigInfo::getDescription(const Properties * section,
const char* fname) const {
return getInfoString(section, fname, "Description");
@@ -2063,8 +2378,8 @@ ConfigInfo::isSection(const char * section) const {
bool
ConfigInfo::verify(const Properties * section, const char* fname,
- Uint32 value) const {
- Uint32 min, max; min = max + 1;
+ Uint64 value) const {
+ Uint64 min, max; min = max + 1;
min = getInfoInt(section, fname, "Min");
max = getInfoInt(section, fname, "Max");
@@ -2104,7 +2419,6 @@ void ConfigInfo::print(const char* section) const {
Properties::Iterator it(sec);
for (const char* n = it.first(); n != NULL; n = it.next()) {
// Skip entries with different F- and P-names
- if (strcmp(n, getPName(sec, n))) continue;
if (getStatus(sec, n) == ConfigInfo::INTERNAL) continue;
if (getStatus(sec, n) == ConfigInfo::DEPRICATED) continue;
if (getStatus(sec, n) == ConfigInfo::NOTIMPLEMENTED) continue;
@@ -2114,7 +2428,7 @@ void ConfigInfo::print(const char* section) const {
void ConfigInfo::print(const Properties * section,
const char* parameter) const {
- ndbout << getPName(section, parameter);
+ ndbout << parameter;
// ndbout << getDescription(section, parameter) << endl;
switch (getType(section, parameter)) {
case ConfigInfo::BOOL:
@@ -2133,6 +2447,7 @@ void ConfigInfo::print(const Properties * section,
break;
case ConfigInfo::INT:
+ case ConfigInfo::INT64:
ndbout << " (Non-negative Integer)" << endl;
ndbout << getDescription(section, parameter) << endl;
if (getDefault(section, parameter) == MANDATORY) {
@@ -2157,6 +2472,8 @@ void ConfigInfo::print(const Properties * section,
}
ndbout << endl;
break;
+ case ConfigInfo::SECTION:
+ break;
}
}
@@ -2189,6 +2506,39 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){
}
bool
+fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
+
+ const char * compId;
+ if(!ctx.m_currentSection->get("ExecuteOnComputer", &compId)){
+ ctx.reportError("Parameter \"ExecuteOnComputer\" missing from section "
+ "[%s] starting at line: %d",
+ ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
+ const Properties * computer;
+ char tmp[255];
+ snprintf(tmp, sizeof(tmp), "Computer_%s", compId);
+ if(!ctx.m_config->get(tmp, &computer)){
+ ctx.reportError("Computer \"%s\" not declared"
+ "- [%s] starting at line: %d",
+ compId, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
+ const char * hostname;
+ if(!computer->get("HostName", &hostname)){
+ ctx.reportError("HostName missing in [COMPUTER] (Id: %d) "
+ " - [%s] starting at line: %d",
+ compId, ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
+ require(ctx.m_currentSection->put("HostName", hostname));
+ return true;
+}
+
+bool
transformExtNode(InitConfigFileParser::Context & ctx, const char * data){
Uint32 id;
@@ -2301,6 +2651,7 @@ applyDefaultValues(InitConfigFileParser::Context & ctx,
Properties::Iterator it(defaults);
for(const char * name = it.first(); name != NULL; name = it.next()){
+ ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name);
if(!ctx.m_currentSection->contains(name)){
switch (ctx.m_info->getType(ctx.m_currentInfo, name)){
case ConfigInfo::INT:
@@ -2310,12 +2661,20 @@ applyDefaultValues(InitConfigFileParser::Context & ctx,
ctx.m_currentSection->put(name, val);
break;
}
+ case ConfigInfo::INT64:{
+ Uint64 val = 0;
+ ::require(defaults->get(name, &val));
+ ctx.m_currentSection->put64(name, val);
+ break;
+ }
case ConfigInfo::STRING:{
const char * val;
::require(defaults->get(name, &val));
ctx.m_currentSection->put(name, val);
break;
}
+ case ConfigInfo::SECTION:
+ break;
}
}
}
@@ -2325,9 +2684,13 @@ applyDefaultValues(InitConfigFileParser::Context & ctx,
bool
applyDefaultValues(InitConfigFileParser::Context & ctx, const char * data){
- applyDefaultValues(ctx, ctx.m_userDefaults);
- applyDefaultValues(ctx, ctx.m_systemDefaults);
-
+ if(strcmp(data, "user") == 0)
+ applyDefaultValues(ctx, ctx.m_userDefaults);
+ else if (strcmp(data, "system") == 0)
+ applyDefaultValues(ctx, ctx.m_systemDefaults);
+ else
+ return false;
+
return true;
}
@@ -2343,11 +2706,9 @@ checkMandatory(InitConfigFileParser::Context & ctx, const char * data){
::require(ctx.m_currentInfo->get(name, &info));
Uint32 val;
if(info->get("Default", &val) && val == MANDATORY){
- const char * pname;
const char * fname;
- ::require(info->get("Pname", &pname));
::require(info->get("Fname", &fname));
- if(!ctx.m_currentSection->contains(pname)){
+ if(!ctx.m_currentSection->contains(fname)){
ctx.reportError("Mandatory parameter %s missing from section "
"[%s] starting at line: %d",
fname, ctx.fname, ctx.m_sectionLineno);
@@ -2364,13 +2725,13 @@ checkMandatory(InitConfigFileParser::Context & ctx, const char * data){
* Transform a string "NodeidX" (e.g. "uppsala.32")
* into a Uint32 "NodeIdX" (e.g. 32) and a string "SystemX" (e.g. "uppsala").
*/
-bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data){
-
+bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data)
+{
char buf[] = "NodeIdX"; buf[6] = data[sizeof("NodeI")];
char sysbuf[] = "SystemX"; sysbuf[6] = data[sizeof("NodeI")];
const char* nodeId;
require(ctx.m_currentSection->get(buf, &nodeId));
-
+
char tmpLine[MAX_LINE_LENGTH];
strncpy(tmpLine, nodeId, MAX_LINE_LENGTH);
char* token1 = strtok(tmpLine, ".");
@@ -2391,7 +2752,6 @@ bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data){
require(ctx.m_currentSection->put(buf, id, true));
require(ctx.m_currentSection->put(sysbuf, token1));
}
-
return true;
}
@@ -2493,20 +2853,12 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){
if(!ctx.m_currentSection->contains(data)){
Uint32 id = 0;
require(ctx.m_currentSection->get(buf, &id));
-
+
const Properties * node;
require(ctx.m_config->get("Node", id, &node));
- const char * compId;
- require(node->get("ExecuteOnComputer", &compId));
-
- const Properties * computer;
- char tmp[255];
- snprintf(tmp, sizeof(tmp), "Computer_%s", compId);
- require(ctx.m_config->get(tmp, &computer));
-
const char * hostname;
- require(computer->get("HostName", &hostname));
+ require(node->get("HostName", &hostname));
require(ctx.m_currentSection->put(data, hostname));
}
return true;
@@ -2522,9 +2874,9 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
Uint32 adder = 0;
ctx.m_userProperties.get("PortNumberAdder", &adder);
Uint32 base = 0;
- if(!ctx.m_userDefaults->get("PortNumber", &base) &&
+ if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) &&
!ctx.m_systemDefaults->get("PortNumber", &base)){
- return true;
+ return false;
}
ctx.m_currentSection->put("PortNumber", base + adder);
adder++;
@@ -2627,3 +2979,265 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){
}
return true;
}
+
+static
+bool
+transform(InitConfigFileParser::Context & ctx,
+ Properties & dst,
+ const char * oldName,
+ const char * newName,
+ double add, double mul){
+
+ if(ctx.m_currentSection->contains(newName)){
+ ctx.reportError("Both %s and %s specified"
+ " - [%s] starting at line: %d",
+ oldName, newName,
+ ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
+ PropertiesType oldType;
+ require(ctx.m_currentSection->getTypeOf(oldName, &oldType));
+ ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName);
+ if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64)
+ && (newType == ConfigInfo::INT || newType == ConfigInfo::INT64))){
+ ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s"
+ "- [%s] starting at line: %d",
+ oldName, newName,
+ ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+ Uint64 oldVal;
+ require(ctx.m_currentSection->get(oldName, &oldVal));
+
+ Uint64 newVal = (Uint64)(oldVal * mul + add);
+ if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){
+ ctx.reportError("Unable to handle deprication, new value not within bounds"
+ "%s %s - [%s] starting at line: %d",
+ oldName, newName,
+ ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
+ if(newType == ConfigInfo::INT){
+ require(dst.put(newName, (Uint32)newVal));
+ } else {
+ require(dst.put64(newName, newVal));
+ }
+ return true;
+}
+
+bool
+fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
+ /**
+ * Transform old values to new values
+ * Transform new values to old values (backward compatible)
+ */
+ Properties tmp;
+ Properties::Iterator it(ctx.m_currentSection);
+ for (const char* name = it.first(); name != NULL; name = it.next()) {
+ const DepricationTransform * p = &f_deprication[0];
+ while(p->m_section != 0){
+ if(strcmp(p->m_section, ctx.fname) == 0){
+ double mul = p->m_mul;
+ double add = p->m_add;
+ if(strcmp(name, p->m_oldName) == 0){
+ if(!transform(ctx, tmp, name, p->m_newName, add, mul)){
+ return false;
+ }
+ } else if(strcmp(name, p->m_newName) == 0) {
+ if(!transform(ctx, tmp, name, p->m_oldName, -add/mul,1.0/mul)){
+ return false;
+ }
+ }
+ }
+ p++;
+ }
+ }
+
+ Properties::Iterator it2(&tmp);
+ for (const char* name = it2.first(); name != NULL; name = it2.next()) {
+ PropertiesType type;
+ require(tmp.getTypeOf(name, &type));
+ switch(type){
+ case PropertiesType_Uint32:{
+ Uint32 val;
+ require(tmp.get(name, &val));
+ ::require(ctx.m_currentSection->put(name, val));
+ break;
+ }
+ case PropertiesType_char:{
+ const char * val;
+ require(tmp.get(name, &val));
+ ::require(ctx.m_currentSection->put(name, val));
+ break;
+ }
+ case PropertiesType_Uint64:{
+ Uint64 val;
+ require(tmp.get(name, &val));
+ ::require(ctx.m_currentSection->put64(name, val));
+ break;
+ }
+ case PropertiesType_Properties:
+ default:
+ abort();
+ }
+ }
+ return true;
+}
+
+bool
+saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
+ const Properties * sec;
+ if(!ctx.m_currentInfo->get(ctx.fname, &sec)){
+ abort();
+ return false;
+ }
+
+ do {
+ const char *secName;
+ Uint32 id, status, typeVal;
+ require(sec->get("Fname", &secName));
+ require(sec->get("Id", &id));
+ require(sec->get("Status", &status));
+ require(sec->get("Default", &typeVal));
+
+ if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){
+ ndbout_c("skipping section %s", ctx.fname);
+ break;
+ }
+
+ Uint32 no = 0;
+ ctx.m_userProperties.get("$Section", id, &no);
+ ctx.m_userProperties.put("$Section", id, no+1, true);
+
+ ctx.m_configValues.openSection(id, no);
+ ctx.m_configValues.put(CFG_TYPE_OF_SECTION, typeVal);
+
+ Properties::Iterator it(ctx.m_currentSection);
+ for (const char* n = it.first(); n != NULL; n = it.next()) {
+ const Properties * info;
+ if(!ctx.m_currentInfo->get(n, &info))
+ continue;
+
+ Uint32 id = 0;
+ info->get("Id", &id);
+
+ if(id == KEY_INTERNAL)
+ continue;
+
+ bool ok = true;
+ PropertiesType type;
+ require(ctx.m_currentSection->getTypeOf(n, &type));
+ switch(type){
+ case PropertiesType_Uint32:{
+ Uint32 val;
+ require(ctx.m_currentSection->get(n, &val));
+ ok = ctx.m_configValues.put(id, val);
+ break;
+ }
+ case PropertiesType_Uint64:{
+ Uint64 val;
+ require(ctx.m_currentSection->get(n, &val));
+ ok = ctx.m_configValues.put64(id, val);
+ break;
+ }
+ case PropertiesType_char:{
+ const char * val;
+ require(ctx.m_currentSection->get(n, &val));
+ ok = ctx.m_configValues.put(id, val);
+ break;
+ }
+ default:
+ abort();
+ }
+ }
+ ctx.m_configValues.closeSection();
+ } while(0);
+ return true;
+}
+
+bool
+addNodeConnections(Vector<ConfigInfo::ConfigRuleSection>&sections,
+ struct InitConfigFileParser::Context &ctx,
+ const char * ruleData)
+{
+ Properties * props= ctx.m_config;
+ Properties p_connections;
+ Properties p_connections2;
+
+ for (Uint32 i = 0;; i++){
+ const Properties * tmp;
+ Uint32 nodeId1, nodeId2;
+
+ if(!props->get("Connection", i, &tmp)) break;
+
+ if(!tmp->get("NodeId1", &nodeId1)) continue;
+ p_connections.put("", nodeId1, nodeId1);
+ if(!tmp->get("NodeId2", &nodeId2)) continue;
+ p_connections.put("", nodeId2, nodeId2);
+
+ p_connections2.put("", nodeId1 + nodeId2<<16, nodeId1);
+ p_connections2.put("", nodeId2 + nodeId1<<16, nodeId2);
+ }
+
+ Uint32 nNodes;
+ ctx.m_userProperties.get("NoOfNodes", &nNodes);
+
+ Properties p_db_nodes;
+ Properties p_api_mgm_nodes;
+
+ Uint32 i_db= 0, i_api_mgm= 0;
+ for (Uint32 i= 0, n= 0; n < nNodes; i++){
+ const Properties * tmp;
+ if(!props->get("Node", i, &tmp)) continue;
+ n++;
+
+ const char * type;
+ if(!tmp->get("Type", &type)) continue;
+
+ if (strcmp(type,"DB") == 0)
+ p_db_nodes.put("", i_db++, i);
+ else if (strcmp(type,"API") == 0 ||
+ strcmp(type,"MGM") == 0)
+ p_api_mgm_nodes.put("", i_api_mgm++, i);
+ }
+
+ Uint32 nodeId1, nodeId2, dummy;
+
+ for (Uint32 i= 0; p_db_nodes.get("", i, &nodeId1); i++){
+ for (Uint32 j= i+1;; j++){
+ if(!p_db_nodes.get("", j, &nodeId2)) break;
+ if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) {
+ ConfigInfo::ConfigRuleSection s;
+ s.m_sectionType= BaseString("TCP");
+ s.m_sectionData= new Properties;
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", nodeId1);
+ s.m_sectionData->put("NodeId1", buf);
+ snprintf(buf, sizeof(buf), "%u", nodeId2);
+ s.m_sectionData->put("NodeId2", buf);
+ sections.push_back(s);
+ }
+ }
+ }
+
+ for (Uint32 i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
+ if(!p_connections.get("", nodeId1, &dummy)) {
+ for (Uint32 j= 0;; j++){
+ if(!p_db_nodes.get("", j, &nodeId2)) break;
+ ConfigInfo::ConfigRuleSection s;
+ s.m_sectionType= BaseString("TCP");
+ s.m_sectionData= new Properties;
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%u", nodeId1);
+ s.m_sectionData->put("NodeId1", buf);
+ snprintf(buf, sizeof(buf), "%u", nodeId2);
+ s.m_sectionData->put("NodeId2", buf);
+ sections.push_back(s);
+ }
+ }
+ }
+
+ return true;
+}
diff --git a/ndb/src/common/mgmcommon/ConfigInfo.hpp b/ndb/src/common/mgmcommon/ConfigInfo.hpp
index 43041a3f772..79c17b436fe 100644
--- a/ndb/src/common/mgmcommon/ConfigInfo.hpp
+++ b/ndb/src/common/mgmcommon/ConfigInfo.hpp
@@ -27,8 +27,8 @@
* A MANDATORY parameters must be specified in the config file
* An UNDEFINED parameter may or may not be specified in the config file
*/
-static const Uint32 MANDATORY = ~0; // Default value for mandatory params.
-static const Uint32 UNDEFINED = (~0)-1; // Default value for undefined params.
+static const Uint64 MANDATORY = ~0; // Default value for mandatory params.
+static const Uint64 UNDEFINED = (~0)-1; // Default value for undefined params.
/**
* @class ConfigInfo
@@ -38,27 +38,27 @@ static const Uint32 UNDEFINED = (~0)-1; // Default value for undefined params.
*/
class ConfigInfo {
public:
- enum Type {BOOL, INT, STRING};
- enum Status {USED, ///< Active
- DEPRICATED, ///< Can be, but should not be used anymore
- NOTIMPLEMENTED, ///< Can not be used currently. Is ignored.
- INTERNAL ///< Not configurable by the user
+ enum Type { BOOL, INT, INT64, STRING, SECTION };
+ enum Status { USED, ///< Active
+ DEPRICATED, ///< Can be, but shouldn't
+ NOTIMPLEMENTED, ///< Is ignored.
+ INTERNAL ///< Not configurable by the user
};
/**
* Entry for one configuration parameter
*/
struct ParamInfo {
+ Uint32 _paramId;
const char* _fname;
- const char* _pname;
const char* _section;
const char* _description;
Status _status;
bool _updateable;
Type _type;
- Uint32 _default;
- Uint32 _min;
- Uint32 _max;
+ Uint64 _default;
+ Uint64 _min;
+ Uint64 _max;
};
/**
@@ -71,6 +71,21 @@ public:
const char * m_ruleData;
};
+ /**
+ * Entry for config rule
+ */
+ struct ConfigRuleSection {
+ BaseString m_sectionType;
+ Properties * m_sectionData;
+ };
+
+ struct ConfigRule {
+ bool (* m_configRule)(Vector<ConfigRuleSection>&,
+ struct InitConfigFileParser::Context &,
+ const char * m_ruleData);
+ const char * m_ruleData;
+ };
+
ConfigInfo();
/**
@@ -84,16 +99,15 @@ public:
*
* @note Result is not defined if section/name are wrong!
*/
- bool verify(const Properties* section, const char* fname, Uint32 value) const;
+ bool verify(const Properties* secti, const char* fname, Uint64 value) const;
bool isSection(const char*) const;
- const char* getPName(const Properties * section, const char* fname) const;
- const char* getDescription(const Properties * section, const char* fname) const;
+ const char* getDescription(const Properties * sec, const char* fname) const;
Type getType(const Properties * section, const char* fname) const;
Status getStatus(const Properties* section, const char* fname) const;
- Uint32 getMin(const Properties * section, const char* fname) const;
- Uint32 getMax(const Properties * section, const char* fname) const;
- Uint32 getDefault(const Properties * section, const char* fname) const;
+ Uint64 getMin(const Properties * section, const char* fname) const;
+ Uint64 getMax(const Properties * section, const char* fname) const;
+ Uint64 getDefault(const Properties * section, const char* fname) const;
const Properties * getInfo(const char * section) const;
const Properties * getDefaults(const char * section) const;
@@ -114,6 +128,7 @@ private:
public:
static const SectionRule m_SectionRules[];
+ static const ConfigRule m_ConfigRules[];
static const int m_NoOfRules;
};
diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
index 04dc5466bbc..d2c622593de 100644
--- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp
+++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp
@@ -33,6 +33,12 @@
#include <socket_io.h>
#include <NdbConfig.h>
+#include <NdbAutoPtr.hpp>
+
+#include <mgmapi.h>
+#include <mgmapi_config_parameters.h>
+#include <ConfigValues.hpp>
+#include <NdbHost.h>
//****************************************************************************
//****************************************************************************
@@ -83,41 +89,10 @@ ConfigRetriever::init(bool onlyNodeId) {
//****************************************************************************
//****************************************************************************
-
-Properties *
-ConfigRetriever::getConfig(const char * nodeType, int versionId) {
- Properties * p = getConfig(versionId);
-
- if (p == 0) {
- char err_buf[255];
- snprintf(err_buf, sizeof(err_buf),
- "No configuration retrieved for this %s node ", nodeType);
- setError(CR_ERROR, err_buf);
- return 0;
- }
-
- const Uint32 nodeId = _ownNodeId;
-
- if (strcmp(nodeType, "DB") == 0) {
- if (!verifyProperties("DB", p, nodeId, versionId)) return 0;
- } else if (strcmp(nodeType, "API") == 0) {
- if (!verifyProperties("API", p, nodeId, versionId)) return 0;
- } else if (strcmp(nodeType, "REP") == 0) {
- if (!verifyProperties("REP", p, nodeId, versionId)) return 0;
- } else if (strcmp(nodeType, "MGM") == 0) {
- if (!verifyProperties("MGM", p, nodeId, versionId)) return 0;
- } else {
- return 0;
- }
-
- return p;
-}
-
-
//****************************************************************************
//****************************************************************************
-Properties *
-ConfigRetriever::getConfig(int verId) {
+struct ndb_mgm_configuration*
+ConfigRetriever::getConfig(int verId, int nodeType) {
int res = init();
if (res == -1) {
@@ -125,7 +100,7 @@ ConfigRetriever::getConfig(int verId) {
}
if (_localConfig->items == 0){
- setError(CR_ERROR, "No Management Servers configured in local config file");
+ setError(CR_ERROR,"No Management Servers configured in local config file");
return 0;
}
@@ -136,14 +111,13 @@ ConfigRetriever::getConfig(int verId) {
Uint32 type = CR_ERROR;
for (int i = 0; i<_localConfig->items; i++){
MgmtSrvrId * m = _localConfig->ids[i];
- Properties * p = 0;
- const Uint32 nodeId = _ownNodeId;
+ struct ndb_mgm_configuration * p = 0;
switch(m->type){
case MgmId_TCP:
- p = getConfig(m->data.tcp.remoteHost, m->data.tcp.port, nodeId, verId);
+ p = getConfig(m->data.tcp.remoteHost, m->data.tcp.port, verId);
break;
case MgmId_File:
- p = getConfig(m->data.file.filename, nodeId, verId);
+ p = getConfig(m->data.file.filename, verId);
break;
default:
setError(CR_ERROR, "Unknown error type");
@@ -151,6 +125,10 @@ ConfigRetriever::getConfig(int verId) {
}
if (p != 0) {
+ if(!verifyConfig(p, nodeType)){
+ free(p);
+ return 0;
+ }
return p;
}
if(latestErrorType == CR_RETRY)
@@ -161,110 +139,49 @@ ConfigRetriever::getConfig(int verId) {
REPORT_WARNING("Failed to retrieve cluster configuration");
ndbout << "(Cause of failure: " << getErrorString() << ")" << endl;
ndbout << "Attempt " << retry << " of " << retry_max << ". "
- << "Trying again in "<<retry_interval<<" seconds..." << endl << endl;
+ << "Trying again in "<< retry_interval <<" seconds..."
+ << endl << endl;
NdbSleep_SecSleep(retry_interval);
} else {
break;
}
retry++;
-
+
} while (retry <= retry_max);
return 0;
}
-int global_ndb_check = 0; // set to one in ndb main;
-Properties *
+ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * mgmhost,
- unsigned int port,
- Uint32 nodeId,
+ short port,
int versionId){
- const int socketTimeout = 10000;
- int result;
- const NDB_SOCKET_TYPE sockfd = socket(AF_INET, SOCK_STREAM, 0);
- if (sockfd == NDB_INVALID_SOCKET) {
- setError(CR_RETRY, "Could not create socket to Management Server");
+
+ NdbMgmHandle h;
+ h = ndb_mgm_create_handle();
+ if (h == NULL) {
+ setError(CR_ERROR, "Unable to allocate mgm handle");
return 0;
}
- char err_buf[255];
- struct sockaddr_in servaddr;
- memset(&servaddr, 0, sizeof(servaddr));
- servaddr.sin_family = AF_INET;
- servaddr.sin_port = htons(port);
- // Convert ip address presentation format to numeric format
- result = Ndb_getInAddr(&servaddr.sin_addr, mgmhost);
- if (result != 0) {
- snprintf(err_buf, sizeof(err_buf),
- "Name lookup failed: host \"%s\"", mgmhost);
- setError(CR_ERROR, err_buf);
+ BaseString tmp;
+ tmp.assfmt("%s:%d", mgmhost, port);
+ if (ndb_mgm_connect(h, tmp.c_str()) != 0) {
+ setError(CR_RETRY, ndb_mgm_get_latest_error_desc(h));
+ ndb_mgm_destroy_handle(&h);
return 0;
}
- result = connect(sockfd, (struct sockaddr*) &servaddr, sizeof(servaddr));
- if (result == -1) {
- snprintf(err_buf, sizeof(err_buf),
- "Failed to connect to \"%s:%d\"", mgmhost, port);
- setError(CR_RETRY, err_buf);
- NDB_CLOSE_SOCKET(sockfd);
- return 0;
+ ndb_mgm_configuration * conf = ndb_mgm_get_configuration(h, versionId);
+ if(conf == 0){
+ setError(CR_ERROR, ndb_mgm_get_latest_error_desc(h));
}
-
- if(println_socket(sockfd, 1000, "GET CONFIG %d %d" ,
- versionId, nodeId) != 0){
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, "IO error, write");
- return 0;
- }
-
- char buf[255];
- {
- const int tmp = readln_socket(sockfd, socketTimeout, buf, 255);
- if(tmp == -1){
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, "IO error, read");
- return 0;
- }
- if(tmp == 0){
- snprintf(err_buf, 256,
- "IO error, failed request: "
- "GET CONFIG %d %d", versionId, nodeId);
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, err_buf);
- return 0;
- }
- }
+ ndb_mgm_disconnect(h);
+ ndb_mgm_destroy_handle(&h);
- int status, version, node, bytes, bytesUU;
- if(sscanf(buf, "GET CONFIG %d %d %d %d %d",
- &status, &version, &node, &bytes, &bytesUU) != 5){
- NDB_CLOSE_SOCKET(sockfd);
- snprintf(err_buf, sizeof(err_buf),
- "Invalid response: %s", buf);
- setError(CR_ERROR, err_buf);
- return 0;
- }
-
- if(status != 0){
- NDB_CLOSE_SOCKET(sockfd);
- if (status == 1){
- snprintf(err_buf, sizeof(err_buf),
- "Management Server: Requested version id is invalid");
- } else if (status == 2){
- snprintf(err_buf, sizeof(err_buf),
- "Management Server: Node with id %d has not been specified",
- nodeId);
- } else if (status == 3){
- snprintf(err_buf, sizeof(err_buf), "Management Server: Internal error");
- } else {
- snprintf(err_buf, sizeof(err_buf),
- "Management Server returned unknown error: %d", status);
- }
- setError(CR_ERROR, err_buf);
- return 0;
- }
-
+ return conf;
+#if 0
bool compatible;
if (global_ndb_check)
compatible = ndbCompatible_ndb_mgmt(versionId, version);
@@ -278,90 +195,11 @@ ConfigRetriever::getConfig(const char * mgmhost,
setError(CR_ERROR, err_buf);
return 0;
}
-
- if(node != (int)nodeId){
- NDB_CLOSE_SOCKET(sockfd);
- snprintf(err_buf, sizeof(err_buf), "Management Server: Invalid node id. "
- "Node id from server: %d Own node id: %d", node, nodeId);
- setError(CR_ERROR, err_buf);
- return 0;
- }
-
- if(readln_socket(sockfd, socketTimeout, buf, 255) == -1){
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, "IO error, read");
- return 0;
- }
-
- if(strncmp("begin", buf, strlen("begin")) != 0){
- NDB_CLOSE_SOCKET(sockfd);
- snprintf(err_buf, sizeof(err_buf),
- "Invalid response: %s", buf);
- setError(CR_ERROR, err_buf);
- return 0;
- }
-
- char* bufUU = new char[bytesUU];
- int read = 0;
- int start = 0;
- do {
- if((read = read_socket(sockfd, socketTimeout, &bufUU[start], bytesUU-start)) == -1){
- delete[] bufUU;
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, "IO error, read(bufUU)");
- return 0;
- }
- start += read;
- } while(start < bytesUU);
-
- Uint32 * buf2 = new Uint32[bytes/4+1]; // Properties byte size
- char * dst = (char *)buf2;
- int sz = 0;
- start = 0;
-
- for (int i = 0; i < bytesUU; i++) {
- if (bufUU[i] == '\n') {
- bufUU[i] = 0;
- if (bufUU[i-1] == '\r') {
- bufUU[i-1] = 0;
- }
- sz = uudecode_mem(dst, bytes, &bufUU[start]);
- dst += sz;
- start = i + 1; // Next row
- }
- }
-
- delete[] bufUU;
-
- if(sz < 0){
- delete []buf2;
- NDB_CLOSE_SOCKET(sockfd);
- setError(CR_ERROR, "IO error, sz < 0");
- return 0;
- }
-
- Properties * p = new Properties();
- if(!p->unpack(buf2, bytes+4)){
- snprintf(buf, sizeof(buf), "Error while unpacking %d,%d",
- p->getPropertiesErrno(),
- p->getOSErrno());
- setError(CR_ERROR, buf);
- delete []buf2;
- delete p;
- return 0;
- }
- delete []buf2;
-
- NDB_CLOSE_SOCKET(sockfd);
-
- return p;
-
+#endif
}
-Properties *
-ConfigRetriever::getConfig(const char * filename,
- Uint32 nodeId,
- int versionId){
+ndb_mgm_configuration *
+ConfigRetriever::getConfig(const char * filename, int versionId){
struct stat sbuf;
const int res = stat(filename, &sbuf);
@@ -389,74 +227,19 @@ ConfigRetriever::getConfig(const char * filename,
return 0;
}
- Properties * p = new Properties();
- if(!p->unpack(buf2, bytes+4)){
+ ConfigValuesFactory cvf;
+ if(!cvf.unpack(buf2, bytes)){
char buf[255];
- snprintf(buf, sizeof(buf), "Error while unpacking %d,%d",
- p->getPropertiesErrno(),
- p->getOSErrno());
+ snprintf(buf, sizeof(buf), "Error while unpacking");
setError(CR_ERROR, buf);
delete []buf2;
- delete p;
return 0;
}
delete [] buf2;
- return p;
+ return (ndb_mgm_configuration*)cvf.m_cfg;
}
-bool
-ConfigRetriever::verifyProperties(const char* nodeType, Properties * p,
- Uint32 nodeId, int versionId){
-
- Uint32 t = 0;
- const Properties *tmp;
- const char *type;
-
- if (p == 0) return false;
-
- bool compatible = false;
- if (p->get("Version", &t))
- if (global_ndb_check)
- compatible = ndbCompatible_ndb_mgmt(versionId, t);
- else
- compatible = ndbCompatible_api_mgmt(versionId, t);
-
- if(!compatible){ // if(!p->get("Version", &t) || versionId != (int)t){
- setError(CR_ERROR, "Invalid configuration version");
- delete p;
- return false;
- }
-
- if(!p->get("LocalNodeId", &t) || nodeId != t){
- setError(CR_ERROR, "Invalid node identity in configuration");
- delete p;
- return false;
- }
-
- if(!p->get("Node", nodeId, &tmp)){
- setError(CR_ERROR, "Internal error while processing configuration");
- ndbout_c("nodeId = %d", nodeId);
- p->print();
- delete p;
- return false;
- }
-
- if(!tmp->get("Type", &type) || strcmp(type, nodeType)) {
- if (!(!strcmp(type, "REP") && !strcmp(nodeType, "API"))) {
- char buf[1024];
- snprintf(buf, sizeof(buf),
- "Configuration error: Node with id %d is not of type %s.\n"
- "Check local config file: %s", nodeId, nodeType,
- _localConfigFileName);
- setError(CR_ERROR, buf);
- return false;
- }
- }
-
- return true;
-}
-
void
ConfigRetriever::setError(ErrorType et, const char * s){
if(errorString != 0){
@@ -509,3 +292,82 @@ ConfigRetriever::setDefaultConnectString(const char * defaultConnectString) {
m_defaultConnectString = 0;
}
}
+
+bool
+ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf,
+ int type){
+ char buf[255];
+ ndb_mgm_configuration_iterator * it;
+ it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, CFG_SECTION_NODE);
+
+ if(it == 0){
+ snprintf(buf, 255, "Unable to create config iterator");
+ setError(CR_ERROR, buf);
+ return false;
+
+ }
+ NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it);
+
+ if(ndb_mgm_find(it, CFG_NODE_ID, getOwnNodeId()) != 0){
+ snprintf(buf, 255, "Unable to find node with id: %d", getOwnNodeId());
+ setError(CR_ERROR, buf);
+ return false;
+ }
+
+ const char * hostname;
+ if(ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &hostname)){
+ snprintf(buf, 255, "Unable to get hostname(%d) from config",CFG_NODE_HOST);
+ setError(CR_ERROR, buf);
+ return false;
+ }
+
+ char localhost[MAXHOSTNAMELEN];
+ if(NdbHost_GetHostName(localhost) != 0){
+ snprintf(buf, 255, "Unable to own hostname");
+ setError(CR_ERROR, buf);
+ return false;
+ }
+
+ do {
+ if(strcasecmp(hostname, localhost) == 0)
+ break;
+
+ if(strcasecmp(hostname, "localhost") == 0)
+ break;
+
+ struct in_addr local, config;
+ bool b1 = false, b2 = false, b3 = false;
+ b1 = Ndb_getInAddr(&local, localhost) == 0;
+ b2 = Ndb_getInAddr(&config, hostname) == 0;
+ b3 = memcmp(&local, &config, sizeof(local)) == 0;
+
+ if(b1 && b2 && b3)
+ break;
+
+ b1 = Ndb_getInAddr(&local, "localhost") == 0;
+ b3 = memcmp(&local, &config, sizeof(local)) == 0;
+ if(b1 && b2 && b3)
+ break;
+
+ snprintf(buf, 255, "Local hostname(%s) and config hostname(%s) dont match",
+ localhost, hostname);
+ setError(CR_ERROR, buf);
+ return false;
+ } while(false);
+
+ unsigned int _type;
+ if(ndb_mgm_get_int_parameter(it, CFG_TYPE_OF_SECTION, &_type)){
+ snprintf(buf, 255, "Unable to get type of node(%d) from config",
+ CFG_TYPE_OF_SECTION);
+ setError(CR_ERROR, buf);
+ return false;
+ }
+
+ if(_type != type){
+ snprintf(buf, 255, "Supplied node type(%d) and config node type(%d) "
+ " don't match", type, _type);
+ setError(CR_ERROR, buf);
+ return false;
+ }
+ return true;
+}
diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp
index f75cf806cc0..ba5fe7ace80 100644
--- a/ndb/src/common/mgmcommon/IPCConfig.cpp
+++ b/ndb/src/common/mgmcommon/IPCConfig.cpp
@@ -17,10 +17,14 @@
#include "IPCConfig.hpp"
#include <NdbOut.hpp>
#include <NdbHost.h>
+
#include <TransporterDefinitions.hpp>
#include <TransporterRegistry.hpp>
#include <Properties.hpp>
+#include <mgmapi_configuration.hpp>
+#include <mgmapi_config_parameters.h>
+
#if defined DEBUG_TRANSPORTER
#define DEBUG(t) ndbout << __FILE__ << ":" << __LINE__ << ":" << t << endl;
#else
@@ -334,3 +338,158 @@ IPCConfig::getNodeType(NodeId id) const {
return out;
}
+
+Uint32
+IPCConfig::configureTransporters(Uint32 nodeId,
+ const class ndb_mgm_configuration & config,
+ class TransporterRegistry & tr){
+
+ Uint32 noOfTransportersCreated = 0;
+ ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION);
+
+ for(iter.first(); iter.valid(); iter.next()){
+
+ Uint32 nodeId1, nodeId2, remoteNodeId;
+ if(iter.get(CFG_CONNECTION_NODE_1, &nodeId1)) continue;
+ if(iter.get(CFG_CONNECTION_NODE_2, &nodeId2)) continue;
+
+ if(nodeId1 != nodeId && nodeId2 != nodeId) continue;
+ remoteNodeId = (nodeId == nodeId1 ? nodeId2 : nodeId1);
+
+ Uint32 sendSignalId = 1;
+ Uint32 checksum = 1;
+ if(iter.get(CFG_CONNECTION_SEND_SIGNAL_ID, &sendSignalId)) continue;
+ if(iter.get(CFG_CONNECTION_CHECKSUM, &checksum)) continue;
+
+ Uint32 type = ~0;
+ if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue;
+
+ switch(type){
+ case CONNECTION_TYPE_SHM:{
+ SHM_TransporterConfiguration conf;
+ conf.localNodeId = nodeId;
+ conf.remoteNodeId = remoteNodeId;
+ conf.byteOrder = 0;
+ conf.compression = 0;
+ conf.checksum = checksum;
+ conf.signalId = sendSignalId;
+
+ if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break;
+ if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break;
+
+ if(!tr.createTransporter(&conf)){
+ ndbout << "Failed to create SHM Transporter from: "
+ << conf.localNodeId << " to: " << conf.remoteNodeId << endl;
+ } else {
+ noOfTransportersCreated++;
+ }
+ break;
+ }
+ case CONNECTION_TYPE_SCI:{
+ SCI_TransporterConfiguration conf;
+ conf.localNodeId = nodeId;
+ conf.remoteNodeId = remoteNodeId;
+ conf.byteOrder = 0;
+ conf.compression = 0;
+ conf.checksum = checksum;
+ conf.signalId = sendSignalId;
+
+ if(iter.get(CFG_SCI_SEND_LIMIT, &conf.sendLimit)) break;
+ if(iter.get(CFG_SCI_BUFFER_MEM, &conf.bufferSize)) break;
+
+ if(nodeId == nodeId1){
+ if(iter.get(CFG_SCI_NODE1_ADAPTERS, &conf.nLocalAdapters)) break;
+ if(iter.get(CFG_SCI_NODE2_ADAPTERS, &conf.nRemoteAdapters)) break;
+ if(iter.get(CFG_SCI_NODE2_ADAPTER0, &conf.remoteSciNodeId0)) break;
+ if(conf.nRemoteAdapters > 1){
+ if(iter.get(CFG_SCI_NODE2_ADAPTER1, &conf.remoteSciNodeId1)) break;
+ }
+ } else {
+ if(iter.get(CFG_SCI_NODE2_ADAPTERS, &conf.nLocalAdapters)) break;
+ if(iter.get(CFG_SCI_NODE1_ADAPTERS, &conf.nRemoteAdapters)) break;
+ if(iter.get(CFG_SCI_NODE1_ADAPTER0, &conf.remoteSciNodeId0)) break;
+ if(conf.nRemoteAdapters > 1){
+ if(iter.get(CFG_SCI_NODE1_ADAPTER1, &conf.remoteSciNodeId1)) break;
+ }
+ }
+
+ if(!tr.createTransporter(&conf)){
+ ndbout << "Failed to create SCI Transporter from: "
+ << conf.localNodeId << " to: " << conf.remoteNodeId << endl;
+ } else {
+ noOfTransportersCreated++;
+ continue;
+ }
+ }
+ case CONNECTION_TYPE_TCP:{
+ TCP_TransporterConfiguration conf;
+
+ const char * host1, * host2;
+ if(iter.get(CFG_TCP_HOSTNAME_1, &host1)) break;
+ if(iter.get(CFG_TCP_HOSTNAME_2, &host2)) break;
+
+ if(iter.get(CFG_TCP_SERVER_PORT, &conf.port)) break;
+ if(iter.get(CFG_TCP_SEND_BUFFER_SIZE, &conf.sendBufferSize)) break;
+ if(iter.get(CFG_TCP_RECEIVE_BUFFER_SIZE, &conf.maxReceiveSize)) break;
+
+ const char * proxy;
+ if (!iter.get(CFG_TCP_PROXY, &proxy)) {
+ if (strlen(proxy) > 0 && nodeId2 == nodeId) {
+ // TODO handle host:port
+ conf.port = atoi(proxy);
+ }
+ }
+
+ conf.localNodeId = nodeId;
+ conf.remoteNodeId = remoteNodeId;
+ conf.localHostName = (nodeId == nodeId1 ? host1 : host2);
+ conf.remoteHostName = (nodeId == nodeId1 ? host2 : host1);
+ conf.byteOrder = 0;
+ conf.compression = 0;
+ conf.checksum = checksum;
+ conf.signalId = sendSignalId;
+
+ if(!tr.createTransporter(&conf)){
+ ndbout << "Failed to create TCP Transporter from: "
+ << nodeId << " to: " << remoteNodeId << endl;
+ } else {
+ noOfTransportersCreated++;
+ }
+ case CONNECTION_TYPE_OSE:{
+ OSE_TransporterConfiguration conf;
+
+ const char * host1, * host2;
+ if(iter.get(CFG_OSE_HOSTNAME_1, &host1)) break;
+ if(iter.get(CFG_OSE_HOSTNAME_2, &host2)) break;
+
+ if(iter.get(CFG_OSE_PRIO_A_SIZE, &conf.prioASignalSize)) break;
+ if(iter.get(CFG_OSE_PRIO_B_SIZE, &conf.prioBSignalSize)) break;
+ if(iter.get(CFG_OSE_RECEIVE_ARRAY_SIZE, &conf.receiveBufferSize)) break;
+
+ conf.localNodeId = nodeId;
+ conf.remoteNodeId = remoteNodeId;
+ conf.localHostName = (nodeId == nodeId1 ? host1 : host2);
+ conf.remoteHostName = (nodeId == nodeId1 ? host2 : host1);
+ conf.byteOrder = 0;
+ conf.compression = 0;
+ conf.checksum = checksum;
+ conf.signalId = sendSignalId;
+
+ if(!tr.createTransporter(&conf)){
+ ndbout << "Failed to create OSE Transporter from: "
+ << nodeId << " to: " << remoteNodeId << endl;
+ } else {
+ noOfTransportersCreated++;
+ }
+ }
+ default:
+ ndbout << "Unknown transporter type from: " << nodeId <<
+ " to: " << remoteNodeId << endl;
+ break;
+ }
+ }
+ }
+
+ return noOfTransportersCreated;
+}
+
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
index 62c4bd28857..d52bc54db52 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp
@@ -22,7 +22,7 @@
#include <NdbOut.hpp>
#include "ConfigInfo.hpp"
-const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file
+const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file
static void trim(char *);
static void require(bool v) { if(!v) abort();}
@@ -30,51 +30,66 @@ static void require(bool v) { if(!v) abort();}
//****************************************************************************
// Ctor / Dtor
//****************************************************************************
-InitConfigFileParser::InitConfigFileParser(const char* initialConfigFileName){
-
- m_initConfigStream = fopen(initialConfigFileName, "r");
+InitConfigFileParser::InitConfigFileParser(){
m_info = new ConfigInfo();
- m_config = new Config();
- m_defaults = new Properties();
- m_defaults->setCaseInsensitiveNames(true);
}
InitConfigFileParser::~InitConfigFileParser() {
- if (m_initConfigStream != NULL) fclose(m_initConfigStream);
-
delete m_info;
- delete m_config;
- delete m_defaults;
}
//****************************************************************************
// Read Config File
//****************************************************************************
-bool InitConfigFileParser::readConfigFile() {
+InitConfigFileParser::Context::Context(const ConfigInfo * info)
+ : m_configValues(1000, 20) {
+
+ m_config = new Properties();
+ m_defaults = new Properties();
+}
+
+InitConfigFileParser::Context::~Context(){
+ if(m_config != 0)
+ delete m_config;
+
+ if(m_defaults != 0)
+ delete m_defaults;
+}
+
+Config *
+InitConfigFileParser::parseConfig(const char * filename) {
+ FILE * file = fopen(filename, "r");
+ if(file == 0){
+ ndbout << "Error opening file: " << filename << endl;
+ return 0;
+ }
+
+ Config * ret = parseConfig(file);
+ fclose(file);
+ return ret;
+}
+
+Config *
+InitConfigFileParser::parseConfig(FILE * file) {
char line[MAX_LINE_LENGTH];
- Context ctx;
+ Context ctx(m_info);
ctx.m_lineno = 0;
ctx.m_currentSection = 0;
- ctx.m_info = m_info;
- ctx.m_config = m_config;
- ctx.m_defaults = m_defaults;
-
/*************
* Open file *
*************/
- if (m_initConfigStream == NULL) {
- ctx.reportError("Could not open file.");
- return false;
+ if (file == NULL) {
+ return 0;
}
/***********************
* While lines to read *
***********************/
- while (fgets(line, MAX_LINE_LENGTH, m_initConfigStream)) {
+ while (fgets(line, MAX_LINE_LENGTH, file)) {
ctx.m_lineno++;
trim(line);
@@ -94,7 +109,7 @@ bool InitConfigFileParser::readConfigFile() {
free(section);
ctx.reportError("Could not store previous default section "
"of configuration file.");
- return false;
+ return 0;
}
snprintf(ctx.fname, sizeof(ctx.fname), section); free(section);
@@ -115,7 +130,7 @@ bool InitConfigFileParser::readConfigFile() {
free(section);
ctx.reportError("Could not store previous section "
"of configuration file.");
- return false;
+ return 0;
}
snprintf(ctx.fname, sizeof(ctx.fname), section);
@@ -123,7 +138,7 @@ bool InitConfigFileParser::readConfigFile() {
ctx.type = InitConfigFileParser::Section;
ctx.m_sectionLineno = ctx.m_lineno;
ctx.m_currentSection = new Properties();
- ctx.m_userDefaults = getSection(ctx.fname, m_defaults);
+ ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults);
ctx.m_currentInfo = m_info->getInfo(ctx.fname);
ctx.m_systemDefaults = m_info->getDefaults(ctx.fname);
continue;
@@ -134,15 +149,44 @@ bool InitConfigFileParser::readConfigFile() {
****************************/
if (!parseNameValuePair(ctx, line)) {
ctx.reportError("Could not parse name-value pair in config file.");
- return false;
+ return 0;
}
}
+ if (ferror(file)){
+ ctx.reportError("Failure in reading");
+ return 0;
+ }
+
if(!storeSection(ctx)) {
ctx.reportError("Could not store section of configuration file.");
- return false;
+ return 0;
}
+ for(size_t i = 0; ConfigInfo::m_ConfigRules[i].m_configRule != 0; i++){
+ ctx.type = InitConfigFileParser::Undefined;
+ ctx.m_currentSection = 0;
+ ctx.m_userDefaults = 0;
+ ctx.m_currentInfo = 0;
+ ctx.m_systemDefaults = 0;
+
+ Vector<ConfigInfo::ConfigRuleSection> tmp;
+ if(!(* ConfigInfo::m_ConfigRules[i].m_configRule)(tmp, ctx,
+ ConfigInfo::m_ConfigRules[i].m_ruleData))
+ return 0;
+
+ for(size_t j = 0; j<tmp.size(); j++){
+ snprintf(ctx.fname, sizeof(ctx.fname), tmp[j].m_sectionType.c_str());
+ ctx.type = InitConfigFileParser::Section;
+ ctx.m_currentSection = tmp[j].m_sectionData;
+ ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults);
+ ctx.m_currentInfo = m_info->getInfo(ctx.fname);
+ ctx.m_systemDefaults = m_info->getDefaults(ctx.fname);
+ if(!storeSection(ctx))
+ return 0;
+ }
+ }
+
Uint32 nConnections = 0;
Uint32 nComputers = 0;
Uint32 nNodes = 0;
@@ -153,21 +197,20 @@ bool InitConfigFileParser::readConfigFile() {
ctx.m_userProperties.get("NoOfNodes", &nNodes);
ctx.m_userProperties.get("ExtNoOfConnections", &nExtConnections);
ctx.m_userProperties.get("ExtSystem", &system);
- m_config->put("NoOfConnections", nConnections);
- m_config->put("NoOfComputers", nComputers);
- m_config->put("NoOfNodes", nNodes);
+ ctx.m_config->put("NoOfConnections", nConnections);
+ ctx.m_config->put("NoOfComputers", nComputers);
+ ctx.m_config->put("NoOfNodes", nNodes);
char tmpLine[MAX_LINE_LENGTH];
snprintf(tmpLine, MAX_LINE_LENGTH, "EXTERNAL SYSTEM_");
strncat(tmpLine, system, MAX_LINE_LENGTH);
strncat(tmpLine, ":NoOfConnections", MAX_LINE_LENGTH);
- m_config->put(tmpLine, nExtConnections);
+ ctx.m_config->put(tmpLine, nExtConnections);
- if (ferror(m_initConfigStream)) {
- ctx.reportError("Failure in reading");
- return false;
- }
- return true;
+ Config * ret = new Config();
+ ret->m_configValues = (struct ndb_mgm_configuration*)ctx.m_configValues.getConfigValues();
+ ret->m_oldConfig = ctx.m_config; ctx.m_config = 0;
+ return ret;
}
//****************************************************************************
@@ -216,7 +259,13 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) {
ctx.reportWarning("[%s] %s not yet implemented", ctx.fname, fname);
}
if (status == ConfigInfo::DEPRICATED) {
- ctx.reportWarning("[%s] %s is depricated", ctx.fname, fname);
+ const char * desc = m_info->getDescription(ctx.m_currentInfo, fname);
+ if(desc){
+ ctx.reportWarning("[%s] %s is depricated, use %s instead",
+ ctx.fname, fname, desc);
+ } else {
+ ctx.reportWarning("[%s] %s is depricated", ctx.fname, fname);
+ }
}
// ******************************************
@@ -249,7 +298,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
const char* fname,
const char* value) {
- const char * pname = m_info->getPName(ctx.m_currentInfo, fname);
+ const char * pname = fname;
if (ctx.m_currentSection->contains(pname)) {
ctx.reportError("[%s] Parameter %s specified twice", ctx.fname, fname);
@@ -260,7 +309,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
// Store name-value pair
// ***********************
- switch(m_info->getType(ctx.m_currentInfo, fname)){
+ const ConfigInfo::Type type = m_info->getType(ctx.m_currentInfo, fname);
+ switch(type){
case ConfigInfo::BOOL: {
bool value_bool;
if (!convertStringToBool(value, value_bool)) {
@@ -270,20 +320,25 @@ InitConfigFileParser::storeNameValuePair(Context& ctx,
MGM_REQUIRE(ctx.m_currentSection->put(pname, value_bool));
break;
}
- case ConfigInfo::INT:{
- Uint32 value_int;
- if (!convertStringToUint32(value, value_int)) {
+ case ConfigInfo::INT:
+ case ConfigInfo::INT64:{
+ Uint64 value_int;
+ if (!convertStringToUint64(value, value_int)) {
ctx.reportError("Illegal integer value for parameter %s", fname);
return false;
}
if (!m_info->verify(ctx.m_currentInfo, fname, value_int)) {
ctx.reportError("Illegal value %s for parameter %s.\n"
- "Legal values are between %d and %d", value, fname,
+ "Legal values are between %Lu and %Lu", value, fname,
m_info->getMin(ctx.m_currentInfo, fname),
m_info->getMax(ctx.m_currentInfo, fname));
return false;
}
- MGM_REQUIRE(ctx.m_currentSection->put(pname, value_int));
+ if(type == ConfigInfo::INT){
+ MGM_REQUIRE(ctx.m_currentSection->put(pname, (Uint32)value_int));
+ } else {
+ MGM_REQUIRE(ctx.m_currentSection->put64(pname, value_int));
+ }
break;
}
case ConfigInfo::STRING:
@@ -313,8 +368,8 @@ bool InitConfigFileParser::isEmptyLine(const char* line) const {
//****************************************************************************
// Convert String to Int
//****************************************************************************
-bool InitConfigFileParser::convertStringToUint32(const char* s,
- Uint32& val,
+bool InitConfigFileParser::convertStringToUint64(const char* s,
+ Uint64& val,
Uint32 log10base) {
if (s == NULL)
return false;
@@ -323,7 +378,7 @@ bool InitConfigFileParser::convertStringToUint32(const char* s,
errno = 0;
char* p;
- long v = strtol(s, &p, 10);
+ long long v = strtoll(s, &p, 10);
if (errno != 0)
return false;
@@ -359,14 +414,16 @@ bool InitConfigFileParser::convertStringToBool(const char* s, bool& val) {
if (!strcmp(s, "Y") || !strcmp(s, "y") ||
!strcmp(s, "Yes") || !strcmp(s, "YES") || !strcmp(s, "yes") ||
- !strcmp(s, "True") || !strcmp(s, "TRUE") || !strcmp(s, "true")) {
+ !strcmp(s, "True") || !strcmp(s, "TRUE") || !strcmp(s, "true") ||
+ !strcmp(s, "1")) {
val = true;
return true;
}
if (!strcmp(s, "N") || !strcmp(s, "n") ||
!strcmp(s, "No") || !strcmp(s, "NO") || !strcmp(s, "no") ||
- !strcmp(s, "False") || !strcmp(s, "FALSE") || !strcmp(s, "false")) {
+ !strcmp(s, "False") || !strcmp(s, "FALSE") || !strcmp(s, "false") ||
+ !strcmp(s, "0")) {
val = false;
return true;
}
@@ -375,21 +432,6 @@ bool InitConfigFileParser::convertStringToBool(const char* s, bool& val) {
}
//****************************************************************************
-// Get Config
-//****************************************************************************
-const Config* InitConfigFileParser::getConfig() {
- Uint32 nConnections = 0;
- Uint32 nComputers = 0;
- Uint32 nNodes = 0;
- m_config->get("NoOfConnections", &nConnections);
- m_config->get("NoOfComputers", &nComputers);
- m_config->get("NoOfNodes", &nNodes);
-
- return m_config;
-}
-
-
-//****************************************************************************
// Parse Section Header
//****************************************************************************
static void
@@ -481,33 +523,30 @@ bool
InitConfigFileParser::storeSection(Context& ctx){
if(ctx.m_currentSection == NULL)
return true;
-
for(int i = strlen(ctx.fname) - 1; i>=0; i--){
ctx.fname[i] = toupper(ctx.fname[i]);
}
-
snprintf(ctx.pname, sizeof(ctx.pname), ctx.fname);
-
char buf[255];
if(ctx.type == InitConfigFileParser::Section)
snprintf(buf, sizeof(buf), "%s", ctx.fname);
if(ctx.type == InitConfigFileParser::DefaultSection)
snprintf(buf, sizeof(buf), "%s DEFAULT", ctx.fname);
-
snprintf(ctx.fname, sizeof(ctx.fname), buf);
- for(int i = 0; i<m_info->m_NoOfRules; i++){
- const ConfigInfo::SectionRule & rule = m_info->m_SectionRules[i];
- if(strcmp(rule.m_section, ctx.fname) == 0)
- if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData)){
- return false;
- }
+ if(ctx.type == InitConfigFileParser::Section){
+ for(int i = 0; i<m_info->m_NoOfRules; i++){
+ const ConfigInfo::SectionRule & rule = m_info->m_SectionRules[i];
+ if(!strcmp(rule.m_section, "*") || !strcmp(rule.m_section, ctx.fname))
+ if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData))
+ return false;
+ }
}
-
+
if(ctx.type == InitConfigFileParser::DefaultSection)
- require(m_defaults->put(ctx.pname, ctx.m_currentSection));
+ require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection));
if(ctx.type == InitConfigFileParser::Section)
- require(m_config->put(ctx.pname, ctx.m_currentSection));
+ require(ctx.m_config->put(ctx.pname, ctx.m_currentSection));
delete ctx.m_currentSection; ctx.m_currentSection = NULL;
diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
index f4f27abb055..6b7482c12ae 100644
--- a/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
+++ b/ndb/src/common/mgmcommon/InitConfigFileParser.hpp
@@ -20,6 +20,7 @@
#include <ndb_global.h>
#include <Properties.hpp>
+#include <ConfigValues.hpp>
class Config;
class ConfigInfo;
@@ -28,18 +29,40 @@ class ConfigInfo;
* @class InitConfigFileParser
* @brief Reads initial config file and returns Config object
*
- * This class contains one public method InitConfigFileParser::getConfig,
+ * This class contains one public method InitConfigFileParser::parseConfig,
* which reads an initial configuration file and returns a Config
* object if the config file has correct syntax and semantic.
*/
class InitConfigFileParser {
public:
+ /**
+ * Constructor
+ */
+ InitConfigFileParser();
+ ~InitConfigFileParser();
+
+ /**
+ * Reads the initial configuration file, checks syntax and semantic
+ * and stores internally the values of all parameters.
+ *
+ * @returns Config or NULL on failure
+ * @note must be freed by caller
+ */
+ Config * parseConfig(FILE * file);
+ Config * parseConfig(const char * filename);
+
+ /**
+ * Parser context struct
+ */
enum ContextSectionType { Undefined, Section, DefaultSection };
/**
* Context = Which section in init config file we are currently parsing
*/
struct Context {
+ Context(const ConfigInfo *);
+ ~Context();
+
ContextSectionType type; ///< Section type (e.g. default section,section)
char fname[256]; ///< Section name occuring in init config file
char pname[256]; ///< Section name stored in properties object
@@ -47,8 +70,8 @@ public:
Uint32 m_sectionLineno; ///< Where did current section start
const ConfigInfo * m_info; // The config info
- const Properties * m_config; // The config object
- const Properties * m_defaults; // The user defaults
+ Properties * m_config; // The config object
+ Properties * m_defaults; // The user defaults
Properties * m_currentSection; // The current section I'm in
const Properties * m_userDefaults; // The defaults of this section
@@ -56,36 +79,13 @@ public:
const Properties * m_currentInfo; // The "info" for this section
Properties m_userProperties; // User properties (temporary values)
+ ConfigValuesFactory m_configValues; //
public:
void reportError(const char * msg, ...);
void reportWarning(const char * msg, ...);
};
-
- /**
- * Constructor
- * @param initialConfigFileName: Name of the initial configuration file
- */
- InitConfigFileParser(const char* initialConfigFileName);
- ~InitConfigFileParser();
-
- /**
- * Reads the initial configuration file, checks syntax and semantic
- * and stores internally the values of all parameters.
- *
- * @returns true if succeeded, o/w false (e.g. incorrect config file)
- */
- bool readConfigFile();
-
- /**
- * Get config. Must execute InitConfigFileParser::readConfigFile first.
- *
- * @returns Config if succeeded, o/w NULL
- */
- const Config* getConfig();
-
-
private:
/**
* Check if line only contains space/comments
@@ -111,33 +111,16 @@ private:
bool parseNameValuePair(Context&, const char* line);
bool storeNameValuePair(Context&, const char* fname, const char* value);
- bool convertStringToUint32(const char* s, Uint32& val, Uint32 log10base = 0);
+ bool convertStringToUint64(const char* s, Uint64& val, Uint32 log10base = 0);
bool convertStringToBool(const char* s, bool& val);
+ bool storeSection(Context&);
const Properties* getSection(const char * name, const Properties* src);
- /***************************************************************************
- * VARIABLES
- ***************************************************************************/
- FILE* m_initConfigStream;
-
/**
* Information about parameters (min, max values etc)
*/
- const ConfigInfo* m_info;
-
- /**
- * Configuration from initial configuration file
- * (returned by InitConfigFileParser::readConfigFile)
- */
- Config* m_config;
-
- /**
- * Default values specified in default sections
- */
- Properties* m_defaults;
-
- bool storeSection(Context&);
+ ConfigInfo* m_info;
};
#endif // InitConfigFileParser_H
diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am
new file mode 100644
index 00000000000..8a34fa16ed1
--- /dev/null
+++ b/ndb/src/common/mgmcommon/Makefile.am
@@ -0,0 +1,18 @@
+noinst_LTLIBRARIES = libmgmsrvcommon.la
+
+libmgmsrvcommon_la_SOURCES = \
+ LocalConfig.cpp \
+ Config.cpp \
+ ConfigInfo.cpp \
+ ConfigRetriever.cpp \
+ InitConfigFileParser.cpp \
+ IPCConfig.cpp NdbConfig.c
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/mgmcommon/Makefile b/ndb/src/common/mgmcommon/Makefile_old
index 2db7be01d60..c7bfda7e3bf 100644
--- a/ndb/src/common/mgmcommon/Makefile
+++ b/ndb/src/common/mgmcommon/Makefile_old
@@ -5,6 +5,7 @@ TYPE := ndbapi mgmapiclient
PIC_ARCHIVE := Y
ARCHIVE_TARGET := mgmsrvcommon
+# Removed temporary
DIRS := printConfig
SOURCES = \
@@ -17,6 +18,8 @@ SOURCES = \
SOURCES.c = NdbConfig.c
+CFLAGS_IPCConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/common/mgmcommon/printConfig/Makefile b/ndb/src/common/mgmcommon/printConfig/Makefile
index 9194316da87..77e8943e2c6 100644
--- a/ndb/src/common/mgmcommon/printConfig/Makefile
+++ b/ndb/src/common/mgmcommon/printConfig/Makefile
@@ -7,8 +7,10 @@ BIN_TARGET_ARCHIVES := general portlib
CCFLAGS_LOC += -I..
-SOURCES := printConfig.cpp
+SOURCES := printConfig.cpp ../ConfigRetriever.cpp
-SOURCES.c := ../ConfigRetriever.c ../NdbConfig.c ../LocalConfig.c
+SOURCES.c := ../NdbConfig.c ../LocalConfig.c
+
+CFLAGS_printConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
index daa287cc44d..7cedbb451e2 100644
--- a/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
+++ b/ndb/src/common/mgmcommon/printConfig/printConfig.cpp
@@ -18,6 +18,7 @@
#include <ndb_global.h>
#include <NdbMain.h>
+#include <mgmapi.h>
#include <ConfigRetriever.hpp>
#include <Properties.hpp>
#include <NdbOut.hpp>
@@ -50,9 +51,9 @@ NDB_COMMAND(printConfig,
return 0;
}
- Properties * p = 0;
ConfigRetriever c;
-
+ struct ndb_mgm_configuration * p = 0;
+
if(strcmp("host", argv[1]) == 0){
int verId = 0;
if(argc > 5)
@@ -64,7 +65,6 @@ NDB_COMMAND(printConfig,
p = c.getConfig(argv[2],
atoi(argv[3]),
- atoi(argv[4]),
verId);
} else if (strcmp("file", argv[1]) == 0){
int verId = 0;
@@ -79,12 +79,11 @@ NDB_COMMAND(printConfig,
}
if(p != 0){
- p->print(stdout);
+ //
+ free(p);
} else {
ndbout << "Configuration not found: " << c.getErrorString() << endl;
}
- delete p;
-
return 0;
}
diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am
new file mode 100644
index 00000000000..e6ecb30fe04
--- /dev/null
+++ b/ndb/src/common/portlib/Makefile.am
@@ -0,0 +1,18 @@
+noinst_HEADERS = gcc.cpp
+
+noinst_LTLIBRARIES = libportlib.la
+
+libportlib_la_SOURCES = \
+ NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \
+ NdbEnv.c NdbThread.c NdbHost.c NdbTCP.c \
+ NdbDaemon.c NdbMem.c
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+
+EXTRA_PROGRAMS = memtest PortLibTest munmaptest
+
+PortLibTest_SOURCES = NdbPortLibTest.cpp
+munmaptest_SOURCES = munmaptest.cpp
+
+# Don't update the files from bitkeeper
diff --git a/ndb/src/common/portlib/Makefile b/ndb/src/common/portlib/Makefile_old
index 48f4929a839..48f4929a839 100644
--- a/ndb/src/common/portlib/Makefile
+++ b/ndb/src/common/portlib/Makefile_old
diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/NdbCondition.c
index 1d229bdcdef..1d229bdcdef 100644
--- a/ndb/src/common/portlib/unix/NdbCondition.c
+++ b/ndb/src/common/portlib/NdbCondition.c
diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c
index 186331a4dab..d8d33595156 100644
--- a/ndb/src/common/portlib/unix/NdbDaemon.c
+++ b/ndb/src/common/portlib/NdbDaemon.c
@@ -18,9 +18,9 @@
#include "NdbDaemon.h"
#define NdbDaemon_ErrorSize 500
-long NdbDaemon_DaemonPid;
-int NdbDaemon_ErrorCode;
-char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
+long NdbDaemon_DaemonPid = 0;
+int NdbDaemon_ErrorCode = 0;
+char NdbDaemon_ErrorText[NdbDaemon_ErrorSize] = "";
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/NdbEnv.c
index d294e0b52ca..d294e0b52ca 100644
--- a/ndb/src/common/portlib/unix/NdbEnv.c
+++ b/ndb/src/common/portlib/NdbEnv.c
diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/NdbHost.c
index 4749bb39ea7..4749bb39ea7 100644
--- a/ndb/src/common/portlib/unix/NdbHost.c
+++ b/ndb/src/common/portlib/NdbHost.c
diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/NdbMem.c
index 0b06e5b23f1..0b06e5b23f1 100644
--- a/ndb/src/common/portlib/unix/NdbMem.c
+++ b/ndb/src/common/portlib/NdbMem.c
diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/NdbMutex.c
index 50f314d2683..50f314d2683 100644
--- a/ndb/src/common/portlib/unix/NdbMutex.c
+++ b/ndb/src/common/portlib/NdbMutex.c
diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp
index 55b9ccec5f2..55b9ccec5f2 100644
--- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp
+++ b/ndb/src/common/portlib/NdbPortLibTest.cpp
diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/NdbSleep.c
index 8702a25d1b1..8702a25d1b1 100644
--- a/ndb/src/common/portlib/unix/NdbSleep.c
+++ b/ndb/src/common/portlib/NdbSleep.c
diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/NdbTCP.c
index 287dc6c2ecd..287dc6c2ecd 100644
--- a/ndb/src/common/portlib/unix/NdbTCP.c
+++ b/ndb/src/common/portlib/NdbTCP.c
diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/NdbThread.c
index a5c42f79be8..8683a37edcb 100644
--- a/ndb/src/common/portlib/unix/NdbThread.c
+++ b/ndb/src/common/portlib/NdbThread.c
@@ -21,6 +21,7 @@
#define MAX_THREAD_NAME 16
+/*#define USE_PTHREAD_EXTRAS*/
struct NdbThread
{
@@ -52,14 +53,14 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
pthread_attr_init(&thread_attr);
pthread_attr_setstacksize(&thread_attr, thread_stack_size);
-#if defined NDB_SOLARIS
-#if !defined NDB_SOLARIS6
+#ifdef USE_PTHREAD_EXTRAS
/* Guard stack overflow with a 2k databuffer */
pthread_attr_setguardsize(&thread_attr, 2048);
#endif
-#endif
+#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
+#endif
result = pthread_create(&tmpThread->thread,
&thread_attr,
p_thread_func,
@@ -104,7 +105,7 @@ void NdbThread_Exit(int status)
int NdbThread_SetConcurrencyLevel(int level)
{
-#ifndef NDB_SOLARIS6
+#ifdef USE_PTHREAD_EXTRAS
return pthread_setconcurrency(level);
#else
return 0;
diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/NdbTick.c
index d8f0b6ec27a..d8f0b6ec27a 100644
--- a/ndb/src/common/portlib/unix/NdbTick.c
+++ b/ndb/src/common/portlib/NdbTick.c
diff --git a/ndb/src/common/portlib/gcc.cpp b/ndb/src/common/portlib/gcc.cpp
index 41b1373ee78..66aa4812dc6 100644
--- a/ndb/src/common/portlib/gcc.cpp
+++ b/ndb/src/common/portlib/gcc.cpp
@@ -2,6 +2,6 @@
/**
* GCC linking problem...
*/
-#if ( __GNUC__ == 3 )
+#ifdef DEFINE_CXA_PURE_VIRTUAL
extern "C" { int __cxa_pure_virtual() { return 0;} }
#endif
diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest.c
index 059a4ec025e..059a4ec025e 100644
--- a/ndb/src/common/portlib/memtest/memtest.c
+++ b/ndb/src/common/portlib/memtest.c
diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmslist.cpp
index 05538785293..05538785293 100644
--- a/ndb/src/common/portlib/mmstest/mmslist.cpp
+++ b/ndb/src/common/portlib/mmslist.cpp
diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest.cpp
index 9cc7d810985..9cc7d810985 100644
--- a/ndb/src/common/portlib/mmstest/mmstest.cpp
+++ b/ndb/src/common/portlib/mmstest.cpp
diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/munmaptest.cpp
index b1d84131810..b1d84131810 100644
--- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp
+++ b/ndb/src/common/portlib/munmaptest.cpp
diff --git a/ndb/src/common/portlib/memtest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/Makefile
index 716cdbdea82..716cdbdea82 100644
--- a/ndb/src/common/portlib/memtest/Makefile
+++ b/ndb/src/common/portlib/old_dirs/memtest/Makefile
diff --git a/ndb/src/common/portlib/memtest/munmaptest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile
index ea8c5238d1c..ea8c5238d1c 100644
--- a/ndb/src/common/portlib/memtest/munmaptest/Makefile
+++ b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile
diff --git a/ndb/src/common/portlib/ose/Makefile b/ndb/src/common/portlib/old_dirs/ose/Makefile
index 4ef93b7824a..4ef93b7824a 100644
--- a/ndb/src/common/portlib/ose/Makefile
+++ b/ndb/src/common/portlib/old_dirs/ose/Makefile
diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c
index 73a2dbc5d66..73a2dbc5d66 100644
--- a/ndb/src/common/portlib/ose/NdbCondition.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c
diff --git a/ndb/src/common/portlib/ose/NdbConditionOSE.h b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h
index bd0306261cc..bd0306261cc 100644
--- a/ndb/src/common/portlib/ose/NdbConditionOSE.h
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h
diff --git a/ndb/src/common/portlib/ose/NdbEnv.c b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c
index e2ac4d879d2..e2ac4d879d2 100644
--- a/ndb/src/common/portlib/ose/NdbEnv.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c
diff --git a/ndb/src/common/portlib/ose/NdbHost.c b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c
index f5e1e511c16..f5e1e511c16 100644
--- a/ndb/src/common/portlib/ose/NdbHost.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c
diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c
index 0e38024bbb4..0e38024bbb4 100644
--- a/ndb/src/common/portlib/ose/NdbMem.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c
diff --git a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp
index cad22c0474b..cad22c0474b 100644
--- a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp
diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c
index 253c0e412ff..253c0e412ff 100644
--- a/ndb/src/common/portlib/ose/NdbMutex.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c
diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp
index eb81bc9d971..eb81bc9d971 100644
--- a/ndb/src/common/portlib/ose/NdbOut.cpp
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp
diff --git a/ndb/src/common/portlib/ose/NdbSleep.c b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c
index 70fd83117ef..70fd83117ef 100644
--- a/ndb/src/common/portlib/ose/NdbSleep.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c
diff --git a/ndb/src/common/portlib/ose/NdbTCP.c b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c
index 9994697b3f8..9994697b3f8 100644
--- a/ndb/src/common/portlib/ose/NdbTCP.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c
diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c
index e46903a5cce..e46903a5cce 100644
--- a/ndb/src/common/portlib/ose/NdbThread.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c
diff --git a/ndb/src/common/portlib/ose/NdbTick.c b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c
index c3deae2bec3..c3deae2bec3 100644
--- a/ndb/src/common/portlib/ose/NdbTick.c
+++ b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c
diff --git a/ndb/src/common/portlib/test/Makefile b/ndb/src/common/portlib/old_dirs/test/Makefile
index 4edc98ede75..4edc98ede75 100644
--- a/ndb/src/common/portlib/test/Makefile
+++ b/ndb/src/common/portlib/old_dirs/test/Makefile
diff --git a/ndb/src/common/portlib/unix/Makefile b/ndb/src/common/portlib/old_dirs/unix/Makefile_old
index 452196d9f08..452196d9f08 100644
--- a/ndb/src/common/portlib/unix/Makefile
+++ b/ndb/src/common/portlib/old_dirs/unix/Makefile_old
diff --git a/ndb/src/common/portlib/win32/Makefile b/ndb/src/common/portlib/old_dirs/win32/Makefile
index bb29ac5547e..bb29ac5547e 100644
--- a/ndb/src/common/portlib/win32/Makefile
+++ b/ndb/src/common/portlib/old_dirs/win32/Makefile
diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c
index 77869b673de..77869b673de 100644
--- a/ndb/src/common/portlib/win32/NdbCondition.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c
diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c
index 972fb1b88d8..972fb1b88d8 100644
--- a/ndb/src/common/portlib/win32/NdbDaemon.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c
diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c
index 0df703a5e97..0df703a5e97 100644
--- a/ndb/src/common/portlib/win32/NdbEnv.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c
diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c
index f91dd1a531c..f91dd1a531c 100644
--- a/ndb/src/common/portlib/win32/NdbHost.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c
diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c
index ab7123b0a29..ab7123b0a29 100644
--- a/ndb/src/common/portlib/win32/NdbMem.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c
diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c
index e797024d5bb..e797024d5bb 100644
--- a/ndb/src/common/portlib/win32/NdbMutex.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c
diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c
index ac0f44dd07f..ac0f44dd07f 100644
--- a/ndb/src/common/portlib/win32/NdbSleep.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c
diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c
index 483a53bd606..483a53bd606 100644
--- a/ndb/src/common/portlib/win32/NdbTCP.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c
diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c
index 1f052f034e8..1f052f034e8 100644
--- a/ndb/src/common/portlib/win32/NdbThread.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c
diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c
index e3a67d8437d..e3a67d8437d 100644
--- a/ndb/src/common/portlib/win32/NdbTick.c
+++ b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c
diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am
new file mode 100644
index 00000000000..218b261606d
--- /dev/null
+++ b/ndb/src/common/transporter/Makefile.am
@@ -0,0 +1,22 @@
+
+noinst_LTLIBRARIES = libtransporter.la
+
+libtransporter_la_SOURCES = \
+ Transporter.cpp \
+ SendBuffer.cpp \
+ TCP_Transporter.cpp \
+ TransporterRegistry.cpp \
+ Packer.cpp
+
+EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp SCI_Transporter.cpp
+
+libtransporter_la_LIBADD = @ndb_transporter_opt_objs@
+libtransporter_la_DEPENDENCIES = @ndb_transporter_opt_objs@
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/include/transporter
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile_old
index 372bf640566..372bf640566 100644
--- a/ndb/src/common/transporter/Makefile
+++ b/ndb/src/common/transporter/Makefile_old
diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp
index c562451a1b0..43b26d45899 100644
--- a/ndb/src/common/transporter/Transporter.hpp
+++ b/ndb/src/common/transporter/Transporter.hpp
@@ -17,6 +17,8 @@
#ifndef Transporter_H
#define Transporter_H
+#include <ndb_global.h>
+
#include <TransporterCallback.hpp>
#include "TransporterDefinitions.hpp"
#include "Packer.hpp"
diff --git a/ndb/src/common/util/Base64.cpp b/ndb/src/common/util/Base64.cpp
index 482d0b10ad2..f7a490d427d 100644
--- a/ndb/src/common/util/Base64.cpp
+++ b/ndb/src/common/util/Base64.cpp
@@ -22,89 +22,186 @@ static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789+/";
int
-base64_encode(UtilBuffer &src, BaseString &dst) {
- char *s = (char *)src.get_data();
- int i = 0;
+base64_encode(const UtilBuffer &src, BaseString &dst) {
+ const unsigned char *s = (const unsigned char *)src.get_data();
+ size_t i = 0;
+ size_t len = 0;
+ size_t src_len = src.length();
+ while(i < src_len) {
+ if(len == 76){
+ len = 0;
+ dst.append('\n');
+ }
- while(i < src.length()) {
- int c;
+ unsigned c;
c = s[i++];
c <<= 8;
- if(i < src.length())
+ if(i < src_len)
c += s[i];
c <<= 8;
i++;
- if(i < src.length())
+ if(i < src_len)
c += s[i];
i++;
-
+
dst.append(base64_table[(c >> 18) & 0x3f]);
dst.append(base64_table[(c >> 12) & 0x3f]);
- if(i > (src.length() + 1))
+ if(i > (src_len + 1))
dst.append('=');
else
dst.append(base64_table[(c >> 6) & 0x3f]);
- if(i > src.length())
+ if(i > src_len)
dst.append('=');
else
dst.append(base64_table[(c >> 0) & 0x3f]);
+
+ len += 4;
}
return 0;
}
-static inline int
-pos(char c) {
+static inline unsigned
+pos(unsigned char c) {
return strchr(base64_table, c) - base64_table;
}
int
-base64_decode(BaseString &src, UtilBuffer &dst) {
- size_t size;
- size = (src.length() * 3) / 4;
+base64_decode(const BaseString &src, UtilBuffer &dst) {
+ return base64_decode(src.c_str(), src.length(), dst);
+}
+
+#define SKIP_SPACE(src, i, size){ \
+ while(i < size && isspace(* src)){ \
+ i++; \
+ src++; \
+ } \
+ if(i == size){ \
+ i = size + 1; \
+ break; \
+ } \
+}
+
+int
+base64_decode(const char * src, size_t size, UtilBuffer &dst) {
size_t i = 0;
- const char *s = src.c_str();
- while(i < size) {
- int c = 0;
+ while(i < size){
+ unsigned c = 0;
int mark = 0;
- c += pos(*s++);
+
+ SKIP_SPACE(src, i, size);
+
+ c += pos(*src++);
c <<= 6;
i++;
- c += pos(*s++);
+ SKIP_SPACE(src, i, size);
+
+ c += pos(*src++);
c <<= 6;
i++;
- if(*s != '=')
- c += pos(*s++);
+ SKIP_SPACE(src, i, size);
+
+ if(* src != '=')
+ c += pos(*src++);
else {
- size--;
- mark++;
+ i = size;
+ mark = 2;
+ c <<= 6;
+ goto end;
}
c <<= 6;
i++;
- if(*s != '=')
- c += pos(*s++);
+ SKIP_SPACE(src, i, size);
+
+ if(*src != '=')
+ c += pos(*src++);
else {
- size--;
- mark++;
+ i = size;
+ mark = 1;
+ goto end;
}
- /* c <<= 6; */
i++;
+ end:
char b[3];
-
-
b[0] = (c >> 16) & 0xff;
b[1] = (c >> 8) & 0xff;
b[2] = (c >> 0) & 0xff;
-
+
dst.append((void *)b, 3-mark);
}
+
+ if(i != size){
+ abort();
+ return -1;
+ }
return 0;
}
+
+#ifdef __TEST__B64
+/**
+ * USER_FLAGS="-D__TEST__B64" make Base64.o && g++ Base64.o BaseString.o
+ */
+inline
+void
+require(bool b){
+ if(!b)
+ abort();
+}
+
+int
+main(void){
+ for(int i = 0; i < 500; i++){
+ const size_t len = rand() % 10000 + 1;
+ UtilBuffer src;
+ for(size_t j = 0; j<len; j++){
+ char c = rand();
+ src.append(&c, 1);
+ }
+ require(src.length() == len);
+
+ BaseString str;
+ require(base64_encode(src, str) == 0);
+
+ if(str.length() == 3850){
+ printf(">%s<\n", str.c_str());
+ }
+
+ UtilBuffer dst;
+ require(base64_decode(str, dst) == 0);
+ require(dst.length() == src.length());
+
+ const char * c_src = (char*)src.get_data();
+ const char * c_dst = (char*)dst.get_data();
+ if(memcmp(src.get_data(), dst.get_data(), src.length()) != 0){
+ printf("-- src --\n");
+ for(int i2 = 0; i2<len; i2++){
+ unsigned char c = c_src[i2];
+ printf("%.2x ", (unsigned)c);
+ if((i2 % 8) == 7)
+ printf("\n");
+ }
+ printf("\n");
+
+ printf("-- dst --\n");
+ for(int i2 = 0; i2<len; i2++){
+ unsigned char c = c_dst[i2];
+ printf("%.2x ", (unsigned)c);
+ if((i2 % 8) == 7)
+ printf("\n");
+ }
+ printf("\n");
+ abort();
+ }
+ }
+ return 0;
+}
+
+#endif
diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp
new file mode 100644
index 00000000000..18ecf4bcdc4
--- /dev/null
+++ b/ndb/src/common/util/ConfigValues.cpp
@@ -0,0 +1,743 @@
+#include <ConfigValues.hpp>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <new>
+#include <NdbOut.hpp>
+#include <NdbTCP.h>
+
+static Uint32 hash(Uint32 key, Uint32 size);
+static Uint32 nextHash(Uint32 key, Uint32 size, Uint32 pos, Uint32 count);
+static bool findKey(const Uint32 * vals, Uint32 sz, Uint32 key, Uint32 * pos);
+
+/**
+ * Key
+ *
+ * t = Type - 4 bits 0-15
+ * s = Section - 14 bits 0-16383
+ * k = Key value - 14 bits 0-16383
+ *
+ * 1111111111222222222233
+ * 01234567890123456789012345678901
+ * kkkkkkkkkkkkkkssssssssssssssoooo
+ */
+#define KP_TYPE_MASK (15)
+#define KP_TYPE_SHIFT (28)
+#define KP_SECTION_MASK (0x3FFF)
+#define KP_SECTION_SHIFT (14)
+#define KP_KEYVAL_MASK (0x3FFF)
+#define KP_KEYVAL_SHIFT (0)
+#define KP_MASK (0x0FFFFFFF)
+
+static const Uint32 CFV_KEY_PARENT = (KP_KEYVAL_MASK - 1);
+static const Uint32 CFV_KEY_FREE = ~0;
+
+static const char Magic[] = { 'N', 'D', 'B', 'C', 'O', 'N', 'F', 'V' };
+
+//#define DEBUG_CV
+#ifdef DEBUG_CV
+#define DEBUG
+#else
+#define DEBUG if(0)
+#endif
+
+inline
+ConfigValues::ValueType
+getTypeOf(Uint32 k) {
+ return (ConfigValues::ValueType)((k >> KP_TYPE_SHIFT) & KP_TYPE_MASK);
+}
+
+ConfigValues::ConfigValues(Uint32 sz, Uint32 dsz){
+ m_size = sz;
+ m_dataSize = dsz;
+ m_stringCount = 0;
+ m_int64Count = 0;
+ for(Uint32 i = 0; i<m_size; i++){
+ m_values[i << 1] = CFV_KEY_FREE;
+ }
+}
+
+ConfigValues::~ConfigValues(){
+ for(Uint32 i = 0; i<m_stringCount; i++){
+ free(getString(i));
+ }
+}
+
+bool
+ConfigValues::ConstIterator::get(Uint32 key, Entry * result) const {
+ Uint32 pos;
+ if(!findKey(m_cfg.m_values, m_cfg.m_size, key | m_currentSection, &pos)){
+ return false;
+ }
+
+ result->m_key = key;
+ return m_cfg.getByPos(pos, result);
+}
+
+bool
+ConfigValues::getByPos(Uint32 pos, Entry * result) const {
+ assert(pos < (2 * m_size));
+ Uint32 keypart = m_values[pos];
+ Uint32 val = m_values[pos+1];
+
+ switch(::getTypeOf(keypart)){
+ case IntType:
+ case SectionType:
+ result->m_int = val;
+ break;
+ case StringType:
+ result->m_string = getString(val);
+ break;
+ case Int64Type:
+ result->m_int64 = get64(val);
+ break;
+ case InvalidType:
+ default:
+ return false;
+ }
+
+ result->m_type = ::getTypeOf(keypart);
+
+ return true;
+}
+
+Uint64 &
+ConfigValues::get64(Uint32 index) const {
+ assert(index < m_int64Count);
+ Uint64 * ptr = (Uint64*)(&m_values[m_size << 1]);
+ return ptr[index];
+}
+
+char * &
+ConfigValues::getString(Uint32 index) const {
+ assert(index < m_stringCount);
+ char ** ptr = (char**)(((char *)&(m_values[m_size << 1])) + m_dataSize);
+ return ptr[-index];
+}
+
+bool
+ConfigValues::ConstIterator::openSection(Uint32 key, Uint32 no){
+ Uint32 curr = m_currentSection;
+
+ Entry tmp;
+ if(get(key, &tmp) && tmp.m_type == SectionType){
+ m_currentSection = tmp.m_int;
+ if(get(no, &tmp) && tmp.m_type == IntType){
+ m_currentSection = tmp.m_int;
+ /**
+ * Validate
+ */
+ if(get(CFV_KEY_PARENT, &tmp)){
+ return true;
+ }
+ }
+ }
+
+ m_currentSection = curr;
+ return false;
+}
+
+bool
+ConfigValues::ConstIterator::closeSection() {
+
+ Entry tmp;
+ if(get(CFV_KEY_PARENT, &tmp) && tmp.m_type == IntType){
+ m_currentSection = tmp.m_int;
+ return true;
+ }
+
+ return false;
+}
+
+bool
+ConfigValues::Iterator::set(Uint32 key, Uint32 value){
+ Uint32 pos;
+ if(!findKey(m_cfg.m_values, m_cfg.m_size, key | m_currentSection, &pos)){
+ return false;
+ }
+
+ if(::getTypeOf(m_cfg.m_values[pos]) != IntType){
+ return false;
+ }
+
+ m_cfg.m_values[pos+1] = value;
+ return true;
+}
+
+bool
+ConfigValues::Iterator::set(Uint32 key, Uint64 value){
+ Uint32 pos;
+ if(!findKey(m_cfg.m_values, m_cfg.m_size, key | m_currentSection, &pos)){
+ return false;
+ }
+
+ if(::getTypeOf(m_cfg.m_values[pos]) != Int64Type){
+ return false;
+ }
+
+ m_cfg.get64(m_cfg.m_values[pos+1]) = value;
+ return true;
+}
+
+bool
+ConfigValues::Iterator::set(Uint32 key, const char * value){
+ Uint32 pos;
+ if(!findKey(m_cfg.m_values, m_cfg.m_size, key | m_currentSection, &pos)){
+ return false;
+ }
+
+ if(::getTypeOf(m_cfg.m_values[pos]) != StringType){
+ return false;
+ }
+
+ char * & str = m_cfg.getString(m_cfg.m_values[pos+1]);
+ free(str);
+ str = strdup(value ? value : "");
+ return true;
+}
+
+static
+bool
+findKey(const Uint32 * values, Uint32 sz, Uint32 key, Uint32 * _pos){
+ Uint32 pos = hash(key, sz);
+ Uint32 count = 0;
+ while((values[pos] & KP_MASK) != key && count < sz){
+ pos = nextHash(key, sz, pos, ++count);
+ }
+
+ if((values[pos] & KP_MASK)== key){
+ *_pos = pos;
+ return true;
+ }
+ return false;
+}
+
+static
+Uint32
+hash(Uint32 key, Uint32 size){
+ Uint32 tmp = (key >> 16) ^ (key & 0xFFFF);
+ return (((tmp << 16) | tmp) % size) << 1;
+}
+
+static
+Uint32
+nextHash(Uint32 key, Uint32 size, Uint32 pos, Uint32 count){
+ Uint32 p = (pos >> 1);
+ if((key % size) != 0)
+ p += key;
+ else
+ p += 1;
+ return (p % size) << 1;
+}
+
+static
+Uint32
+directory(Uint32 sz){
+ const Uint32 _input = sz;
+ if((sz & 1) == 0)
+ sz ++;
+
+ bool prime = false;
+ while(!prime){
+ prime = true;
+ for(Uint32 n = 3; n*n <= sz; n += 2){
+ if((sz % n) == 0){
+ prime = false;
+ sz += 2;
+ break;
+ }
+ }
+ }
+ DEBUG printf("directory %d -> %d\n", _input, sz);
+ return sz;
+}
+
+ConfigValuesFactory::ConfigValuesFactory(Uint32 keys, Uint32 data){
+ m_sectionCounter = (1 << KP_SECTION_SHIFT);
+ m_freeKeys = directory(keys);
+ m_freeData = data;
+ m_currentSection = 0;
+ m_cfg = create(m_freeKeys, data);
+}
+
+ConfigValuesFactory::ConfigValuesFactory(ConfigValues * cfg){
+ m_cfg = cfg;
+ m_freeKeys = 0;
+ m_freeData = m_cfg->m_dataSize;
+ m_sectionCounter = (1 << KP_SECTION_SHIFT);
+ m_currentSection = 0;
+ const Uint32 sz = 2 * m_cfg->m_size;
+ for(Uint32 i = 0; i<sz; i += 2){
+ const Uint32 key = m_cfg->m_values[i];
+ if(key == CFV_KEY_FREE){
+ m_freeKeys++;
+ } else {
+ switch(::getTypeOf(key)){
+ case ConfigValues::IntType:
+ case ConfigValues::SectionType:
+ break;
+ case ConfigValues::Int64Type:
+ m_freeData -= sizeof(Uint64);
+ break;
+ case ConfigValues::StringType:
+ m_freeData -= sizeof(char *);
+ break;
+ case ConfigValues::InvalidType:
+ abort();
+ }
+ Uint32 sec = key & (KP_SECTION_MASK << KP_SECTION_SHIFT);
+ m_sectionCounter = (sec > m_sectionCounter ? sec : m_sectionCounter);
+ }
+ }
+}
+
+ConfigValues *
+ConfigValuesFactory::create(Uint32 keys, Uint32 data){
+ Uint32 sz = sizeof(ConfigValues);
+ sz += (2 * keys * sizeof(Uint32));
+ sz += data;
+
+ void * tmp = malloc(sz);
+ return new (tmp) ConfigValues(keys, data);
+}
+
+void
+ConfigValuesFactory::expand(Uint32 fk, Uint32 fs){
+ if(m_freeKeys >= fk && m_freeData >= fs){
+ return ;
+ }
+
+ m_freeKeys = (m_freeKeys >= fk ? m_cfg->m_size : fk + m_cfg->m_size);
+ m_freeData = (m_freeData >= fs ? m_cfg->m_dataSize : fs + m_cfg->m_dataSize);
+ m_freeKeys = directory(m_freeKeys);
+
+ ConfigValues * m_tmp = m_cfg;
+ m_cfg = create(m_freeKeys, m_freeData);
+ put(* m_tmp);
+ m_tmp->~ConfigValues();
+ free(m_tmp);
+}
+
+void
+ConfigValuesFactory::shrink(){
+ if(m_freeKeys == 0 && m_freeData == 0){
+ return ;
+ }
+
+ m_freeKeys = m_cfg->m_size - m_freeKeys;
+ m_freeData = m_cfg->m_dataSize - m_freeData;
+ m_freeKeys = directory(m_freeKeys);
+
+ ConfigValues * m_tmp = m_cfg;
+ m_cfg = create(m_freeKeys, m_freeData);
+ put(* m_tmp);
+ m_tmp->~ConfigValues();
+ free(m_tmp);
+}
+
+bool
+ConfigValuesFactory::openSection(Uint32 key, Uint32 no){
+ ConfigValues::Entry tmp;
+ const Uint32 parent = m_currentSection;
+
+ ConfigValues::ConstIterator iter(* m_cfg);
+ iter.m_currentSection = m_currentSection;
+ if(!iter.get(key, &tmp)){
+
+ tmp.m_key = key;
+ tmp.m_type = ConfigValues::SectionType;
+ tmp.m_int = m_sectionCounter;
+ m_sectionCounter += (1 << KP_SECTION_SHIFT);
+
+ if(!put(tmp)){
+ return false;
+ }
+ }
+
+ if(tmp.m_type != ConfigValues::SectionType){
+ return false;
+ }
+
+ m_currentSection = tmp.m_int;
+
+ tmp.m_key = no;
+ tmp.m_type = ConfigValues::IntType;
+ tmp.m_int = m_sectionCounter;
+ if(!put(tmp)){
+ m_currentSection = parent;
+ return false;
+ }
+ m_sectionCounter += (1 << KP_SECTION_SHIFT);
+
+ m_currentSection = tmp.m_int;
+ tmp.m_type = ConfigValues::IntType;
+ tmp.m_key = CFV_KEY_PARENT;
+ tmp.m_int = parent;
+ if(!put(tmp)){
+ m_currentSection = parent;
+ return false;
+ }
+
+ return true;
+}
+
+bool
+ConfigValuesFactory::closeSection(){
+ ConfigValues::ConstIterator iter(* m_cfg);
+ iter.m_currentSection = m_currentSection;
+ const bool b = iter.closeSection();
+ m_currentSection = iter.m_currentSection;
+ return b;
+}
+
+bool
+ConfigValuesFactory::put(const ConfigValues::Entry & entry){
+
+ if(m_freeKeys == 0 ||
+ (entry.m_type == ConfigValues::StringType && m_freeData < sizeof(char *))
+ || (entry.m_type == ConfigValues::Int64Type && m_freeData < 8 )){
+
+ DEBUG ndbout_c("m_freeKeys = %d, m_freeData = %d -> expand",
+ m_freeKeys, m_freeData);
+
+ expand(31, 20);
+ }
+
+ const Uint32 tmp = entry.m_key | m_currentSection;
+ const Uint32 sz = m_cfg->m_size;
+ Uint32 pos = hash(tmp, sz);
+ Uint32 count = 0;
+ Uint32 val = m_cfg->m_values[pos];
+
+ while((val & KP_MASK) != tmp && val != CFV_KEY_FREE && count < sz){
+ pos = nextHash(tmp, sz, pos, ++count);
+ val = m_cfg->m_values[pos];
+ }
+
+ if((val & KP_MASK) == tmp){
+ DEBUG ndbout_c("key %x already found at pos: %d", tmp, pos);
+ return false;
+ }
+
+ if(count >= sz){
+ pos = hash(tmp, sz);
+ count = 0;
+ Uint32 val = m_cfg->m_values[pos];
+
+ printf("key: %d, (key %% size): %d\n", entry.m_key, (entry.m_key % sz));
+ printf("pos: %d", pos);
+ while((val & KP_MASK) != tmp && val != CFV_KEY_FREE && count < sz){
+ pos = nextHash(tmp, sz, pos, ++count);
+ val = m_cfg->m_values[pos];
+ printf(" %d", pos);
+ }
+ printf("\n");
+
+ abort();
+ printf("Full\n");
+ return false;
+ }
+
+ assert(pos < (sz << 1));
+
+ Uint32 key = tmp;
+ key |= (entry.m_type << KP_TYPE_SHIFT);
+ m_cfg->m_values[pos] = key;
+ switch(entry.m_type){
+ case ConfigValues::IntType:
+ case ConfigValues::SectionType:
+ m_cfg->m_values[pos+1] = entry.m_int;
+ m_freeKeys--;
+ DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value: %d\n",
+ pos, sz, count,
+ (key >> KP_KEYVAL_SHIFT) & KP_KEYVAL_MASK,
+ entry.m_int);
+ return true;
+ case ConfigValues::StringType:{
+ Uint32 index = m_cfg->m_stringCount++;
+ m_cfg->m_values[pos+1] = index;
+ m_cfg->getString(index) = strdup(entry.m_string ? entry.m_string : "");
+ m_freeKeys--;
+ m_freeData -= sizeof(char *);
+ DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value(%d): %s\n",
+ pos, sz, count,
+ (key >> KP_KEYVAL_SHIFT) & KP_KEYVAL_MASK,
+ index,
+ entry.m_string);
+ return true;
+ }
+ case ConfigValues::Int64Type:{
+ Uint32 index = m_cfg->m_int64Count++;
+ m_cfg->m_values[pos+1] = index;
+ m_cfg->get64(index) = entry.m_int64;
+ m_freeKeys--;
+ m_freeData -= 8;
+ DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value64(%d): %lld\n",
+ pos, sz, count,
+ (key >> KP_KEYVAL_SHIFT) & KP_KEYVAL_MASK,
+ index,
+ entry.m_int64);
+ return true;
+ }
+ case ConfigValues::InvalidType:
+ default:
+ return false;
+ }
+ return false;
+}
+
+void
+ConfigValuesFactory::put(const ConfigValues & cfg){
+
+ Uint32 curr = m_currentSection;
+ m_currentSection = 0;
+
+ ConfigValues::Entry tmp;
+ for(Uint32 i = 0; i < 2 * cfg.m_size; i += 2){
+ if(cfg.m_values[i] != CFV_KEY_FREE){
+ tmp.m_key = cfg.m_values[i];
+ cfg.getByPos(i, &tmp);
+ put(tmp);
+ }
+ }
+
+ m_currentSection = curr;
+}
+
+ConfigValues *
+ConfigValuesFactory::extractCurrentSection(const ConfigValues::ConstIterator & cfg){
+ ConfigValuesFactory * fac = new ConfigValuesFactory(20, 20);
+ Uint32 curr = cfg.m_currentSection;
+
+ ConfigValues::Entry tmp;
+ for(Uint32 i = 0; i < 2 * cfg.m_cfg.m_size; i += 2){
+ Uint32 keypart = cfg.m_cfg.m_values[i];
+ const Uint32 sec = keypart & (KP_SECTION_MASK << KP_SECTION_SHIFT);
+ const Uint32 key = keypart & KP_KEYVAL_MASK;
+ if(sec == curr && key != CFV_KEY_PARENT){
+ tmp.m_key = cfg.m_cfg.m_values[i];
+ cfg.m_cfg.getByPos(i, &tmp);
+ tmp.m_key = key;
+ fac->put(tmp);
+ }
+ }
+
+ ConfigValues * ret = fac->m_cfg;
+ delete fac;
+ return ret;
+}
+
+ConfigValues *
+ConfigValuesFactory::getConfigValues(){
+ ConfigValues * ret = m_cfg;
+ m_cfg = create(10, 10);
+ return ret;
+}
+
+static int
+mod4(unsigned int i){
+ int res = i + (4 - (i % 4));
+ return res;
+}
+
+Uint32
+ConfigValues::getPackedSize() const {
+
+ Uint32 size = 0;
+ for(Uint32 i = 0; i < 2 * m_size; i += 2){
+ Uint32 key = m_values[i];
+ if(key != CFV_KEY_FREE){
+ switch(::getTypeOf(key)){
+ case IntType:
+ case SectionType:
+ size += 8;
+ break;
+ case Int64Type:
+ size += 12;
+ break;
+ case StringType:
+ size += 8; // key + len
+ size += mod4(strlen(getString(m_values[i+1])) + 1);
+ break;
+ case InvalidType:
+ default:
+ abort();
+ }
+ }
+ }
+
+ return size + sizeof(Magic) + 4; // checksum also
+}
+
+Uint32
+ConfigValues::pack(void * _dst, Uint32 _len) const {
+
+ char * dst = (char*)_dst;
+ memcpy(dst, Magic, sizeof(Magic)); dst += sizeof(Magic);
+
+ for(Uint32 i = 0; i < 2 * m_size; i += 2){
+ Uint32 key = m_values[i];
+ Uint32 val = m_values[i+1];
+ if(key != CFV_KEY_FREE){
+ switch(::getTypeOf(key)){
+ case IntType:
+ case SectionType:
+ * (Uint32*)dst = htonl(key); dst += 4;
+ * (Uint32*)dst = htonl(val); dst += 4;
+ break;
+ case Int64Type:{
+ Uint64 i64 = get64(val);
+ Uint32 hi = (i64 >> 32);
+ Uint32 lo = (i64 & 0xFFFFFFFF);
+ * (Uint32*)dst = htonl(key); dst += 4;
+ * (Uint32*)dst = htonl(hi); dst += 4;
+ * (Uint32*)dst = htonl(lo); dst += 4;
+ }
+ break;
+ case StringType:{
+ const char * str = getString(val);
+ Uint32 len = strlen(str) + 1;
+ * (Uint32*)dst = htonl(key); dst += 4;
+ * (Uint32*)dst = htonl(len); dst += 4;
+ memcpy(dst, str, len);
+ memset(dst+len, 0, mod4(len) - len);
+ dst += mod4(len);
+ }
+ break;
+ case InvalidType:
+ default:
+ abort();
+ }
+ }
+ }
+
+ const Uint32 * sum = (Uint32*)_dst;
+ const Uint32 len = ((Uint32*)dst) - sum;
+ Uint32 chk = 0;
+ for(Uint32 i = 0; i<len; i++){
+ chk ^= htonl(sum[i]);
+ }
+
+ * (Uint32*)dst = htonl(chk); dst += 4;
+ return 4 * (len + 1);
+}
+
+bool
+ConfigValuesFactory::unpack(const void * _src, Uint32 len){
+
+ if(len < sizeof(Magic) + 4){
+ DEBUG abort();
+ return false;
+ }
+
+ if(memcmp(_src, Magic, sizeof(Magic)) != 0){
+ DEBUG abort();
+ return false;
+ }
+
+ const char * src = (const char *)_src;
+
+ {
+ Uint32 len32 = (len >> 2);
+ const Uint32 * tmp = (const Uint32*)_src;
+ Uint32 chk = 0;
+ for(Uint32 i = 0; (i+1)<len32; i++){
+ chk ^= ntohl(tmp[i]);
+ }
+
+ if(chk != ntohl(tmp[len32-1])){
+ DEBUG abort();
+ return false;
+ }
+ }
+
+ const char * end = src + len - 4;
+ src += sizeof(Magic);
+
+ ConfigValues::Entry entry;
+ while(end - src > 4){
+ Uint32 tmp = ntohl(* (const Uint32 *)src); src += 4;
+ entry.m_key = tmp & KP_MASK;
+ entry.m_type = ::getTypeOf(tmp);
+ switch(entry.m_type){
+ case ConfigValues::IntType:
+ case ConfigValues::SectionType:
+ entry.m_int = ntohl(* (const Uint32 *)src); src += 4;
+ break;
+ case ConfigValues::Int64Type:{
+ Uint64 hi = ntohl(* (const Uint32 *)src); src += 4;
+ Uint64 lo = ntohl(* (const Uint32 *)src); src += 4;
+ entry.m_int64 = (hi <<32) | lo;
+ }
+ break;
+ case ConfigValues::StringType:{
+ Uint32 s_len = ntohl(* (const Uint32 *)src); src += 4;
+ size_t s_len2 = strlen((const char*)src);
+ if(s_len2 + 1 != s_len){
+ DEBUG abort();
+ return false;
+ }
+
+ entry.m_string = (const char*)src; src+= mod4(s_len);
+ }
+ break;
+ case ConfigValues::InvalidType:
+ default:
+ DEBUG abort();
+ return false;
+ }
+ if(!put(entry)){
+ DEBUG abort();
+ return false;
+ }
+ }
+ if(src != end){
+ DEBUG abort();
+ return false;
+ }
+ return true;
+}
+
+#ifdef __TEST_CV_HASH_HPP
+
+int
+main(void){
+ srand(time(0));
+ for(int t = 0; t<100; t++){
+ const size_t len = directory(rand() % 1000);
+
+ printf("size = %d\n", len);
+ unsigned * buf = new unsigned[len];
+ for(size_t key = 0; key<len; key++){
+ Uint32 p = hash(key, len);
+ for(size_t j = 0; j<len; j++){
+ buf[j] = p;
+ p = nextHash(key, len, p, j+1);
+ }
+
+ for(size_t j = 0; j<len; j++){
+ Uint32 pos = buf[j];
+ int unique = 0;
+ for(size_t k = j + 1; k<len; k++){
+ if(pos == buf[k]){
+ if(unique > 0)
+ printf("size=%d key=%d pos(%d)=%d buf[%d]=%d\n", len, key, j, pos, k, buf[k]);
+ unique ++;
+ }
+ }
+ if(unique > 1){
+ printf("key = %d size = %d not uniqe!!\n", key, len);
+ for(size_t k = 0; k<len; k++){
+ printf("%d ", buf[k]);
+ }
+ printf("\n");
+ }
+ }
+ }
+ delete[] buf;
+ }
+ return 0;
+}
+
+#endif
diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am
new file mode 100644
index 00000000000..59d9775b8e3
--- /dev/null
+++ b/ndb/src/common/util/Makefile.am
@@ -0,0 +1,17 @@
+
+noinst_LTLIBRARIES = libgeneral.la
+
+libgeneral_la_SOURCES = \
+ File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \
+ SimpleProperties.cpp Parser.cpp InputStream.cpp SocketServer.cpp \
+ OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \
+ NdbSqlUtil.cpp new.cpp \
+ uucode.c random.c getarg.c version.c \
+ strdup.c strlcat.c strlcpy.c \
+ ConfigValues.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/common/util/Makefile b/ndb/src/common/util/Makefile_old
index e8ca2b87c20..65093396246 100644
--- a/ndb/src/common/util/Makefile
+++ b/ndb/src/common/util/Makefile_old
@@ -8,7 +8,7 @@ ARCHIVE_TARGET := general
SOURCES = File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \
SimpleProperties.cpp Parser.cpp InputStream.cpp SocketServer.cpp \
OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \
- NdbSqlUtil.cpp new.cpp
+ NdbSqlUtil.cpp ConfigValues.cpp new.cpp
SOURCES.c = uucode.c random.c getarg.c version.c
@@ -20,7 +20,7 @@ ifeq ($(NDB_OS), OSE)
endif
SOURCES.c += strdup.c strlcat.c strlcpy.c
-DIRS := testSimpleProperties
+DIRS := testSimpleProperties testProperties testConfigValues
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp
index e91ade374cf..e34d6d18539 100644
--- a/ndb/src/common/util/NdbSqlUtil.cpp
+++ b/ndb/src/common/util/NdbSqlUtil.cpp
@@ -155,6 +155,14 @@ NdbSqlUtil::m_typeList[] = {
{
Type::Timespec,
NULL // cmpTimespec
+ },
+ {
+ Type::Blob,
+ NULL // cmpDatetime
+ },
+ {
+ Type::Clob,
+ cmpClob
}
};
@@ -284,6 +292,18 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32
return cmp(Type::Timespec, p1, p2, full, size);
}
+int
+NdbSqlUtil::cmpBlob(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size)
+{
+ return cmp(Type::Blob, p1, p2, full, size);
+}
+
+int
+NdbSqlUtil::cmpClob(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size)
+{
+ return cmp(Type::Clob, p1, p2, full, size);
+}
+
#ifdef NDB_SQL_UTIL_TEST
#include <NdbTick.h>
diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp
index 2ab008142ba..3e41056ac18 100644
--- a/ndb/src/common/util/Properties.cpp
+++ b/ndb/src/common/util/Properties.cpp
@@ -21,6 +21,12 @@
#include <NdbTCP.h>
#include <NdbOut.hpp>
+static
+char * f_strdup(const char * s){
+ if(!s) return 0;
+ return strdup(s);
+}
+
/**
* Note has to be a multiple of 4 bytes
*/
@@ -36,6 +42,7 @@ struct PropertyImpl{
~PropertyImpl();
PropertyImpl(const char * name, Uint32 value);
+ PropertyImpl(const char * name, Uint64 value);
PropertyImpl(const char * name, const char * value);
PropertyImpl(const char * name, const Properties * value);
@@ -167,6 +174,11 @@ Properties::put(const char * name, Uint32 value, bool replace){
return ::put(impl, name, value, replace);
}
+bool
+Properties::put64(const char * name, Uint64 value, bool replace){
+ return ::put(impl, name, value, replace);
+}
+
bool
Properties::put(const char * name, const char * value, bool replace){
return ::put(impl, name, value, replace);
@@ -208,6 +220,40 @@ Properties::get(const char * name, Uint32 * value) const {
setErrno(E_PROPERTIES_OK);
return true;
}
+
+ if(nvp->valueType == PropertiesType_Uint64){
+ Uint64 tmp = * (Uint64 *)nvp->value;
+ Uint64 max = 1; max <<= 32;
+ if(tmp < max){
+ * value = (Uint32)tmp;
+ setErrno(E_PROPERTIES_OK);
+ return true;
+ }
+ }
+ setErrno(E_PROPERTIES_INVALID_TYPE);
+ return false;
+}
+
+bool
+Properties::get(const char * name, Uint64 * value) const {
+ PropertyImpl * nvp = impl->get(name);
+ if(nvp == 0){
+ setErrno(E_PROPERTIES_NO_SUCH_ELEMENT);
+ return false;
+ }
+
+ if(nvp->valueType == PropertiesType_Uint32){
+ Uint32 tmp = * (Uint32 *)nvp->value;
+ * value = (Uint64)tmp;
+ setErrno(E_PROPERTIES_OK);
+ return true;
+ }
+
+ if(nvp->valueType == PropertiesType_Uint64){
+ * value = * (Uint64 *)nvp->value;
+ setErrno(E_PROPERTIES_OK);
+ return true;
+ }
setErrno(E_PROPERTIES_INVALID_TYPE);
return false;
}
@@ -263,7 +309,7 @@ Properties::getCopy(const char * name, char ** value) const {
}
if(nvp->valueType == PropertiesType_char){
- * value = strdup((const char *)nvp->value);
+ * value = f_strdup((const char *)nvp->value);
setErrno(E_PROPERTIES_OK);
return true;
}
@@ -313,6 +359,10 @@ Properties::print(FILE * out, const char * prefix) const{
fprintf(out, "%s%s = (Uint32) %d\n", buf, impl->content[i]->name,
*(Uint32 *)impl->content[i]->value);
break;
+ case PropertiesType_Uint64:
+ fprintf(out, "%s%s = (Uint64) %lld\n", buf, impl->content[i]->name,
+ *(Uint64 *)impl->content[i]->value);
+ break;
case PropertiesType_char:
fprintf(out, "%s%s = (char*) \"%s\"\n", buf, impl->content[i]->name,
(char *)impl->content[i]->value);
@@ -598,11 +648,18 @@ PropertiesImpl::getPackedSize(Uint32 pLen) const {
sz += 4; // Name Len
sz += 4; // Value Len
sz += mod4(pLen + strlen(content[i]->name)); // Name
- if(content[i]->valueType == PropertiesType_char){
+ switch(content[i]->valueType){
+ case PropertiesType_char:
sz += mod4(strlen((char *)content[i]->value));
- } else if(content[i]->valueType == PropertiesType_Uint32){
+ break;
+ case PropertiesType_Uint32:
sz += mod4(4);
- } else {
+ break;
+ case PropertiesType_Uint64:
+ sz += mod4(8);
+ break;
+ case PropertiesType_Properties:
+ default:
assert(0);
}
}
@@ -700,6 +757,9 @@ PropertiesImpl::pack(Uint32 *& buf, const char * prefix, Uint32 pLen) const {
case PropertiesType_Uint32:
valLenData = 4;
break;
+ case PropertiesType_Uint64:
+ valLenData = 8;
+ break;
case PropertiesType_char:
valLenData = strlen((char *)content[i]->value);
break;
@@ -722,6 +782,14 @@ PropertiesImpl::pack(Uint32 *& buf, const char * prefix, Uint32 pLen) const {
case PropertiesType_Uint32:
* (Uint32 *)valBuf = htonl(* (Uint32 *)content[i]->value);
break;
+ case PropertiesType_Uint64:{
+ Uint64 val = * (Uint64 *)content[i]->value;
+ Uint32 hi = (val >> 32);
+ Uint32 lo = (val & 0xFFFFFFFF);
+ * (Uint32 *)valBuf = htonl(hi);
+ * (Uint32 *)(valBuf + 4) = htonl(lo);
+ }
+ break;
case PropertiesType_char:
memcpy(valBuf, content[i]->value, strlen((char*)content[i]->value));
break;
@@ -788,6 +856,12 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top,
case PropertiesType_Uint32:
res3 = top->put(nameBuf, ntohl(* (Uint32 *)valBuf), true);
break;
+ case PropertiesType_Uint64:{
+ Uint64 hi = ntohl(* (Uint32 *)valBuf);
+ Uint64 lo = ntohl(* (Uint32 *)(valBuf + 4));
+ res3 = top->put64(nameBuf, (hi << 32) + lo, true);
+ }
+ break;
case PropertiesType_char:
res3 = top->put(nameBuf, valBuf, true);
break;
@@ -808,6 +882,9 @@ PropertyImpl::~PropertyImpl(){
case PropertiesType_Uint32:
delete (Uint32 *)value;
break;
+ case PropertiesType_Uint64:
+ delete (Uint64 *)value;
+ break;
case PropertiesType_char:
free((char *)value);
break;
@@ -822,6 +899,8 @@ PropertyImpl::copyPropertyImpl(const PropertyImpl & org){
switch(org.valueType){
case PropertiesType_Uint32:
return new PropertyImpl(org.name, * (Uint32 *)org.value);
+ case PropertiesType_Uint64:
+ return new PropertyImpl(org.name, * (Uint64 *)org.value);
break;
case PropertiesType_char:
return new PropertyImpl(org.name, (char *)org.value);
@@ -836,21 +915,28 @@ PropertyImpl::copyPropertyImpl(const PropertyImpl & org){
}
PropertyImpl::PropertyImpl(const char * _name, Uint32 _value){
- this->name = strdup(_name);
+ this->name = f_strdup(_name);
this->value = new Uint32;
* ((Uint32 *)this->value) = _value;
this->valueType = PropertiesType_Uint32;
}
+PropertyImpl::PropertyImpl(const char * _name, Uint64 _value){
+ this->name = f_strdup(_name);
+ this->value = new Uint64;
+ * ((Uint64 *)this->value) = _value;
+ this->valueType = PropertiesType_Uint64;
+}
+
PropertyImpl::PropertyImpl(const char * _name, const char * _value){
- this->name = strdup(_name);
- this->value = strdup(_value);
+ this->name = f_strdup(_name);
+ this->value = f_strdup(_value);
this->valueType = PropertiesType_char;
}
PropertyImpl::PropertyImpl(const char * _name, const Properties * _value){
- this->name = strdup(_name);
+ this->name = f_strdup(_name);
this->value = new Properties(* _value);
this->valueType = PropertiesType_Properties;
}
@@ -902,6 +988,16 @@ Properties::put(const char * name, Uint32 no, Uint32 val, bool replace){
return res;
}
+bool
+Properties::put64(const char * name, Uint32 no, Uint64 val, bool replace){
+ size_t tmp_len = strlen(name)+20;
+ char * tmp = (char*)malloc(tmp_len);
+ snprintf(tmp, tmp_len, "%s_%d", name, no);
+ bool res = put(tmp, val, replace);
+ free(tmp);
+ return res;
+}
+
bool
Properties::put(const char * name, Uint32 no, const char * val, bool replace){
@@ -957,6 +1053,16 @@ Properties::get(const char * name, Uint32 no, Uint32 * value) const{
return res;
}
+bool
+Properties::get(const char * name, Uint32 no, Uint64 * value) const{
+ size_t tmp_len = strlen(name)+20;
+ char * tmp = (char*)malloc(tmp_len);
+ snprintf(tmp, tmp_len, "%s_%d", name, no);
+ bool res = get(tmp, value);
+ free(tmp);
+ return res;
+}
+
bool
Properties::get(const char * name, Uint32 no, const char ** value) const {
diff --git a/ndb/src/common/util/md5_hash.cpp b/ndb/src/common/util/md5_hash.cpp
index 5e28edcf8fa..068843183ac 100644
--- a/ndb/src/common/util/md5_hash.cpp
+++ b/ndb/src/common/util/md5_hash.cpp
@@ -48,7 +48,7 @@ void byteReverse(unsigned char *buf, unsigned longs);
*/
void byteReverse(unsigned char *buf, unsigned longs)
{
- uint32 t;
+ Uint32 t;
do {
t = (Uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
diff --git a/ndb/src/common/util/new.cpp b/ndb/src/common/util/new.cpp
index 889e83edf6f..b61541b7474 100644
--- a/ndb/src/common/util/new.cpp
+++ b/ndb/src/common/util/new.cpp
@@ -5,6 +5,8 @@ extern "C" {
void (* ndb_new_handler)() = 0;
}
+#ifdef USE_MYSYS_NEW
+
void *operator new (size_t sz)
{
void * p = malloc (sz ? sz : 1);
@@ -36,3 +38,5 @@ void operator delete[] (void *ptr) throw ()
if (ptr)
free(ptr);
}
+
+#endif // USE_MYSYS_NEW
diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp
index 8def7ebe91b..97bb4863a67 100644
--- a/ndb/src/common/util/socket_io.cpp
+++ b/ndb/src/common/util/socket_io.cpp
@@ -202,13 +202,13 @@ vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
size_t size = sizeof(buf);
if (fmt != 0) {
- size = vsnprintf(buf, sizeof(buf)-1, fmt, ap);
+ size = vsnprintf(buf, sizeof(buf), fmt, ap);
/* Check if the output was truncated */
- if(size >= sizeof(buf)) {
+ if(size >= sizeof(buf)-1) {
buf2 = (char *)malloc(size+2);
if(buf2 == NULL)
return -1;
- vsnprintf(buf2, size, fmt, ap);
+ vsnprintf(buf2, size+1, fmt, ap);
} else
size = sizeof(buf);
} else
diff --git a/ndb/src/common/util/testConfigValues/Makefile b/ndb/src/common/util/testConfigValues/Makefile
new file mode 100644
index 00000000000..5b7400f5ee3
--- /dev/null
+++ b/ndb/src/common/util/testConfigValues/Makefile
@@ -0,0 +1,12 @@
+include .defs.mk
+
+TYPE := util
+
+BIN_TARGET := testConfigValues
+BIN_TARGET_ARCHIVES := portlib general
+
+SOURCES := testConfigValues.cpp
+
+CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/common/util/testConfigValues/testConfigValues.cpp b/ndb/src/common/util/testConfigValues/testConfigValues.cpp
new file mode 100644
index 00000000000..362deb1ddad
--- /dev/null
+++ b/ndb/src/common/util/testConfigValues/testConfigValues.cpp
@@ -0,0 +1,122 @@
+#include <ConfigValues.hpp>
+#include <NdbOut.hpp>
+#include <stdlib.h>
+#include <string.h>
+
+#define CF_NODES 1
+#define CF_LOG_PAGES 2
+#define CF_MEM_PAGES 3
+#define CF_START_TO 4
+#define CF_STOP_TO 5
+
+void print(Uint32 i, ConfigValues::ConstIterator & cf){
+ ndbout_c("---");
+ for(Uint32 j = 2; j<=7; j++){
+ switch(cf.getTypeOf(j)){
+ case ConfigValues::IntType:
+ ndbout_c("Node %d : CFG(%d) : %d",
+ i, j, cf.get(j, 999));
+ break;
+ case ConfigValues::Int64Type:
+ ndbout_c("Node %d : CFG(%d) : %lld (64)",
+ i, j, cf.get64(j, 999));
+ break;
+ case ConfigValues::StringType:
+ ndbout_c("Node %d : CFG(%d) : %s",
+ i, j, cf.get(j, "<NOT FOUND>"));
+ break;
+ default:
+ ndbout_c("Node %d : CFG(%d) : TYPE: %d",
+ i, j, cf.getTypeOf(j));
+ }
+ }
+}
+
+void print(Uint32 i, ConfigValues & _cf){
+ ConfigValues::ConstIterator cf(_cf);
+ print(i, cf);
+}
+
+void
+print(ConfigValues & _cf){
+ ConfigValues::ConstIterator cf(_cf);
+ Uint32 i = 0;
+ while(cf.openSection(CF_NODES, i)){
+ print(i, cf);
+ cf.closeSection();
+ i++;
+ }
+}
+
+inline
+void
+require(bool b){
+ if(!b)
+ abort();
+}
+
+int
+main(void){
+
+ {
+ ConfigValuesFactory cvf(10, 20);
+ cvf.openSection(1, 0);
+ cvf.put(2, 12);
+ cvf.put64(3, 13);
+ cvf.put(4, 14);
+ cvf.put64(5, 15);
+ cvf.put(6, "Keso");
+ cvf.put(7, "Kent");
+ cvf.closeSection();
+
+ cvf.openSection(1, 1);
+ cvf.put(2, 22);
+ cvf.put64(3, 23);
+ cvf.put(4, 24);
+ cvf.put64(5, 25);
+ cvf.put(6, "Kalle");
+ cvf.put(7, "Anka");
+ cvf.closeSection();
+
+ ndbout_c("-- print --");
+ print(* cvf.m_cfg);
+
+ cvf.shrink();
+ ndbout_c("shrink\n-- print --");
+ print(* cvf.m_cfg);
+ cvf.expand(10, 10);
+ ndbout_c("expand\n-- print --");
+ print(* cvf.m_cfg);
+
+ ndbout_c("packed size: %d", cvf.m_cfg->getPackedSize());
+
+ ConfigValues::ConstIterator iter(* cvf.m_cfg);
+ iter.openSection(CF_NODES, 0);
+ ConfigValues * cfg2 = ConfigValuesFactory::extractCurrentSection(iter);
+ print(99, * cfg2);
+
+ cvf.shrink();
+ ndbout_c("packed size: %d", cfg2->getPackedSize());
+
+ UtilBuffer buf;
+ Uint32 l1 = cvf.m_cfg->pack(buf);
+ Uint32 l2 = cvf.m_cfg->getPackedSize();
+ require(l1 == l2);
+
+ ConfigValuesFactory cvf2;
+ require(cvf2.unpack(buf));
+ UtilBuffer buf2;
+ cvf2.shrink();
+ Uint32 l3 = cvf2.m_cfg->pack(buf2);
+ require(l1 == l3);
+
+ ndbout_c("unpack\n-- print --");
+ print(* cvf2.m_cfg);
+
+ cfg2->~ConfigValues();;
+ cvf.m_cfg->~ConfigValues();
+ free(cfg2);
+ free(cvf.m_cfg);
+ }
+ return 0;
+}
diff --git a/ndb/src/common/util/testProperties/Makefile b/ndb/src/common/util/testProperties/Makefile
index 00b4465b69d..343c07a49e7 100644
--- a/ndb/src/common/util/testProperties/Makefile
+++ b/ndb/src/common/util/testProperties/Makefile
@@ -1,12 +1,9 @@
include .defs.mk
-TYPE :=
+TYPE := util
BIN_TARGET := keso
-BIN_TARGET_ARCHIVES := portlib general
SOURCES := testProperties.cpp
-CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
-
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/common/util/testProperties/testProperties.cpp b/ndb/src/common/util/testProperties/testProperties.cpp
index 3aa2af92c5b..e445f7ca3e4 100644
--- a/ndb/src/common/util/testProperties/testProperties.cpp
+++ b/ndb/src/common/util/testProperties/testProperties.cpp
@@ -63,12 +63,6 @@ readFromFile(Properties & p, const char *fname, bool uu = true){
return res;
}
-Property defs[] = {
- Property("Rolf", 123)
- ,Property("Keso", "Kent")
-};
-
-
void putALot(Properties & tmp){
int i = 123;
tmp.put("LockPagesInMainMemory", i++);
@@ -124,7 +118,6 @@ main(void){
p.put("Ank4", "anka");
putALot(p);
- //p.put(defs, 2);
Properties tmp;
tmp.put("Type", "TCP");
tmp.put("OwnNodeId", 1);
@@ -136,8 +129,8 @@ main(void){
tmp.put("Compression", (Uint32)false);
tmp.put("Checksum", 1);
- tmp.put("SendBufferSize", 2000);
- tmp.put("MaxReceiveSize", 1000);
+ tmp.put64("SendBufferSize", 2000);
+ tmp.put64("MaxReceiveSize", 1000);
tmp.put("PortNumber", 1233);
putALot(tmp);
diff --git a/ndb/src/cw/Makefile.am b/ndb/src/cw/Makefile.am
new file mode 100644
index 00000000000..b530922a3a7
--- /dev/null
+++ b/ndb/src/cw/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = cpcd
diff --git a/ndb/src/cw/Makefile b/ndb/src/cw/Makefile_old
index e710c1e244d..e710c1e244d 100644
--- a/ndb/src/cw/Makefile
+++ b/ndb/src/cw/Makefile_old
diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am
new file mode 100644
index 00000000000..6345bae9bbe
--- /dev/null
+++ b/ndb/src/cw/cpcd/Makefile.am
@@ -0,0 +1,14 @@
+
+ndbtools_PROGRAMS = ndb_cpcd
+
+ndb_cpcd_SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp
+
+LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+
+ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/cw/cpcd/Makefile b/ndb/src/cw/cpcd/Makefile_old
index f214fb087d2..f214fb087d2 100644
--- a/ndb/src/cw/cpcd/Makefile
+++ b/ndb/src/cw/cpcd/Makefile_old
diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/Main.cpp
index 46eb41b0ec6..7bd4e75ca18 100644
--- a/ndb/src/kernel/ndb-main/Main.cpp
+++ b/ndb/src/kernel/Main.cpp
@@ -33,7 +33,7 @@
#include <EventLogger.hpp>
#include <NodeState.hpp>
-#if defined NDB_SOLARIS
+#if defined NDB_SOLARIS // ok
#include <sys/processor.h> // For system informatio
#endif
@@ -52,10 +52,7 @@ void systemInfo(const Configuration & conf,
const char programName[] = "NDB Kernel";
-extern int global_ndb_check;
NDB_MAIN(ndb_kernel){
-
- global_ndb_check = 1;
// Print to stdout/console
g_eventLogger.createConsoleHandler();
@@ -94,9 +91,10 @@ NDB_MAIN(ndb_kernel){
* Parent
*/
catchsigs(true);
+
int status = 0;
while(waitpid(child, &status, 0) != child);
- if(WIFEXITED(status) || !theConfig->stopOnError()){
+ if(WIFEXITED(status)){
switch(WEXITSTATUS(status)){
case NRT_Default:
g_eventLogger.info("Angel shutting down");
@@ -115,24 +113,29 @@ NDB_MAIN(ndb_kernel){
globalData.theRestartFlag = perform_start;
break;
default:
+ if(theConfig->stopOnError()){
+ /**
+ * Error shutdown && stopOnError()
+ */
+ exit(0);
+ }
+ // Fall-through
case NRT_DoStart_Restart:
theConfig->setInitialStart(false);
globalData.theRestartFlag = perform_start;
break;
}
- g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
- } else {
+ } else if(theConfig->stopOnError()){
/**
* Error shutdown && stopOnError()
*/
exit(0);
}
+ g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
}
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
-
- systemInfo(* theConfig,
- theConfig->clusterConfigurationData().SizeAltData.logLevel);
+ systemInfo(* theConfig, * theConfig->m_logLevel);
// Load blocks
globalEmulatorData.theSimBlockList->load(* theConfig);
@@ -147,6 +150,7 @@ NDB_MAIN(ndb_kernel){
char buf[255];
strcpy(buf, homePath);
FILE * signalLog = fopen(strncat(buf,"Signal.log", 255), "a");
+ globalSignalLoggers.setOwnNodeId(globalData.ownId);
globalSignalLoggers.setOutputStream(signalLog);
#endif
@@ -199,7 +203,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
}
RegCloseKey(hKey);
}
-#elif defined NDB_SOLARIS
+#elif defined NDB_SOLARIS // ok
// Search for at max 16 processors among the first 256 processor ids
processor_info_t pinfo; memset(&pinfo, 0, sizeof(pinfo));
int pid = 0;
@@ -213,7 +217,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId);
g_eventLogger.info("%s --", NDB_VERSION_STRING);
-#ifdef NDB_SOLARIS
+#ifdef NDB_SOLARIS // ok
g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz",
processor, speed);
#endif
diff --git a/ndb/src/kernel/Makefile b/ndb/src/kernel/Makefile
deleted file mode 100644
index 11261c047a6..00000000000
--- a/ndb/src/kernel/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include .defs.mk
-
-DIRS := error blocks vm ndb-main
-
-include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am
new file mode 100644
index 00000000000..b2aa5f2e074
--- /dev/null
+++ b/ndb/src/kernel/Makefile.am
@@ -0,0 +1,58 @@
+SUBDIRS = error blocks vm
+
+include $(top_srcdir)/ndb/config/common.mk.am
+
+ndbbin_PROGRAMS = ndbd
+
+ndbd_SOURCES = Main.cpp SimBlockList.cpp
+
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+INCLUDES += \
+ -Iblocks/cmvmi \
+ -Iblocks/dbacc \
+ -Iblocks/dbdict \
+ -Iblocks/dbdih \
+ -Iblocks/dblqh \
+ -Iblocks/dbtc \
+ -Iblocks/dbtup \
+ -Iblocks/ndbfs \
+ -Iblocks/ndbcntr \
+ -Iblocks/qmgr \
+ -Iblocks/trix \
+ -Iblocks/backup \
+ -Iblocks/dbutil \
+ -Iblocks/suma \
+ -Iblocks/grep \
+ -Iblocks/dbtux
+
+LDADD += \
+ blocks/cmvmi/libcmvmi.a \
+ blocks/dbacc/libdbacc.a \
+ blocks/dbdict/libdbdict.a \
+ blocks/dbdih/libdbdih.a \
+ blocks/dblqh/libdblqh.a \
+ blocks/dbtc/libdbtc.a \
+ blocks/dbtup/libdbtup.a \
+ blocks/ndbfs/libndbfs.a \
+ blocks/ndbcntr/libndbcntr.a \
+ blocks/qmgr/libqmgr.a \
+ blocks/trix/libtrix.a \
+ blocks/backup/libbackup.a \
+ blocks/dbutil/libdbutil.a \
+ blocks/suma/libsuma.a \
+ blocks/grep/libgrep.a \
+ blocks/dbtux/libdbtux.a \
+ vm/libkernel.a \
+ error/liberror.a \
+ $(top_builddir)/ndb/src/common/transporter/libtransporter.la \
+ $(top_builddir)/ndb/src/common/debugger/libtrace.la \
+ $(top_builddir)/ndb/src/common/debugger/signaldata/libsignaldataprint.la \
+ $(top_builddir)/ndb/src/common/logger/liblogger.la \
+ $(top_builddir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \
+ $(top_builddir)/ndb/src/mgmapi/libmgmapi.la \
+ $(top_builddir)/ndb/src/common/portlib/libportlib.la \
+ $(top_builddir)/ndb/src/common/util/libgeneral.la
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/scripts/Makefile b/ndb/src/kernel/Makefile_old
index bc8049ac34b..d1f1741aca4 100644
--- a/ndb/src/scripts/Makefile
+++ b/ndb/src/kernel/Makefile_old
@@ -1,5 +1,5 @@
include .defs.mk
-DIRS :=
+DIRS := error vm ndb-main blocks
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/kernel/ndb-main/SimBlockList.cpp b/ndb/src/kernel/SimBlockList.cpp
index 9e1d28a7fce..75a52ae0c4b 100644
--- a/ndb/src/kernel/ndb-main/SimBlockList.cpp
+++ b/ndb/src/kernel/SimBlockList.cpp
@@ -32,7 +32,11 @@
#include <Suma.hpp>
#include <Grep.hpp>
#include <Dbtux.hpp>
+#include <NdbEnv.h>
+#ifndef VM_TRACE
+#define NEW_BLOCK(B) new B
+#else
enum SIMBLOCKLIST_DUMMY { A_VALUE = 0 };
static
@@ -59,32 +63,43 @@ void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){
return tmp;
}
+#define NEW_BLOCK(B) new(A_VALUE) B
+#endif
void
SimBlockList::load(const Configuration & conf){
noOfBlocks = 16;
theList = new SimulatedBlock * [noOfBlocks];
- for(int i = 0; i<noOfBlocks; i++)
- theList[i] = 0;
Dbdict* dbdict = 0;
Dbdih* dbdih = 0;
+
+ SimulatedBlock * fs = 0;
+ {
+ Uint32 dl;
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
+ if(p && !ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl){
+ fs = NEW_BLOCK(VoidFs)(conf);
+ } else {
+ fs = NEW_BLOCK(Ndbfs)(conf);
+ }
+ }
- theList[0] = new (A_VALUE) Dbacc(conf);
- theList[1] = new (A_VALUE) Cmvmi(conf);
- theList[2] = new (A_VALUE) Ndbfs(conf);
- theList[3] = dbdict = new (A_VALUE) Dbdict(conf);
- theList[4] = dbdih = new (A_VALUE) Dbdih(conf);
- theList[5] = new (A_VALUE) Dblqh(conf);
- theList[6] = new (A_VALUE) Dbtc(conf);
- theList[7] = new (A_VALUE) Dbtup(conf);
- theList[8] = new (A_VALUE) Ndbcntr(conf);
- theList[9] = new (A_VALUE) Qmgr(conf);
- theList[10] = new (A_VALUE) Trix(conf);
- theList[11] = new (A_VALUE) Backup(conf);
- theList[12] = new (A_VALUE) DbUtil(conf);
- theList[13] = new (A_VALUE) Suma(conf);
- theList[14] = new (A_VALUE) Grep(conf);
- theList[15] = new (A_VALUE) Dbtux(conf);
+ theList[0] = NEW_BLOCK(Dbacc)(conf);
+ theList[1] = NEW_BLOCK(Cmvmi)(conf);
+ theList[2] = fs;
+ theList[3] = dbdict = NEW_BLOCK(Dbdict)(conf);
+ theList[4] = dbdih = NEW_BLOCK(Dbdih)(conf);
+ theList[5] = NEW_BLOCK(Dblqh)(conf);
+ theList[6] = NEW_BLOCK(Dbtc)(conf);
+ theList[7] = NEW_BLOCK(Dbtup)(conf);
+ theList[8] = NEW_BLOCK(Ndbcntr)(conf);
+ theList[9] = NEW_BLOCK(Qmgr)(conf);
+ theList[10] = NEW_BLOCK(Trix)(conf);
+ theList[11] = NEW_BLOCK(Backup)(conf);
+ theList[12] = NEW_BLOCK(DbUtil)(conf);
+ theList[13] = NEW_BLOCK(Suma)(conf);
+ theList[14] = NEW_BLOCK(Grep)(conf);
+ theList[15] = NEW_BLOCK(Dbtux)(conf);
// Metadata common part shared by block instances
ptrMetaDataCommon = new MetaData::Common(*dbdict, *dbdih);
diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt
index 331333c101e..92dbfd067f7 100644
--- a/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -4,7 +4,7 @@ Next NDBFS 2000
Next DBACC 3001
Next DBTUP 4007
Next DBLQH 5036
-Next DBDICT 6003
+Next DBDICT 6006
Next DBDIH 7173
Next DBTC 8035
Next CMVMI 9000
@@ -12,7 +12,6 @@ Next BACKUP 10022
Next DBUTIL 11002
Next DBTUX 12001
Next SUMA 13001
-Next DBDICT 14003
TESTING NODE FAILURE, ARBITRATION
---------------------------------
@@ -425,6 +424,6 @@ Ordered index:
Dbdict:
-------
-14000 Crash in participant @ CreateTabReq::Prepare
-14001 Crash in participant @ CreateTabReq::Commit
-14002 Crash in participant @ CreateTabReq::CreateDrop
+6003 Crash in participant @ CreateTabReq::Prepare
+6004 Crash in participant @ CreateTabReq::Commit
+6005 Crash in participant @ CreateTabReq::CreateDrop
diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am
new file mode 100644
index 00000000000..0b2bc3b8c88
--- /dev/null
+++ b/ndb/src/kernel/blocks/Makefile.am
@@ -0,0 +1,17 @@
+SUBDIRS = \
+ cmvmi \
+ dbacc \
+ dbdict \
+ dbdih \
+ dblqh \
+ dbtc \
+ dbtup \
+ ndbfs \
+ ndbcntr \
+ qmgr \
+ trix \
+ backup \
+ dbutil \
+ suma \
+ grep \
+ dbtux
diff --git a/ndb/src/kernel/blocks/Makefile b/ndb/src/kernel/blocks/Makefile_old
index ce554dfc3b8..ce554dfc3b8 100644
--- a/ndb/src/kernel/blocks/Makefile
+++ b/ndb/src/kernel/blocks/Makefile_old
diff --git a/ndb/src/kernel/blocks/Start.txt b/ndb/src/kernel/blocks/Start.txt
index 545296d44f1..3e805ebab55 100644
--- a/ndb/src/kernel/blocks/Start.txt
+++ b/ndb/src/kernel/blocks/Start.txt
@@ -60,8 +60,8 @@ Cluster participant -
including info in DIH_RESTART_REF/CONF
4) Wait until -
-a) Receiving CNTR_MASTER_CONF -> continue
-b) Receiving CNTR_MASTER_REF -> P = node specified in REF, goto 3
+b) Receiving CNTR_START_CONF -> continue
+b) Receiving CNTR_START_REF -> P = node specified in REF, goto 3
c) TimeToWaitAlive has passed -> Failure to start
4) Run ndb-startphase 1
@@ -70,18 +70,23 @@ c) TimeToWaitAlive has passed -> Failure to start
Initial start/System restart NdbCntr (on qmgr president node)
1) Wait until -
-a) Receiving all CNTR_MASTER_REQ (all = those in READ_NODES_CONF)
-b) TimeToWaitAlive has passed -> Failure to start
+a) Receiving CNTR_START_REQ with GCI > than own GCI
+ send CNTR_START_REF to all waiting nodes
+b) Receiving all CNTR_START_REQ (for all defined nodes)
+c) TimeToWait has passed and partition win
+d) TimeToWait has passed and partitioning
+ and configuration "start with partition" = true
-2) Wait until -
-a) Enough nodes (at least 1 in each node group and 1 full node group)
- has sent me CNTR_MASTER_REQ
-b) TimeToWaitAlive has passed -> Failure to start
+2) Send CNTR_START_CONF to all nodes "with filesystem"
+
+3) Wait until -
+ Receiving CNTR_START_REP for all starting nodes
-3) Decide what kind of start to perform (initial / system restart)
- Decide who should be the master (the one with greatest GCI)
- Send CNTR_MASTER_CONF(initial/system restart) to all nodes included in start
+4) Start waiting nodes (if any)
+NOTE:
+1c) Partition win = 1 node in each node group and 1 full node group
+1d) Pattitioning = at least 1 node in each node group
--
Running NdbCntr
@@ -90,8 +95,3 @@ When receiving CNTR_MASTER_REQ
2) If I'm master
Coordinate parallell node restarts
send CNTR_MASTER_CONF (node restart)
-
-NOTE:
-2a Specified with a command line/config parameter the system could
- start using only one node in each node group (if possible w.r.t LCP/GCP)
-
diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp
index 1997e560bb9..36ce1857144 100644
--- a/ndb/src/kernel/blocks/backup/BackupInit.cpp
+++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp
@@ -38,14 +38,14 @@ Backup::Backup(const Configuration & conf) :
c_nodePool.setSize(MAX_NDB_NODES);
c_masterNodeId = getOwnNodeId();
- const Properties * p = conf.getOwnProperties();
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
- p->get("ParallelBackups", &noBackups);
- ndbrequire(p->get("MaxNoOfTables", &noTables));
- ndbrequire(p->get("MaxNoOfAttributes", &noAttribs));
-
+ ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
+
// To allow for user tables AND SYSTAB
// See ClusterConfig
//TODO get this infor from NdbCntr
@@ -65,7 +65,7 @@ Backup::Backup(const Configuration & conf) :
c_fragmentPool.setSize(noBackups * 2 * NO_OF_FRAG_PER_NODE * noTables);
Uint32 szMem = 0;
- p->get("BackupMemory", &szMem);
+ ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
Uint32 noPages = (szMem + sizeof(Page32) - 1) / sizeof(Page32);
// We need to allocate an additional of 2 pages. 1 page because of a bug in
// ArrayPool and another one for DICTTAINFO.
@@ -74,9 +74,9 @@ Backup::Backup(const Configuration & conf) :
Uint32 szDataBuf = (2 * 1024 * 1024);
Uint32 szLogBuf = (2 * 1024 * 1024);
Uint32 szWrite = 32768;
- p->get("BackupDataBufferSize", &szDataBuf);
- p->get("BackupLogBufferSize", &szLogBuf);
- p->get("BackupWriteSize", &szWrite);
+ ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf);
+ ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf);
+ ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite);
c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf;
diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am
new file mode 100644
index 00000000000..85bf5b12415
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/Makefile.am
@@ -0,0 +1,12 @@
+
+SUBDIRS = restore
+
+noinst_LIBRARIES = libbackup.a
+
+libbackup_a_SOURCES = Backup.cpp BackupInit.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/backup/Makefile b/ndb/src/kernel/blocks/backup/Makefile_old
index 989199cbe02..989199cbe02 100644
--- a/ndb/src/kernel/blocks/backup/Makefile
+++ b/ndb/src/kernel/blocks/backup/Makefile_old
diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile b/ndb/src/kernel/blocks/backup/restore/Makefile
deleted file mode 100644
index 4c884525d73..00000000000
--- a/ndb/src/kernel/blocks/backup/restore/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-include .defs.mk
-
-TYPE := *
-
-BIN_TARGET := restore
-BIN_TARGET_LIBS :=
-BIN_TARGET_ARCHIVES := NDB_API
-
-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
-#LDFLAGS_LOC += -L$(MYSQLCLUSTER_TOP)/libmysql_r/ -lmysqlclient_r
-#endif
-
-SOURCES = main.cpp Restore.cpp
-
-include $(NDB_TOP)/Epilogue.mk
-
-
diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am
new file mode 100644
index 00000000000..e0429c60723
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am
@@ -0,0 +1,12 @@
+
+ndbtools_PROGRAMS = ndb_restore
+
+ndb_restore_SOURCES = main.cpp consumer.cpp consumer_restore.cpp consumer_printer.cpp Restore.cpp
+
+LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la
+
+include $(top_srcdir)/ndb/config/common.mk.am
+
+INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel
+
+ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
index 2c3c1c8df7b..24d2cfbfe35 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp
@@ -33,32 +33,32 @@ Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data
Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data
bool
-BackupFile::Twiddle(AttributeS* attr, Uint32 arraySize){
+BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Uint32 arraySize){
if(m_hostByteOrder)
return true;
if(arraySize == 0){
- arraySize = attr->Desc->arraySize;
+ arraySize = attr_desc->arraySize;
}
- switch(attr->Desc->size){
+ switch(attr_desc->size){
case 8:
return true;
case 16:
for(unsigned i = 0; i<arraySize; i++){
- attr->Data.u_int16_value[i] = Twiddle16(attr->Data.u_int16_value[i]);
+ attr_data->u_int16_value[i] = Twiddle16(attr_data->u_int16_value[i]);
}
return true;
case 32:
for(unsigned i = 0; i<arraySize; i++){
- attr->Data.u_int32_value[i] = Twiddle32(attr->Data.u_int32_value[i]);
+ attr_data->u_int32_value[i] = Twiddle32(attr_data->u_int32_value[i]);
}
return true;
case 64:
for(unsigned i = 0; i<arraySize; i++){
- attr->Data.u_int64_value[i] = Twiddle64(attr->Data.u_int64_value[i]);
+ attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]);
}
return true;
default:
@@ -82,14 +82,14 @@ RestoreMetaData::RestoreMetaData(const char* path, Uint32 nodeId, Uint32 bNo) {
}
RestoreMetaData::~RestoreMetaData(){
- for(int i = 0; i<allTables.size(); i++)
+ for(Uint32 i= 0; i < allTables.size(); i++)
delete allTables[i];
allTables.clear();
}
const TableS *
RestoreMetaData::getTable(Uint32 tableId) const {
- for(int i = 0; i<allTables.size(); i++)
+ for(Uint32 i= 0; i < allTables.size(); i++)
if(allTables[i]->getTableId() == tableId)
return allTables[i];
return NULL;
@@ -101,42 +101,14 @@ RestoreMetaData::getStopGCP() const {
}
int
-RestoreMetaData::loadContent(const char * catalog,
- const char * schema)
+RestoreMetaData::loadContent()
{
-
-#if NDB_VERSION_MAJOR >= VERSION_3X
- if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X) {
- if(catalog == NULL)
- return -1;
- if(schema == NULL)
- return -1;
- }
-
-
- /**
- * if backup is of version 3 or higher, then
- * return -2 to indicate for the user that he
- * cannot restore tables to a certain catalog/schema
- */
- if(getMajor(m_fileHeader.NdbVersion) >= VERSION_3X &&
- (catalog != NULL ||
- schema != NULL)) {
- return -2;
- }
-#endif
-#if NDB_VERSION_MAJOR < VERSION_3X
- if(getMajor(m_fileHeader.NdbVersion) >= VERSION_3X)
- {
- return -2;
- }
-#endif
-
Uint32 noOfTables = readMetaTableList();
- if(noOfTables == 0)
- return -3;
+ if(noOfTables == 0) {
+ return 1;
+ }
for(Uint32 i = 0; i<noOfTables; i++){
- if(!readMetaTableDesc(catalog, schema)){
+ if(!readMetaTableDesc()){
return 0;
}
}
@@ -150,7 +122,8 @@ RestoreMetaData::readMetaTableList() {
Uint32 sectionInfo[2];
- if (fread(&sectionInfo, sizeof(sectionInfo), 1, m_file) != 1){
+ if (buffer_read(&sectionInfo, sizeof(sectionInfo), 1) != 1){
+ err << "readMetaTableList read header error" << endl;
return 0;
}
sectionInfo[0] = ntohl(sectionInfo[0]);
@@ -158,11 +131,9 @@ RestoreMetaData::readMetaTableList() {
const Uint32 tabCount = sectionInfo[1] - 2;
- const Uint32 len = 4 * tabCount;
- if(createBuffer(len) == 0)
- abort();
-
- if (fread(m_buffer, 1, len, m_file) != len){
+ void *tmp;
+ if (buffer_get_ptr(&tmp, 4, tabCount) != tabCount){
+ err << "readMetaTableList read tabCount error" << endl;
return 0;
}
@@ -170,13 +141,12 @@ RestoreMetaData::readMetaTableList() {
}
bool
-RestoreMetaData::readMetaTableDesc(const char * catalog,
- const char * schema) {
+RestoreMetaData::readMetaTableDesc() {
Uint32 sectionInfo[2];
// Read section header
- if (fread(&sectionInfo, sizeof(sectionInfo), 1, m_file) != 1){
+ if (buffer_read(&sectionInfo, sizeof(sectionInfo), 1) != 1){
err << "readMetaTableDesc read header error" << endl;
return false;
} // if
@@ -185,23 +155,15 @@ RestoreMetaData::readMetaTableDesc(const char * catalog,
assert(sectionInfo[0] == BackupFormat::TABLE_DESCRIPTION);
- // Allocate temporary storage for dictTabInfo buffer
- const Uint32 len = (sectionInfo[1] - 2);
- if (createBuffer(4 * (len+1)) == NULL) {
- err << "readMetaTableDesc allocation error" << endl;
- return false;
- } // if
-
// Read dictTabInfo buffer
- if (fread(m_buffer, 4, len, m_file) != len){
+ const Uint32 len = (sectionInfo[1] - 2);
+ void *ptr;
+ if (buffer_get_ptr(&ptr, 4, len) != len){
err << "readMetaTableDesc read error" << endl;
return false;
} // if
- return parseTableDescriptor(m_buffer,
- len,
- catalog,
- schema);
+ return parseTableDescriptor((Uint32*)ptr, len);
}
bool
@@ -209,11 +171,10 @@ RestoreMetaData::readGCPEntry() {
Uint32 data[4];
-
BackupFormat::CtlFile::GCPEntry * dst =
(BackupFormat::CtlFile::GCPEntry *)&data[0];
- if(fread(dst, 4, 4, m_file) != 4){
+ if(buffer_read(dst, 4, 4) != 4){
err << "readGCPEntry read error" << endl;
return false;
}
@@ -234,369 +195,118 @@ RestoreMetaData::readGCPEntry() {
return true;
}
+TableS::TableS(NdbTableImpl* tableImpl)
+ : m_dictTable(tableImpl)
+{
+ m_dictTable = tableImpl;
+ m_noOfNullable = m_nullBitmaskSize = 0;
-struct tmpTableS {
- Uint32 tableId;
- Uint32 schemaVersion;
- Uint32 noOfAttributes;
-}; // tmpTableS
-
-static const
-SimpleProperties::SP2StructMapping
-RestoreTabMap[] = {
- // Map the basic stuff to begin with
- DTIMAP(tmpTableS, TableId, tableId),
- DTIMAP(tmpTableS, TableVersion, schemaVersion),
- DTIMAP(tmpTableS, NoOfAttributes, noOfAttributes),
-
- DTIBREAK(AttributeName)
-}; // RestoreTabMap
-
-static const Uint32
-TabMapSize = sizeof(RestoreTabMap)
- / sizeof(SimpleProperties::SP2StructMapping);
-
-/**
- * Use a temporary struct to keep variables in AttributeDesc private
- * and DTIMAP requires all Uint32
- */
-struct tmpAttrS {
- // Just the basic needed stuff is yet implemented
- char name[AttrNameLenC];
- Uint32 attrId;
- Uint32 type;
- Uint32 nullable;
- Uint32 key;
- Uint32 size;
- Uint32 arraySize;
-};
-
-static const
-SimpleProperties::SP2StructMapping
-RestoreAttrMap[] = {
- // Map the most basic properties
- DTIMAP(tmpAttrS, AttributeId, attrId),
- DTIMAP(tmpAttrS, AttributeType, type),
- DTIMAP(tmpAttrS, AttributeNullableFlag, nullable),
- DTIMAP(tmpAttrS, AttributeKeyFlag, key),
- DTIMAP(tmpAttrS, AttributeSize, size),
- DTIMAP(tmpAttrS, AttributeArraySize, arraySize),
- DTIBREAK(AttributeEnd)
-}; // RestoreAttrMap
-static const Uint32
-AttrMapSize = sizeof(RestoreAttrMap)
- / sizeof(SimpleProperties::SP2StructMapping);
-
-struct v2xKernel_to_v3xAPIMapping {
- Int32 kernelConstant;
- Int32 apiConstant;
-};
-
-enum v2xKernelTypes {
- ExtUndefined=0,// Undefined
- ExtInt, // 32 bit
- ExtUnsigned, // 32 bit
- ExtBigint, // 64 bit
- ExtBigunsigned,// 64 Bit
- ExtFloat, // 32-bit float
- ExtDouble, // 64-bit float
- ExtDecimal, // Precision, Scale
- ExtChar, // Len
- ExtVarchar, // Max len
- ExtBinary, // Len
- ExtVarbinary, // Max len
- ExtDatetime, // Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
- ExtTimespec // Precision down to 1 nsec (sizeof(Datetime) == 12 bytes )
-};
-
-const
-v2xKernel_to_v3xAPIMapping
-columnTypeMapping[] = {
- { ExtInt, NdbDictionary::Column::Int },
- { ExtUnsigned, NdbDictionary::Column::Unsigned },
- { ExtBigint, NdbDictionary::Column::Bigint },
- { ExtBigunsigned, NdbDictionary::Column::Bigunsigned },
- { ExtFloat, NdbDictionary::Column::Float },
- { ExtDouble, NdbDictionary::Column::Double },
- { ExtDecimal, NdbDictionary::Column::Decimal },
- { ExtChar, NdbDictionary::Column::Char },
- { ExtVarchar, NdbDictionary::Column::Varchar },
- { ExtBinary, NdbDictionary::Column::Binary },
- { ExtVarbinary, NdbDictionary::Column::Varbinary },
- { ExtDatetime, NdbDictionary::Column::Datetime },
- { ExtTimespec, NdbDictionary::Column::Timespec },
- { -1, -1 }
-};
+ for (int i = 0; i < tableImpl->getNoOfColumns(); i++)
+ createAttr(tableImpl->getColumn(i));
+}
-static
-NdbDictionary::Column::Type
-convertToV3x(Int32 kernelConstant, const v2xKernel_to_v3xAPIMapping map[],
- Int32 def)
+TableS::~TableS()
{
- int i = 0;
- while(map[i].kernelConstant != kernelConstant){
- if(map[i].kernelConstant == -1 &&
- map[i].apiConstant == -1){
- return (NdbDictionary::Column::Type)def;
- }
- i++;
- }
- return (NdbDictionary::Column::Type)map[i].apiConstant;
+ for (Uint32 i= 0; i < allAttributesDesc.size(); i++)
+ delete allAttributesDesc[i];
}
-
-
// Parse dictTabInfo buffer and pushback to to vector storage
-// Using SimpleProperties (here we don't need ntohl, ref:ejonore)
bool
-RestoreMetaData::parseTableDescriptor(const Uint32 * data,
- Uint32 len,
- const char * catalog,
- const char * schema) {
- SimplePropertiesLinearReader it(data, len);
- SimpleProperties::UnpackStatus spStatus;
-
- // Parse table name
- if (it.getKey() != DictTabInfo::TableName) {
- err << "readMetaTableDesc getKey table name error" << endl;
- return false;
- } // if
-
- /**
- * if backup was taken in v21x then there is no info about catalog,
- * and schema. This infomration is concatenated to the tableName.
- *
- */
- char tableName[MAX_TAB_NAME_SIZE*2]; // * 2 for db and schema.-.
-
-
- char tmpTableName[MAX_TAB_NAME_SIZE];
- it.getString(tmpTableName);
-#if NDB_VERSION_MAJOR >= VERSION_3X
- /**
- * only mess with name in version 3.
- */
- /* switch(getMajor(m_fileHeader.NdbVersion)) {
- */
- if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X)
- {
+RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len)
+{
+ NdbTableImpl* tableImpl = 0;
+ int ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false);
- if(strcmp(tmpTableName, "SYSTAB_0") == 0 ||
- strcmp(tmpTableName, "NDB$EVENTS_0") == 0)
- {
- sprintf(tableName,"sys/def/%s",tmpTableName);
- }
- else {
- if(catalog == NULL && schema == NULL)
- {
- sprintf(tableName,"%s",tmpTableName);
- }
- else
- {
- sprintf(tableName,"%s/%s/%s",catalog,schema,tmpTableName);
- }
- }
- }
- else
- sprintf(tableName,"%s",tmpTableName);
-#elif NDB_VERSION_MAJOR < VERSION_3X
- /**
- * this is version two!
- */
- sprintf(tableName,"%s",tmpTableName);
-#endif
- if (strlen(tableName) == 0) {
- err << "readMetaTableDesc getString table name error" << endl;
+ if (ret != 0) {
+ err << "parseTableInfo " << " failed" << endl;
return false;
- } // if
+ }
+ if(tableImpl == 0)
+ return false;
+
+ debug << "parseTableInfo " << tableImpl->getName() << " done" << endl;
- TableS * table = new TableS(tableName);
+ TableS * table = new TableS(tableImpl);
if(table == NULL) {
return false;
}
-
table->setBackupVersion(m_fileHeader.NdbVersion);
- tmpTableS tmpTable;
- spStatus = SimpleProperties::unpack(it, &tmpTable,
- RestoreTabMap, TabMapSize, true, true);
- if ((spStatus != SimpleProperties::Break) ||
- it.getKey() != DictTabInfo::AttributeName) {
- err << "readMetaTableDesc sp.unpack error" << endl;
- delete table;
- return false;
- } // if
- debug << "Parsed table id " << tmpTable.tableId << endl;
- table->setTableId(tmpTable.tableId);
- debug << "Parsed table #attr " << tmpTable.noOfAttributes << endl;
+ debug << "Parsed table id " << table->getTableId() << endl;
+ debug << "Parsed table #attr " << table->getNoOfAttributes() << endl;
debug << "Parsed table schema version not used " << endl;
- for (Uint32 i = 0; i < tmpTable.noOfAttributes; i++) {
- if (it.getKey() != DictTabInfo::AttributeName) {
- err << "readMetaTableDesc error " << endl;
- delete table;
- return false;
- } // if
-
- tmpAttrS tmpAttr;
- if(it.getValueLen() > AttrNameLenC){
- err << "readMetaTableDesc attribute name too long??" << endl;
- delete table;
- return false;
- }
- it.getString(tmpAttr.name);
-
- spStatus = SimpleProperties::unpack(it, &tmpAttr, RestoreAttrMap,
- AttrMapSize, true, true);
- if ((spStatus != SimpleProperties::Break) ||
- (it.getKey() != DictTabInfo::AttributeEnd)) {
- err << "readMetaTableDesc sp unpack attribute " << i << " error"
- << endl;
- delete table;
- return false;
- } // if
-
- debug << "Creating attribute " << i << " " << tmpAttr.name << endl;
-
- bool thisNullable = (bool)(tmpAttr.nullable); // Really not needed (now)
- KeyType thisKey = (KeyType)(tmpAttr.key); // These are identical (right now)
- // Convert attribute size from enum to Uint32
- // The static consts are really enum taking the value in DictTabInfo
- // e.g. 3 is not ...0011 but rather ...0100
- //TODO: rather do a switch if the constants should change
- Uint32 thisSize = 1 << tmpAttr.size;
- // Convert attribute type to AttrType
- AttrType thisType;
- switch (tmpAttr.type) {
- case 0: // SignedType
- thisType = Signed;
- break;
- case 1: // UnSignedType
- thisType = UnSigned;
- break;
- case 2: // FloatingPointType
- thisType = Float;
- break;
- case 3: // StringType:
- debug << "String type detected " << endl;
- thisType = String;
- break;
- default:
- // What, default to unsigned?
- thisType = UnSigned;
- break;
- } // switch
- /* ndbout_c << " type: " << thisType << " size: " << thisSize <<" arraySize: "
- << tmpAttr.arraySize << " nullable: " << thisNullable << " key: "
- << thisKey << endl;
- */
- table->createAttr(tmpAttr.name, thisType,
- thisSize, tmpAttr.arraySize,
- thisNullable, thisKey);
- if (!it.next()) {
- break;
- // Check number of created attributes and compare with expected
- //ndbout << "readMetaTableDesc expecting more attributes" << endl;
- //return false;
- } // if
- } // for
-
- debug << "Pushing table " << tableName << endl;
+ debug << "Pushing table " << table->getTableName() << endl;
debug << " with " << table->getNoOfAttributes() << " attributes" << endl;
allTables.push_back(table);
-#ifndef restore_old_types
- NdbTableImpl* tableImpl = 0;
- int ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len);
-#if NDB_VERSION_MAJOR >= VERSION_3X
- NdbDictionary::Column::Type type;
- if(getMajor(m_fileHeader.NdbVersion) < VERSION_3X) {
- tableImpl->setName(tableName);
- Uint32 noOfColumns = tableImpl->getNoOfColumns();
- for(Uint32 i = 0 ; i < noOfColumns; i++) {
- type = convertToV3x(tableImpl->getColumn(i)->m_extType,
- columnTypeMapping,
- -1);
- if(type == -1)
- {
- ndbout_c("Restore: Was not able to map external type %d (in v2x) "
- " to a proper type in v3x", tableImpl->getColumn(i)->m_extType);
- return false;
- }
- else
- {
- tableImpl->getColumn(i)->m_type = type;
- }
-
-
-
-
- }
- }
-#endif
- if (ret != 0) {
- err << "parseTableInfo " << tableName << " failed" << endl;
- return false;
- }
- if(tableImpl == 0)
- return false;
- debug << "parseTableInfo " << tableName << " done" << endl;
- table->m_dictTable = tableImpl;
-#endif
return true;
}
// Constructor
-RestoreDataIterator::RestoreDataIterator(const RestoreMetaData & md)
- : m_metaData(md)
+RestoreDataIterator::RestoreDataIterator(const RestoreMetaData & md, void (* _free_data_callback)())
+ : BackupFile(_free_data_callback), m_metaData(md)
{
debug << "RestoreDataIterator constructor" << endl;
setDataFile(md, 0);
}
-RestoreDataIterator::~RestoreDataIterator(){
+TupleS & TupleS::operator=(const TupleS& tuple)
+{
+ prepareRecord(*tuple.m_currentTable);
+
+ if (allAttrData)
+ memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData));
+
+ return *this;
+};
+int TupleS::getNoOfAttributes() const {
+ if (m_currentTable == 0)
+ return 0;
+ return m_currentTable->getNoOfAttributes();
+};
+
+const TableS * TupleS::getTable() const {
+ return m_currentTable;
+};
+
+const AttributeDesc * TupleS::getDesc(int i) const {
+ return m_currentTable->allAttributesDesc[i];
}
+AttributeData * TupleS::getData(int i) const{
+ return &(allAttrData[i]);
+};
+
bool
TupleS::prepareRecord(const TableS & tab){
- m_currentTable = &tab;
- for(int i = 0; i<allAttributes.size(); i++) {
- if(allAttributes[i] != NULL)
- delete allAttributes[i];
- }
- allAttributes.clear();
- AttributeS * a;
- for(int i = 0; i<tab.getNoOfAttributes(); i++){
- a = new AttributeS;
- if(a == NULL) {
- ndbout_c("Restore: Failed to allocate memory");
- return false;
+ if (allAttrData) {
+ if (getNoOfAttributes() == tab.getNoOfAttributes())
+ {
+ m_currentTable = &tab;
+ return true;
}
- a->Desc = tab[i];
- allAttributes.push_back(a);
+ delete [] allAttrData;
+ m_currentTable= 0;
}
+
+ allAttrData = new AttributeData[tab.getNoOfAttributes()];
+ if (allAttrData == 0)
+ return false;
+
+ m_currentTable = &tab;
+
return true;
}
const TupleS *
-RestoreDataIterator::getNextTuple(int & res) {
- TupleS * tup = new TupleS();
- if(tup == NULL) {
- ndbout_c("Restore: Failed to allocate memory");
- res = -1;
- return NULL;
- }
- if(!tup->prepareRecord(* m_currentTable)) {
- res =-1;
- return NULL;
- }
-
-
+RestoreDataIterator::getNextTuple(int & res)
+{
Uint32 dataLength = 0;
// Read record length
- if (fread(&dataLength, sizeof(dataLength), 1, m_file) != 1){
+ if (buffer_read(&dataLength, sizeof(dataLength), 1) != 1){
err << "getNextTuple:Error reading length of data part" << endl;
- delete tup;
res = -1;
return NULL;
} // if
@@ -610,34 +320,34 @@ RestoreDataIterator::getNextTuple(int & res) {
// End of this data fragment
debug << "End of fragment" << endl;
res = 0;
- delete tup;
return NULL;
} // if
-
- tup->createDataRecord(dataLenBytes);
+
// Read tuple data
- if (fread(tup->getDataRecord(), 1, dataLenBytes, m_file) != dataLenBytes) {
+ void *_buf_ptr;
+ if (buffer_get_ptr(&_buf_ptr, 1, dataLenBytes) != dataLenBytes) {
err << "getNextTuple:Read error: " << endl;
- delete tup;
res = -1;
return NULL;
}
- Uint32 * ptr = tup->getDataRecord();
+ Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr;
ptr += m_currentTable->m_nullBitmaskSize;
- for(int i = 0; i < m_currentTable->m_fixedKeys.size(); i++){
- assert(ptr < tup->getDataRecord() + dataLength);
-
+ for(Uint32 i= 0; i < m_currentTable->m_fixedKeys.size(); i++){
+ assert(ptr < buf_ptr + dataLength);
+
const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId;
- AttributeS * attr = tup->allAttributes[attrId];
- const Uint32 sz = attr->Desc->getSizeInWords();
+ AttributeData * attr_data = m_tuple.getData(attrId);
+ const AttributeDesc * attr_desc = m_tuple.getDesc(attrId);
+
+ const Uint32 sz = attr_desc->getSizeInWords();
- attr->Data.null = false;
- attr->Data.void_value = ptr;
+ attr_data->null = false;
+ attr_data->void_value = ptr;
- if(!Twiddle(attr))
+ if(!Twiddle(attr_desc, attr_data))
{
res = -1;
return NULL;
@@ -645,18 +355,20 @@ RestoreDataIterator::getNextTuple(int & res) {
ptr += sz;
}
- for(int i = 0; i<m_currentTable->m_fixedAttribs.size(); i++){
- assert(ptr < tup->getDataRecord() + dataLength);
+ for(Uint32 i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){
+ assert(ptr < buf_ptr + dataLength);
const Uint32 attrId = m_currentTable->m_fixedAttribs[i]->attrId;
- AttributeS * attr = tup->allAttributes[attrId];
- const Uint32 sz = attr->Desc->getSizeInWords();
+ AttributeData * attr_data = m_tuple.getData(attrId);
+ const AttributeDesc * attr_desc = m_tuple.getDesc(attrId);
+
+ const Uint32 sz = attr_desc->getSizeInWords();
- attr->Data.null = false;
- attr->Data.void_value = ptr;
+ attr_data->null = false;
+ attr_data->void_value = ptr;
- if(!Twiddle(attr))
+ if(!Twiddle(attr_desc, attr_data))
{
res = -1;
return NULL;
@@ -665,21 +377,23 @@ RestoreDataIterator::getNextTuple(int & res) {
ptr += sz;
}
- for(int i = 0; i<m_currentTable->m_variableAttribs.size(); i++){
+ for(Uint32 i = 0; i < m_currentTable->m_variableAttribs.size(); i++){
const Uint32 attrId = m_currentTable->m_variableAttribs[i]->attrId;
- AttributeS * attr = tup->allAttributes[attrId];
+
+ AttributeData * attr_data = m_tuple.getData(attrId);
+ const AttributeDesc * attr_desc = m_tuple.getDesc(attrId);
- if(attr->Desc->nullable){
- const Uint32 ind = attr->Desc->m_nullBitIndex;
+ if(attr_desc->m_column->getNullable()){
+ const Uint32 ind = attr_desc->m_nullBitIndex;
if(BitmaskImpl::get(m_currentTable->m_nullBitmaskSize,
- tup->getDataRecord(),ind)){
- attr->Data.null = true;
- attr->Data.void_value = NULL;
+ buf_ptr,ind)){
+ attr_data->null = true;
+ attr_data->void_value = NULL;
continue;
}
}
- assert(ptr < tup->getDataRecord() + dataLength);
+ assert(ptr < buf_ptr + dataLength);
typedef BackupFormat::DataFile::VariableData VarData;
VarData * data = (VarData *)ptr;
@@ -687,15 +401,15 @@ RestoreDataIterator::getNextTuple(int & res) {
Uint32 id = ntohl(data->Id);
assert(id == attrId);
- attr->Data.null = false;
- attr->Data.void_value = &data->Data[0];
+ attr_data->null = false;
+ attr_data->void_value = &data->Data[0];
/**
* Compute array size
*/
- const Uint32 arraySize = (4 * sz) / (attr->Desc->size / 8);
- assert(arraySize >= attr->Desc->arraySize);
- if(!Twiddle(attr, attr->Desc->arraySize))
+ const Uint32 arraySize = (4 * sz) / (attr_desc->size / 8);
+ assert(arraySize >= attr_desc->arraySize);
+ if(!Twiddle(attr_desc, attr_data, attr_desc->arraySize))
{
res = -1;
return NULL;
@@ -706,15 +420,20 @@ RestoreDataIterator::getNextTuple(int & res) {
m_count ++;
res = 0;
- return tup;
+ return &m_tuple;
} // RestoreDataIterator::getNextTuple
-BackupFile::BackupFile(){
+BackupFile::BackupFile(void (* _free_data_callback)())
+ : free_data_callback(_free_data_callback)
+{
m_file = 0;
m_path[0] = 0;
m_fileName[0] = 0;
- m_buffer = 0;
- m_bufferSize = 0;
+
+ m_buffer_sz = 64*1024;
+ m_buffer = malloc(m_buffer_sz);
+ m_buffer_ptr = m_buffer;
+ m_buffer_data_left = 0;
}
BackupFile::~BackupFile(){
@@ -735,15 +454,54 @@ BackupFile::openFile(){
return m_file != 0;
}
-Uint32 *
-BackupFile::createBuffer(Uint32 bytes){
- if(bytes > m_bufferSize){
- if(m_buffer != 0)
- free(m_buffer);
- m_bufferSize = m_bufferSize + 2 * bytes;
- m_buffer = (Uint32*)malloc(m_bufferSize);
+Uint32 BackupFile::buffer_get_ptr_ahead(void **p_buf_ptr, Uint32 size, Uint32 nmemb)
+{
+ Uint32 sz = size*nmemb;
+ if (sz > m_buffer_data_left) {
+
+ if (free_data_callback)
+ (*free_data_callback)();
+
+ memcpy(m_buffer, m_buffer_ptr, m_buffer_data_left);
+
+ size_t r = fread(((char *)m_buffer) + m_buffer_data_left, 1, m_buffer_sz - m_buffer_data_left, m_file);
+ m_buffer_data_left += r;
+ m_buffer_ptr = m_buffer;
+
+ if (sz > m_buffer_data_left)
+ sz = size * (m_buffer_data_left / size);
}
- return m_buffer;
+
+ *p_buf_ptr = m_buffer_ptr;
+
+ return sz/size;
+}
+Uint32 BackupFile::buffer_get_ptr(void **p_buf_ptr, Uint32 size, Uint32 nmemb)
+{
+ Uint32 r = buffer_get_ptr_ahead(p_buf_ptr, size, nmemb);
+
+ m_buffer_ptr = ((char*)m_buffer_ptr)+(r*size);
+ m_buffer_data_left -= (r*size);
+
+ return r;
+}
+
+Uint32 BackupFile::buffer_read_ahead(void *ptr, Uint32 size, Uint32 nmemb)
+{
+ void *buf_ptr;
+ Uint32 r = buffer_get_ptr_ahead(&buf_ptr, size, nmemb);
+ memcpy(ptr, buf_ptr, r*size);
+
+ return r;
+}
+
+Uint32 BackupFile::buffer_read(void *ptr, Uint32 size, Uint32 nmemb)
+{
+ void *buf_ptr;
+ Uint32 r = buffer_get_ptr(&buf_ptr, size, nmemb);
+ memcpy(ptr, buf_ptr, r*size);
+
+ return r;
}
void
@@ -804,7 +562,7 @@ BackupFile::readHeader(){
return false;
}
- if(fread(&m_fileHeader, sizeof(m_fileHeader), 1, m_file) != 1){
+ if(buffer_read(&m_fileHeader, sizeof(m_fileHeader), 1) != 1){
err << "readDataFileHeader: Error reading header" << endl;
return false;
}
@@ -852,14 +610,13 @@ BackupFile::validateFooter(){
return true;
}
-bool
-RestoreDataIterator::readFragmentHeader(int & ret)
+bool RestoreDataIterator::readFragmentHeader(int & ret)
{
BackupFormat::DataFile::FragmentHeader Header;
debug << "RestoreDataIterator::getNextFragment" << endl;
- if (fread(&Header, sizeof(Header), 1, m_file) != 1){
+ if (buffer_read(&Header, sizeof(Header), 1) != 1){
ret = 0;
return false;
} // if
@@ -882,6 +639,12 @@ RestoreDataIterator::readFragmentHeader(int & ret)
return false;
}
+ if(!m_tuple.prepareRecord(*m_currentTable))
+ {
+ ret =-1;
+ return false;
+ }
+
info << "_____________________________________________________" << endl
<< "Restoring data in table: " << m_currentTable->getTableName()
<< "(" << Header.TableId << ") fragment "
@@ -889,6 +652,7 @@ RestoreDataIterator::readFragmentHeader(int & ret)
m_count = 0;
ret = 0;
+
return true;
} // RestoreDataIterator::getNextFragment
@@ -897,7 +661,7 @@ bool
RestoreDataIterator::validateFragmentFooter() {
BackupFormat::DataFile::FragmentFooter footer;
- if (fread(&footer, sizeof(footer), 1, m_file) != 1){
+ if (buffer_read(&footer, sizeof(footer), 1) != 1){
err << "getFragmentFooter:Error reading fragment footer" << endl;
return false;
}
@@ -915,44 +679,39 @@ RestoreDataIterator::validateFragmentFooter() {
return true;
} // RestoreDataIterator::getFragmentFooter
-void TableS::createAttr(const char* name,
- const AttrType type,
- const unsigned int size, // in bytes
- const unsigned int arraySize,
- const bool nullable,
- const KeyType key)
+AttributeDesc::AttributeDesc(NdbDictionary::Column *c)
+ : m_column(c)
{
- AttributeDesc desc;
-
- strncpy(desc.name, name, AttrNameLenC);
- desc.type = type;
- desc.size = size;
- desc.arraySize = arraySize;
- desc.nullable = nullable;
- desc.key = key;
- desc.attrId = allAttributesDesc.size();
+ size = c->getSize()*8;
+ arraySize = c->getLength();
+}
- AttributeDesc * d = new AttributeDesc(desc);
+void TableS::createAttr(NdbDictionary::Column *column)
+{
+ AttributeDesc * d = new AttributeDesc(column);
if(d == NULL) {
ndbout_c("Restore: Failed to allocate memory");
abort();
}
- d->m_table = this;
+ d->attrId = allAttributesDesc.size();
allAttributesDesc.push_back(d);
- if(desc.key != NoKey /* && not variable */){
+ if(d->m_column->getPrimaryKey() /* && not variable */)
+ {
m_fixedKeys.push_back(d);
return;
}
- if(!nullable){
+
+ if(!d->m_column->getNullable())
+ {
m_fixedAttribs.push_back(d);
return;
}
- if(nullable){
- d->m_nullBitIndex = m_noOfNullable;
- m_noOfNullable++;
- m_nullBitmaskSize = (m_noOfNullable + 31) / 32;
- }
+
+ /* Nullable attr*/
+ d->m_nullBitIndex = m_noOfNullable;
+ m_noOfNullable++;
+ m_nullBitmaskSize = (m_noOfNullable + 31) / 32;
m_variableAttribs.push_back(d);
} // TableS::createAttr
@@ -1010,45 +769,32 @@ RestoreLogIterator::getNextLogEntry(int & res) {
// Read record length
typedef BackupFormat::LogFile::LogEntry LogE;
- Uint32 gcp = 0;
- LogE * logE = 0;
- Uint32 len = ~0;
+ Uint32 gcp= 0;
+ LogE * logE= 0;
+ Uint32 len= ~0;
const Uint32 stopGCP = m_metaData.getStopGCP();
do {
-
- if(createBuffer(4) == 0) {
- res = -1;
- return NULL;
+ if (buffer_read_ahead(&len, sizeof(Uint32), 1) != 1){
+ res= -1;
+ return 0;
}
-
+ len= ntohl(len);
- if (fread(m_buffer, sizeof(Uint32), 1, m_file) != 1){
- res = -1;
- return NULL;
+ Uint32 data_len = sizeof(Uint32) + len*4;
+ if (buffer_get_ptr((void **)(&logE), 1, data_len) != data_len) {
+ res= -2;
+ return 0;
}
- m_buffer[0] = ntohl(m_buffer[0]);
- len = m_buffer[0];
if(len == 0){
- res = 0;
+ res= 0;
return 0;
}
- if(createBuffer(4 * (len + 1)) == 0){
- res = -1;
- return NULL;
- }
-
- if (fread(&m_buffer[1], 4, len, m_file) != len) {
- res = -1;
- return NULL;
- }
+ logE->TableId= ntohl(logE->TableId);
+ logE->TriggerEvent= ntohl(logE->TriggerEvent);
- logE = (LogE *)&m_buffer[0];
- logE->TableId = ntohl(logE->TableId);
- logE->TriggerEvent = ntohl(logE->TriggerEvent);
-
- const bool hasGcp = (logE->TriggerEvent & 0x10000) != 0;
+ const bool hasGcp= (logE->TriggerEvent & 0x10000) != 0;
logE->TriggerEvent &= 0xFFFF;
if(hasGcp){
@@ -1057,9 +803,6 @@ RestoreLogIterator::getNextLogEntry(int & res) {
}
} while(gcp > stopGCP + 1);
- for(int i=0; i<m_logEntry.m_values.size();i++)
- delete m_logEntry.m_values[i];
- m_logEntry.m_values.clear();
m_logEntry.m_table = m_metaData.getTable(logE->TableId);
switch(logE->TriggerEvent){
case TriggerEvent::TE_INSERT:
@@ -1077,17 +820,19 @@ RestoreLogIterator::getNextLogEntry(int & res) {
}
const TableS * tab = m_logEntry.m_table;
+ m_logEntry.clear();
AttributeHeader * ah = (AttributeHeader *)&logE->Data[0];
AttributeHeader *end = (AttributeHeader *)&logE->Data[len - 2];
AttributeS * attr;
while(ah < end){
- attr = new AttributeS;
+ attr= m_logEntry.add_attr();
if(attr == NULL) {
ndbout_c("Restore: Failed to allocate memory");
res = -1;
- return NULL;
+ return 0;
}
+
attr->Desc = (* tab)[ah->getAttributeId()];
assert(attr->Desc != 0);
@@ -1100,13 +845,94 @@ RestoreLogIterator::getNextLogEntry(int & res) {
attr->Data.void_value = ah->getDataPtr();
}
- Twiddle(attr);
- m_logEntry.m_values.push_back(attr);
+ Twiddle(attr->Desc, &(attr->Data));
ah = ah->getNext();
}
-
+
m_count ++;
res = 0;
return &m_logEntry;
}
+
+NdbOut &
+operator<<(NdbOut& ndbout, const AttributeS& attr){
+ const AttributeData & data = attr.Data;
+ const AttributeDesc & desc = *(attr.Desc);
+
+ if (data.null)
+ {
+ ndbout << "<NULL>";
+ return ndbout;
+ }
+
+ NdbRecAttr tmprec;
+ tmprec.setup(desc.m_column, (char *)data.void_value);
+ ndbout << tmprec;
+
+ return ndbout;
+}
+
+// Print tuple data
+NdbOut&
+operator<<(NdbOut& ndbout, const TupleS& tuple)
+{
+ ndbout << tuple.getTable()->getTableName() << "; ";
+ for (int i = 0; i < tuple.getNoOfAttributes(); i++)
+ {
+ AttributeData * attr_data = tuple.getData(i);
+ const AttributeDesc * attr_desc = tuple.getDesc(i);
+ const AttributeS attr = {attr_desc, *attr_data};
+ debug << i << " " << attr_desc->m_column->getName();
+ ndbout << attr;
+
+ if (i != (tuple.getNoOfAttributes() - 1))
+ ndbout << delimiter << " ";
+ } // for
+ return ndbout;
+}
+
+// Print tuple data
+NdbOut&
+operator<<(NdbOut& ndbout, const LogEntry& logE)
+{
+ switch(logE.m_type)
+ {
+ case LogEntry::LE_INSERT:
+ ndbout << "INSERT " << logE.m_table->getTableName() << " ";
+ break;
+ case LogEntry::LE_DELETE:
+ ndbout << "DELETE " << logE.m_table->getTableName() << " ";
+ break;
+ case LogEntry::LE_UPDATE:
+ ndbout << "UPDATE " << logE.m_table->getTableName() << " ";
+ break;
+ default:
+ ndbout << "Unknown log entry type (not insert, delete or update)" ;
+ }
+
+ for (Uint32 i= 0; i < logE.size();i++)
+ {
+ const AttributeS * attr = logE[i];
+ ndbout << attr->Desc->m_column->getName() << "=";
+ ndbout << (* attr);
+ if (i < (logE.size() - 1))
+ ndbout << ", ";
+ }
+ return ndbout;
+}
+
+
+NdbOut &
+operator<<(NdbOut& ndbout, const TableS & table){
+ ndbout << endl << "Table: " << table.getTableName() << endl;
+ for (int j = 0; j < table.getNoOfAttributes(); j++)
+ {
+ const AttributeDesc * desc = table[j];
+ ndbout << desc->m_column->getName() << ": " << desc->m_column->getType();
+ ndbout << " key: " << desc->m_column->getPrimaryKey();
+ ndbout << " array: " << desc->arraySize;
+ ndbout << " size: " << desc->size << endl;
+ } // for
+ return ndbout;
+}
diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
index 0c075e18933..e9149e38e44 100644
--- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp
+++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp
@@ -18,18 +18,14 @@
#define RESTORE_H
#include <ndb_global.h>
+#include <NdbOut.hpp>
#include <BackupFormat.hpp>
#include <NdbApi.hpp>
-#include <AttrType.hpp>
-
-#include <NdbOut.hpp>
-#include "myVector.hpp"
#include <ndb_version.h>
#include <version.h>
-#define VERSION_3X 3
-
+static const char * delimiter = ";"; // Delimiter in file dump
const int FileNameLenC = 256;
const int TableNameLenC = 256;
@@ -67,29 +63,22 @@ struct AttributeData {
struct AttributeDesc {
//private:
- // TODO (sometimes): use a temporary variable in DTIMAP so we can
- // hide AttributeDesc private variables
friend class TupleS;
friend class TableS;
friend class RestoreDataIterator;
friend class RestoreMetaData;
friend struct AttributeS;
- char name[AttrNameLenC];
- Uint32 attrId;
- AttrType type;
- bool nullable;
- KeyType key;
Uint32 size; // bits
Uint32 arraySize;
+ Uint32 attrId;
+ NdbDictionary::Column *m_column;
Uint32 m_nullBitIndex;
public:
- AttributeDesc() {
- name[0] = 0;
- }
+ AttributeDesc(NdbDictionary::Column *column);
+ AttributeDesc();
- const TableS * m_table;
Uint32 getSizeInWords() const { return (size * arraySize + 31)/ 32;}
}; // AttributeDesc
@@ -102,19 +91,26 @@ class TupleS {
private:
friend class RestoreDataIterator;
- const TableS * m_currentTable;
- myVector<AttributeS*> allAttributes;
- Uint32 * dataRecord;
+ const TableS *m_currentTable;
+ AttributeData *allAttrData;
bool prepareRecord(const TableS &);
public:
- TupleS() {dataRecord = NULL;};
- ~TupleS() {if(dataRecord != NULL) delete [] dataRecord;};
- int getNoOfAttributes() const { return allAttributes.size(); };
- const TableS * getTable() const { return m_currentTable;};
- const AttributeS * operator[](int i) const { return allAttributes[i];};
- Uint32 * getDataRecord() { return dataRecord;};
- void createDataRecord(Uint32 bytes) { dataRecord = new Uint32[bytes];};
+ TupleS() {
+ m_currentTable= 0;
+ allAttrData= 0;
+ };
+ ~TupleS()
+ {
+ if (allAttrData)
+ delete [] allAttrData;
+ };
+ TupleS(const TupleS& tuple); // disable copy constructor
+ TupleS & operator=(const TupleS& tuple);
+ int getNoOfAttributes() const;
+ const TableS * getTable() const;
+ const AttributeDesc * getDesc(int i) const;
+ AttributeData * getData(int i) const;
}; // class TupleS
class TableS {
@@ -123,49 +119,28 @@ class TableS {
friend class RestoreMetaData;
friend class RestoreDataIterator;
- Uint32 tableId;
- char tableName[TableNameLenC];
Uint32 schemaVersion;
Uint32 backupVersion;
- myVector<AttributeDesc *> allAttributesDesc;
- myVector<AttributeDesc *> m_fixedKeys;
- //myVector<AttributeDesc *> m_variableKey;
- myVector<AttributeDesc *> m_fixedAttribs;
- myVector<AttributeDesc *> m_variableAttribs;
+ Vector<AttributeDesc *> allAttributesDesc;
+ Vector<AttributeDesc *> m_fixedKeys;
+ //Vector<AttributeDesc *> m_variableKey;
+ Vector<AttributeDesc *> m_fixedAttribs;
+ Vector<AttributeDesc *> m_variableAttribs;
Uint32 m_noOfNullable;
Uint32 m_nullBitmaskSize;
int pos;
- char create_string[2048];
- /*
- char mysqlTableName[1024];
- char mysqlDatabaseName[1024];
- */
- void createAttr(const char* name,
- const AttrType type,
- const unsigned int size, // in bits
- const unsigned int arraySize,
- const bool nullable,
- const KeyType key);
+ void createAttr(NdbDictionary::Column *column);
-#ifndef restore_old_types
public:
class NdbDictionary::Table* m_dictTable;
-#endif
-public:
- TableS (const char * name){
- snprintf(tableName, sizeof(tableName), name);
- m_noOfNullable = m_nullBitmaskSize = 0;
- }
+ TableS (class NdbTableImpl* dictTable);
+ ~TableS();
- void setTableId (Uint32 id) {
- tableId = id;
- }
-
Uint32 getTableId() const {
- return tableId;
+ return m_dictTable->getTableId();
}
/*
void setMysqlTableName(char * tableName) {
@@ -182,7 +157,6 @@ public:
void setBackupVersion(Uint32 version) {
backupVersion = version;
}
-
Uint32 getBackupVersion() const {
return backupVersion;
@@ -216,18 +190,26 @@ protected:
BackupFormat::FileHeader m_expectedFileHeader;
Uint32 m_nodeId;
- Uint32 * m_buffer;
- Uint32 m_bufferSize;
- Uint32 * createBuffer(Uint32 bytes);
+ void * m_buffer;
+ void * m_buffer_ptr;
+ Uint32 m_buffer_sz;
+ Uint32 m_buffer_data_left;
+ void (* free_data_callback)();
+
bool openFile();
void setCtlFile(Uint32 nodeId, Uint32 backupId, const char * path);
void setDataFile(const BackupFile & bf, Uint32 no);
void setLogFile(const BackupFile & bf, Uint32 no);
+ Uint32 buffer_get_ptr(void **p_buf_ptr, Uint32 size, Uint32 nmemb);
+ Uint32 buffer_read(void *ptr, Uint32 size, Uint32 nmemb);
+ Uint32 buffer_get_ptr_ahead(void **p_buf_ptr, Uint32 size, Uint32 nmemb);
+ Uint32 buffer_read_ahead(void *ptr, Uint32 size, Uint32 nmemb);
+
void setName(const char * path, const char * name);
- BackupFile();
+ BackupFile(void (* free_data_callback)() = 0);
~BackupFile();
public:
bool readHeader();
@@ -237,15 +219,14 @@ public:
const char * getFilename() const { return m_fileName;}
Uint32 getNodeId() const { return m_nodeId;}
const BackupFormat::FileHeader & getFileHeader() const { return m_fileHeader;}
- bool Twiddle(AttributeS * attr, Uint32 arraySize = 0);
+ bool Twiddle(const AttributeDesc * attr_desc, AttributeData * attr_data, Uint32 arraySize = 0);
};
class RestoreMetaData : public BackupFile {
- myVector<TableS *> allTables;
+ Vector<TableS *> allTables;
bool readMetaFileHeader();
- bool readMetaTableDesc(const char * catalog,
- const char * schema);
+ bool readMetaTableDesc();
bool readGCPEntry();
Uint32 readMetaTableList();
@@ -253,20 +234,14 @@ class RestoreMetaData : public BackupFile {
Uint32 m_startGCP;
Uint32 m_stopGCP;
- bool parseTableDescriptor(const Uint32 * data, Uint32 len,
- const char * catalog,
- const char * schema);
+ bool parseTableDescriptor(const Uint32 * data, Uint32 len);
public:
-
RestoreMetaData(const char * path, Uint32 nodeId, Uint32 bNo);
- ~RestoreMetaData();
+ virtual ~RestoreMetaData();
- int loadContent(const char * catalog,
- const char * schema);
+ int loadContent();
-
-
Uint32 getNoOfTables() const { return allTables.size();}
const TableS * operator[](int i) const { return allTables[i];}
@@ -278,20 +253,20 @@ public:
class RestoreDataIterator : public BackupFile {
const RestoreMetaData & m_metaData;
-
Uint32 m_count;
- TupleS m_tuple;
const TableS* m_currentTable;
+ TupleS m_tuple;
+
public:
// Constructor
- RestoreDataIterator(const RestoreMetaData &);
- ~RestoreDataIterator();
+ RestoreDataIterator(const RestoreMetaData &, void (* free_data_callback)());
+ ~RestoreDataIterator() {};
// Read data file fragment header
bool readFragmentHeader(int & res);
bool validateFragmentFooter();
-
+
const TupleS *getNextTuple(int & res);
};
@@ -304,9 +279,35 @@ public:
};
EntryType m_type;
const TableS * m_table;
- myVector<AttributeS*> m_values;
-
-
+ Vector<AttributeS*> m_values;
+ Vector<AttributeS*> m_values_e;
+ AttributeS *add_attr() {
+ AttributeS * attr;
+ if (m_values_e.size() > 0) {
+ attr = m_values_e[m_values_e.size()-1];
+ m_values_e.erase(m_values_e.size()-1);
+ }
+ else
+ {
+ attr = new AttributeS;
+ }
+ m_values.push_back(attr);
+ return attr;
+ }
+ void clear() {
+ for(Uint32 i= 0; i < m_values.size(); i++)
+ m_values_e.push_back(m_values[i]);
+ m_values.clear();
+ }
+ ~LogEntry()
+ {
+ for(Uint32 i= 0; i< m_values.size(); i++)
+ delete m_values[i];
+ for(Uint32 i= 0; i< m_values_e.size(); i++)
+ delete m_values_e[i];
+ }
+ Uint32 size() const { return m_values.size(); }
+ const AttributeS * operator[](int i) const { return m_values[i];}
};
class RestoreLogIterator : public BackupFile {
@@ -317,10 +318,16 @@ private:
LogEntry m_logEntry;
public:
RestoreLogIterator(const RestoreMetaData &);
-
+ virtual ~RestoreLogIterator() {};
+
const LogEntry * getNextLogEntry(int & res);
};
+NdbOut& operator<<(NdbOut& ndbout, const TableS&);
+NdbOut& operator<<(NdbOut& ndbout, const TupleS&);
+NdbOut& operator<<(NdbOut& ndbout, const LogEntry&);
+NdbOut& operator<<(NdbOut& ndbout, const RestoreMetaData&);
+
#endif
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.cpp b/ndb/src/kernel/blocks/backup/restore/consumer.cpp
new file mode 100644
index 00000000000..e94c31b2666
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer.cpp
@@ -0,0 +1,107 @@
+/* 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 "consumer.hpp"
+
+#ifdef USE_MYSQL
+int
+BackupConsumer::create_table_string(const TableS & table,
+ char * tableName,
+ char *buf){
+ int pos = 0;
+ int pos2 = 0;
+ char buf2[2048];
+
+ pos += sprintf(buf+pos, "%s%s", "CREATE TABLE ", tableName);
+ pos += sprintf(buf+pos, "%s", "(");
+ pos2 += sprintf(buf2+pos2, "%s", " primary key(");
+
+ for (int j = 0; j < table.getNoOfAttributes(); j++)
+ {
+ const AttributeDesc * desc = table[j];
+ // ndbout << desc->name << ": ";
+ pos += sprintf(buf+pos, "%s%s", desc->m_column->getName()," ");
+ switch(desc->m_column->getType()){
+ case NdbDictionary::Column::Int:
+ pos += sprintf(buf+pos, "%s", "int");
+ break;
+ case NdbDictionary::Column::Unsigned:
+ pos += sprintf(buf+pos, "%s", "int unsigned");
+ break;
+ case NdbDictionary::Column::Float:
+ pos += sprintf(buf+pos, "%s", "float");
+ break;
+ case NdbDictionary::Column::Decimal:
+ pos += sprintf(buf+pos, "%s", "decimal");
+ break;
+ case NdbDictionary::Column::Char:
+ pos += sprintf(buf+pos, "%s", "char");
+ break;
+ case NdbDictionary::Column::Varchar:
+ pos += sprintf(buf+pos, "%s", "varchar");
+ break;
+ case NdbDictionary::Column::Binary:
+ pos += sprintf(buf+pos, "%s", "binary");
+ break;
+ case NdbDictionary::Column::Varbinary:
+ pos += sprintf(buf+pos, "%s", "varchar binary");
+ break;
+ case NdbDictionary::Column::Bigint:
+ pos += sprintf(buf+pos, "%s", "bigint");
+ break;
+ case NdbDictionary::Column::Bigunsigned:
+ pos += sprintf(buf+pos, "%s", "bigint unsigned");
+ break;
+ case NdbDictionary::Column::Double:
+ pos += sprintf(buf+pos, "%s", "double");
+ break;
+ case NdbDictionary::Column::Datetime:
+ pos += sprintf(buf+pos, "%s", "datetime");
+ break;
+ case NdbDictionary::Column::Timespec:
+ pos += sprintf(buf+pos, "%s", "time");
+ break;
+ case NdbDictionary::Column::Undefined:
+ // pos += sprintf(buf+pos, "%s", "varchar binary");
+ return -1;
+ break;
+ default:
+ //pos += sprintf(buf+pos, "%s", "varchar binary");
+ return -1;
+ }
+ if (desc->arraySize > 1) {
+ int attrSize = desc->arraySize;
+ pos += sprintf(buf+pos, "%s%u%s",
+ "(",
+ attrSize,
+ ")");
+ }
+ if (desc->m_column->getPrimaryKey()) {
+ pos += sprintf(buf+pos, "%s", " not null");
+ pos2 += sprintf(buf2+pos2, "%s%s", desc->m_column->getName(), ",");
+ }
+ pos += sprintf(buf+pos, "%s", ",");
+ } // for
+ pos2--; // remove trailing comma
+ pos2 += sprintf(buf2+pos2, "%s", ")");
+ // pos--; // remove trailing comma
+
+ pos += sprintf(buf+pos, "%s", buf2);
+ pos += sprintf(buf+pos, "%s", ") type=ndbcluster");
+ return 0;
+}
+
+#endif // USE_MYSQL
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.hpp b/ndb/src/kernel/blocks/backup/restore/consumer.hpp
new file mode 100644
index 00000000000..e3ba2041a22
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer.hpp
@@ -0,0 +1,34 @@
+/* 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 CONSUMER_HPP
+#define CONSUMER_HPP
+
+#include "Restore.hpp"
+
+class BackupConsumer {
+public:
+ virtual ~BackupConsumer() { }
+ virtual bool init() { return true;}
+ virtual bool table(const TableS &){return true;}
+ virtual void tuple(const TupleS &){}
+ virtual void tuple_free(){}
+ virtual void endOfTuples(){}
+ virtual void logEntry(const LogEntry &){}
+ virtual void endOfLogEntrys(){}
+};
+
+#endif
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp
new file mode 100644
index 00000000000..0aa5b521d29
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp
@@ -0,0 +1,55 @@
+/* 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 "consumer_printer.hpp"
+
+bool
+BackupPrinter::table(const TableS & tab)
+{
+ if (m_print || m_print_meta)
+ {
+ m_ndbout << tab;
+ ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName());
+ }
+ return true;
+}
+
+void
+BackupPrinter::tuple(const TupleS & tup)
+{
+ m_dataCount++;
+ if (m_print || m_print_data)
+ m_ndbout << tup << endl;
+}
+
+void
+BackupPrinter::logEntry(const LogEntry & logE)
+{
+ if (m_print || m_print_log)
+ m_ndbout << logE << endl;
+ m_logCount++;
+}
+
+void
+BackupPrinter::endOfLogEntrys()
+{
+ if (m_print || m_print_log)
+ {
+ ndbout << "Printed " << m_dataCount << " tuples and "
+ << m_logCount << " log entries"
+ << " to stdout." << endl;
+ }
+}
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp b/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp
new file mode 100644
index 00000000000..7cbc924e364
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp
@@ -0,0 +1,50 @@
+/* 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 CONSUMER_PRINTER_HPP
+#define CONSUMER_PRINTER_HPP
+
+#include "consumer.hpp"
+
+class BackupPrinter : public BackupConsumer
+{
+ NdbOut & m_ndbout;
+public:
+ BackupPrinter(NdbOut & out = ndbout) : m_ndbout(out)
+ {
+ m_print = false;
+ m_print_log = false;
+ m_print_data = false;
+ m_print_meta = false;
+ }
+
+ virtual bool table(const TableS &);
+#ifdef USE_MYSQL
+ virtual bool table(const TableS &, MYSQL* mysqlp);
+#endif
+ virtual void tuple(const TupleS &);
+ virtual void logEntry(const LogEntry &);
+ virtual void endOfTuples() {};
+ virtual void endOfLogEntrys();
+ bool m_print;
+ bool m_print_log;
+ bool m_print_data;
+ bool m_print_meta;
+ Uint32 m_logCount;
+ Uint32 m_dataCount;
+};
+
+#endif
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp
new file mode 100644
index 00000000000..5731a9a3883
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp
@@ -0,0 +1,516 @@
+/* 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 "consumer_restore.hpp"
+#include <NdbSleep.h>
+
+extern FilteredNdbOut err;
+extern FilteredNdbOut info;
+extern FilteredNdbOut debug;
+
+static void callback(int, NdbConnection*, void*);
+
+bool
+BackupRestore::init()
+{
+ release();
+
+ if (!m_restore && !m_restore_meta)
+ return true;
+
+ m_ndb = new Ndb();
+
+ if (m_ndb == NULL)
+ return false;
+
+ // Turn off table name completion
+ m_ndb->useFullyQualifiedNames(false);
+
+ m_ndb->init(1024);
+ if (m_ndb->waitUntilReady(30) != 0)
+ {
+ err << "Failed to connect to ndb!!" << endl;
+ return false;
+ }
+ info << "Connected to ndb!!" << endl;
+
+ m_callback = new restore_callback_t[m_parallelism];
+
+ if (m_callback == 0)
+ {
+ err << "Failed to allocate callback structs" << endl;
+ return false;
+ }
+
+ m_tuples = new TupleS[m_parallelism];
+
+ if (m_tuples == 0)
+ {
+ err << "Failed to allocate tuples" << endl;
+ return false;
+ }
+
+ m_free_callback= m_callback;
+ for (Uint32 i= 0; i < m_parallelism; i++) {
+ m_callback[i].restore= this;
+ m_callback[i].connection= 0;
+ m_callback[i].tup= &m_tuples[i];
+ if (i > 0)
+ m_callback[i-1].next= &(m_callback[i]);
+ }
+ m_callback[m_parallelism-1].next = 0;
+
+ return true;
+}
+
+void BackupRestore::release()
+{
+ if (m_ndb)
+ {
+ delete m_ndb;
+ m_ndb= 0;
+ }
+
+ if (m_callback)
+ {
+ delete [] m_callback;
+ m_callback= 0;
+ }
+
+ if (m_tuples)
+ {
+ delete [] m_tuples;
+ m_tuples= 0;
+ }
+}
+
+BackupRestore::~BackupRestore()
+{
+ release();
+}
+
+bool
+BackupRestore::table(const TableS & table){
+ if (!m_restore_meta)
+ return true;
+
+ NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
+ if (dict->createTable(*table.m_dictTable) == -1)
+ {
+ err << "Create table " << table.getTableName() << " failed: "
+ << dict->getNdbError() << endl;
+ return false;
+ }
+ info << "Successfully restored table " << table.getTableName()<< endl ;
+ return true;
+}
+
+void BackupRestore::tuple(const TupleS & tup)
+{
+ if (!m_restore)
+ return;
+
+ restore_callback_t * cb = m_free_callback;
+
+ if (cb == 0)
+ assert(false);
+
+ m_free_callback = cb->next;
+ cb->retries = 0;
+ *(cb->tup) = tup; // must do copy!
+ tuple_a(cb);
+
+ if (m_free_callback == 0)
+ {
+ // send-poll all transactions
+ // close transaction is done in callback
+ m_ndb->sendPollNdb(3000, 1);
+ }
+}
+
+void BackupRestore::tuple_a(restore_callback_t *cb)
+{
+ while (cb->retries < 10)
+ {
+ /**
+ * start transactions
+ */
+ cb->connection = m_ndb->startTransaction();
+ if (cb->connection == NULL)
+ {
+ /*
+ if (errorHandler(cb))
+ {
+ continue;
+ }
+ */
+ exitHandler();
+ } // if
+
+ const TupleS &tup = *(cb->tup);
+ const TableS * table = tup.getTable();
+ NdbOperation * op = cb->connection->getNdbOperation(table->getTableName());
+
+ if (op == NULL)
+ {
+ if (errorHandler(cb))
+ continue;
+ exitHandler();
+ } // if
+
+ if (op->writeTuple() == -1)
+ {
+ if (errorHandler(cb))
+ continue;
+ exitHandler();
+ } // if
+
+ int ret = 0;
+ for (int j = 0; j < 2; j++)
+ {
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeDesc * attr_desc = tup.getDesc(i);
+ const AttributeData * attr_data = tup.getData(i);
+ int size = attr_desc->size;
+ int arraySize = attr_desc->arraySize;
+ char * dataPtr = attr_data->string_value;
+ Uint32 length = (size * arraySize) / 8;
+ if (attr_desc->m_column->getPrimaryKey())
+ {
+ if (j == 1) continue;
+ ret = op->equal(i, dataPtr, length);
+ }
+ else
+ {
+ if (j == 0) continue;
+ if (attr_data->null)
+ ret = op->setValue(i, NULL, 0);
+ else
+ ret = op->setValue(i, dataPtr, length);
+ }
+ if (ret < 0) {
+ ndbout_c("Column: %d type %d",i,
+ attr_desc->m_column->getType());
+ break;
+ }
+ }
+ if (ret < 0)
+ break;
+ }
+ if (ret < 0)
+ {
+ if (errorHandler(cb))
+ continue;
+ exitHandler();
+ }
+
+ // Prepare transaction (the transaction is NOT yet sent to NDB)
+ cb->connection->executeAsynchPrepare(Commit, &callback, cb);
+ m_transactions++;
+ return;
+ }
+ err << "Unable to recover from errors. Exiting..." << endl;
+ exitHandler();
+}
+
+void BackupRestore::cback(int result, restore_callback_t *cb)
+{
+ m_transactions--;
+
+ if (result < 0)
+ {
+ /**
+ * Error. temporary or permanent?
+ */
+ if (errorHandler(cb))
+ tuple_a(cb); // retry
+ else
+ {
+ err << "Restore: Failed to restore data due to a unrecoverable error. Exiting..." << endl;
+ exitHandler();
+ }
+ }
+ else
+ {
+ /**
+ * OK! close transaction
+ */
+ m_ndb->closeTransaction(cb->connection);
+ cb->connection= 0;
+ cb->next= m_free_callback;
+ m_free_callback= cb;
+ m_dataCount++;
+ }
+}
+
+/**
+ * returns true if is recoverable,
+ * Error handling based on hugo
+ * false if it is an error that generates an abort.
+ */
+bool BackupRestore::errorHandler(restore_callback_t *cb)
+{
+ NdbError error= cb->connection->getNdbError();
+ m_ndb->closeTransaction(cb->connection);
+ cb->connection= 0;
+ cb->retries++;
+ switch(error.status)
+ {
+ case NdbError::Success:
+ return false;
+ // ERROR!
+ break;
+
+ case NdbError::TemporaryError:
+ NdbSleep_MilliSleep(10);
+ return true;
+ // RETRY
+ break;
+
+ case NdbError::UnknownResult:
+ err << error << endl;
+ return false;
+ // ERROR!
+ break;
+
+ default:
+ case NdbError::PermanentError:
+ switch (error.code)
+ {
+ case 499:
+ case 250:
+ NdbSleep_MilliSleep(10);
+ return true; //temp errors?
+ default:
+ break;
+ }
+ //ERROR
+ err << error << endl;
+ return false;
+ break;
+ }
+ return false;
+}
+
+void BackupRestore::exitHandler()
+{
+ release();
+ exit(-1);
+}
+
+
+void
+BackupRestore::tuple_free()
+{
+ if (!m_restore)
+ return;
+
+ if (m_transactions > 0) {
+ // Send all transactions to NDB
+ m_ndb->sendPreparedTransactions(0);
+
+ // Poll all transactions
+ while (m_transactions > 0)
+ m_ndb->pollNdb(3000, m_transactions);
+ }
+}
+
+void
+BackupRestore::endOfTuples()
+{
+ tuple_free();
+}
+
+void
+BackupRestore::logEntry(const LogEntry & tup)
+{
+ if (!m_restore)
+ return;
+
+ NdbConnection * trans = m_ndb->startTransaction();
+ if (trans == NULL)
+ {
+ // Deep shit, TODO: handle the error
+ err << "Cannot start transaction" << endl;
+ exit(-1);
+ } // if
+
+ const TableS * table = tup.m_table;
+ NdbOperation * op = trans->getNdbOperation(table->getTableName());
+ if (op == NULL)
+ {
+ err << "Cannot get operation: " << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ int check = 0;
+ switch(tup.m_type)
+ {
+ case LogEntry::LE_INSERT:
+ check = op->insertTuple();
+ break;
+ case LogEntry::LE_UPDATE:
+ check = op->updateTuple();
+ break;
+ case LogEntry::LE_DELETE:
+ check = op->deleteTuple();
+ break;
+ default:
+ err << "Log entry has wrong operation type."
+ << " Exiting...";
+ exit(-1);
+ }
+
+ for (Uint32 i= 0; i < tup.size(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size / 8) * arraySize;
+ if (attr->Desc->m_column->getPrimaryKey())
+ op->equal(attr->Desc->attrId, dataPtr, length);
+ else
+ op->setValue(attr->Desc->attrId, dataPtr, length);
+ }
+
+ const int ret = trans->execute(Commit);
+ if (ret != 0)
+ {
+ // Both insert update and delete can fail during log running
+ // and it's ok
+ // TODO: check that the error is either tuple exists or tuple does not exist?
+ switch(tup.m_type)
+ {
+ case LogEntry::LE_INSERT:
+ break;
+ case LogEntry::LE_UPDATE:
+ break;
+ case LogEntry::LE_DELETE:
+ break;
+ }
+ if (false)
+ {
+ err << "execute failed: " << trans->getNdbError() << endl;
+ exit(-1);
+ }
+ }
+
+ m_ndb->closeTransaction(trans);
+ m_logCount++;
+}
+
+void
+BackupRestore::endOfLogEntrys()
+{
+ if (!m_restore)
+ return;
+
+ info << "Restored " << m_dataCount << " tuples and "
+ << m_logCount << " log entries" << endl;
+}
+
+/*
+ * callback : This is called when the transaction is polled
+ *
+ * (This function must have three arguments:
+ * - The result of the transaction,
+ * - The NdbConnection object, and
+ * - A pointer to an arbitrary object.)
+ */
+
+static void
+callback(int result, NdbConnection* trans, void* aObject)
+{
+ restore_callback_t *cb = (restore_callback_t *)aObject;
+ (cb->restore)->cback(result, cb);
+}
+
+#if 0 // old tuple impl
+void
+BackupRestore::tuple(const TupleS & tup)
+{
+ if (!m_restore)
+ return;
+ while (1)
+ {
+ NdbConnection * trans = m_ndb->startTransaction();
+ if (trans == NULL)
+ {
+ // Deep shit, TODO: handle the error
+ ndbout << "Cannot start transaction" << endl;
+ exit(-1);
+ } // if
+
+ const TableS * table = tup.getTable();
+ NdbOperation * op = trans->getNdbOperation(table->getTableName());
+ if (op == NULL)
+ {
+ ndbout << "Cannot get operation: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ // TODO: check return value and handle error
+ if (op->writeTuple() == -1)
+ {
+ ndbout << "writeTuple call failed: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size * arraySize) / 8;
+ if (attr->Desc->m_column->getPrimaryKey())
+ op->equal(i, dataPtr, length);
+ }
+
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size * arraySize) / 8;
+ if (!attr->Desc->m_column->getPrimaryKey())
+ if (attr->Data.null)
+ op->setValue(i, NULL, 0);
+ else
+ op->setValue(i, dataPtr, length);
+ }
+ int ret = trans->execute(Commit);
+ if (ret != 0)
+ {
+ ndbout << "execute failed: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ }
+ m_ndb->closeTransaction(trans);
+ if (ret == 0)
+ break;
+ }
+ m_dataCount++;
+}
+#endif
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp b/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp
new file mode 100644
index 00000000000..2d36501bf40
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp
@@ -0,0 +1,75 @@
+/* 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 CONSUMER_RESTORE_HPP
+#define CONSUMER_RESTORE_HPP
+
+#include "consumer.hpp"
+
+struct restore_callback_t {
+ class BackupRestore *restore;
+ class TupleS *tup;
+ class NdbConnection *connection;
+ int retries;
+ restore_callback_t *next;
+};
+
+
+class BackupRestore : public BackupConsumer
+{
+public:
+ BackupRestore(Uint32 parallelism=1)
+ {
+ m_ndb = 0;
+ m_logCount = m_dataCount = 0;
+ m_restore = false;
+ m_restore_meta = false;
+ m_parallelism = parallelism;
+ m_callback = 0;
+ m_tuples = 0;
+ m_free_callback = 0;
+ m_transactions = 0;
+ }
+
+ virtual ~BackupRestore();
+ virtual bool init();
+ virtual void release();
+ virtual bool table(const TableS &);
+ virtual void tuple(const TupleS &);
+ virtual void tuple_free();
+ virtual void tuple_a(restore_callback_t *cb);
+ virtual void cback(int result, restore_callback_t *cb);
+ virtual bool errorHandler(restore_callback_t *cb);
+ virtual void exitHandler();
+ virtual void endOfTuples();
+ virtual void logEntry(const LogEntry &);
+ virtual void endOfLogEntrys();
+ void connectToMysql();
+ Ndb * m_ndb;
+ bool m_restore;
+ bool m_restore_meta;
+ Uint32 m_logCount;
+ Uint32 m_dataCount;
+
+ Uint32 m_parallelism;
+ Uint32 m_transactions;
+
+ TupleS *m_tuples;
+ restore_callback_t *m_callback;
+ restore_callback_t *m_free_callback;
+};
+
+#endif
diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp
new file mode 100644
index 00000000000..6a9ec07148a
--- /dev/null
+++ b/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp
@@ -0,0 +1,652 @@
+/* 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 "consumer_restore.hpp"
+#include <NdbSleep.h>
+
+extern FilteredNdbOut err;
+extern FilteredNdbOut info;
+extern FilteredNdbOut debug;
+
+static bool asynchErrorHandler(NdbConnection * trans, Ndb * ndb);
+static void callback(int result, NdbConnection* trans, void* aObject);
+
+bool
+BackupRestore::init()
+{
+
+ if (!m_restore && !m_restore_meta)
+ return true;
+
+ m_ndb = new Ndb();
+
+ if (m_ndb == NULL)
+ return false;
+
+ // Turn off table name completion
+ m_ndb->useFullyQualifiedNames(false);
+
+ m_ndb->init(1024);
+ if (m_ndb->waitUntilReady(30) != 0)
+ {
+ ndbout << "Failed to connect to ndb!!" << endl;
+ return false;
+ }
+ ndbout << "Connected to ndb!!" << endl;
+
+#if USE_MYSQL
+ if(use_mysql)
+ {
+ if ( mysql_thread_safe() == 0 )
+ {
+ ndbout << "Not thread safe mysql library..." << endl;
+ exit(-1);
+ }
+
+ ndbout << "Connecting to MySQL..." <<endl;
+
+ /**
+ * nwe param:
+ * port
+ * host
+ * user
+ */
+ bool returnValue = true;
+ mysql_init(&mysql);
+ {
+ int portNo = 3306;
+ if ( mysql_real_connect(&mysql,
+ ga_host,
+ ga_user,
+ ga_password,
+ ga_database,
+ ga_port,
+:: ga_socket,
+ 0) == NULL )
+ {
+ ndbout_c("Connect failed: %s", mysql_error(&mysql));
+ returnValue = false;
+ }
+ ndbout << "Connected to MySQL!!!" <<endl;
+ }
+
+ /* if(returnValue){
+ mysql_set_server_option(&mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON);
+ }
+ */
+ return returnValue;
+ }
+#endif
+
+ if (m_callback) {
+ delete [] m_callback;
+ m_callback = 0;
+ }
+
+ m_callback = new restore_callback_t[m_parallelism];
+
+ if (m_callback == 0)
+ {
+ ndbout << "Failed to allocate callback structs" << endl;
+ return false;
+ }
+
+ m_free_callback = m_callback;
+ for (int i= 0; i < m_parallelism; i++) {
+ m_callback[i].restore = this;
+ m_callback[i].connection = 0;
+ m_callback[i].retries = 0;
+ if (i > 0)
+ m_callback[i-1].next = &(m_callback[i]);
+ }
+ m_callback[m_parallelism-1].next = 0;
+
+ return true;
+
+}
+
+BackupRestore::~BackupRestore()
+{
+ if (m_ndb != 0)
+ delete m_ndb;
+
+ if (m_callback)
+ delete [] m_callback;
+}
+
+#ifdef USE_MYSQL
+bool
+BackupRestore::table(const TableS & table, MYSQL * mysqlp){
+ if (!m_restore_meta)
+ {
+ return true;
+ }
+
+ char tmpTabName[MAX_TAB_NAME_SIZE*2];
+ sprintf(tmpTabName, "%s", table.getTableName());
+ char * database = strtok(tmpTabName, "/");
+ char * schema = strtok( NULL , "/");
+ char * tableName = strtok( NULL , "/");
+
+ /**
+ * this means that the user did not specify schema
+ * and it is a v2x backup
+ */
+ if(database == NULL)
+ return false;
+ if(schema == NULL)
+ return false;
+ if(tableName==NULL)
+ tableName = schema;
+
+ char stmtCreateDB[255];
+ sprintf(stmtCreateDB,"CREATE DATABASE %s", database);
+
+ /*ignore return value. mysql_select_db will trap errors anyways*/
+ if (mysql_query(mysqlp,stmtCreateDB) == 0)
+ {
+ //ndbout_c("%s", stmtCreateDB);
+ }
+
+ if (mysql_select_db(&mysql, database) != 0)
+ {
+ ndbout_c("Error: %s", mysql_error(&mysql));
+ return false;
+ }
+
+ char buf [2048];
+ /**
+ * create table ddl
+ */
+ if (create_table_string(table, tableName, buf))
+ {
+ ndbout_c("Unable to create a table definition since the "
+ "backup contains undefined types");
+ return false;
+ }
+
+ //ndbout_c("%s", buf);
+
+ if (mysql_query(mysqlp,buf) != 0)
+ {
+ ndbout_c("Error: %s", mysql_error(&mysql));
+ return false;
+ } else
+ {
+ ndbout_c("Successfully restored table %s into database %s", tableName, database);
+ }
+
+ return true;
+}
+#endif
+
+bool
+BackupRestore::table(const TableS & table){
+ if (!m_restore_meta)
+ {
+ return true;
+ }
+ NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
+ if (dict->createTable(*table.m_dictTable) == -1)
+ {
+ err << "Create table " << table.getTableName() << " failed: "
+ << dict->getNdbError() << endl;
+ return false;
+ }
+ info << "Successfully restored table " << table.getTableName()<< endl ;
+ return true;
+}
+
+void BackupRestore::tuple(const TupleS & tup)
+{
+ if (!m_restore)
+ {
+ delete &tup;
+ return;
+ }
+
+ restore_callback_t * cb = m_free_callback;
+
+ if (cb)
+ {
+ m_free_callback = cb->next;
+ cb->retries = 0;
+ cb->tup = &tup;
+ tuple_a(cb);
+ }
+
+ if (m_free_callback == 0)
+ {
+ // send-poll all transactions
+ // close transaction is done in callback
+ m_ndb->sendPollNdb(3000, 1);
+ }
+}
+
+void BackupRestore::tuple_a(restore_callback_t *cb)
+{
+ while (cb->retries < 10)
+ {
+ /**
+ * start transactions
+ */
+ cb->connection = m_ndb->startTransaction();
+ if (cb->connection == NULL)
+ {
+ /*
+ if (asynchErrorHandler(cb->connection, m_ndb))
+ {
+ cb->retries++;
+ continue;
+ }
+ */
+ asynchExitHandler();
+ } // if
+
+ const TupleS &tup = *(cb->tup);
+ const TableS * table = tup.getTable();
+ NdbOperation * op = cb->connection->getNdbOperation(table->getTableName());
+
+ if (op == NULL)
+ {
+ if (asynchErrorHandler(cb->connection, m_ndb))
+ {
+ cb->retries++;
+ continue;
+ }
+ asynchExitHandler();
+ } // if
+
+ if (op->writeTuple() == -1)
+ {
+ if (asynchErrorHandler(cb->connection, m_ndb))
+ {
+ cb->retries++;
+ continue;
+ }
+ asynchExitHandler();
+ } // if
+
+ Uint32 ret = 0;
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ char * dataPtr = attr->Data.string_value;
+ Uint32 length = (size * arraySize) / 8;
+ if (attr->Desc->m_column->getPrimaryKey())
+ {
+ ret = op->equal(i, dataPtr, length);
+ }
+ else
+ {
+ if (attr->Data.null)
+ ret = op->setValue(i, NULL, 0);
+ else
+ ret = op->setValue(i, dataPtr, length);
+ }
+
+ if (ret<0)
+ {
+ ndbout_c("Column: %d type %d",i,
+ tup.getTable()->m_dictTable->getColumn(i)->getType());
+ if (asynchErrorHandler(cb->connection, m_ndb))
+ {
+ cb->retries++;
+ break;
+ }
+ asynchExitHandler();
+ }
+ }
+ if (ret < 0)
+ continue;
+
+ // Prepare transaction (the transaction is NOT yet sent to NDB)
+ cb->connection->executeAsynchPrepare(Commit, &callback, cb);
+ m_transactions++;
+ }
+ ndbout_c("Unable to recover from errors. Exiting...");
+ asynchExitHandler();
+}
+
+void BackupRestore::cback(int result, restore_callback_t *cb)
+{
+ if (result<0)
+ {
+ /**
+ * Error. temporary or permanent?
+ */
+ if (asynchErrorHandler(cb->connection, m_ndb))
+ {
+ cb->retries++;
+ tuple_a(cb);
+ }
+ else
+ {
+ ndbout_c("Restore: Failed to restore data "
+ "due to a unrecoverable error. Exiting...");
+ delete m_ndb;
+ delete cb->tup;
+ exit(-1);
+ }
+ }
+ else
+ {
+ /**
+ * OK! close transaction
+ */
+ m_ndb->closeTransaction(cb->connection);
+ delete cb->tup;
+ m_transactions--;
+ }
+}
+
+void BackupRestore::asynchExitHandler()
+{
+ if (m_ndb != NULL)
+ delete m_ndb;
+ exit(-1);
+}
+
+#if 0 // old tuple impl
+void
+BackupRestore::tuple(const TupleS & tup)
+{
+ if (!m_restore)
+ return;
+ while (1)
+ {
+ NdbConnection * trans = m_ndb->startTransaction();
+ if (trans == NULL)
+ {
+ // Deep shit, TODO: handle the error
+ ndbout << "Cannot start transaction" << endl;
+ exit(-1);
+ } // if
+
+ const TableS * table = tup.getTable();
+ NdbOperation * op = trans->getNdbOperation(table->getTableName());
+ if (op == NULL)
+ {
+ ndbout << "Cannot get operation: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ // TODO: check return value and handle error
+ if (op->writeTuple() == -1)
+ {
+ ndbout << "writeTuple call failed: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size * arraySize) / 8;
+ if (attr->Desc->m_column->getPrimaryKey())
+ op->equal(i, dataPtr, length);
+ }
+
+ for (int i = 0; i < tup.getNoOfAttributes(); i++)
+ {
+ const AttributeS * attr = tup[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size * arraySize) / 8;
+ if (!attr->Desc->m_column->getPrimaryKey())
+ if (attr->Data.null)
+ op->setValue(i, NULL, 0);
+ else
+ op->setValue(i, dataPtr, length);
+ }
+ int ret = trans->execute(Commit);
+ if (ret != 0)
+ {
+ ndbout << "execute failed: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ }
+ m_ndb->closeTransaction(trans);
+ if (ret == 0)
+ break;
+ }
+ m_dataCount++;
+}
+#endif
+
+void
+BackupRestore::endOfTuples()
+{
+ if (!m_restore)
+ return;
+
+ // Send all transactions to NDB
+ m_ndb->sendPreparedTransactions(0);
+
+ // Poll all transactions
+ m_ndb->pollNdb(3000, m_transactions);
+
+ // Close all transactions
+ // for (int i = 0; i < nPreparedTransactions; i++)
+ // m_ndb->closeTransaction(asynchTrans[i]);
+}
+
+void
+BackupRestore::logEntry(const LogEntry & tup)
+{
+ if (!m_restore)
+ return;
+
+ NdbConnection * trans = m_ndb->startTransaction();
+ if (trans == NULL)
+ {
+ // Deep shit, TODO: handle the error
+ ndbout << "Cannot start transaction" << endl;
+ exit(-1);
+ } // if
+
+ const TableS * table = tup.m_table;
+ NdbOperation * op = trans->getNdbOperation(table->getTableName());
+ if (op == NULL)
+ {
+ ndbout << "Cannot get operation: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ } // if
+
+ int check = 0;
+ switch(tup.m_type)
+ {
+ case LogEntry::LE_INSERT:
+ check = op->insertTuple();
+ break;
+ case LogEntry::LE_UPDATE:
+ check = op->updateTuple();
+ break;
+ case LogEntry::LE_DELETE:
+ check = op->deleteTuple();
+ break;
+ default:
+ ndbout << "Log entry has wrong operation type."
+ << " Exiting...";
+ exit(-1);
+ }
+
+ for (int i = 0; i < tup.m_values.size(); i++)
+ {
+ const AttributeS * attr = tup.m_values[i];
+ int size = attr->Desc->size;
+ int arraySize = attr->Desc->arraySize;
+ const char * dataPtr = attr->Data.string_value;
+
+ const Uint32 length = (size / 8) * arraySize;
+ if (attr->Desc->m_column->getPrimaryKey())
+ op->equal(attr->Desc->attrId, dataPtr, length);
+ else
+ op->setValue(attr->Desc->attrId, dataPtr, length);
+ }
+
+#if 1
+ trans->execute(Commit);
+#else
+ const int ret = trans->execute(Commit);
+ // Both insert update and delete can fail during log running
+ // and it's ok
+
+ if (ret != 0)
+ {
+ ndbout << "execute failed: ";
+ ndbout << trans->getNdbError() << endl;
+ exit(-1);
+ }
+#endif
+
+ m_ndb->closeTransaction(trans);
+ m_logCount++;
+}
+
+void
+BackupRestore::endOfLogEntrys()
+{
+ if (m_restore)
+ {
+ ndbout << "Restored " << m_dataCount << " tuples and "
+ << m_logCount << " log entries" << endl;
+ }
+}
+#if 0
+/*****************************************
+ *
+ * Callback function for asynchronous transactions
+ *
+ * Idea for error handling: Transaction objects have to be stored globally when
+ * they are prepared.
+ * In the callback function if the transaction:
+ * succeeded: delete the object from global storage
+ * failed but can be retried: execute the object that is in global storage
+ * failed but fatal: delete the object from global storage
+ *
+ ******************************************/
+static void restoreCallback(int result, // Result for transaction
+ NdbConnection *object, // Transaction object
+ void *anything) // Not used
+{
+ static Uint32 counter = 0;
+
+
+ debug << "restoreCallback function called " << counter << " time(s)" << endl;
+
+ ++counter;
+
+ if (result == -1)
+ {
+ ndbout << " restoreCallback (" << counter;
+ if ((counter % 10) == 1)
+ {
+ ndbout << "st";
+ } // if
+ else if ((counter % 10) == 2)
+ {
+ ndbout << "nd";
+ } // else if
+ else if ((counter % 10 ) ==3)
+ {
+ ndbout << "rd";
+ } // else if
+ else
+ {
+ ndbout << "th";
+ } // else
+ err << " time: error detected " << object->getNdbError() << endl;
+ } // if
+
+} // restoreCallback
+#endif
+
+
+
+/*
+ * callback : This is called when the transaction is polled
+ *
+ * (This function must have three arguments:
+ * - The result of the transaction,
+ * - The NdbConnection object, and
+ * - A pointer to an arbitrary object.)
+ */
+
+static void
+callback(int result, NdbConnection* trans, void* aObject)
+{
+ restore_callback_t *cb = (restore_callback_t *)aObject;
+ (cb->restore)->cback(result, cb);
+}
+
+/**
+ * returns true if is recoverable,
+ * Error handling based on hugo
+ * false if it is an error that generates an abort.
+ */
+static
+bool asynchErrorHandler(NdbConnection * trans, Ndb* ndb)
+{
+ NdbError error = trans->getNdbError();
+ ndb->closeTransaction(trans);
+ switch(error.status)
+ {
+ case NdbError::Success:
+ return false;
+ // ERROR!
+ break;
+
+ case NdbError::TemporaryError:
+ NdbSleep_MilliSleep(10);
+ return true;
+ // RETRY
+ break;
+
+ case NdbError::UnknownResult:
+ ndbout << error << endl;
+ return false;
+ // ERROR!
+ break;
+
+ default:
+ case NdbError::PermanentError:
+ switch (error.code)
+ {
+ case 499:
+ case 250:
+ NdbSleep_MilliSleep(10);
+ return true; //temp errors?
+ default:
+ break;
+ }
+ //ERROR
+ ndbout << error << endl;
+ return false;
+ break;
+ }
+ return false;
+}
diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp
index 4c15785d5c2..99deeb3115c 100644
--- a/ndb/src/kernel/blocks/backup/restore/main.cpp
+++ b/ndb/src/kernel/blocks/backup/restore/main.cpp
@@ -14,165 +14,37 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "Restore.hpp"
#include <getarg.h>
-#include <NdbSleep.h>
#include <Vector.hpp>
#include <ndb_limits.h>
#include <NdbTCP.h>
-#ifdef USE_MYSQL
-#include <mysql.h>
-#endif
-NdbOut& operator<<(NdbOut& ndbout, const TupleS& tuple);
-NdbOut& operator<<(NdbOut& ndbout, const LogEntry& logEntry);
-NdbOut& operator<<(NdbOut& ndbout, const RestoreMetaData &);
+#include <NdbOut.hpp>
+
+#include "consumer_restore.hpp"
+#include "consumer_printer.hpp"
extern FilteredNdbOut err;
extern FilteredNdbOut info;
extern FilteredNdbOut debug;
-static const char * delimiter = ";"; // Delimiter in file dump
-
static int ga_nodeId = 0;
-static int ga_nParallelism = 1;
+static int ga_nParallelism = 128;
static int ga_backupId = 0;
static bool ga_dont_ignore_systab_0 = false;
-static myVector<class BackupConsumer *> g_consumers;
-
-#ifdef USE_MYSQL
-/**
- * mysql specific stuff:
- */
-static const char* ga_user = "root";
-static const char* ga_host = "localhost";
-static const char* ga_socket = "/tmp/mysql.sock";
-static const char* ga_password = "";
-static const char* ga_database = "";
-static int ga_port = 3306;
-static bool use_mysql = false;
-static MYSQL mysql;
-#endif
+static Vector<class BackupConsumer *> g_consumers;
-
-#ifdef NDB_WIN32
-static const char* ga_backupPath = ".\\";
-#else
-static const char* ga_backupPath = "./";
-#endif
-
-typedef struct {
- void * ndb;
- void * restore;
- TupleS * tup;
- int transaction;
- int retries;
-} restore_callback_t;
+static const char* ga_backupPath = "." DIR_SEPARATOR;
static const char* ga_connect_NDB = NULL;
-static const char* ga_schema = NULL;
-static const char* ga_catalog = NULL;
-
-
/**
* print and restore flags
*/
static bool ga_restore = false;
static bool ga_print = false;
-
-
-
-class BackupConsumer {
-public:
- virtual bool init() { return true;}
- virtual bool table(const TableS &){return true;}
-#ifdef USE_MYSQL
- virtual bool table(const TableS &, MYSQL* mysqlp) {return true;};
-#endif
- virtual void tuple(const TupleS &){}
- virtual void tupleAsynch(const TupleS &, restore_callback_t * callback) {};
- // virtual bool asynchErrorHandler(NdbConnection * trans){return true;};
- virtual void asynchExitHandler(){};
- virtual void endOfTuples(){}
- virtual void logEntry(const LogEntry &){}
- virtual void endOfLogEntrys(){}
-protected:
- int create_table_string(const TableS & table, char * ,char *);
-};
-
-class BackupPrinter : public BackupConsumer
-{
- NdbOut & m_ndbout;
-public:
- BackupPrinter(NdbOut & out = ndbout) : m_ndbout(out)
- {
- m_print = false;
- m_print_log = false;
- m_print_data = false;
- m_print_meta = false;
- }
-
- virtual bool table(const TableS &);
-#ifdef USE_MYSQL
- virtual bool table(const TableS &, MYSQL* mysqlp);
-#endif
- virtual void tuple(const TupleS &);
- virtual void logEntry(const LogEntry &);
- virtual void endOfTuples() {};
- virtual void endOfLogEntrys();
- virtual void tupleAsynch(const TupleS &, restore_callback_t * callback);
- bool m_print;
- bool m_print_log;
- bool m_print_data;
- bool m_print_meta;
- Uint32 m_logCount;
- Uint32 m_dataCount;
-
-};
-
-class BackupRestore : public BackupConsumer
-{
-public:
- BackupRestore()
- {
- m_ndb = 0;
- m_logCount = m_dataCount = 0;
- m_restore = false;
- m_restore_meta = false;
- }
-
- virtual ~BackupRestore();
-
- virtual bool init();
- virtual bool table(const TableS &);
-#ifdef USE_MYSQL
- virtual bool table(const TableS &, MYSQL* mysqlp);
-#endif
- virtual void tuple(const TupleS &);
- virtual void tupleAsynch(const TupleS &, restore_callback_t * callback);
- virtual void asynchExitHandler();
- virtual void endOfTuples();
- virtual void logEntry(const LogEntry &);
- virtual void endOfLogEntrys();
- void connectToMysql();
- Ndb * m_ndb;
- bool m_restore;
- bool m_restore_meta;
- Uint32 m_logCount;
- Uint32 m_dataCount;
-};
bool
readArguments(const int argc, const char** argv)
{
- BackupPrinter* printer = new BackupPrinter();
- if (printer == NULL)
- return false;
- BackupRestore* restore = new BackupRestore();
- if (restore == NULL)
- {
- delete printer;
- return false;
- }
int _print = 0;
int _print_meta = 0;
@@ -206,18 +78,6 @@ readArguments(const int argc, const char** argv)
"No of parallel transactions during restore of data."
"(parallelism can be 1 to 1024)",
"Parallelism"},
-#if NDB_VERSION_MAJOR >= VERSION_3X
- { "catalog", 'd', arg_string, &ga_catalog,
- "Specifies the catalog/database where the data should be restored to. "
- "Restores only to backups taken with v.2.x and restored on >v.3.x "
- "systems. Note: system tables (if restored) defaults to sys/def/ ",
- "catalog"},
- { "schema", 's', arg_string, &ga_schema,
- "Specifies the schema where the data should be restored to."
- "Restores only to backups taken with v.2.x and restored on >v.3.x "
- "systems. Note: system tables (if restored) defaults to sys/def/ ",
- "schema"},
-#endif
#ifdef USE_MYSQL
{ "use_mysql", '\0', arg_flag, &use_mysql,
"Restore meta data via mysql. Systab will be ignored. Data is restored "
@@ -247,10 +107,18 @@ readArguments(const int argc, const char** argv)
ga_nParallelism < 1 ||
ga_nParallelism >1024)
{
-
arg_printusage(args, num_args, argv[0], "<path to backup files>\n");
+ return false;
+ }
+
+ BackupPrinter* printer = new BackupPrinter();
+ if (printer == NULL)
+ return false;
+
+ BackupRestore* restore = new BackupRestore(ga_nParallelism);
+ if (restore == NULL)
+ {
delete printer;
- delete restore;
return false;
}
@@ -293,11 +161,11 @@ readArguments(const int argc, const char** argv)
}
{
- BackupConsumer * c = printer;
+ BackupConsumer * c = printer;
g_consumers.push_back(c);
}
{
- BackupConsumer * c = restore;
+ BackupConsumer * c = restore;
g_consumers.push_back(c);
}
// Set backup file path
@@ -305,20 +173,6 @@ readArguments(const int argc, const char** argv)
{
ga_backupPath = argv[optind];
}
-#ifdef USE_MYSQL
- if(use_mysql) {
- ga_dont_ignore_systab_0 = false;
- ga_database = ""; //not used yet. pethaps later if we want to
- // restore meta data in an existing mysql database,
- // and not just restore it to the same database
- // as when the backup was taken.
- // If implementing this, then the
- // tupleAsynch must also be changed so that the
- // table data is restored to the correct table.
- // also, mysql_select_db must be set properly (ie.,
- // ignored in codw below)
- }
-#endif
return true;
}
@@ -327,15 +181,12 @@ readArguments(const int argc, const char** argv)
void
clearConsumers()
{
- for(int i = 0; i<g_consumers.size(); i++)
+ for(Uint32 i= 0; i<g_consumers.size(); i++)
delete g_consumers[i];
g_consumers.clear();
}
-static bool asynchErrorHandler(NdbConnection * trans, Ndb * ndb);
-static NdbConnection * asynchTrans[1024];
-
-bool
+static bool
checkSysTable(const char *tableName)
{
return ga_dont_ignore_systab_0 ||
@@ -345,6 +196,12 @@ checkSysTable(const char *tableName)
strcmp(tableName, "sys/def/NDB$EVENTS_0") != 0);
}
+static void
+free_data_callback()
+{
+ for(Uint32 i= 0; i < g_consumers.size(); i++)
+ g_consumers[i]->tuple_free();
+}
int
main(int argc, const char** argv)
@@ -353,10 +210,12 @@ main(int argc, const char** argv)
{
return -1;
}
- // Turn off table name completion
-#if NDB_VERSION_MAJOR >= VERSION_3X
- Ndb::useFullyQualifiedNames(false);
-#endif
+
+ if (ga_connect_NDB != NULL)
+ {
+ // Use connection string
+ Ndb::setConnectString(ga_connect_NDB);
+ }
/**
* we must always load meta data, even if we will only print it to stdout
@@ -368,41 +227,19 @@ main(int argc, const char** argv)
return -1;
}
/**
- * check wheater we can restore the backup (right version, and if that
- * version needs catalog and schema specified.
+ * check wheater we can restore the backup (right version).
*/
- int res = metaData.loadContent(ga_catalog, ga_schema);
+ int res = metaData.loadContent();
- if (res == 0)
+ if (res == 0)
{
ndbout_c("Restore: Failed to load content");
return -1;
}
- if (res == -1)
- {
- ndbout_c("Restore: The backup is from a NDB Cluster v.2.x version. "
- "To restore this backup on a > 3.x version you must specify "
- "catalog and schema.");
- return -1;
- }
- if (res == -2)
- {
-#ifdef NDB_VERSION
- ndbout_c("Restore: The backup is from a NDB Cluster v.3.x version "
- "Catalog and schema are invalid parameters since they "
- "already exist implicitly.");
-#endif
-#ifdef NDB_KERNEL_VERSION
- ndbout_c("Restore: The backup is from a NDB Cluster v.3.x version "
- "It is not possible to restore a 3.x backup on v.2.x. ");
-#endif
- return -1;
- }
- if (res == -3)
+ if (metaData.getNoOfTables() == 0)
{
- ndbout_c("Restore: The backup contains no tables "
- "Catalog and schema are invalid parameters. ");
+ ndbout_c("Restore: The backup contains no tables ");
return -1;
}
@@ -414,7 +251,7 @@ main(int argc, const char** argv)
}
- for(int i = 0; i<g_consumers.size(); i++)
+ for(Uint32 i= 0; i < g_consumers.size(); i++)
{
if (!g_consumers[i]->init())
{
@@ -428,36 +265,22 @@ main(int argc, const char** argv)
{
if (checkSysTable(metaData[i]->getTableName()))
{
- for(int j = 0; j<g_consumers.size(); j++)
-#ifdef USE_MYSQL
- if(use_mysql) {
- if (!g_consumers[j]->table(* metaData[i], &mysql))
- {
- ndbout_c("Restore: Failed to restore table: %s. "
- "Exiting...",
- metaData[i]->getTableName());
- return -11;
- }
- } else
-#endif
- if (!g_consumers[j]->table(* metaData[i]))
- {
- ndbout_c("Restore: Failed to restore table: %s. "
- "Exiting...",
- metaData[i]->getTableName());
- return -11;
- }
-
+ for(Uint32 j= 0; j < g_consumers.size(); j++)
+ if (!g_consumers[j]->table(* metaData[i]))
+ {
+ ndbout_c("Restore: Failed to restore table: %s. "
+ "Exiting...",
+ metaData[i]->getTableName());
+ return -11;
+ }
}
}
-
-
if (ga_restore || ga_print)
{
if (ga_restore)
{
- RestoreDataIterator dataIter(metaData);
+ RestoreDataIterator dataIter(metaData, &free_data_callback);
// Read data file header
if (!dataIter.readHeader())
@@ -467,19 +290,15 @@ main(int argc, const char** argv)
}
- while (dataIter.readFragmentHeader(res))
+ while (dataIter.readFragmentHeader(res= 0))
{
- const TupleS* tuple = 0;
- while ((tuple = dataIter.getNextTuple(res)) != NULL)
+ const TupleS* tuple;
+ while ((tuple = dataIter.getNextTuple(res= 1)) != 0)
{
if (checkSysTable(tuple->getTable()->getTableName()))
- {
- for(int i = 0; i<g_consumers.size(); i++)
- {
- g_consumers[i]->tupleAsynch(* tuple, 0);
- }
- }
- } while (tuple != NULL);
+ for(Uint32 i= 0; i < g_consumers.size(); i++)
+ g_consumers[i]->tuple(* tuple);
+ } // while (tuple != NULL);
if (res < 0)
{
@@ -496,44 +315,37 @@ main(int argc, const char** argv)
if (res < 0)
{
- ndbout_c("Restore: An error occured while restoring data. "
- "Exiting...");
+ err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl;
return -1;
}
dataIter.validateFooter(); //not implemented
- for (int i = 0; i<g_consumers.size(); i++)
+
+ for (Uint32 i= 0; i < g_consumers.size(); i++)
g_consumers[i]->endOfTuples();
RestoreLogIterator logIter(metaData);
if (!logIter.readHeader())
{
- ndbout << "Failed to read header of data file. Exiting...";
+ err << "Failed to read header of data file. Exiting..." << endl;
return -1;
}
- /**
- * I have not touched the part below : -johan 040218
- * except fixing return values.
- */
const LogEntry * logEntry = 0;
- while ((logEntry = logIter.getNextLogEntry(res)))
+ while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0)
{
if (checkSysTable(logEntry->m_table->getTableName()))
- {
- for(int i = 0; i<g_consumers.size(); i++)
+ for(Uint32 i= 0; i < g_consumers.size(); i++)
g_consumers[i]->logEntry(* logEntry);
- }
}
if (res < 0)
{
- ndbout_c("Restore: An restoring the data log"
- "Exiting...");
+ err << "Restore: An restoring the data log. Exiting... res=" << res << endl;
return -1;
}
logIter.validateFooter(); //not implemented
- for (int i = 0; i<g_consumers.size(); i++)
+ for (Uint32 i= 0; i < g_consumers.size(); i++)
g_consumers[i]->endOfLogEntrys();
}
}
@@ -541,1152 +353,3 @@ main(int argc, const char** argv)
return 1;
} // main
-NdbOut &
-operator<<(NdbOut& ndbout, const AttributeS& attr){
- const AttributeData & data = attr.Data;
- const AttributeDesc & desc = * attr.Desc;
-
- if (data.null)
- {
- ndbout << "<NULL>";
- return ndbout;
- }
-
- if (desc.arraySize > 1)
- ndbout << "[ ";
- for (Uint32 j = 0; j < desc.arraySize; j++)
- {
- // Print strings without spaces,
- // (but ndbout char does not work as expected, see below)
- switch (desc.type)
- {
- case Signed:
- switch (desc.size)
- {
- case 8:
- ndbout << (short)data.int8_value[j];
- break;
- case 16:
- ndbout << data.int16_value[j];
- break;
- case 32:
- ndbout << data.int32_value[j];
- break;
- case 64:
- ndbout << data.int64_value[j];
- break;
- case 128:
- ndbout << "Signed sz = 128 - this is something wrong??" << endl;
- break;
- default:
- // Unknown, error
- break;
- } // switch size
- break;
- case UnSigned:
- switch (desc.size)
- {
- case 8:
- ndbout << (short)data.u_int8_value[j];
- break;
- case 16:
- ndbout << data.u_int16_value[j];
- break;
- case 32:
- ndbout << data.u_int32_value[j];
- break;
- case 64:
- ndbout << data.u_int64_value[j];
- break;
- case 128:
- ndbout << "UnSigned sz = 128 - this is something wrong??" << endl;
- break;
- default:
- // Unknown, error
- break;
- } // switch size
- break;
- case (String):
- if (desc.size == 8){
- NdbDictionary::Column::Type type = desc.m_table->m_dictTable->getColumn(desc.attrId)->getType();
- if(type == NdbDictionary::Column::Varchar){
- short len = ntohs(data.u_int16_value[0]);
- ndbout.print("%.*s", len, (data.string_value+2));
- } else {
- ndbout << data.string_value;
- }
- } // if
- else
- {
- ndbout << "String sz != 8 - this is something wrong??" << endl;
- }
- j = desc.arraySize;
- break;
- case (Float):
- // Not yet supported to print float
- ndbout << "float";
- break;
- default:
- ndbout << "Not defined Attr Type";
- } // switch AttrType
- ndbout << " ";
- } // for ArraySize
- if (desc.arraySize > 1)
- {
- ndbout << "]";
- }
- return ndbout;
-}
-
-// Print tuple data
-NdbOut&
-operator<<(NdbOut& ndbout, const TupleS& tuple)
-{
- ndbout << tuple.getTable()->getTableName() << "; ";
- for (int i = 0; i < tuple.getNoOfAttributes(); i++)
- {
- const AttributeS * attr = tuple[i];
- debug << i << " " << attr->Desc->name;
- ndbout << (* attr);
-
- if (i != (tuple.getNoOfAttributes() - 1))
- ndbout << delimiter << " ";
- } // for
- return ndbout;
-}
-
-// Print tuple data
-NdbOut&
-operator<<(NdbOut& ndbout, const LogEntry& logE)
-{
- switch(logE.m_type)
- {
- case LogEntry::LE_INSERT:
- ndbout << "INSERT " << logE.m_table->getTableName() << " ";
- break;
- case LogEntry::LE_DELETE:
- ndbout << "DELETE " << logE.m_table->getTableName() << " ";
- break;
- case LogEntry::LE_UPDATE:
- ndbout << "UPDATE " << logE.m_table->getTableName() << " ";
- break;
- default:
- ndbout << "Unknown log entry type (not insert, delete or update)" ;
- }
-
- for (int i = 0; i < logE.m_values.size();i++)
- {
- const AttributeS * attr = logE.m_values[i];
- ndbout << attr->Desc->name << "=";
- ndbout << (* attr);
- if (i < (logE.m_values.size() - 1))
- ndbout << ", ";
- }
- return ndbout;
-}
-
-
-NdbOut &
-operator<<(NdbOut& ndbout, const TableS & table){
- ndbout << endl << "Table: " << table.getTableName() << endl;
- for (int j = 0; j < table.getNoOfAttributes(); j++)
- {
- const AttributeDesc * desc = table[j];
- ndbout << desc->name << ": ";
- NdbDictionary::Column::Type type = table.m_dictTable->getColumn(desc->attrId)->getType();
- switch(type){
- case NdbDictionary::Column::Int:
- ndbout << "Int ";
- break;
- case NdbDictionary::Column::Unsigned:
- ndbout << "Unsigned ";
- break;
- case NdbDictionary::Column::Float:
- ndbout << "Float ";
- break;
- case NdbDictionary::Column::Decimal:
- ndbout << "Decimal ";
- break;
- case NdbDictionary::Column::Char:
- ndbout << "Char ";
- break;
- case NdbDictionary::Column::Varchar:
- ndbout << "Varchar ";
- break;
- case NdbDictionary::Column::Binary:
- ndbout << "Binary ";
- break;
- case NdbDictionary::Column::Varbinary:
- ndbout << "Varbinary ";
- break;
- case NdbDictionary::Column::Bigint:
- ndbout << "Bigint ";
- break;
- case NdbDictionary::Column::Bigunsigned:
- ndbout << "Bigunsigned ";
- break;
- case NdbDictionary::Column::Double:
- ndbout << "Double ";
- break;
- case NdbDictionary::Column::Datetime:
- ndbout << "Datetime ";
- break;
- case NdbDictionary::Column::Timespec:
- ndbout << "Timespec ";
- break;
- case NdbDictionary::Column::Undefined:
- ndbout << "Undefined ";
- break;
- default:
- ndbout << "Unknown(" << type << ")";
- }
- ndbout << " key: " << desc->key;
- ndbout << " array: " << desc->arraySize;
- ndbout << " size: " << desc->size << endl;
- } // for
- return ndbout;
-}
-
-
-#if 0
-/*****************************************
- *
- * Callback function for asynchronous transactions
- *
- * Idea for error handling: Transaction objects have to be stored globally when
- * they are prepared.
- * In the callback function if the transaction:
- * succeeded: delete the object from global storage
- * failed but can be retried: execute the object that is in global storage
- * failed but fatal: delete the object from global storage
- *
- ******************************************/
-static void restoreCallback(int result, // Result for transaction
- NdbConnection *object, // Transaction object
- void *anything) // Not used
-{
- static Uint32 counter = 0;
-
-
- debug << "restoreCallback function called " << counter << " time(s)" << endl;
-
- ++counter;
-
- if (result == -1)
- {
- ndbout << " restoreCallback (" << counter;
- if ((counter % 10) == 1)
- {
- ndbout << "st";
- } // if
- else if ((counter % 10) == 2)
- {
- ndbout << "nd";
- } // else if
- else if ((counter % 10 ) ==3)
- {
- ndbout << "rd";
- } // else if
- else
- {
- ndbout << "th";
- } // else
- err << " time: error detected " << object->getNdbError() << endl;
- } // if
-
-} // restoreCallback
-#endif
-
-
-
-bool
-BackupPrinter::table(const TableS & tab)
-{
- if (m_print || m_print_meta)
- {
- m_ndbout << tab;
- ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName());
- }
- return true;
-}
-
-#ifdef USE_MYSQL
-bool
-BackupPrinter::table(const TableS & tab, MYSQL * mysql)
-{
- if (m_print || m_print_meta)
- {
-
- char tmpTabName[MAX_TAB_NAME_SIZE*2];
- sprintf(tmpTabName, "%s", tab.getTableName());
- char * database = strtok(tmpTabName, "/");
- char * schema = strtok( NULL , "/");
- char * tableName = strtok( NULL , "/");
-
- /**
- * this means that the user did not specify schema
- * and it is a v2x backup
- */
- if(database == NULL)
- return false;
- if(schema == NULL)
- return false;
- if(tableName==NULL)
- tableName = schema;
-
- char stmtCreateDB[255];
-
- sprintf(stmtCreateDB,"CREATE DATABASE %s", database);
- ndbout_c("%s", stmtCreateDB);
-
-
- char buf [2048];
- create_table_string(tab, tableName, buf);
- ndbout_c("%s", buf);
-
- ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName());
- }
- return true;
-}
-
-#endif
-
-void
-BackupPrinter::tuple(const TupleS & tup)
-{
- if (m_print || m_print_data)
- m_ndbout << tup << endl;
-}
-
-void
-BackupPrinter::logEntry(const LogEntry & logE)
-{
- if (m_print || m_print_log)
- m_ndbout << logE << endl;
- m_logCount++;
-}
-
-bool
-BackupRestore::init()
-{
-
- if (!m_restore && !m_restore_meta)
- return true;
-
- if (ga_connect_NDB != NULL)
- {
- // Use connection string
- Ndb::setConnectString(ga_connect_NDB);
- }
-
- m_ndb = new Ndb("TEST_DB");
- if (m_ndb == NULL)
- return false;
-
- m_ndb->init(1024);
- if (m_ndb->waitUntilReady(30) != 0)
- {
- ndbout << "Failed to connect to ndb!!" << endl;
- delete m_ndb;
- return false;
- }
- ndbout << "Connected to ndb!!" << endl;
-
-#if USE_MYSQL
- if(use_mysql)
- {
- if ( mysql_thread_safe() == 0 )
- {
- ndbout << "Not thread safe mysql library..." << endl;
- exit(-1);
- }
-
- ndbout << "Connecting to MySQL..." <<endl;
-
- /**
- * nwe param:
- * port
- * host
- * user
- */
- bool returnValue = true;
- mysql_init(&mysql);
- {
- int portNo = 3306;
- if ( mysql_real_connect(&mysql,
- ga_host,
- ga_user,
- ga_password,
- ga_database,
- ga_port,
- ga_socket,
- 0) == NULL )
- {
- ndbout_c("Connect failed: %s", mysql_error(&mysql));
- returnValue = false;
- }
- ndbout << "Connected to MySQL!!!" <<endl;
- }
-
- /* if(returnValue){
- mysql_set_server_option(&mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON);
- }
- */
- return returnValue;
- }
-#endif
- return true;
-
-}
-
-BackupRestore::~BackupRestore()
-{
- if (m_ndb != 0)
- delete m_ndb;
-}
-#ifdef USE_MYSQL
-bool
-BackupRestore::table(const TableS & table, MYSQL * mysqlp){
- if (!m_restore_meta)
- {
- return true;
- }
-
- char tmpTabName[MAX_TAB_NAME_SIZE*2];
- sprintf(tmpTabName, "%s", table.getTableName());
- char * database = strtok(tmpTabName, "/");
- char * schema = strtok( NULL , "/");
- char * tableName = strtok( NULL , "/");
-
- /**
- * this means that the user did not specify schema
- * and it is a v2x backup
- */
- if(database == NULL)
- return false;
- if(schema == NULL)
- return false;
- if(tableName==NULL)
- tableName = schema;
-
- char stmtCreateDB[255];
- sprintf(stmtCreateDB,"CREATE DATABASE %s", database);
-
- /*ignore return value. mysql_select_db will trap errors anyways*/
- if (mysql_query(mysqlp,stmtCreateDB) == 0)
- {
- //ndbout_c("%s", stmtCreateDB);
- }
-
- if (mysql_select_db(&mysql, database) != 0)
- {
- ndbout_c("Error: %s", mysql_error(&mysql));
- return false;
- }
-
- char buf [2048];
- /**
- * create table ddl
- */
- if (create_table_string(table, tableName, buf))
- {
- ndbout_c("Unable to create a table definition since the "
- "backup contains undefined types");
- return false;
- }
-
- //ndbout_c("%s", buf);
-
- if (mysql_query(mysqlp,buf) != 0)
- {
- ndbout_c("Error: %s", mysql_error(&mysql));
- return false;
- } else
- {
- ndbout_c("Successfully restored table %s into database %s", tableName, database);
- }
-
- return true;
-}
-#endif
-
-int
-BackupConsumer::create_table_string(const TableS & table,
- char * tableName,
- char *buf){
- int pos = 0;
- int pos2 = 0;
- char buf2[2048];
-
- pos += sprintf(buf+pos, "%s%s", "CREATE TABLE ", tableName);
- pos += sprintf(buf+pos, "%s", "(");
- pos2 += sprintf(buf2+pos2, "%s", " primary key(");
-
- for (int j = 0; j < table.getNoOfAttributes(); j++)
- {
- const AttributeDesc * desc = table[j];
- // ndbout << desc->name << ": ";
- pos += sprintf(buf+pos, "%s%s", desc->name," ");
- NdbDictionary::Column::Type type = table.m_dictTable->getColumn(desc->attrId)->getType();
- switch(type){
- case NdbDictionary::Column::Int:
- pos += sprintf(buf+pos, "%s", "int");
- break;
- case NdbDictionary::Column::Unsigned:
- pos += sprintf(buf+pos, "%s", "int unsigned");
- break;
- case NdbDictionary::Column::Float:
- pos += sprintf(buf+pos, "%s", "float");
- break;
- case NdbDictionary::Column::Decimal:
- pos += sprintf(buf+pos, "%s", "decimal");
- break;
- case NdbDictionary::Column::Char:
- pos += sprintf(buf+pos, "%s", "char");
- break;
- case NdbDictionary::Column::Varchar:
- pos += sprintf(buf+pos, "%s", "varchar");
- break;
- case NdbDictionary::Column::Binary:
- pos += sprintf(buf+pos, "%s", "binary");
- break;
- case NdbDictionary::Column::Varbinary:
- pos += sprintf(buf+pos, "%s", "varchar binary");
- break;
- case NdbDictionary::Column::Bigint:
- pos += sprintf(buf+pos, "%s", "bigint");
- break;
- case NdbDictionary::Column::Bigunsigned:
- pos += sprintf(buf+pos, "%s", "bigint unsigned");
- break;
- case NdbDictionary::Column::Double:
- pos += sprintf(buf+pos, "%s", "double");
- break;
- case NdbDictionary::Column::Datetime:
- pos += sprintf(buf+pos, "%s", "datetime");
- break;
- case NdbDictionary::Column::Timespec:
- pos += sprintf(buf+pos, "%s", "time");
- break;
- case NdbDictionary::Column::Undefined:
- // pos += sprintf(buf+pos, "%s", "varchar binary");
- return -1;
- break;
- default:
- //pos += sprintf(buf+pos, "%s", "varchar binary");
- return -1;
- }
- if (desc->arraySize > 1) {
- int attrSize = desc->arraySize;
- pos += sprintf(buf+pos, "%s%u%s",
- "(",
- attrSize,
- ")");
- }
- if (table.m_dictTable->getColumn(desc->attrId)->getPrimaryKey()) {
- pos += sprintf(buf+pos, "%s", " not null");
- pos2 += sprintf(buf2+pos2, "%s%s", desc->name, ",");
- }
- pos += sprintf(buf+pos, "%s", ",");
- } // for
- pos2--; // remove trailing comma
- pos2 += sprintf(buf2+pos2, "%s", ")");
- // pos--; // remove trailing comma
-
- pos += sprintf(buf+pos, "%s", buf2);
- pos += sprintf(buf+pos, "%s", ") type=ndbcluster");
- return 0;
-}
-
-
-
-bool
-BackupRestore::table(const TableS & table){
- if (!m_restore_meta)
- {
- return true;
- }
-#ifndef restore_old_types
- NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
- if (dict->createTable(*table.m_dictTable) == -1)
- {
- err << "Create table " << table.getTableName() << " failed: "
- << dict->getNdbError() << endl;
- return false;
- }
- info << "Successfully restored table " << table.getTableName()<< endl ;
- return true;
-#else
- NdbSchemaCon * tableTransaction = 0;
- NdbSchemaOp * tableOp = 0;
-
- tableTransaction = m_ndb->startSchemaTransaction();
- if (tableTransaction == NULL)
- {
- err << table.getTableName()
- << " - BackupRestore::table cannot startSchemaTransaction: "
- << tableTransaction->getNdbError() << endl;
- return false;
- } // if
-
- tableOp = tableTransaction->getNdbSchemaOp();
- if (tableOp == NULL)
- {
- err << table.getTableName()
- << " - BackupRestore::table cannot getNdbSchemaOp: "
- << tableTransaction->getNdbError() << endl;
- m_ndb->closeSchemaTransaction(tableTransaction);
- return false;
- } // if
-
- // TODO: check for errors in table attributes. set aTupleKey
- int check = 0;
- check = tableOp->createTable(table.getTableName());
- // aTableSize = 8, Not used?
- // aTupleKey = TupleKey, go through attributes and check if there is a PK
- // and so on....
- if (check == -1)
- {
- err << table.getTableName()
- << " - BackupRestore::table cannot createTable: "
- << tableTransaction->getNdbError() << endl;
- m_ndb->closeSchemaTransaction(tableTransaction);
- return false;
- } // if
-
- // Create attributes from meta data
- for (int i = 0; i < table.getNoOfAttributes(); i++)
- {
- const AttributeDesc* desc = table[i];
- check = tableOp->createAttribute(desc->name, // Attr name
- desc->key, // Key type
- desc->size, // bits
- desc->arraySize,
- desc->type,
- MMBased, // only supported
- desc->nullable
- // Rest is don't care for the moment
- );
-
- if (check == -1)
- {
- err << table.getTableName()
- << " - RestoreDataIterator::createTable cannot createAttribute: "
- << tableTransaction->getNdbError() << endl;
- m_ndb->closeSchemaTransaction(tableTransaction);
- return false;
- } // if
- } // for
-
- if (tableTransaction->execute() == -1)
- {
- err << table.getTableName()
- << " - RestoreDataIterator::createTable cannot execute transaction: "
- << tableTransaction->getNdbError() << endl;
- m_ndb->closeSchemaTransaction(tableTransaction);
- return false;
- } // if
-
- m_ndb->closeSchemaTransaction(tableTransaction);
- info << "Successfully created table " << table.getTableName() << endl;
- return true ;
-#endif
-}
-
-
-
-/*
- * callback : This is called when the transaction is polled
- *
- * (This function must have three arguments:
- * - The result of the transaction,
- * - The NdbConnection object, and
- * - A pointer to an arbitrary object.)
- */
-
-static void
-callback(int result, NdbConnection* trans, void* aObject)
-{
- restore_callback_t * cbData = (restore_callback_t *)aObject;
- if (result<0)
- {
- /**
- * Error. temporary or permanent?
- */
- if (asynchErrorHandler(trans, (Ndb*)cbData->ndb))
- {
- ((Ndb*)cbData->ndb)->closeTransaction(asynchTrans[cbData->transaction]);
- cbData->retries++;
- ((BackupRestore*)cbData)->tupleAsynch( * (TupleS*)(cbData->tup), cbData);
- }
- else
- {
- ndbout_c("Restore: Failed to restore data "
- "due to a unrecoverable error. Exiting...");
- delete (Ndb*)cbData->ndb;
- delete cbData->tup;
- delete cbData;
- exit(-1);
- }
- }
- else
- {
- /**
- * OK! close transaction
- */
- ((Ndb*)cbData->ndb)->closeTransaction(asynchTrans[cbData->transaction]);
- delete cbData->tup;
- delete cbData;
- }
-}
-
-static int nPreparedTransactions = 0;
-void
-BackupPrinter::tupleAsynch(const TupleS & tup, restore_callback_t * callback)
-{
- m_dataCount++;
- if (m_print || m_print_data)
- m_ndbout << tup << endl;
-}
-
-void BackupRestore::tupleAsynch(const TupleS & tup, restore_callback_t * cbData)
-{
-
- if (!m_restore)
- {
- delete &tup;
- return;
- }
- Uint32 retries;
- if (cbData!=0)
- retries = cbData->retries;
- else
- retries = 0;
-
- while (retries < 10)
- {
- /**
- * start transactions
- */
- asynchTrans[nPreparedTransactions] = m_ndb->startTransaction();
- if (asynchTrans[nPreparedTransactions] == NULL)
- {
- if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb))
- {
- retries++;
- continue;
- }
- asynchExitHandler();
- } // if
-
- const TableS * table = tup.getTable();
- NdbOperation * op =
- asynchTrans[nPreparedTransactions]->getNdbOperation(table->getTableName());
-
- if (op == NULL)
- {
- if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb))
- {
- retries++;
- continue;
- }
- asynchExitHandler();
- } // if
-
- if (op->writeTuple() == -1)
- {
- if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb))
- {
- retries++;
- continue;
- }
- asynchExitHandler();
- } // if
-
- Uint32 ret = 0;
- for (int i = 0; i < tup.getNoOfAttributes(); i++)
- {
- const AttributeS * attr = tup[i];
- int size = attr->Desc->size;
- int arraySize = attr->Desc->arraySize;
- const KeyType key = attr->Desc->key;
- char * dataPtr = attr->Data.string_value;
- Uint32 length = (size * arraySize) / 8;
- if (key == TupleKey)
- {
-#if NDB_VERSION_MAJOR >= VERSION3X
- /**
- * Convert VARCHAR from v.2x to v3x representation
- */
- if (getMajor(tup.getTable()->getBackupVersion()) < VERSION_3X &&
- ((tup.getTable()->m_dictTable->getColumn(i)->getType() ==
- NdbDictionary::Column::Varbinary ) ||
- (tup.getTable()->m_dictTable->getColumn(i)->getType() ==
- NdbDictionary::Column::Varchar)) && !attr->Data.null)
- {
- char * src = dataPtr;
- char var_len[2];
- var_len[0]= *(dataPtr+length - 2);
- var_len[1]= *(dataPtr+length - 1);
- memmove((char*)dataPtr+2, dataPtr, length);
- src[0] = var_len[0];
- src[1] = var_len[1];
- dataPtr = src;
- }
-#endif
- ret = op->equal(i, dataPtr, length);
- if (ret<0)
- {
- ndbout_c("Column: %d type %d",i,
- tup.getTable()->m_dictTable->getColumn(i)->getType());
-
- if (asynchErrorHandler(asynchTrans[nPreparedTransactions],m_ndb))
- {
- retries++;
- continue;
- }
- asynchExitHandler();
- }
- }
- }
-
- for (int i = 0; i < tup.getNoOfAttributes(); i++)
- {
- const AttributeS * attr = tup[i];
- int size = attr->Desc->size;
- int arraySize = attr->Desc->arraySize;
- KeyType key = attr->Desc->key;
- char * dataPtr = attr->Data.string_value;
- Uint32 length = (size * arraySize) / 8;
-#if NDB_VERSION_MAJOR >= VERSION3X
- /**
- * Convert VARCHAR from v.2x to v3x representation
- */
- if (getMajor(tup.getTable()->getBackupVersion()) < VERSION_3X &&
- ((tup.getTable()->m_dictTable->getColumn(i)->getType() ==
- NdbDictionary::Column::Varbinary ) ||
- (tup.getTable()->m_dictTable->getColumn(i)->getType() ==
- NdbDictionary::Column::Varchar)) && !attr->Data.null)
- {
- char * src = dataPtr;
- char var_len[2];
- var_len[0]= *(dataPtr+length - 2);//length is last 2 bytes
- var_len[1]= *(dataPtr+length - 1);
- memmove((char*)dataPtr+2, dataPtr, length);
- src[0] = var_len[0];
- src[1] = var_len[1];
- dataPtr = src;
- }
-#endif
-
- if (key == NoKey && !attr->Data.null)
- {
- ret = op->setValue(i, dataPtr, length);
- }
- else if (key == NoKey && attr->Data.null)
- {
- ret = op->setValue(i, NULL, 0);
- }
-
- if (ret<0)
- {
- ndbout_c("Column: %d type %d",i,
- tup.getTable()->m_dictTable->getColumn(i)->getType());
-
- if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb))
- {
- retries++;
- continue;
- }
-
-
- asynchExitHandler();
- }
- }
- restore_callback_t * cb;
- if (cbData ==0)
- {
- cb = new restore_callback_t;
- cb->retries = 0;
- }
- else
- cb =cbData;
- cb->ndb = m_ndb;
- cb->restore = this;
- cb->tup = (TupleS*)&tup;
- cb->transaction = nPreparedTransactions;
-
- // Prepare transaction (the transaction is NOT yet sent to NDB)
- asynchTrans[nPreparedTransactions]->executeAsynchPrepare(Commit,
- &callback,
- cb);
- if (nPreparedTransactions == ga_nParallelism-1)
- {
- // send-poll all transactions
- // close transaction is done in callback
- m_ndb->sendPollNdb(3000, ga_nParallelism);
- nPreparedTransactions=0;
- }
- else
- nPreparedTransactions++;
- m_dataCount++;
- return;
- }
- ndbout_c("Unable to recover from errors. Exiting...");
- asynchExitHandler();
-}
-
-void BackupRestore::asynchExitHandler()
-{
- if (m_ndb != NULL)
- delete m_ndb;
- exit(-1);
-}
-/**
- * returns true if is recoverable,
- * Error handling based on hugo
- * false if it is an error that generates an abort.
- */
-static
-bool asynchErrorHandler(NdbConnection * trans, Ndb* ndb)
-{
-
- NdbError error = trans->getNdbError();
- ndb->closeTransaction(trans);
- switch(error.status)
- {
- case NdbError::Success:
- return false;
- // ERROR!
- break;
-
- case NdbError::TemporaryError:
- NdbSleep_MilliSleep(10);
- return true;
- // RETRY
- break;
-
- case NdbError::UnknownResult:
- ndbout << error << endl;
- return false;
- // ERROR!
- break;
-
- default:
- case NdbError::PermanentError:
- switch (error.code)
- {
- case 499:
- case 250:
- NdbSleep_MilliSleep(10);
- return true; //temp errors?
- default:
- break;
- }
- //ERROR
- ndbout << error << endl;
- return false;
- break;
- }
- return false;
-}
-
-
-
-void
-BackupRestore::tuple(const TupleS & tup)
-{
- if (!m_restore)
- return;
- while (1)
- {
- NdbConnection * trans = m_ndb->startTransaction();
- if (trans == NULL)
- {
- // Deep shit, TODO: handle the error
- ndbout << "Cannot start transaction" << endl;
- exit(-1);
- } // if
-
- const TableS * table = tup.getTable();
- NdbOperation * op = trans->getNdbOperation(table->getTableName());
- if (op == NULL)
- {
- ndbout << "Cannot get operation: ";
- ndbout << trans->getNdbError() << endl;
- exit(-1);
- } // if
-
- // TODO: check return value and handle error
- if (op->writeTuple() == -1)
- {
- ndbout << "writeTuple call failed: ";
- ndbout << trans->getNdbError() << endl;
- exit(-1);
- } // if
-
- for (int i = 0; i < tup.getNoOfAttributes(); i++)
- {
- const AttributeS * attr = tup[i];
- int size = attr->Desc->size;
- int arraySize = attr->Desc->arraySize;
- KeyType key = attr->Desc->key;
- const char * dataPtr = attr->Data.string_value;
-
- const Uint32 length = (size * arraySize) / 8;
- if (key == TupleKey)
- {
- op->equal(i, dataPtr, length);
- }
- }
-
- for (int i = 0; i < tup.getNoOfAttributes(); i++)
- {
- const AttributeS * attr = tup[i];
- int size = attr->Desc->size;
- int arraySize = attr->Desc->arraySize;
- KeyType key = attr->Desc->key;
- const char * dataPtr = attr->Data.string_value;
-
- const Uint32 length = (size * arraySize) / 8;
- if (key == NoKey && !attr->Data.null)
- {
- op->setValue(i, dataPtr, length);
- }
- else if (key == NoKey && attr->Data.null)
- {
- op->setValue(i, NULL, 0);
- }
- }
- int ret = trans->execute(Commit);
- if (ret != 0)
- {
- ndbout << "execute failed: ";
- ndbout << trans->getNdbError() << endl;
- exit(-1);
- }
- m_ndb->closeTransaction(trans);
- if (ret == 0)
- break;
- }
- m_dataCount++;
-}
-
-void
-BackupRestore::endOfTuples()
-{
- if (!m_restore)
- return;
- // Send all transactions to NDB
- m_ndb->sendPreparedTransactions(0);
- // Poll all transactions
- m_ndb->pollNdb(3000, nPreparedTransactions);
- // Close all transactions
- // for (int i = 0; i < nPreparedTransactions; i++)
- // m_ndb->closeTransaction(asynchTrans[i]);
- nPreparedTransactions=0;
-}
-
-void
-BackupRestore::logEntry(const LogEntry & tup)
-{
- if (!m_restore)
- return;
-
- NdbConnection * trans = m_ndb->startTransaction();
- if (trans == NULL)
- {
- // Deep shit, TODO: handle the error
- ndbout << "Cannot start transaction" << endl;
- exit(-1);
- } // if
-
- const TableS * table = tup.m_table;
- NdbOperation * op = trans->getNdbOperation(table->getTableName());
- if (op == NULL)
- {
- ndbout << "Cannot get operation: ";
- ndbout << trans->getNdbError() << endl;
- exit(-1);
- } // if
-
- int check = 0;
- switch(tup.m_type)
- {
- case LogEntry::LE_INSERT:
- check = op->insertTuple();
- break;
- case LogEntry::LE_UPDATE:
- check = op->updateTuple();
- break;
- case LogEntry::LE_DELETE:
- check = op->deleteTuple();
- break;
- default:
- ndbout << "Log entry has wrong operation type."
- << " Exiting...";
- exit(-1);
- }
-
- for (int i = 0; i < tup.m_values.size(); i++)
- {
- const AttributeS * attr = tup.m_values[i];
- int size = attr->Desc->size;
- int arraySize = attr->Desc->arraySize;
- KeyType key = attr->Desc->key;
- const char * dataPtr = attr->Data.string_value;
-
- const Uint32 length = (size / 8) * arraySize;
- if (key == TupleKey)
- {
- op->equal(attr->Desc->attrId, dataPtr, length);
- }
- else if (key == NoKey)
- {
- op->setValue(attr->Desc->attrId, dataPtr, length);
- }
- }
-
-#if 1
- trans->execute(Commit);
-#else
- const int ret = trans->execute(Commit);
- // Both insert update and delete can fail during log running
- // and it's ok
-
- if (ret != 0)
- {
- ndbout << "execute failed: ";
- ndbout << trans->getNdbError() << endl;
- exit(-1);
- }
-#endif
-
- m_ndb->closeTransaction(trans);
- m_logCount++;
-}
-
-void
-BackupRestore::endOfLogEntrys()
-{
- if (ga_restore)
- {
- ndbout << "Restored " << m_dataCount << " tuples and "
- << m_logCount << " log entries" << endl;
- }
-}
-
-void
-BackupPrinter::endOfLogEntrys()
-{
- if (m_print || m_print_log)
- {
- ndbout << "Printed " << m_dataCount << " tuples and "
- << m_logCount << " log entries"
- << " to stdout." << endl;
- }
-}
-
-
-
-
diff --git a/ndb/src/kernel/blocks/backup/restore/myVector.hpp b/ndb/src/kernel/blocks/backup/restore/myVector.hpp
deleted file mode 100644
index c858999d2be..00000000000
--- a/ndb/src/kernel/blocks/backup/restore/myVector.hpp
+++ /dev/null
@@ -1,128 +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 MY_VECTOR_HPP
-#define MY_VECTOR_HPP
-
-// Template class for std::vector-like class (hopefully works in OSE)
-template <class T>
-class myVector
-{
-
- // Note that last element in array is used for end() and is always empty
- int sizeIncrement;
- int thisSize;
- int used;
- T *storage;
-
-public:
-
- // Assignment of whole vector
- myVector<T> & operator=(myVector<T> & org) {
-
- // Don't copy if they point to the same address
- if (!(this == &org)) {
- // Check memory space
- if (thisSize < org.thisSize) {
- // We have to increase memory for destination
- T* tmpStorage = new T[org.thisSize];
- delete[] storage;
- storage = tmpStorage;
- } // if
- thisSize = org.thisSize;
- sizeIncrement = org.sizeIncrement;
- used = org.used;
- for (int i = 0; i < thisSize; i++) {
- storage[i] = org.storage[i];
- } // for
- } // if
- return *this;
- } // operator=
-
- // Construct with size s+1
- myVector(int s = 1) : sizeIncrement(5), // sizeIncrement(s),
- thisSize(s + 1),
- used(0),
- storage(new T[s + 1]) { }
-
- ~myVector() { delete[] storage; } // Destructor: deallocate memory
-
- T& operator[](int i) { // Return by index
- if ((i < 0) || (i >= used)) {
- // Index error
- ndbout << "vector index out of range" << endl;
- abort();
- return storage[used - 1];
- } // if
- else {
- return storage[i];
- } // else
- } // operator[]
-
- const T& operator[](int i) const { // Return by index
- if ((i < 0) || (i >= used)) {
- // Index error
- ndbout << "vector index out of range" << endl;
- abort();
- return storage[used - 1];
- } // if
- else {
- return storage[i];
- } // else
- } // operator[]
-
- int getSize() const { return used; }
-
- void push_back (T& item) {
- if (used >= thisSize - 1) {
- // We have to allocate new storage
- int newSize = thisSize + sizeIncrement;
- T* tmpStorage = new T[newSize];
- if (tmpStorage == NULL) {
- // Memory allocation error! break
- ndbout << "PANIC: Memory allocation error in vector" << endl;
- return;
- } // if
- thisSize = newSize;
- for (int i = 0; i < used; i++) {
- tmpStorage[i] = storage[i];
- } // for
- delete[] storage;
- storage = tmpStorage;
- } // if
-
- // Now push
- storage[used] = item;
- used++;
- }; // myVector<> push_back()
-
- // Remove item at back
- void pop_back() {
- if (used > 0) {
- used--;
- } // if
- } // pop_back()
-
- int size() const { return used; };
-
- bool empty() const { return(used == 0); }
-
- void clear() {
- used = 0;
- }
-};
-
-#endif
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index cd6198eff23..694007c8508 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -16,7 +16,6 @@
#include "Cmvmi.hpp"
-#include <ClusterConfiguration.hpp>
#include <Configuration.hpp>
#include <kernel_types.h>
#include <TransporterRegistry.hpp>
@@ -31,15 +30,11 @@
#include <signaldata/TestOrd.hpp>
#include <signaldata/EventReport.hpp>
#include <signaldata/TamperOrd.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/StartOrd.hpp>
-#include <signaldata/CmvmiCfgConf.hpp>
-#include <signaldata/CmInit.hpp>
#include <signaldata/CloseComReqConf.hpp>
#include <signaldata/SetLogLevelOrd.hpp>
#include <signaldata/EventSubscribeReq.hpp>
#include <signaldata/DumpStateOrd.hpp>
-#include <signaldata/ArbitSignalData.hpp>
#include <signaldata/DisconnectRep.hpp>
#include <EventLogger.hpp>
@@ -55,8 +50,7 @@ EventLogger g_eventLogger;
Cmvmi::Cmvmi(const Configuration & conf) :
SimulatedBlock(CMVMI, conf)
,theConfig((Configuration&)conf)
- ,theCConfig(conf.clusterConfiguration()),
- subscribers(subscriberPool)
+ ,subscribers(subscriberPool)
{
BLOCK_CONSTRUCTOR(Cmvmi);
@@ -67,14 +61,10 @@ Cmvmi::Cmvmi(const Configuration & conf) :
addRecSignal(GSN_NDB_TAMPER, &Cmvmi::execNDB_TAMPER, true);
addRecSignal(GSN_SET_LOGLEVELORD, &Cmvmi::execSET_LOGLEVELORD);
addRecSignal(GSN_EVENT_REP, &Cmvmi::execEVENT_REP);
- addRecSignal(GSN_STTOR, &Cmvmi::execSTTOR_Local);
- addRecSignal(GSN_CM_RUN, &Cmvmi::execCM_RUN);
- addRecSignal(GSN_CM_INFOREQ, &Cmvmi::execCM_INFOREQ);
- addRecSignal(GSN_CMVMI_CFGREQ, &Cmvmi::execCMVMI_CFGREQ);
+ addRecSignal(GSN_STTOR, &Cmvmi::execSTTOR);
addRecSignal(GSN_CLOSE_COMREQ, &Cmvmi::execCLOSE_COMREQ);
addRecSignal(GSN_ENABLE_COMORD, &Cmvmi::execENABLE_COMORD);
addRecSignal(GSN_OPEN_COMREQ, &Cmvmi::execOPEN_COMREQ);
- addRecSignal(GSN_SIZEALT_ACK, &Cmvmi::execSIZEALT_ACK);
addRecSignal(GSN_TEST_ORD, &Cmvmi::execTEST_ORD);
addRecSignal(GSN_STATISTICS_REQ, &Cmvmi::execSTATISTICS_REQ);
@@ -93,16 +83,28 @@ Cmvmi::Cmvmi(const Configuration & conf) :
subscriberPool.setSize(5);
- const ClusterConfiguration::ClusterData & clData =
- theConfig.clusterConfigurationData() ;
+ const ndb_mgm_configuration_iterator * db = theConfig.getOwnConfigIterator();
+ for(unsigned j = 0; j<LogLevel::LOGLEVEL_CATEGORIES; j++){
+ Uint32 logLevel;
+ if(!ndb_mgm_get_int_parameter(db, LogLevel::MIN_LOGLEVEL_ID+j, &logLevel)){
+ clogLevel.setLogLevel((LogLevel::EventCategory)j,
+ logLevel);
+ }
+ }
- clogLevel = clData.SizeAltData.logLevel;
-
- for(Uint32 i= 0; i< clData.SizeAltData.noOfNodes; i++ ){
+ ndb_mgm_configuration_iterator * iter = theConfig.getClusterConfigIterator();
+ for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){
jam();
- const Uint32 nodeId = clData.nodeData[i].nodeId;
- switch(clData.nodeData[i].nodeType){
+ Uint32 nodeId;
+ Uint32 nodeType;
+
+ ndbrequire(!ndb_mgm_get_int_parameter(iter,CFG_NODE_ID, &nodeId));
+ ndbrequire(!ndb_mgm_get_int_parameter(iter,CFG_TYPE_OF_SECTION,&nodeType));
+
+ switch(nodeType){
case NodeInfo::DB:
+ c_dbNodes.set(nodeId);
+ break;
case NodeInfo::API:
case NodeInfo::MGM:
case NodeInfo::REP:
@@ -110,7 +112,7 @@ Cmvmi::Cmvmi(const Configuration & conf) :
default:
ndbrequire(false);
}
- setNodeInfo(nodeId).m_type = clData.nodeData[i].nodeType;
+ setNodeInfo(nodeId).m_type = nodeType;
}
}
@@ -130,6 +132,10 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
if(ERROR_INSERTED(9998)){
while(true) NdbSleep_SecSleep(1);
}
+
+ if(ERROR_INSERTED(9997)){
+ ndbrequire(false);
+ }
}//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
@@ -278,121 +284,42 @@ Cmvmi::cancelSubscription(NodeId nodeId){
void Cmvmi::sendSTTORRY(Signal* signal)
{
- if( theStartPhase == 1 ) {
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData() ;
- const int myNodeId = globalData.ownId;
- int MyNodeFound = 0;
-
- jam();
-
- CmInit * const cmInit = (CmInit *)&signal->theData[0];
-
- cmInit->heartbeatDbDb = clusterConf.ispValues[0][2];
- cmInit->heartbeatDbApi = clusterConf.ispValues[0][3];
- cmInit->arbitTimeout = clusterConf.ispValues[0][5];
-
- NodeBitmask::clear(cmInit->allNdbNodes);
- for(unsigned int i = 0; i < clusterConf.SizeAltData.noOfNodes; i++ ) {
- jam();
- if (clusterConf.nodeData[i].nodeType == NodeInfo::DB){
- jam();
- const NodeId nodeId = clusterConf.nodeData[i].nodeId;
- if (nodeId == myNodeId) {
- jam();
- MyNodeFound = 1;
- }//if
- NodeBitmask::set(cmInit->allNdbNodes, nodeId);
- }//if
- }//for
-
- if (MyNodeFound == 0) {
- ERROR_SET(fatal, ERR_NODE_NOT_IN_CONFIG, "", "");
- }//if
-
- sendSignal(QMGR_REF, GSN_CM_INIT, signal, CmInit::SignalLength, JBB);
-
- // these do not fit into CM_INIT
- ArbitSignalData* const sd = (ArbitSignalData*)&signal->theData[0];
- for (unsigned rank = 1; rank <= 2; rank++) {
- sd->sender = myNodeId;
- sd->code = rank;
- sd->node = 0;
- sd->ticket.clear();
- sd->mask.clear();
- for (int i = 0; i < MAX_NODES; i++) {
- if (clusterConf.nodeData[i].arbitRank == rank)
- sd->mask.set(clusterConf.nodeData[i].nodeId);
- }
- sendSignal(QMGR_REF, GSN_ARBIT_CFG, signal,
- ArbitSignalData::SignalLength, JBB);
- }
- } else {
- jam();
- signal->theData[0] = theSignalKey;
- signal->theData[3] = 1;
- signal->theData[4] = 3;
- signal->theData[5] = 255;
- sendSignal(NDBCNTR_REF, GSN_STTORRY, signal,6, JBB);
- }
+ jam();
+ signal->theData[3] = 1;
+ signal->theData[4] = 3;
+ signal->theData[5] = 8;
+ signal->theData[6] = 255;
+ sendSignal(NDBCNTR_REF, GSN_STTORRY, signal, 7, JBB);
}//Cmvmi::sendSTTORRY
-// Received a restart signal.
-// Answer it like any other block
-// PR0 : StartCase
-// DR0 : StartPhase
-// DR1 : ?
-// DR2 : ?
-// DR3 : ?
-// DR4 : ?
-// DR5 : SignalKey
-
-void Cmvmi::execSTTOR_Local(Signal* signal)
+void Cmvmi::execSTTOR(Signal* signal)
{
- theStartPhase = signal->theData[1];
- theSignalKey = signal->theData[6];
+ Uint32 theStartPhase = signal->theData[1];
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData();
jamEntry();
- if (theStartPhase == 1 && clusterConf.SizeAltData.exist == true){
+ if (theStartPhase == 1){
jam();
- signalCount = 0;
- execSIZEALT_ACK(signal);
+ sendSTTORRY(signal);
return;
} else if (theStartPhase == 3) {
jam();
globalData.activateSendPacked = 1;
sendSTTORRY(signal);
- } else {
- jam();
+ } else if (theStartPhase == 8){
+ /*---------------------------------------------------*/
+ /* Open com to API + REP nodes */
+ /*---------------------------------------------------*/
+ signal->theData[0] = 0; // no answer
+ signal->theData[1] = 0; // no id
+ signal->theData[2] = NodeInfo::API;
+ execOPEN_COMREQ(signal);
+ signal->theData[0] = 0; // no answer
+ signal->theData[1] = 0; // no id
+ signal->theData[2] = NodeInfo::REP;
+ execOPEN_COMREQ(signal);
+ globalData.theStartLevel = NodeState::SL_STARTED;
sendSTTORRY(signal);
- }
-}
-
-void Cmvmi::execSIZEALT_ACK(Signal* signal)
-{
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData();
- jamEntry();
-
- if (signalCount < NDB_SIZEALT_OFF){
- jam();
- BlockNumber blockNo = clusterConf.SizeAltData.blockNo[signalCount];
- signal->theData[0] = CMVMI_REF;
-
- /**
- * This send SizeAlt(s) to blocks
- * Definition of data content can be found in SignalData/XXXSizeAltReq.H
- */
- const unsigned int noOfWords = 20;
- for(unsigned int i = 1; i<noOfWords; i++){
- signal->theData[i] = clusterConf.SizeAltData.varSize[signalCount][i].nrr;
- }
-
- signalCount++;
- sendSignal(numberToRef(blockNo, 0), GSN_SIZEALT_REP, signal,21, JBB);
} else {
jam();
@@ -408,90 +335,6 @@ void Cmvmi::execSIZEALT_ACK(Signal* signal)
}
}
-void Cmvmi::execCM_INFOREQ(Signal* signal)
-{
- int id = signal->theData[1];
- const BlockReference userRef = signal->theData[0];
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData();
- const int myNodeId = globalData.ownId;
-
- jamEntry();
- signal->theData[0] = id;
-
- for(unsigned int i= 0; i< clusterConf.SizeAltData.noOfNodes; i++ ) {
- jam();
- if (clusterConf.nodeData[i].nodeType == NodeInfo::DB){
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
- if (nodeId != myNodeId) {
- jam();
- globalTransporterRegistry.setPerformState(nodeId, PerformConnect);
- }
- }
- }
-
- sendSignal(userRef, GSN_CM_INFOCONF, signal, 1, JBB);
-}
-
-void Cmvmi::execCM_RUN(Signal* signal)
-{
- jamEntry();
- if (signal->theData[0] == 0) {
- jam();
- signal->theData[0] = theSignalKey;
- signal->theData[3] = 1;
- signal->theData[4] = 3;
- signal->theData[5] = 255;
- sendSignal(NDBCNTR_REF, GSN_STTORRY, signal, 6, JBB);
- } else {
- globalData.theStartLevel = NodeState::SL_STARTED;
-
- // Connect to all application nodes.
- // Enable communication with all NDB blocks.
-
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData();
- jam();
- for(unsigned int i= 0; i< clusterConf.SizeAltData.noOfNodes; i++ ) {
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
- jam();
- if (clusterConf.nodeData[i].nodeType != NodeInfo::DB &&
- clusterConf.nodeData[i].nodeType != NodeInfo::MGM){
-
- jam();
- globalTransporterRegistry.setPerformState(nodeId, PerformConnect);
- globalTransporterRegistry.setIOState(nodeId, HaltIO);
- //-----------------------------------------------------
- // Report that the connection to the node is opened
- //-----------------------------------------------------
- signal->theData[0] = EventReport::CommunicationOpened;
- signal->theData[1] = clusterConf.nodeData[i].nodeId;
- sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
- //-----------------------------------------------------
- }
- }
- }
-}
-
-void Cmvmi::execCMVMI_CFGREQ(Signal* signal)
-{
- const BlockReference userRef = signal->theData[0];
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData();
-
- int theStart_phase = signal->theData[1];
-
- jamEntry();
-
- CmvmiCfgConf * const cfgConf = (CmvmiCfgConf *)&signal->theData[0];
-
- cfgConf->startPhase = theStart_phase;
- for(unsigned int i = 0; i<CmvmiCfgConf::NO_OF_WORDS; i++)
- cfgConf->theData[i] = clusterConf.ispValues[theStart_phase][i];
-
- sendSignal(userRef, GSN_CMVMI_CFGCONF, signal, CmvmiCfgConf::LENGTH,JBB );
-}
-
void Cmvmi::execCLOSE_COMREQ(Signal* signal)
{
// Close communication with the node and halt input/output from
@@ -540,21 +383,42 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
const BlockReference userRef = signal->theData[0];
Uint32 tStartingNode = signal->theData[1];
-
+ Uint32 tData2 = signal->theData[2];
jamEntry();
+
+ const Uint32 len = signal->getLength();
+ if(len == 2){
+ globalTransporterRegistry.setPerformState(tStartingNode, PerformConnect);
+ globalTransporterRegistry.setIOState(tStartingNode, HaltIO);
+
+ //-----------------------------------------------------
+ // Report that the connection to the node is opened
+ //-----------------------------------------------------
+ signal->theData[0] = EventReport::CommunicationOpened;
+ signal->theData[1] = tStartingNode;
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
+ //-----------------------------------------------------
+ } else {
+ for(unsigned int i = 1; i < MAX_NODES; i++ ) {
+ jam();
+ if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2){
+ jam();
+ globalTransporterRegistry.setPerformState(i, PerformConnect);
+ globalTransporterRegistry.setIOState(i, HaltIO);
+
+ signal->theData[0] = EventReport::CommunicationOpened;
+ signal->theData[1] = i;
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
+ }
+ }
+ }
+
if (userRef != 0) {
jam();
- signal->theData[0] = signal->theData[1];
- sendSignal(userRef, GSN_OPEN_COMCONF, signal, 2,JBA);
+ signal->theData[0] = tStartingNode;
+ signal->theData[1] = tData2;
+ sendSignal(userRef, GSN_OPEN_COMCONF, signal, len - 1,JBA);
}
- globalTransporterRegistry.setPerformState(tStartingNode, PerformConnect);
- //-----------------------------------------------------
- // Report that the connection to the node is opened
- //-----------------------------------------------------
- signal->theData[0] = EventReport::CommunicationOpened;
- signal->theData[1] = tStartingNode;
- sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
- //-----------------------------------------------------
}
void Cmvmi::execENABLE_COMORD(Signal* signal)
@@ -888,18 +752,11 @@ Cmvmi::execSTART_ORD(Signal* signal) {
/**
* Open connections to management servers
*/
-
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData() ;
-
- for(unsigned int i= 0; i < clusterConf.SizeAltData.noOfNodes; i++ ){
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
-
- if (clusterConf.nodeData[i].nodeType == NodeInfo::MGM){
-
- if(globalTransporterRegistry.performState(nodeId) != PerformIO){
- globalTransporterRegistry.setPerformState(nodeId, PerformConnect);
- globalTransporterRegistry.setIOState(nodeId, NoHalt);
+ for(unsigned int i = 1; i < MAX_NODES; i++ ){
+ if (getNodeInfo(i).m_type == NodeInfo::MGM){
+ if(globalTransporterRegistry.performState(i) != PerformIO){
+ globalTransporterRegistry.setPerformState(i, PerformConnect);
+ globalTransporterRegistry.setIOState(i, NoHalt);
}
}
}
@@ -922,17 +779,10 @@ Cmvmi::execSTART_ORD(Signal* signal) {
// Disconnect all nodes as part of the system restart.
// We need to ensure that we are starting up
// without any connected nodes.
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData() ;
- const int myNodeId = globalData.ownId;
-
- for(unsigned int i= 0; i < clusterConf.SizeAltData.noOfNodes; i++ ){
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
- if (myNodeId != nodeId &&
- clusterConf.nodeData[i].nodeType != NodeInfo::MGM){
-
- globalTransporterRegistry.setPerformState(nodeId, PerformDisconnect);
- globalTransporterRegistry.setIOState(nodeId, HaltIO);
+ for(unsigned int i = 1; i < MAX_NODES; i++ ){
+ if (i != getOwnNodeId() && getNodeInfo(i).m_type != NodeInfo::MGM){
+ globalTransporterRegistry.setPerformState(i, PerformDisconnect);
+ globalTransporterRegistry.setIOState(i, HaltIO);
}
}
@@ -963,6 +813,7 @@ void Cmvmi::execTAMPER_ORD(Signal* signal)
void Cmvmi::execSET_VAR_REQ(Signal* signal)
{
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
@@ -1047,7 +898,7 @@ void Cmvmi::execSET_VAR_REQ(Signal* signal)
sendSignal(mgmtSrvr, GSN_SET_VAR_REF, signal, 0, JBB);
} // switch
-
+#endif
}//execSET_VAR_REQ()
@@ -1068,7 +919,7 @@ void Cmvmi::execSET_VAR_REF(Signal* signal)
void Cmvmi::handleSET_VAR_REQ(Signal* signal) {
-
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
int val = setVarReq->value();
@@ -1109,7 +960,7 @@ void Cmvmi::handleSET_VAR_REQ(Signal* signal) {
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
return;
} // switch
-
+#endif
}
#ifdef VM_TRACE
@@ -1184,14 +1035,9 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0];
if (dumpState->args[0] == DumpStateOrd::CmvmiDumpConnections){
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData() ;
-
- for(unsigned int i= 0; i < clusterConf.SizeAltData.noOfNodes; i++ ){
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
-
+ for(unsigned int i = 1; i < MAX_NODES; i++ ){
const char* nodeTypeStr = "";
- switch(clusterConf.nodeData[i].nodeType){
+ switch(getNodeInfo(i).m_type){
case NodeInfo::DB:
nodeTypeStr = "DB";
break;
@@ -1204,12 +1050,18 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
case NodeInfo::REP:
nodeTypeStr = "REP";
break;
+ case NodeInfo::INVALID:
+ nodeTypeStr = 0;
+ break;
default:
nodeTypeStr = "<UNKNOWN>";
}
+ if(nodeTypeStr == 0)
+ continue;
+
const char* actionStr = "";
- switch (globalTransporterRegistry.performState(nodeId)){
+ switch (globalTransporterRegistry.performState(i)){
case PerformNothing:
actionStr = "does nothing";
break;
@@ -1228,18 +1080,18 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
}
infoEvent("Connection to %d (%s) %s",
- nodeId,
+ i,
nodeTypeStr,
actionStr);
}
}
-
+
if (dumpState->args[0] == DumpStateOrd::CmvmiDumpLongSignalMemory){
infoEvent("Cmvmi: g_sectionSegmentPool size: %d free: %d",
g_sectionSegmentPool.getSize(),
g_sectionSegmentPool.getNoOfFree());
}
-
+
if (dumpState->args[0] == DumpStateOrd::CmvmiSetRestartOnErrorInsert){
if(signal->getLength() == 1)
theConfig.setRestartOnErrorInsert((int)NRT_NoStart_Restart);
@@ -1372,15 +1224,7 @@ Cmvmi::execTESTSIG(Signal* signal){
return;
}
- NodeReceiverGroup rg; rg.m_block = CMVMI;
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfig.clusterConfigurationData() ;
- for(unsigned int i = 0; i < clusterConf.SizeAltData.noOfNodes; i++ ){
- NodeId nodeId = clusterConf.nodeData[i].nodeId;
- if (clusterConf.nodeData[i].nodeType == NodeInfo::DB){
- rg.m_nodes.set(nodeId);
- }
- }
+ NodeReceiverGroup rg(CMVMI, c_dbNodes);
if(signal->getSendersBlockRef() == ref){
/**
@@ -1550,6 +1394,26 @@ Cmvmi::execTESTSIG(Signal* signal){
}
break;
}
+ case 13:{
+ ndbrequire(signal->getNoOfSections() == 0);
+ Uint32 loop = signal->theData[9];
+ if(loop > 0){
+ signal->theData[9] --;
+ sendSignal(CMVMI_REF, GSN_TESTSIG, signal, signal->length(), JBB);
+ return;
+ }
+ sendSignal(ref, GSN_TESTSIG, signal, signal->length(), JBB);
+ return;
+ }
+ case 14:{
+ Uint32 count = signal->theData[8];
+ signal->theData[10] = count * rg.m_nodes.count();
+ for(Uint32 i = 0; i<count; i++){
+ sendSignal(rg, GSN_TESTSIG, signal, signal->length(), JBB);
+ }
+ return;
+ }
+
default:
ndbrequire(false);
}
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
index 4f42c2efc93..1c91f564749 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
@@ -48,10 +48,7 @@ private:
void execNDB_TAMPER(Signal* signal);
void execSET_LOGLEVELORD(Signal* signal);
void execEVENT_REP(Signal* signal);
- void execSTTOR_Local(Signal* signal);
- void execCM_RUN(Signal* signal);
- void execCM_INFOREQ(Signal* signal);
- void execCMVMI_CFGREQ(Signal* signal);
+ void execSTTOR(Signal* signal);
void execCLOSE_COMREQ(Signal* signal);
void execENABLE_COMORD(Signal* signal);
void execOPEN_COMREQ(Signal* signal);
@@ -75,17 +72,13 @@ private:
void execTESTSIG(Signal* signal);
- int signalCount;
- int theSignalKey;
- int theStartPhase;
- int theNumberOfNodes;
-
char theErrorMessage[256];
void sendSTTORRY(Signal* signal);
LogLevel clogLevel;
+ NdbNodeBitmask c_dbNodes;
+
class Configuration & theConfig;
- const class ClusterConfiguration & theCConfig;
/**
* This struct defines the data needed for a EVENT_REP subscriber
diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am
new file mode 100644
index 00000000000..fdd43932682
--- /dev/null
+++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am
@@ -0,0 +1,10 @@
+
+noinst_LIBRARIES = libcmvmi.a
+
+libcmvmi_a_SOURCES = Cmvmi.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile b/ndb/src/kernel/blocks/cmvmi/Makefile_old
index d75e5dbf08b..d75e5dbf08b 100644
--- a/ndb/src/kernel/blocks/cmvmi/Makefile
+++ b/ndb/src/kernel/blocks/cmvmi/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
index fef41be88c4..6ba2d083e58 100644
--- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
+++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
@@ -958,7 +958,7 @@ private:
void execDROP_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal);
@@ -1000,7 +1000,6 @@ private:
void initScanFragmentPart(Signal* signal);
Uint32 checkScanExpand(Signal* signal);
Uint32 checkScanShrink(Signal* signal);
- void sendInitialiseRecords(Signal* signal);
void initialiseDirRec(Signal* signal);
void initialiseDirRangeRec(Signal* signal);
void initialiseFragRec(Signal* signal);
@@ -1174,7 +1173,7 @@ private:
void srReadPagesLab(Signal* signal);
void srDoUndoLab(Signal* signal);
void ndbrestart1Lab(Signal* signal);
- void initialiseRecordsLab(Signal* signal);
+ void initialiseRecordsLab(Signal* signal, Uint32 returnRef, Uint32 retData);
void srReadPagesAllocLab(Signal* signal);
void checkNextBucketLab(Signal* signal);
void endsavepageLab(Signal* signal);
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
index 107420c7148..90e914987c3 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
@@ -179,7 +179,7 @@ Dbacc::Dbacc(const class Configuration & conf):
addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF);
addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF);
- addRecSignal(GSN_SIZEALT_REP, &Dbacc::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ);
initData();
diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
index ea8d808458b..933ee2cf8e1 100644
--- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
@@ -20,13 +20,11 @@
#include <signaldata/AccFrag.hpp>
#include <signaldata/AccScan.hpp>
#include <signaldata/AccLock.hpp>
-#include <signaldata/AccSizeAltReq.hpp>
#include <signaldata/EventReport.hpp>
#include <signaldata/FsConf.hpp>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsRemoveReq.hpp>
#include <signaldata/DropTab.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/DumpStateOrd.hpp>
// TO_DO_RONM is a label for comments on what needs to be improved in future versions
@@ -127,7 +125,7 @@ void Dbacc::execCONTINUEB(Signal* signal)
break;
case ZINITIALISE_RECORDS:
jam();
- initialiseRecordsLab(signal);
+ initialiseRecordsLab(signal, signal->theData[3], signal->theData[4]);
return;
break;
case ZSR_READ_PAGES_ALLOC:
@@ -496,9 +494,6 @@ void Dbacc::execFSWRITEREF(Signal* signal)
void Dbacc::execNDB_STTOR(Signal* signal)
{
Uint32 tstartphase;
- Uint32 tconfig1;
- Uint32 tconfig2;
- Uint32 tlqhConfig1;
Uint32 tStartType;
jamEntry();
@@ -506,9 +501,6 @@ void Dbacc::execNDB_STTOR(Signal* signal)
cmynodeid = signal->theData[1];
tstartphase = signal->theData[2];
tStartType = signal->theData[3];
- tlqhConfig1 = signal->theData[10]; /* DBLQH */
- tconfig1 = signal->theData[16]; /* DBACC */
- tconfig2 = signal->theData[17]; /* DBACC */
switch (tstartphase) {
case ZSPH1:
jam();
@@ -534,21 +526,7 @@ void Dbacc::execNDB_STTOR(Signal* signal)
//---------------------------------------------
csystemRestart = ZFALSE;
}//if
- if (tconfig1 > 0) {
- jam();
- clblPagesPerTick = tconfig1;
- } else {
- jam();
- clblPagesPerTick = 1;
- }//if
- clblPageCounter = clblPagesPerTick;
- if (tconfig2 > 0) {
- jam();
- clblPagesPerTickAfterSr = tconfig2;
- } else {
- jam();
- clblPagesPerTickAfterSr = 1;
- }//if
+
signal->theData[0] = ZLOAD_BAL_LCP_TIMER;
sendSignalWithDelay(cownBlockref, GSN_CONTINUEB, signal, 100, 1);
break;
@@ -606,98 +584,86 @@ void Dbacc::ndbrestart1Lab(Signal* signal)
for (Uint32 tmp = 0; tmp < ZMAX_UNDO_VERSION; tmp++) {
csrVersList[tmp] = RNIL;
}//for
- tdata0 = 0;
- initialiseRecordsLab(signal);
return;
}//Dbacc::ndbrestart1Lab()
-void Dbacc::initialiseRecordsLab(Signal* signal)
+void Dbacc::initialiseRecordsLab(Signal* signal, Uint32 ref, Uint32 data)
{
switch (tdata0) {
case 0:
jam();
initialiseTableRec(signal);
- sendInitialiseRecords(signal);
break;
case 1:
jam();
initialiseFsConnectionRec(signal);
- sendInitialiseRecords(signal);
break;
case 2:
jam();
initialiseFsOpRec(signal);
- sendInitialiseRecords(signal);
break;
case 3:
jam();
initialiseLcpConnectionRec(signal);
- sendInitialiseRecords(signal);
break;
case 4:
jam();
initialiseDirRec(signal);
- sendInitialiseRecords(signal);
break;
case 5:
jam();
initialiseDirRangeRec(signal);
- sendInitialiseRecords(signal);
break;
case 6:
jam();
initialiseFragRec(signal);
- sendInitialiseRecords(signal);
break;
case 7:
jam();
initialiseOverflowRec(signal);
- sendInitialiseRecords(signal);
break;
case 8:
jam();
initialiseOperationRec(signal);
- sendInitialiseRecords(signal);
break;
case 9:
jam();
initialisePageRec(signal);
- sendInitialiseRecords(signal);
break;
case 10:
jam();
initialiseRootfragRec(signal);
- sendInitialiseRecords(signal);
break;
case 11:
jam();
initialiseScanRec(signal);
- sendInitialiseRecords(signal);
break;
case 12:
jam();
initialiseSrVerRec(signal);
- signal->theData[0] = cownBlockref;
- sendSignal(CMVMI_REF, GSN_SIZEALT_ACK, signal, 1, JBB);
+
+ {
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = data;
+ sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
+ }
return;
break;
default:
ndbrequire(false);
break;
}//switch
- return;
-}//Dbacc::initialiseRecordsLab()
-/* --------------------------------------------------------------------------------- */
-/* SEND REAL-TIME BREAK DURING INITIALISATION OF VARIABLES DURING SYSTEM RESTART.*/
-/* --------------------------------------------------------------------------------- */
-void Dbacc::sendInitialiseRecords(Signal* signal)
-{
signal->theData[0] = ZINITIALISE_RECORDS;
signal->theData[1] = tdata0 + 1;
signal->theData[2] = 0;
- sendSignal(cownBlockref, GSN_CONTINUEB, signal, 3, JBB);
-}//Dbacc::sendInitialiseRecords()
+ signal->theData[3] = ref;
+ signal->theData[4] = data;
+ sendSignal(reference(), GSN_CONTINUEB, signal, 5, JBB);
+ return;
+}//Dbacc::initialiseRecordsLab()
/* *********************************<< */
/* NDB_STTORRY */
@@ -712,23 +678,41 @@ void Dbacc::ndbsttorryLab(Signal* signal)
/* *********************************<< */
/* SIZEALT_REP SIZE ALTERATION */
/* *********************************<< */
-void Dbacc::execSIZEALT_REP(Signal* signal)
+void Dbacc::execREAD_CONFIG_REQ(Signal* signal)
{
- Uint32 tsizealtBlockRef;
-
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
jamEntry();
- tsizealtBlockRef = signal->theData[AccSizeAltReq::IND_BLOCK_REF];
- cdirrangesize = signal->theData[AccSizeAltReq::IND_DIR_RANGE];
- cdirarraysize = signal->theData[AccSizeAltReq::IND_DIR_ARRAY];
- cfragmentsize = signal->theData[AccSizeAltReq::IND_FRAGMENT];
- coprecsize = signal->theData[AccSizeAltReq::IND_OP_RECS];
- coverflowrecsize = signal->theData[AccSizeAltReq::IND_OVERFLOW_RECS];
- cpagesize = signal->theData[AccSizeAltReq::IND_PAGE8];
- crootfragmentsize = signal->theData[AccSizeAltReq::IND_ROOT_FRAG];
- ctablesize = signal->theData[AccSizeAltReq::IND_TABLE];
- cscanRecSize = signal->theData[AccSizeAltReq::IND_SCAN];
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_RANGE, &cdirrangesize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_ARRAY, &cdirarraysize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_FRAGMENT, &cfragmentsize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_OP_RECS, &coprecsize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_OVERFLOW_RECS,
+ &coverflowrecsize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_PAGE8, &cpagesize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_ROOT_FRAG,
+ &crootfragmentsize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_TABLE, &ctablesize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_SCAN, &cscanRecSize));
initRecords();
ndbrestart1Lab(signal);
+
+ clblPagesPerTick = 50;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick);
+
+ clblPagesPerTickAfterSr = 50;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr);
+
+ tdata0 = 0;
+ initialiseRecordsLab(signal, ref, senderData);
return;
}//Dbacc::execSIZEALT_REP()
@@ -2448,6 +2432,7 @@ void Dbacc::execACC_LOCKREQ(Signal* signal)
}
fragrecptr.i = req->fragPtrI;
ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec);
+ ndbrequire(req->fragId == fragrecptr.p->myfid);
// caller must be explicit here
ndbrequire(req->accOpPtr == RNIL);
// seize operation to hold the lock
@@ -13260,6 +13245,7 @@ Dbacc::execDUMP_STATE_ORD(Signal* signal)
void Dbacc::execSET_VAR_REQ(Signal* signal)
{
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
int val = setVarReq->value();
@@ -13280,6 +13266,6 @@ void Dbacc::execSET_VAR_REQ(Signal* signal)
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
} // switch
-
+#endif
}//execSET_VAR_REQ()
diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am
new file mode 100644
index 00000000000..7ccfbe22f76
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbacc/Makefile.am
@@ -0,0 +1,10 @@
+
+noinst_LIBRARIES = libdbacc.a
+
+libdbacc_a_SOURCES = DbaccInit.cpp DbaccMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbacc/Makefile b/ndb/src/kernel/blocks/dbacc/Makefile_old
index 93a830cec95..93a830cec95 100644
--- a/ndb/src/kernel/blocks/dbacc/Makefile
+++ b/ndb/src/kernel/blocks/dbacc/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 790c29737e9..2ef9e721e22 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.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>
+
#define DBDICT_C
#include "Dbdict.hpp"
@@ -25,7 +27,6 @@
#include <SimpleProperties.hpp>
#include <AttributeHeader.hpp>
#include <signaldata/DictSchemaInfo.hpp>
-#include <signaldata/DictSizeAltReq.hpp>
#include <signaldata/DictTabInfo.hpp>
#include <signaldata/DropTabFile.hpp>
@@ -110,7 +111,7 @@ Dbdict::execDUMP_STATE_ORD(Signal* signal)
{
jamEntry();
-#ifdef NDB_DEBUG
+#ifdef VM_TRACE
if(signal->theData[0] == 1222){
const Uint32 tab = signal->theData[1];
PrepDropTabReq* req = (PrepDropTabReq*)signal->getDataPtr();
@@ -1040,10 +1041,10 @@ Dbdict::Dbdict(const class Configuration & conf):
{
BLOCK_CONSTRUCTOR(Dbdict);
- const Properties * p = conf.getOwnProperties();
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
- p->get("MaxNoOfTriggers", &c_maxNoOfTriggers);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGERS, &c_maxNoOfTriggers);
// Transit signals
addRecSignal(GSN_DUMP_STATE_ORD, &Dbdict::execDUMP_STATE_ORD);
addRecSignal(GSN_GET_TABINFOREQ, &Dbdict::execGET_TABINFOREQ);
@@ -1159,7 +1160,7 @@ Dbdict::Dbdict(const class Configuration & conf):
addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF);
addRecSignal(GSN_LQHFRAGREF, &Dbdict::execLQHFRAGREF);
addRecSignal(GSN_NDB_STTOR, &Dbdict::execNDB_STTOR);
- addRecSignal(GSN_SIZEALT_REP, &Dbdict::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbdict::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_STTOR, &Dbdict::execSTTOR);
addRecSignal(GSN_TC_SCHVERCONF, &Dbdict::execTC_SCHVERCONF);
addRecSignal(GSN_NODE_FAILREP, &Dbdict::execNODE_FAILREP);
@@ -1522,7 +1523,6 @@ void Dbdict::execSTTOR(Signal* signal)
c_startPhase = signal->theData[1];
switch (c_startPhase) {
case 1:
- initCommonData();
break;
case 3:
c_restartType = signal->theData[7]; /* valid if 3 */
@@ -1549,14 +1549,22 @@ void Dbdict::sendSTTORRY(Signal* signal)
/* ---------------------------------------------------------------- */
// We receive information about sizes of records.
/* ---------------------------------------------------------------- */
-void Dbdict::execSIZEALT_REP(Signal* signal)
+void Dbdict::execREAD_CONFIG_REQ(Signal* signal)
{
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
jamEntry();
- BlockReference tblockref;
- tblockref = signal->theData[DictSizeAltReq::IND_BLOCK_REF];
- Uint32 attributesize = signal->theData[DictSizeAltReq::IND_ATTRIBUTE];
-// Uint32 connectsize = signal->theData[DictSizeAltReq::IND_CONNECT];
- Uint32 tablerecSize = signal->theData[DictSizeAltReq::IND_TABLE];
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ Uint32 attributesize, tablerecSize;
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_ATTRIBUTE,&attributesize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &tablerecSize));
c_attributeRecordPool.setSize(attributesize);
c_attributeRecordHash.setSize(64);
@@ -1592,9 +1600,14 @@ void Dbdict::execSIZEALT_REP(Signal* signal)
bat[1].bits.q = ZLOG_SIZE_OF_PAGES_IN_WORDS; // 2**13 = 8192 elements
bat[1].bits.v = 5; // 32 bits per element
+ initCommonData();
initRecords();
- signal->theData[0] = DBDICT_REF;
- sendSignal(tblockref, GSN_SIZEALT_ACK, signal, 2, JBB);
+
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = senderData;
+ sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
}//execSIZEALT_REP()
/* ---------------------------------------------------------------- */
@@ -2388,7 +2401,7 @@ Dbdict::execGET_TABINFO_CONF(Signal* signal){
SegmentedSectionPtr tabInfoPtr;
signal->getSection(tabInfoPtr, GetTabInfoConf::DICT_TAB_INFO);
-
+
CreateTableRecordPtr createTabPtr;
ndbrequire(c_opCreateTable.find(createTabPtr, senderData));
ndbrequire(!createTabPtr.isNull());
@@ -2410,7 +2423,10 @@ Dbdict::execGET_TABINFO_CONF(Signal* signal){
callback.m_callbackFunction =
safe_cast(&Dbdict::restartCreateTab_writeTableConf);
+ signal->header.m_noOfSections = 0;
writeTableFile(signal, createTabPtr.p->m_tablePtrI, tabInfoPtr, &callback);
+ signal->setSection(tabInfoPtr, 0);
+ releaseSections(signal);
}
void
@@ -3818,15 +3834,15 @@ Dbdict::execCREATE_TAB_REQ(Signal* signal){
CreateTabReq::RequestType rt = (CreateTabReq::RequestType)req->requestType;
switch(rt){
case CreateTabReq::CreateTablePrepare:
- CRASH_INSERTION2(14000, getOwnNodeId() != c_masterNodeId);
+ CRASH_INSERTION2(6003, getOwnNodeId() != c_masterNodeId);
createTab_prepare(signal, req);
return;
case CreateTabReq::CreateTableCommit:
- CRASH_INSERTION2(14001, getOwnNodeId() != c_masterNodeId);
+ CRASH_INSERTION2(6004, getOwnNodeId() != c_masterNodeId);
createTab_commit(signal, req);
return;
case CreateTabReq::CreateTableDrop:
- CRASH_INSERTION2(14002, getOwnNodeId() != c_masterNodeId);
+ CRASH_INSERTION2(6005, getOwnNodeId() != c_masterNodeId);
createTab_drop(signal, req);
return;
}
@@ -3926,9 +3942,9 @@ Dbdict::createTab_writeSchemaConf1(Signal* signal,
SegmentedSectionPtr tabInfoPtr;
getSection(tabInfoPtr, createTabPtr.p->m_tabInfoPtrI);
-
writeTableFile(signal, createTabPtr.p->m_tablePtrI, tabInfoPtr, &callback);
+ createTabPtr.p->m_tabInfoPtrI = RNIL;
signal->setSection(tabInfoPtr, 0);
releaseSections(signal);
}
@@ -5703,7 +5719,7 @@ void Dbdict::sendGET_TABINFOREF(Signal* signal,
}//sendGET_TABINFOREF()
Uint32 convertEndian(Uint32 in) {
-#ifdef _BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
Uint32 ut = 0;
ut += ((in >> 24) & 255);
ut += (((in >> 16) & 255) << 8);
@@ -7760,8 +7776,9 @@ Dbdict::createEventComplete_RT_USER_GET(Signal* signal,
#endif
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
- evntRecPtr.p->m_reqTracker.init<CreateEvntRef>
- (c_counterMgr, rg, GSN_CREATE_EVNT_REF, evntRecPtr.i);
+ RequestTracker & p = evntRecPtr.p->m_reqTracker;
+ p.init<CreateEvntRef>(c_counterMgr, rg, GSN_CREATE_EVNT_REF, evntRecPtr.i);
+
sendSignal(rg, GSN_CREATE_EVNT_REQ, signal, CreateEvntReq::SignalLength, JBB);
}
@@ -8109,7 +8126,8 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
subbPtr.p->m_senderRef = origSenderRef; // not sure if API sets correctly
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
- subbPtr.p->m_reqTracker.init<SubStartRef>(c_counterMgr, rg, GSN_SUB_START_REF, subbPtr.i);
+ RequestTracker & p = subbPtr.p->m_reqTracker;
+ p.init<SubStartRef>(c_counterMgr, rg, GSN_SUB_START_REF, subbPtr.i);
SubStartReq* req = (SubStartReq*) signal->getDataPtrSend();
@@ -8322,7 +8340,8 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
#endif
subbPtr.p->m_senderRef = origSenderRef; // not sure if API sets correctly
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
- subbPtr.p->m_reqTracker.init<SubStopRef>(c_counterMgr, rg, GSN_SUB_STOP_REF, subbPtr.i);
+ RequestTracker & p = subbPtr.p->m_reqTracker;
+ p.init<SubStopRef>(c_counterMgr, rg, GSN_SUB_STOP_REF, subbPtr.i);
SubStopReq* req = (SubStopReq*) signal->getDataPtrSend();
@@ -8609,7 +8628,8 @@ Dbdict::dropEventUTIL_EXECUTE_READ(Signal* signal,
parseReadEventSys(signal, evntRecPtr.p->m_eventRec);
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
- evntRecPtr.p->m_reqTracker.init<SubRemoveRef>(c_counterMgr, rg, GSN_SUB_REMOVE_REF,
+ RequestTracker & p = evntRecPtr.p->m_reqTracker;
+ p.init<SubRemoveRef>(c_counterMgr, rg, GSN_SUB_REMOVE_REF,
evntRecPtr.i);
SubRemoveReq* req = (SubRemoveReq*) signal->getDataPtrSend();
@@ -11492,7 +11512,7 @@ Dbdict::initSchemaFile(SchemaFile * sf, Uint32 fileSz){
ndbrequire(noEntries > MAX_TABLES);
sf->NoOfTableEntries = noEntries;
- memset(sf->TableEntries, 0, sizeof(noEntries*sizeof(SchemaFile::TableEntry)));
+ memset(sf->TableEntries, 0, noEntries*sizeof(SchemaFile::TableEntry));
memset(&(sf->TableEntries[noEntries]), 0, slack);
computeChecksum(sf);
}
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
index 02e2d4496bf..68214785234 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
@@ -102,6 +102,22 @@
#endif
/**
+ * Systable NDB$EVENTS_0
+ */
+
+#define EVENT_SYSTEM_TABLE_NAME "sys/def/NDB$EVENTS_0"
+#define EVENT_SYSTEM_TABLE_LENGTH 6
+
+struct sysTab_NDBEVENTS_0 {
+ char NAME[MAX_TAB_NAME_SIZE];
+ Uint32 EVENT_TYPE;
+ char TABLE_NAME[MAX_TAB_NAME_SIZE];
+ Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS];
+ Uint32 SUBID;
+ Uint32 SUBKEY;
+};
+
+/**
* DICT - This blocks handles all metadata
*/
class Dbdict: public SimulatedBlock {
@@ -451,7 +467,7 @@ private:
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal);
void execTC_SCHVERCONF(Signal* signal);
void execNODE_FAILREP(Signal* signal);
@@ -1227,22 +1243,6 @@ private:
};
typedef Ptr<OpSubEvent> OpSubEventPtr;
- /**
- * Systable NDB$EVENTS_0
- */
-
-#define EVENT_SYSTEM_TABLE_NAME "sys/def/NDB$EVENTS_0"
-#define EVENT_SYSTEM_TABLE_LENGTH 6
-
- struct sysTab_NDBEVENTS_0 {
- char NAME[MAX_TAB_NAME_SIZE];
- Uint32 EVENT_TYPE;
- char TABLE_NAME[MAX_TAB_NAME_SIZE];
- Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS];
- Uint32 SUBID;
- Uint32 SUBKEY;
- };
-
static const Uint32 sysTab_NDBEVENTS_0_szs[];
/**
diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am
new file mode 100644
index 00000000000..dc4c4fe4734
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbdict/Makefile.am
@@ -0,0 +1,11 @@
+#SUBDIRS = printSchemafile
+
+noinst_LIBRARIES = libdbdict.a
+
+libdbdict_a_SOURCES = Dbdict.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbdict/Makefile b/ndb/src/kernel/blocks/dbdict/Makefile_old
index 46d938114fb..46d938114fb 100644
--- a/ndb/src/kernel/blocks/dbdict/Makefile
+++ b/ndb/src/kernel/blocks/dbdict/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index 4ec699cebec..e029af70574 100644
--- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -312,7 +312,6 @@ public:
Bitmask<1> m_nodefailSteps;
Uint32 activeTabptr;
Uint32 nextNode;
- Uint32 ndbversion;
Uint32 nodeGroup;
SignalCounter m_NF_COMPLETE_REP;
@@ -663,7 +662,7 @@ private:
void execSTOP_ME_REF(Signal *);
void execSTOP_ME_CONF(Signal *);
- void execSIZEALT_REP(Signal *);
+ void execREAD_CONFIG_REQ(Signal *);
void execUNBLO_DICTCONF(Signal *);
void execCOPY_ACTIVECONF(Signal *);
void execTAB_COMMITREQ(Signal *);
@@ -685,7 +684,6 @@ private:
void execNDB_STARTREQ(Signal *);
void execGETGCIREQ(Signal *);
void execDIH_RESTARTREQ(Signal *);
- void execCNTR_CHANGEREP(Signal *);
void execSTART_RECCONF(Signal *);
void execSTART_FRAGCONF(Signal *);
void execADD_FRAGCONF(Signal *);
@@ -798,6 +796,7 @@ private:
void closeFileDelete(Signal *, FileRecordPtr regFilePtr);
void createFileRw(Signal *, FileRecordPtr regFilePtr);
void openFileRw(Signal *, FileRecordPtr regFilePtr);
+ void openFileRo(Signal *, FileRecordPtr regFilePtr);
void seizeFile(FileRecordPtr& regFilePtr);
void releaseFile(Uint32 fileIndex);
@@ -969,7 +968,7 @@ private:
void checkCopyTab(NodeRecordPtr failedNodePtr);
void initCommonData();
- void initialiseRecordsLab(Signal *, Uint32 stepNo);
+ void initialiseRecordsLab(Signal *, Uint32 stepNo, Uint32, Uint32);
void findReplica(ReplicaRecordPtr& regReplicaPtr,
Fragmentstore* fragPtrP, Uint32 nodeId);
@@ -1409,7 +1408,6 @@ private:
Uint32 startNode;
Uint32 wait;
Uint32 failNr;
- Uint32 ndbVersion;
bool activeState;
bool blockLcp;
bool blockGcp;
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
index b115cc0297a..df47237ae59 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
@@ -179,7 +179,7 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_START_LCP_REQ, &Dbdih::execSTART_LCP_REQ);
addRecSignal(GSN_START_LCP_CONF, &Dbdih::execSTART_LCP_CONF);
- addRecSignal(GSN_SIZEALT_REP, &Dbdih::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbdih::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_UNBLO_DICTCONF, &Dbdih::execUNBLO_DICTCONF);
addRecSignal(GSN_COPY_ACTIVECONF, &Dbdih::execCOPY_ACTIVECONF);
addRecSignal(GSN_TAB_COMMITREQ, &Dbdih::execTAB_COMMITREQ);
@@ -201,7 +201,6 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_NDB_STARTREQ, &Dbdih::execNDB_STARTREQ);
addRecSignal(GSN_GETGCIREQ, &Dbdih::execGETGCIREQ);
addRecSignal(GSN_DIH_RESTARTREQ, &Dbdih::execDIH_RESTARTREQ);
- addRecSignal(GSN_CNTR_CHANGEREP, &Dbdih::execCNTR_CHANGEREP);
addRecSignal(GSN_START_RECCONF, &Dbdih::execSTART_RECCONF);
addRecSignal(GSN_START_FRAGCONF, &Dbdih::execSTART_FRAGCONF);
addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF);
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index cefbb3e66a3..0ce1f1e4bbe 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -32,7 +32,6 @@
#include <signaldata/DictStart.hpp>
#include <signaldata/DiGetNodes.hpp>
#include <signaldata/DihContinueB.hpp>
-#include <signaldata/DihSizeAltReq.hpp>
#include <signaldata/DihSwitchReplica.hpp>
#include <signaldata/DumpStateOrd.hpp>
#include <signaldata/EmptyLcp.hpp>
@@ -45,7 +44,6 @@
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/ReadNodesConf.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/StartFragReq.hpp>
#include <signaldata/StartInfo.hpp>
#include <signaldata/StartMe.hpp>
@@ -68,7 +66,7 @@
#include <signaldata/DictTabInfo.hpp>
#include <signaldata/CreateFragmentation.hpp>
#include <signaldata/LqhFrag.hpp>
-
+#include <signaldata/FsOpenReq.hpp>
#include <DebuggerNames.hpp>
#define SYSFILE ((Sysfile *)&sysfileData[0])
@@ -212,7 +210,7 @@ void Dbdih::sendINCL_NODEREQ(Signal* signal, Uint32 nodeId)
signal->theData[0] = reference();
signal->theData[1] = c_nodeStartMaster.startNode;
signal->theData[2] = c_nodeStartMaster.failNr;
- signal->theData[3] = c_nodeStartMaster.ndbVersion;
+ signal->theData[3] = 0;
signal->theData[4] = currentgcp;
sendSignal(nodeDihRef, GSN_INCL_NODEREQ, signal, 5, JBB);
}//Dbdih::sendINCL_NODEREQ()
@@ -291,13 +289,6 @@ void Dbdih::sendUPDATE_TOREQ(Signal* signal, Uint32 nodeId)
sendSignal(ref, GSN_UPDATE_TOREQ, signal, UpdateToReq::SignalLength, JBB);
}//sendUPDATE_TOREQ()
-void Dbdih::execCNTR_CHANGEREP(Signal* signal)
-{
- (void)signal; // Don't want compiler warning
- jamEntry();
- return;
-}//Dbdih::execCNTR_CHANGEREP()
-
void Dbdih::execCONTINUEB(Signal* signal)
{
jamEntry();
@@ -542,7 +533,10 @@ void Dbdih::execCONTINUEB(Signal* signal)
}
case DihContinueB::ZINITIALISE_RECORDS:
jam();
- initialiseRecordsLab(signal, signal->theData[1]);
+ initialiseRecordsLab(signal,
+ signal->theData[1],
+ signal->theData[2],
+ signal->theData[3]);
return;
break;
case DihContinueB::ZSTART_PERMREQ_AGAIN:
@@ -1023,17 +1017,30 @@ void Dbdih::execGETGCIREQ(Signal* signal)
sendSignal(userRef, GSN_GETGCICONF, signal, 2, JBB);
}//Dbdih::execGETGCIREQ()
-void Dbdih::execSIZEALT_REP(Signal* signal)
+void Dbdih::execREAD_CONFIG_REQ(Signal* signal)
{
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
jamEntry();
- capiConnectFileSize = signal->theData[DihSizeAltReq::IND_API_CONNECT];
- cconnectFileSize = signal->theData[DihSizeAltReq::IND_CONNECT];
- cfragstoreFileSize = signal->theData[DihSizeAltReq::IND_FRAG_CONNECT];
- creplicaFileSize = signal->theData[DihSizeAltReq::IND_REPLICAS];
- ctabFileSize = signal->theData[DihSizeAltReq::IND_TABLE];
- cfileFileSize = (2 * ctabFileSize) + 2;
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_API_CONNECT,
+ &capiConnectFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_CONNECT,&cconnectFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT,
+ &cfragstoreFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_REPLICAS,
+ &creplicaFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_TABLE, &ctabFileSize))
+ cfileFileSize = (2 * ctabFileSize) + 2;
initRecords();
- initialiseRecordsLab(signal, 0);
+ initialiseRecordsLab(signal, 0, ref, senderData);
return;
}//Dbdih::execSIZEALT_REP()
@@ -1158,11 +1165,8 @@ void Dbdih::execNDB_STTOR(Signal* signal)
Uint32 ownNodeId = signal->theData[1]; /* OWN PROCESSOR ID*/
Uint32 phase = signal->theData[2]; /* INTERNAL START PHASE*/
Uint32 typestart = signal->theData[3];
- const Uint32 tconfig1 = signal->theData[8];
- const Uint32 tconfig2 = signal->theData[9];
cstarttype = typestart;
-
cstartPhase = phase;
switch (phase){
@@ -1171,10 +1175,6 @@ void Dbdih::execNDB_STTOR(Signal* signal)
/*----------------------------------------------------------------------*/
/* Set the delay between local checkpoints in ndb startphase 1. */
/*----------------------------------------------------------------------*/
- c_lcpState.clcpDelay = tconfig1 > 31 ? 31 : tconfig1;
-
- cminHotSpareNodes = tconfig2 > 2 ? 2 : tconfig2;
-
cownNodeId = ownNodeId;
/*-----------------------------------------------------------------------*/
// Compute all static block references in this node as part of
@@ -1193,8 +1193,6 @@ void Dbdih::execNDB_STTOR(Signal* signal)
// Set the number of replicas, maximum is 4 replicas.
// Read the ndb nodes from the configuration.
/*-----------------------------------------------------------------------*/
- cnoReplicas = tconfig1 > 4 ? 4 : tconfig1;
- cgcpDelay = tconfig2 > 60000 ? 60000 : (tconfig2 < 10 ? 10 : tconfig2);
/*-----------------------------------------------------------------------*/
// For node restarts we will also add a request for permission
@@ -1261,7 +1259,7 @@ void Dbdih::execNDB_STTOR(Signal* signal)
*/
StartMeReq * req = (StartMeReq*)&signal->theData[0];
req->startingRef = reference();
- req->startingVersion = NDB_VERSION;
+ req->startingVersion = 0; // Obsolete
sendSignal(cmasterdihref, GSN_START_MEREQ, signal,
StartMeReq::SignalLength, JBB);
return;
@@ -1623,7 +1621,8 @@ void Dbdih::execSTART_PERMREQ(Signal* signal)
c_nodeStartMaster.startInfoErrorCode = 0;
c_nodeStartMaster.startNode = nodeId;
c_nodeStartMaster.activeState = true;
-
+ c_nodeStartMaster.m_outstandingGsn = GSN_START_INFOREQ;
+
setNodeStatus(nodeId, NodeRecord::STARTING);
/**
* But if it's a NodeState::ST_INITIAL_NODE_RESTART
@@ -1704,13 +1703,11 @@ void Dbdih::execSTART_MEREQ(Signal* signal)
jamEntry();
const BlockReference Tblockref = req->startingRef;
const Uint32 Tnodeid = refToNode(Tblockref);
- const Uint32 TndbVersion = req->startingVersion;
ndbrequire(isMaster());
ndbrequire(c_nodeStartMaster.startNode == Tnodeid);
ndbrequire(getNodeStatus(Tnodeid) == NodeRecord::STARTING);
- c_nodeStartMaster.ndbVersion = TndbVersion;
sendSTART_RECREQ(signal, Tnodeid);
}//Dbdih::execSTART_MEREQ()
@@ -2011,7 +2008,6 @@ void Dbdih::execINCL_NODEREQ(Signal* signal)
Uint32 retRef = signal->theData[0];
Uint32 nodeId = signal->theData[1];
Uint32 tnodeStartFailNr = signal->theData[2];
- Uint32 TndbVersion = signal->theData[3];
currentgcp = signal->theData[4];
CRASH_INSERTION(7127);
cnewgcp = currentgcp;
@@ -2063,7 +2059,6 @@ void Dbdih::execINCL_NODEREQ(Signal* signal)
nodePtr.p->nodeStatus = NodeRecord::ALIVE;
nodePtr.p->useInTransactions = true;
nodePtr.p->m_inclDihLcp = true;
- nodePtr.p->ndbversion = TndbVersion;
removeDeadNode(nodePtr);
insertAlive(nodePtr);
@@ -3391,7 +3386,8 @@ void Dbdih::readGciFileLab(Signal* signal)
filePtr.i = crestartInfoFile[0];
ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
filePtr.p->reqStatus = FileRecord::OPENING_GCP;
- openFileRw(signal, filePtr);
+
+ openFileRo(signal, filePtr);
}//Dbdih::readGciFileLab()
void Dbdih::openingGcpLab(Signal* signal, FileRecordPtr filePtr)
@@ -3455,6 +3451,7 @@ void Dbdih::selectMasterCandidateAndSend(Signal* signal)
signal->theData[0] = masterCandidateId;
signal->theData[1] = gci;
sendSignal(cntrlblockref, GSN_DIH_RESTARTCONF, signal, 2, JBB);
+ setNodeGroups();
}//Dbdih::selectMasterCandidate()
/* ------------------------------------------------------------------------- */
@@ -3472,7 +3469,7 @@ void Dbdih::openingGcpErrorLab(Signal* signal, FileRecordPtr filePtr)
/* --------------------------------------------------------------------- */
filePtr.i = crestartInfoFile[1];
ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
- openFileRw(signal, filePtr);
+ openFileRo(signal, filePtr);
filePtr.p->reqStatus = FileRecord::OPENING_GCP;
} else {
jam();
@@ -3762,6 +3759,7 @@ void Dbdih::checkCopyTab(NodeRecordPtr failedNodePtr)
c_COPY_TABREQ_Counter.clearWaitingFor(failedNodePtr.i);
c_nodeStartMaster.wait = ZFALSE;
break;
+ case GSN_START_INFOREQ:
case GSN_START_PERMCONF:
case GSN_DICTSTARTREQ:
case GSN_START_MECONF:
@@ -10863,6 +10861,26 @@ void Dbdih::initCommonData()
c_nodeStartMaster.wait = ZFALSE;
memset(&sysfileData[0], 0, sizeof(sysfileData));
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ c_lcpState.clcpDelay = 20;
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_INTERVAL, &c_lcpState.clcpDelay);
+ c_lcpState.clcpDelay = c_lcpState.clcpDelay > 31 ? 31 : c_lcpState.clcpDelay;
+
+ cminHotSpareNodes = 0;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_MIN_HOT_SPARES, &cminHotSpareNodes);
+ cminHotSpareNodes = cminHotSpareNodes > 2 ? 2 : cminHotSpareNodes;
+
+ cnoReplicas = 1;
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_REPLICAS, &cnoReplicas);
+ cnoReplicas = cnoReplicas > 4 ? 4 : cnoReplicas;
+
+ cgcpDelay = 2000;
+ ndb_mgm_get_int_parameter(p, CFG_DB_GCP_INTERVAL, &cgcpDelay);
+ cgcpDelay = cgcpDelay > 60000 ? 60000 : (cgcpDelay < 10 ? 10 : cgcpDelay);
}//Dbdih::initCommonData()
void Dbdih::initFragstore(FragmentstorePtr fragPtr)
@@ -10901,7 +10919,6 @@ void Dbdih::initNodeState(NodeRecordPtr nodePtr)
nodePtr.p->nodeStatus = NodeRecord::NOT_IN_CLUSTER;
nodePtr.p->useInTransactions = false;
nodePtr.p->copyCompleted = false;
- nodePtr.p->ndbversion = 0xffff;
}//Dbdih::initNodeState()
/*************************************************************************/
@@ -11070,44 +11087,43 @@ void Dbdih::initTableFile(TabRecordPtr tabPtr)
/* --------------------------------------------------------------------- */
}//Dbdih::initTableFile()
-void Dbdih::initialiseRecordsLab(Signal* signal, Uint32 stepNo)
+void Dbdih::initialiseRecordsLab(Signal* signal,
+ Uint32 stepNo, Uint32 retRef, Uint32 retData)
{
switch (stepNo) {
case 0:
jam();
initCommonData();
break;
- case 1:
- {
- ApiConnectRecordPtr apiConnectptr;
- jam();
- /******** INTIALIZING API CONNECT RECORDS ********/
- for (apiConnectptr.i = 0; apiConnectptr.i < capiConnectFileSize; apiConnectptr.i++) {
- ptrAss(apiConnectptr, apiConnectRecord);
- apiConnectptr.p->nextApi = RNIL;
- }//for
- jam();
- break;
- }
- case 2:
- {
- ConnectRecordPtr connectPtr;
- jam();
- /****** CONNECT ******/
- for (connectPtr.i = 0; connectPtr.i < cconnectFileSize; connectPtr.i++) {
- ptrAss(connectPtr, connectRecord);
- connectPtr.p->userpointer = RNIL;
- connectPtr.p->userblockref = ZNIL;
- connectPtr.p->connectState = ConnectRecord::FREE;
- connectPtr.p->table = RNIL;
- connectPtr.p->nfConnect = connectPtr.i + 1;
- }//for
- connectPtr.i = cconnectFileSize - 1;
+ case 1:{
+ ApiConnectRecordPtr apiConnectptr;
+ jam();
+ /******** INTIALIZING API CONNECT RECORDS ********/
+ for (apiConnectptr.i = 0; apiConnectptr.i < capiConnectFileSize; apiConnectptr.i++) {
+ ptrAss(apiConnectptr, apiConnectRecord);
+ apiConnectptr.p->nextApi = RNIL;
+ }//for
+ jam();
+ break;
+ }
+ case 2:{
+ ConnectRecordPtr connectPtr;
+ jam();
+ /****** CONNECT ******/
+ for (connectPtr.i = 0; connectPtr.i < cconnectFileSize; connectPtr.i++) {
ptrAss(connectPtr, connectRecord);
- connectPtr.p->nfConnect = RNIL;
- cfirstconnect = 0;
- break;
- }
+ connectPtr.p->userpointer = RNIL;
+ connectPtr.p->userblockref = ZNIL;
+ connectPtr.p->connectState = ConnectRecord::FREE;
+ connectPtr.p->table = RNIL;
+ connectPtr.p->nfConnect = connectPtr.i + 1;
+ }//for
+ connectPtr.i = cconnectFileSize - 1;
+ ptrAss(connectPtr, connectRecord);
+ connectPtr.p->nfConnect = RNIL;
+ cfirstconnect = 0;
+ break;
+ }
case 3:
{
FileRecordPtr filePtr;
@@ -11208,8 +11224,12 @@ void Dbdih::initialiseRecordsLab(Signal* signal, Uint32 stepNo)
initTakeOver(takeOverPtr);
releaseTakeOver(takeOverPtr.i);
}//for
- signal->theData[0] = DBDIH_REF;
- sendSignal(CMVMI_REF, GSN_SIZEALT_ACK, signal, 2, JBB);
+
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = retData;
+ sendSignal(retRef, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
return;
break;
}
@@ -11218,12 +11238,14 @@ void Dbdih::initialiseRecordsLab(Signal* signal, Uint32 stepNo)
break;
}//switch
jam();
- /* ------------------------------------------------------------------------- */
- /* SEND REAL-TIME BREAK DURING INIT OF VARIABLES DURING SYSTEM RESTART. */
- /* ------------------------------------------------------------------------- */
+ /* ---------------------------------------------------------------------- */
+ /* SEND REAL-TIME BREAK DURING INIT OF VARIABLES DURING SYSTEM RESTART. */
+ /* ---------------------------------------------------------------------- */
signal->theData[0] = DihContinueB::ZINITIALISE_RECORDS;
signal->theData[1] = stepNo + 1;
- sendSignal(reference(), GSN_CONTINUEB, signal, 2, JBB);
+ signal->theData[2] = retRef;
+ signal->theData[3] = retData;
+ sendSignal(reference(), GSN_CONTINUEB, signal, 4, JBB);
}//Dbdih::initialiseRecordsLab()
/*************************************************************************/
@@ -11512,8 +11534,6 @@ void Dbdih::makePrnList(ReadNodesConf * readNodes, Uint32 nodeArray[])
nodePtr.p->nodeStatus = NodeRecord::DEAD;
insertDeadNode(nodePtr);
}//if
- nodePtr.p->ndbversion = readNodes->getVersionId(nodePtr.i,
- readNodes->theVersionIds);
}//for
}//Dbdih::makePrnList()
@@ -11563,7 +11583,19 @@ void Dbdih::openFileRw(Signal* signal, FileRecordPtr filePtr)
signal->theData[3] = filePtr.p->fileName[1];
signal->theData[4] = filePtr.p->fileName[2];
signal->theData[5] = filePtr.p->fileName[3];
- signal->theData[6] = ZOPEN_READ_WRITE;
+ signal->theData[6] = FsOpenReq::OM_READWRITE;
+ sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, 7, JBA);
+}//Dbdih::openFileRw()
+
+void Dbdih::openFileRo(Signal* signal, FileRecordPtr filePtr)
+{
+ signal->theData[0] = reference();
+ signal->theData[1] = filePtr.i;
+ signal->theData[2] = filePtr.p->fileName[0];
+ signal->theData[3] = filePtr.p->fileName[1];
+ signal->theData[4] = filePtr.p->fileName[2];
+ signal->theData[5] = filePtr.p->fileName[3];
+ signal->theData[6] = FsOpenReq::OM_READONLY;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, 7, JBA);
}//Dbdih::openFileRw()
@@ -12502,7 +12534,10 @@ void Dbdih::setNodeGroups()
}//for
for (sngNodeptr.i = 1; sngNodeptr.i < MAX_NDB_NODES; sngNodeptr.i++) {
ptrAss(sngNodeptr, nodeRecord);
- switch (sngNodeptr.p->activeStatus) {
+ Sysfile::ActiveStatus s =
+ (Sysfile::ActiveStatus)Sysfile::getNodeStatus(sngNodeptr.i,
+ SYSFILE->nodeStatus);
+ switch (s){
case Sysfile::NS_Active:
case Sysfile::NS_ActiveMissed_1:
case Sysfile::NS_ActiveMissed_2:
@@ -12911,8 +12946,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
cnoHotSpare, c_nodeStartMaster.startNode, c_nodeStartMaster.wait);
}//if
if (signal->theData[0] == 7007) {
- infoEvent("c_nodeStartMaster.failNr = %d, c_nodeStartMaster.ndbVersion = %d",
- c_nodeStartMaster.failNr, c_nodeStartMaster.ndbVersion);
+ infoEvent("c_nodeStartMaster.failNr = %d", c_nodeStartMaster.failNr);
infoEvent("c_nodeStartMaster.startInfoErrorCode = %d",
c_nodeStartMaster.startInfoErrorCode);
infoEvent("c_nodeStartMaster.blockLcp = %d, c_nodeStartMaster.blockGcp = %d",
@@ -13391,7 +13425,7 @@ Dbdih::execNDB_TAMPER(Signal* signal)
}//Dbdih::execNDB_TAMPER()
void Dbdih::execSET_VAR_REQ(Signal* signal) {
-
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
int val = setVarReq->value();
@@ -13411,6 +13445,7 @@ void Dbdih::execSET_VAR_REQ(Signal* signal) {
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
} // switch
+#endif
}
void Dbdih::execBLOCK_COMMIT_ORD(Signal* signal){
diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am
new file mode 100644
index 00000000000..2ee8017ec13
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbdih/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libdbdih.a
+
+libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbdih/Makefile b/ndb/src/kernel/blocks/dbdih/Makefile_old
index 83c1b95b5c4..83c1b95b5c4 100644
--- a/ndb/src/kernel/blocks/dbdih/Makefile
+++ b/ndb/src/kernel/blocks/dbdih/Makefile_old
diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
index 3d7980f0e73..824f74c59af 100644
--- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
@@ -560,7 +560,6 @@ public:
UintR scanLocalFragid;
UintR scanSchemaVersion;
Uint32 fragPtrI;
- UintR scanSearchCondFalseCount;
UintR scanStoredProcId;
ScanState scanState;
UintR scanTcrec;
@@ -2110,7 +2109,7 @@ private:
void execCHECK_LCP_STOP(Signal* signal);
void execSEND_PACKED(Signal* signal);
void execTUP_ATTRINFO(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
void execLQHFRAGREQ(Signal* signal);
void execLQHADDATTREQ(Signal* signal);
void execTUP_ADD_ATTCONF(Signal* signal);
@@ -2329,7 +2328,6 @@ private:
void initialiseLogPage(Signal* signal);
void initialiseLogPart(Signal* signal);
void initialisePageRef(Signal* signal);
- void sendInitialiseRecords(Signal* signal, Uint32 data);
void initialiseScanrec(Signal* signal);
void initialiseTabrec(Signal* signal);
void initialiseTcrec(Signal* signal);
@@ -2463,7 +2461,6 @@ private:
void closeCopyRequestLab(Signal* signal);
void closeScanRequestLab(Signal* signal);
void scanTcConnectLab(Signal* signal, Uint32 startTcCon, Uint32 fragId);
- void returnInitialiseRecordsLab(Signal* signal);
void initGcpRecLab(Signal* signal);
void prepareContinueAfterBlockedLab(Signal* signal);
void commitContinueAfterBlockedLab(Signal* signal);
@@ -2480,7 +2477,7 @@ private:
void accFragRefLab(Signal* signal);
void rwConcludedLab(Signal* signal);
void sendsttorryLab(Signal* signal);
- void initialiseRecordsLab(Signal* signal, Uint32 data);
+ void initialiseRecordsLab(Signal* signal, Uint32 data, Uint32, Uint32);
void startphase2Lab(Signal* signal, Uint32 config);
void startphase3Lab(Signal* signal);
void startphase4Lab(Signal* signal);
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
index cb1698ec8c0..d5f40ec143c 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
@@ -220,7 +220,7 @@ Dblqh::Dblqh(const class Configuration & conf):
addRecSignal(GSN_CHECK_LCP_STOP, &Dblqh::execCHECK_LCP_STOP);
addRecSignal(GSN_SEND_PACKED, &Dblqh::execSEND_PACKED);
addRecSignal(GSN_TUP_ATTRINFO, &Dblqh::execTUP_ATTRINFO);
- addRecSignal(GSN_SIZEALT_REP, &Dblqh::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dblqh::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_LQHFRAGREQ, &Dblqh::execLQHFRAGREQ);
addRecSignal(GSN_LQHADDATTREQ, &Dblqh::execLQHADDATTREQ);
addRecSignal(GSN_TUP_ADD_ATTCONF, &Dblqh::execTUP_ADD_ATTCONF);
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index debea883cfc..1abf4b3a7e9 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -32,14 +32,12 @@
#include <signaldata/GCPSave.hpp>
#include <signaldata/TcKeyRef.hpp>
#include <signaldata/LqhKey.hpp>
-#include <signaldata/LqhSizeAltReq.hpp>
#include <signaldata/NextScan.hpp>
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/RelTabMem.hpp>
#include <signaldata/ScanFrag.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/SrFragidConf.hpp>
#include <signaldata/StartFragReq.hpp>
#include <signaldata/StartRec.hpp>
@@ -333,7 +331,7 @@ void Dblqh::execCONTINUEB(Signal* signal)
break;
case ZINITIALISE_RECORDS:
jam();
- initialiseRecordsLab(signal, data0);
+ initialiseRecordsLab(signal, data0, data2, signal->theData[4]);
return;
break;
case ZINIT_GCP_REC:
@@ -467,7 +465,6 @@ void Dblqh::execNDB_STTOR(Signal* signal)
Uint32 ownNodeId = signal->theData[1]; /* START PHASE*/
cstartPhase = signal->theData[2]; /* MY NODE ID */
cstartType = signal->theData[3]; /* START TYPE */
- Uint32 config1 = signal->theData[10]; /* CONFIG INFO LQH */
switch (cstartPhase) {
case ZSTART_PHASE1:
@@ -488,7 +485,7 @@ void Dblqh::execNDB_STTOR(Signal* signal)
// Dont setAPIVersion
LqhKeyReq::setMarkerFlag(preComputedRequestInfoMask, 1);
//preComputedRequestInfoMask = 0x003d7fff;
- startphase1Lab(signal, config1, ownNodeId);
+ startphase1Lab(signal, /* dummy */ ~0, ownNodeId);
signal->theData[0] = ZOPERATION_EVENT_REP;
signal->theData[1] = 1;
@@ -497,7 +494,7 @@ void Dblqh::execNDB_STTOR(Signal* signal)
break;
case ZSTART_PHASE2:
jam();
- startphase2Lab(signal, config1);
+ startphase2Lab(signal, /* dummy */ ~0);
return;
break;
case ZSTART_PHASE3:
@@ -539,17 +536,12 @@ void Dblqh::sttorStartphase1Lab(Signal* signal)
/* */
/* INITIATE ALL RECORDS WITHIN THE BLOCK */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-void Dblqh::startphase1Lab(Signal* signal, Uint32 config, Uint32 ownNodeId)
+void Dblqh::startphase1Lab(Signal* signal, Uint32 _dummy, Uint32 ownNodeId)
{
UintR Ti;
HostRecordPtr ThostPtr;
/* ------- INITIATE ALL RECORDS ------- */
- if (config == 0) {
- jam();
- config = 1;
- }//if
- cnoLogFiles = config;
cownNodeid = ownNodeId;
caccBlockref = calcAccBlockRef (cownNodeid);
ctupBlockref = calcTupBlockRef (cownNodeid);
@@ -576,15 +568,8 @@ void Dblqh::startphase1Lab(Signal* signal, Uint32 config, Uint32 ownNodeId)
/* EVERY CONNECTION RECORD IN LQH IS ASSIGNED TO ONE ACC CONNECTION RECORD */
/* AND ONE TUP CONNECTION RECORD. */
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-void Dblqh::startphase2Lab(Signal* signal, Uint32 config)
+void Dblqh::startphase2Lab(Signal* signal, Uint32 _dummy)
{
- if (config == 0) {
- jam();
- config = 1;
- } else if (config > 4) {
- jam();
- config = 4;
- }//if
cmaxWordsAtNodeRec = MAX_NO_WORDS_OUTSTANDING_COPY_FRAGMENT;
/* -- ACC AND TUP CONNECTION PROCESS -- */
tcConnectptr.i = 0;
@@ -836,30 +821,38 @@ void Dblqh::execREAD_NODESREF(Signal* signal)
/* *************** */
/* SIZEALT_REP > */
/* *************** */
-void Dblqh::execSIZEALT_REP(Signal* signal)
+void Dblqh::execREAD_CONFIG_REQ(Signal* signal)
{
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
jamEntry();
- cfragrecFileSize = signal->theData[LqhSizeAltReq::IND_FRAG];
- ctabrecFileSize = signal->theData[LqhSizeAltReq::IND_TABLE];
- ctcConnectrecFileSize = signal->theData[LqhSizeAltReq::IND_TC_CONNECT];
- clogFileFileSize = signal->theData[LqhSizeAltReq::IND_LOG_FILES];
- cscanrecFileSize = signal->theData[LqhSizeAltReq::IND_SCAN];
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ cnoLogFiles = 8;
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_FILES,
+ &cnoLogFiles));
+ ndbrequire(cnoLogFiles > 0);
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &cfragrecFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TABLE, &ctabrecFileSize));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TC_CONNECT,
+ &ctcConnectrecFileSize));
+ clogFileFileSize = 4 * cnoLogFiles;
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_SCAN, &cscanrecFileSize));
cmaxAccOps = cscanrecFileSize * MAX_PARALLEL_SCANS_PER_FRAG;
+
initRecords();
- initialiseRecordsLab(signal, 0);
+ initialiseRecordsLab(signal, 0, ref, senderData);
return;
}//Dblqh::execSIZEALT_REP()
-void Dblqh::returnInitialiseRecordsLab(Signal* signal)
-{
- signal->theData[0] = DBLQH_REF;
- sendSignal(CMVMI_REF, GSN_SIZEALT_ACK, signal, 2, JBB);
-
-
- return;
-}//Dblqh::returnInitialiseRecordsLab()
-
/* ########################################################################## */
/* ####### ADD/DELETE FRAGMENT MODULE ####### */
/* THIS MODULE IS USED BY DICTIONARY TO CREATE NEW FRAGMENTS AND DELETE */
@@ -1232,6 +1225,18 @@ Dblqh::sendAddFragReq(Signal* signal)
tuxreq->fragOff = addfragptr.p->lh3DistrBits;
tuxreq->tableType = addfragptr.p->tableType;
tuxreq->primaryTableId = addfragptr.p->primaryTableId;
+ // pointer to index fragment in TUP
+ tuxreq->tupIndexFragPtrI =
+ addfragptr.p->addfragStatus == AddFragRecord::WAIT_TWO_TUX ?
+ fragptr.p->tupFragptr[0] : fragptr.p->tupFragptr[1];
+ // pointers to table fragments in TUP and ACC
+ FragrecordPtr tFragPtr;
+ tFragPtr.i = fragptr.p->tableFragptr;
+ ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord);
+ tuxreq->tupTableFragPtrI[0] = tFragPtr.p->tupFragptr[0];
+ tuxreq->tupTableFragPtrI[1] = tFragPtr.p->tupFragptr[1];
+ tuxreq->accTableFragPtrI[0] = tFragPtr.p->accFragptr[0];
+ tuxreq->accTableFragPtrI[1] = tFragPtr.p->accFragptr[1];
sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ,
signal, TuxFragReq::SignalLength, JBB);
return;
@@ -2064,8 +2069,6 @@ void Dblqh::execTIME_SIGNAL(Signal* signal)
<< " scanLocalFragid="<<TscanPtr.p->scanLocalFragid
<< endl;
ndbout << " scanSchemaVersion="<<TscanPtr.p->scanSchemaVersion
- << " scanSearchCondFalseCount="<<
- TscanPtr.p->scanSearchCondFalseCount
<< " scanStoredProcId="<<TscanPtr.p->scanStoredProcId
<< " scanTcrec="<<TscanPtr.p->scanTcrec
<< endl;
@@ -7099,14 +7102,26 @@ void Dblqh::scanLockReleasedLab(Signal* signal)
sendScanFragConf(signal, ZFALSE);
} else {
jam();
+ /*
+ We came here after releasing locks after receiving SCAN_NEXTREQ from TC. We only
+ come here when scanHoldLock == ZTRUE
+ */
continueScanNextReqLab(signal);
}//if
- } else {
- ndbrequire(scanptr.p->scanReleaseCounter <=
- scanptr.p->scanCompletedOperations);
+ } else if (scanptr.p->scanReleaseCounter < scanptr.p->scanCompletedOperations) {
jam();
scanptr.p->scanReleaseCounter++;
scanReleaseLocksLab(signal);
+ } else {
+ jam();
+ /*
+ We come here when we have been scanning for a long time and not been able
+ to find scanConcurrentOperations records to return. We needed to release
+ the record we didn't want, but now we are returning all found records to
+ the API.
+ */
+ scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ;
+ sendScanFragConf(signal, ZFALSE);
}//if
}//Dblqh::scanLockReleasedLab()
@@ -8000,28 +8015,28 @@ void Dblqh::scanTupkeyRefLab(Signal* signal)
scanReleaseLocksLab(signal);
return;
}//if
+ Uint32 time_passed= tcConnectptr.p->tcTimer - cLqhTimeOutCount;
+ if (scanptr.p->scanCompletedOperations > 0) {
+ if (time_passed > 1) {
/* -----------------------------------------------------------------------
* WE NEED TO ENSURE THAT WE DO NOT SEARCH FOR THE NEXT TUPLE FOR A
* LONG TIME WHILE WE KEEP A LOCK ON A FOUND TUPLE. WE RATHER REPORT
- * THE FOUND TUPLE IF FOUND TUPLES ARE RARE. WE SELECT 20 TUPLES
- * WHICH SHOULD BE ROUGHLY 10 MS OF LOCK HOLD TIME.
+ * THE FOUND TUPLE IF FOUND TUPLES ARE RARE. If more than 10 ms passed we
+ * send the found tuples to the API.
* ----------------------------------------------------------------------- */
- scanptr.p->scanSearchCondFalseCount++;
-#if 0
- // MASV Uncomment this feature since it forgets
- // to release on operation record in DBACC
- // This is the quick fix and should be changed in
- // the future
- if (scanptr.p->scanSearchCondFalseCount > 20) {
- if (scanptr.p->scanCompletedOperations > 0) {
- jam();
- scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ;
- sendScanFragConf(signal, ZFALSE);
+ scanptr.p->scanReleaseCounter = scanptr.p->scanCompletedOperations + 1;
+ scanReleaseLocksLab(signal);
return;
- }//if
- }//if
-#endif
-
+ }
+ } else {
+ if (time_passed > 10) {
+ jam();
+ signal->theData[0]= scanptr.i;
+ signal->theData[1]= tcConnectptr.p->transid[0];
+ signal->theData[2]= tcConnectptr.p->transid[1];
+ execSCAN_HBREP(signal);
+ }
+ }
scanptr.p->scanFlag = NextScanReq::ZSCAN_NEXT_ABORT;
scanNextLoopLab(signal);
}//Dblqh::scanTupkeyRefLab()
@@ -8179,7 +8194,6 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq)
scanptr.p->scanLockMode = scanLockMode;
scanptr.p->readCommitted = readCommitted;
scanptr.p->rangeScan = idx;
- scanptr.p->scanSearchCondFalseCount = 0;
scanptr.p->scanState = ScanRecord::SCAN_FREE;
scanptr.p->scanFlag = ZFALSE;
scanptr.p->scanLocalref[0] = 0;
@@ -8480,7 +8494,6 @@ void Dblqh::sendKeyinfo20(Signal* signal,
* ------------------------------------------------------------------------ */
void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted)
{
- scanptr.p->scanSearchCondFalseCount = 0;
scanptr.p->scanTcWaiting = ZFALSE;
ScanFragConf * conf = (ScanFragConf*)&signal->theData[0];
@@ -16024,7 +16037,8 @@ void Dblqh::initialisePageRef(Signal* signal)
*
* TAKES CARE OF INITIATION OF ALL RECORDS IN THIS BLOCK.
* ========================================================================= */
-void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data)
+void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data,
+ Uint32 retRef, Uint32 retData)
{
switch (data) {
case 0:
@@ -16062,90 +16076,81 @@ void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data)
csrExecUndoLogState = EULS_IDLE;
c_lcpId = 0;
cnoOfFragsCheckpointed = 0;
- sendInitialiseRecords(signal, data);
break;
case 1:
jam();
initialiseAddfragrec(signal);
- sendInitialiseRecords(signal, data);
break;
case 2:
jam();
initialiseAttrbuf(signal);
- sendInitialiseRecords(signal, data);
break;
case 3:
jam();
initialiseDatabuf(signal);
- sendInitialiseRecords(signal, data);
break;
case 4:
jam();
initialiseFragrec(signal);
- sendInitialiseRecords(signal,data);
break;
case 5:
jam();
initialiseGcprec(signal);
initialiseLcpRec(signal);
initialiseLcpLocrec(signal);
- sendInitialiseRecords(signal, data);
break;
case 6:
jam();
initialiseLogPage(signal);
- sendInitialiseRecords(signal, data);
break;
case 7:
jam();
initialiseLfo(signal);
- sendInitialiseRecords(signal, data);
break;
case 8:
jam();
initialiseLogFile(signal);
initialiseLogPart(signal);
- sendInitialiseRecords(signal, data);
break;
case 9:
jam();
initialisePageRef(signal);
- sendInitialiseRecords(signal, data);
break;
case 10:
jam();
initialiseScanrec(signal);
- sendInitialiseRecords(signal, data);
break;
case 11:
jam();
initialiseTabrec(signal);
- sendInitialiseRecords(signal, data);
break;
case 12:
jam();
initialiseTcNodeFailRec(signal);
initialiseTcrec(signal);
- returnInitialiseRecordsLab(signal);
+ {
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = retData;
+ sendSignal(retRef, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
+ }
return;
break;
default:
ndbrequire(false);
break;
}//switch
- return;
-}//Dblqh::initialiseRecordsLab()
-/* --------------------------------------------------------------------------
- * SEND REAL-TIME BREAK SIGNAL DURING INITIALISATION IN SYSTEM RESTART.
- * ------------------------------------------------------------------------- */
-void Dblqh::sendInitialiseRecords(Signal* signal, Uint32 data)
-{
signal->theData[0] = ZINITIALISE_RECORDS;
signal->theData[1] = data + 1;
signal->theData[2] = 0;
- sendSignal(DBLQH_REF, GSN_CONTINUEB, signal, 3, JBB);
-}//Dblqh::sendInitialiseRecords()
+ signal->theData[3] = retRef;
+ signal->theData[4] = retData;
+ sendSignal(DBLQH_REF, GSN_CONTINUEB, signal, 5, JBB);
+
+ return;
+}//Dblqh::initialiseRecordsLab()
/* ==========================================================================
* ======= INITIATE TC CONNECTION RECORD =======
@@ -17956,11 +17961,10 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
sp.p->scanAiLength,
sp.p->scanCompletedOperations,
sp.p->scanConcurrentOperations);
- infoEvent(" errCnt=%d, localFid=%d, schV=%d, searcCondFalseC=%d",
+ infoEvent(" errCnt=%d, localFid=%d, schV=%d",
sp.p->scanErrorCounter,
sp.p->scanLocalFragid,
- sp.p->scanSchemaVersion,
- sp.p->scanSearchCondFalseCount);
+ sp.p->scanSchemaVersion);
infoEvent(" stpid=%d, flag=%d, lhold=%d, lmode=%d, num=%d",
sp.p->scanStoredProcId,
sp.p->scanFlag,
@@ -18013,7 +18017,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
void Dblqh::execSET_VAR_REQ(Signal* signal)
{
-
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
@@ -18031,7 +18035,7 @@ void Dblqh::execSET_VAR_REQ(Signal* signal)
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
} // switch
-
+#endif
}//execSET_VAR_REQ()
diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am
new file mode 100644
index 00000000000..3a58dba742e
--- /dev/null
+++ b/ndb/src/kernel/blocks/dblqh/Makefile.am
@@ -0,0 +1,11 @@
+#SUBDIRS = redoLogReader
+
+noinst_LIBRARIES = libdblqh.a
+
+libdblqh_a_SOURCES = DblqhInit.cpp DblqhMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dblqh/Makefile b/ndb/src/kernel/blocks/dblqh/Makefile_old
index 520486d8058..520486d8058 100644
--- a/ndb/src/kernel/blocks/dblqh/Makefile
+++ b/ndb/src/kernel/blocks/dblqh/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index 3fc79120942..c87712e1887 100644
--- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -955,7 +955,6 @@ public:
LqhTransState lqhTransStatus;
TakeOverState takeOverStatus;
bool inPackedList;
- UintR ndbVersion;
UintR noOfPackedWordsLqh;
UintR packedWordsLqh[26];
UintR noOfWordsTCKEYCONF;
@@ -1336,7 +1335,7 @@ private:
void execSCAN_TABINFO(Signal* signal);
void execSCAN_FRAGCONF(Signal* signal);
void execSCAN_FRAGREF(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
void execLQH_TRANSCONF(Signal* signal);
void execCOMPLETECONF(Signal* signal);
void execCOMMITCONF(Signal* signal);
@@ -1496,7 +1495,6 @@ private:
AttrbufRecord * const regAttrPtr,
UintR TBref);
void sendContinueTimeOutControl(Signal* signal, Uint32 TapiConPtr);
- void sendInitialiseRecords(Signal* signal, UintR Tnext);
void sendKeyinfo(Signal* signal, BlockReference TBRef, Uint32 len);
void sendlqhkeyreq(Signal* signal, BlockReference TBRef);
void sendSystemError(Signal* signal);
@@ -1613,7 +1611,6 @@ private:
void scanCompletedLab(Signal* signal);
void scanFragError(Signal* signal, Uint32 errorCode);
void diverify010Lab(Signal* signal);
- void returnInitialiseRecordsLab(Signal* signal);
void intstartphase2x010Lab(Signal* signal);
void intstartphase3x010Lab(Signal* signal);
void sttorryLab(Signal* signal);
@@ -1627,7 +1624,7 @@ private:
void completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd);
void completeTransAtTakeOverDoOne(Signal* signal, UintR TtakeOverInd);
void timeOutLoopStartLab(Signal* signal, Uint32 apiConnectPtr);
- void initialiseRecordsLab(Signal* signal, UintR Tdata0);
+ void initialiseRecordsLab(Signal* signal, UintR Tdata0, Uint32, Uint32);
void tckeyreq020Lab(Signal* signal);
void intstartphase2x020Lab(Signal* signal);
void intstartphase1x010Lab(Signal* signal);
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
index 0982ae5bff5..61ecca513f0 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
@@ -182,19 +182,24 @@ Dbtc::Dbtc(const class Configuration & conf):
BLOCK_CONSTRUCTOR(Dbtc);
- const Properties * p = conf.getOwnProperties();
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 transactionBufferMemory = 0;
Uint32 maxNoOfIndexes = 0, maxNoOfConcurrentIndexOperations = 0;
Uint32 maxNoOfTriggers = 0, maxNoOfFiredTriggers = 0;
- p->get("TransactionBufferMemory", &transactionBufferMemory);
- p->get("MaxNoOfIndexes", &maxNoOfIndexes);
- p->get("MaxNoOfConcurrentIndexOperations", &maxNoOfConcurrentIndexOperations);
- p->get("MaxNoOfTriggers", &maxNoOfTriggers);
- p->get("MaxNoOfFiredTriggers", &maxNoOfFiredTriggers);
-
+ ndb_mgm_get_int_parameter(p, CFG_DB_TRANS_BUFFER_MEM,
+ &transactionBufferMemory);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_INDEXES,
+ &maxNoOfIndexes);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_INDEX_OPS,
+ &maxNoOfConcurrentIndexOperations);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGERS,
+ &maxNoOfTriggers);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGER_OPS,
+ &maxNoOfFiredTriggers);
+
c_transactionBufferSpace =
transactionBufferMemory / AttributeBuffer::getSegmentSize();
c_maxNumberOfIndexes = maxNoOfIndexes;
@@ -247,7 +252,7 @@ Dbtc::Dbtc(const class Configuration & conf):
addRecSignal(GSN_SCAN_TABREQ, &Dbtc::execSCAN_TABREQ);
addRecSignal(GSN_SCAN_FRAGCONF, &Dbtc::execSCAN_FRAGCONF);
addRecSignal(GSN_SCAN_FRAGREF, &Dbtc::execSCAN_FRAGREF);
- addRecSignal(GSN_SIZEALT_REP, &Dbtc::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbtc::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_LQH_TRANSCONF, &Dbtc::execLQH_TRANSCONF);
addRecSignal(GSN_COMPLETECONF, &Dbtc::execCOMPLETECONF);
addRecSignal(GSN_COMMITCONF, &Dbtc::execCOMMITCONF);
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index feb5712d9d3..5afd79687a1 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -29,8 +29,6 @@
#include <signaldata/AttrInfo.hpp>
#include <signaldata/TransIdAI.hpp>
#include <signaldata/TcRollbackRep.hpp>
-#include <signaldata/TcSizeAltReq.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/NFCompleteRep.hpp>
@@ -108,6 +106,7 @@ void Dbtc::execCONTINUEB(Signal* signal)
tcase = signal->theData[0];
UintR Tdata0 = signal->theData[1];
UintR Tdata1 = signal->theData[2];
+ UintR Tdata2 = signal->theData[3];
switch (tcase) {
case TcContinueB::ZRETURN_FROM_QUEUED_DELIVERY:
jam();
@@ -138,7 +137,7 @@ void Dbtc::execCONTINUEB(Signal* signal)
return;
case TcContinueB::ZINITIALISE_RECORDS:
jam();
- initialiseRecordsLab(signal, Tdata0);
+ initialiseRecordsLab(signal, Tdata0, Tdata2, signal->theData[4]);
return;
case TcContinueB::ZSEND_COMMIT_LOOP:
jam();
@@ -497,15 +496,30 @@ void Dbtc::execALTER_TAB_REQ(Signal * signal)
/* ***************************************************************************/
/* START / RESTART */
/* ***************************************************************************/
-void Dbtc::execSIZEALT_REP(Signal* signal)
+void Dbtc::execREAD_CONFIG_REQ(Signal* signal)
{
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
jamEntry();
- tblockref = signal->theData[TcSizeAltReq::IND_BLOCK_REF];
- const UintR apiConnect = signal->theData[TcSizeAltReq::IND_API_CONNECT];
- const UintR tcConnect = signal->theData[TcSizeAltReq::IND_TC_CONNECT];
- const UintR tables = signal->theData[TcSizeAltReq::IND_TABLE];
- const UintR localScan = signal->theData[TcSizeAltReq::IND_LOCAL_SCAN];
- const UintR tcScan = signal->theData[TcSizeAltReq::IND_TC_SCAN];
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ UintR apiConnect;
+ UintR tcConnect;
+ UintR tables;
+ UintR localScan;
+ UintR tcScan;
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TC_API_CONNECT, &apiConnect));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TC_TC_CONNECT, &tcConnect));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TC_TABLE, &tables));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TC_LOCAL_SCAN, &localScan));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TC_SCAN, &tcScan));
ccacheFilesize = (apiConnect/3) + 1;
capiConnectFilesize = apiConnect;
@@ -516,14 +530,22 @@ void Dbtc::execSIZEALT_REP(Signal* signal)
cscanFragrecFileSize = localScan;
initRecords();
- initialiseRecordsLab(signal, (UintR)0);
-}//Dbtc::execSIZEALT_REP()
+ initialiseRecordsLab(signal, 0, ref, senderData);
-void Dbtc::returnInitialiseRecordsLab(Signal* signal)
-{
- signal->theData[0] = DBTC_REF;
- sendSignal(CMVMI_REF, GSN_SIZEALT_ACK, signal, 2, JBB);
-}//Dbtc::returnInitialiseRecordsLab()
+ Uint32 val = 3000;
+ ndb_mgm_get_int_parameter(p, CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT, &val);
+ set_timeout_value(val);
+
+ val = 3000;
+ ndb_mgm_get_int_parameter(p, CFG_DB_TRANSACTION_INACTIVE_TIMEOUT, &val);
+ set_appl_timeout_value(val);
+
+ val = 1;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_TRANSACTION_TAKEOVER, &val);
+ set_no_parallel_takeover(val);
+
+ ctimeOutCheckDelay = 50; // 500ms
+}//Dbtc::execSIZEALT_REP()
void Dbtc::execSTTOR(Signal* signal)
{
@@ -568,19 +590,13 @@ void Dbtc::execNDB_STTOR(Signal* signal)
tnodeid = signal->theData[1];
tndbstartphase = signal->theData[2]; /* START PHASE */
tstarttype = signal->theData[3]; /* START TYPE */
- Uint32 config1 = signal->theData[12]; /* CONFIG INFO TC */
- Uint32 config2 = signal->theData[13]; /* CONFIG INFO TC */
switch (tndbstartphase) {
case ZINTSPH1:
jam();
- ctimeOutCheckDelay = 50; // 500ms
- set_timeout_value(config1);
- set_no_parallel_takeover(config2);
intstartphase1x010Lab(signal);
return;
case ZINTSPH2:
jam();
- set_appl_timeout_value(config2);
intstartphase2x010Lab(signal);
return;
case ZINTSPH3:
@@ -747,10 +763,8 @@ void Dbtc::execREAD_NODESCONF(Signal* signal)
if (NodeBitmask::get(readNodes->allNodes, i)) {
hostptr.i = i;
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
-
+
hostptr.p->takeOverStatus = TOS_IDLE;
- hostptr.p->ndbVersion = ReadNodesConf::getVersionId
- (i, readNodes->theVersionIds);
if (NodeBitmask::get(readNodes->inactiveNodes, i)) {
jam();
@@ -2722,8 +2736,8 @@ void Dbtc::execTCKEYREQ(Signal* signal)
case ZUPDATE:
jam();
if (Tattrlength == 0) {
- TCKEY_abort(signal, 5);
- return;
+ //TCKEY_abort(signal, 5);
+ //return;
}//if
/*---------------------------------------------------------------------*/
// The missing break is intentional since we also want to set the opLock
@@ -5936,62 +5950,70 @@ void Dbtc::checkStartFragTimeout(Signal* signal)
/* BEEN DELAYED FOR SO LONG THAT WE ARE FORCED TO PERFORM */
/* SOME ACTION, EITHER ABORT OR RESEND OR REMOVE A NODE FROM */
/* THE WAITING PART OF A PROTOCOL. */
+/*
+The algorithm used here is to check 1024 transactions at a time before
+doing a real-time break.
+To avoid aborting both transactions in a deadlock detected by time-out
+we insert a random extra time-out of upto 630 ms by using the lowest
+six bits of the api connect reference.
+We spread it out from 0 to 630 ms if base time-out is larger than 3 sec,
+we spread it out from 0 to 70 ms if base time-out is smaller than 300 msec,
+and otherwise we spread it out 310 ms.
+*/
/*------------------------------------------------------------------*/
-void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 TapiConPtr)
+void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
{
- UintR texpiredTime[8];
- UintR TloopCount = 0;
+ Uint32 end_ptr, time_passed, time_out_value, mask_value;
+ const Uint32 api_con_sz= capiConnectFilesize;
+ const Uint32 tc_timer= ctcTimer;
+ const Uint32 time_out_param= ctimeOutValue;
- ctimeOutCheckHeartbeat = ctcTimer;
+ ctimeOutCheckHeartbeat = tc_timer;
- const Uint32 TapiConSz = capiConnectFilesize;
- const Uint32 TtcTimer = ctcTimer;
- const Uint32 TtimeOutValue = ctimeOutValue;
-
- while ((TapiConPtr + 8) < TapiConSz) {
- jam();
- texpiredTime[0] = TtcTimer - getApiConTimer(TapiConPtr + 0);
- texpiredTime[1] = TtcTimer - getApiConTimer(TapiConPtr + 1);
- texpiredTime[2] = TtcTimer - getApiConTimer(TapiConPtr + 2);
- texpiredTime[3] = TtcTimer - getApiConTimer(TapiConPtr + 3);
- texpiredTime[4] = TtcTimer - getApiConTimer(TapiConPtr + 4);
- texpiredTime[5] = TtcTimer - getApiConTimer(TapiConPtr + 5);
- texpiredTime[6] = TtcTimer - getApiConTimer(TapiConPtr + 6);
- texpiredTime[7] = TtcTimer - getApiConTimer(TapiConPtr + 7);
- for (Uint32 Ti = 0; Ti < 8; Ti++) {
- if (getApiConTimer(TapiConPtr + Ti) != 0) {
- if (texpiredTime[Ti] > TtimeOutValue) {
- jam();
- timeOutFoundLab(signal, TapiConPtr + Ti);
- return;
- }//if
- }//if
- }//for
- TapiConPtr += 8;
- if (TloopCount++ > 128) {
- jam();
- sendContinueTimeOutControl(signal, TapiConPtr);
- return;
- }//if
- }//while
- for ( ; TapiConPtr < TapiConSz; TapiConPtr++) {
+ if (api_con_ptr + 1024 < api_con_sz) {
+ jam();
+ end_ptr= api_con_ptr + 1024;
+ } else {
+ jam();
+ end_ptr= api_con_sz;
+ }
+ if (time_out_param > 300) {
+ jam();
+ mask_value= 63;
+ } else if (time_out_param < 30) {
+ jam();
+ mask_value= 7;
+ } else {
+ jam();
+ mask_value= 31;
+ }
+ for ( ; api_con_ptr < end_ptr; api_con_ptr++) {
+ Uint32 api_timer= getApiConTimer(api_con_ptr);
jam();
- if (getApiConTimer(TapiConPtr) != 0) {
- texpiredTime[0] = TtcTimer - getApiConTimer(TapiConPtr);
- if (texpiredTime[0] > TtimeOutValue) {
+ if (api_timer != 0) {
+ time_out_value= time_out_param + (api_con_ptr & mask_value);
+ time_passed= tc_timer - api_timer;
+ if (time_passed > time_out_value) {
jam();
- timeOutFoundLab(signal, TapiConPtr);
+ timeOutFoundLab(signal, api_con_ptr);
return;
- }//if
- }//if
- }//for
- /*------------------------------------------------------------------*/
- /* */
- /* WE HAVE NOW CHECKED ALL TRANSACTIONS FOR TIME-OUT AND ALSO */
- /* STARTED TIME-OUT HANDLING OF THOSE WE FOUND. WE ARE NOW */
- /* READY AND CAN WAIT FOR THE NEXT TIME-OUT CHECK. */
- /*------------------------------------------------------------------*/
- ctimeOutCheckActive = TOCS_FALSE;
+ }
+ }
+ }
+ if (api_con_ptr == api_con_sz) {
+ jam();
+ /*------------------------------------------------------------------*/
+ /* */
+ /* WE HAVE NOW CHECKED ALL TRANSACTIONS FOR TIME-OUT AND ALSO */
+ /* STARTED TIME-OUT HANDLING OF THOSE WE FOUND. WE ARE NOW */
+ /* READY AND CAN WAIT FOR THE NEXT TIME-OUT CHECK. */
+ /*------------------------------------------------------------------*/
+ ctimeOutCheckActive = TOCS_FALSE;
+ } else {
+ jam();
+ sendContinueTimeOutControl(signal, api_con_ptr);
+ }
+ return;
}//Dbtc::timeOutLoopStartLab()
void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
@@ -10032,7 +10054,6 @@ void Dbtc::inithost(Signal* signal)
hostptr.p->inPackedList = false;
hostptr.p->takeOverStatus = TOS_NOT_DEFINED;
hostptr.p->lqhTransStatus = LTS_IDLE;
- hostptr.p->ndbVersion = ZNIL;
hostptr.p->noOfWordsTCKEYCONF = 0;
hostptr.p->noOfWordsTCINDXCONF = 0;
hostptr.p->noOfPackedWordsLqh = 0;
@@ -10040,7 +10061,8 @@ void Dbtc::inithost(Signal* signal)
}//for
}//Dbtc::inithost()
-void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0)
+void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0,
+ Uint32 retRef, Uint32 retData)
{
switch (Tdata0) {
case 0:
@@ -10090,7 +10112,14 @@ void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0)
case 11:
jam();
initTcFail(signal);
- returnInitialiseRecordsLab(signal);
+
+ {
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = retData;
+ sendSignal(retRef, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
+ }
return;
break;
default:
@@ -10099,10 +10128,19 @@ void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0)
return;
break;
}//switch
- sendInitialiseRecords(signal, (Tdata0 + 1));
- return;
-}//Dbtc::initialiseRecordsLab()
+ signal->theData[0] = TcContinueB::ZINITIALISE_RECORDS;
+ signal->theData[1] = Tdata0 + 1;
+ signal->theData[2] = 0;
+ signal->theData[3] = retRef;
+ signal->theData[4] = retData;
+ sendSignal(DBTC_REF, GSN_CONTINUEB, signal, 5, JBB);
+}
+
+/* ========================================================================= */
+/* ======= INITIALISE_SCANREC ======= */
+/* */
+/* ========================================================================= */
void Dbtc::initialiseScanrec(Signal* signal)
{
ndbrequire(cscanrecFileSize > 0);
@@ -10529,18 +10567,6 @@ void Dbtc::sendContinueTimeOutControl(Signal* signal, Uint32 TapiConPtr)
sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
}//Dbtc::sendContinueTimeOutControl()
-/* -------------------------------------------------------------------------
- * SEND REAL-TIME BREAK DURING INITIALISATION OF VARIABLES DURING
- * SYSTEM RESTART.
- * ------------------------------------------------------------------------- */
-void Dbtc::sendInitialiseRecords(Signal* signal, UintR Tnext)
-{
- signal->theData[0] = TcContinueB::ZINITIALISE_RECORDS;
- signal->theData[1] = Tnext;
- signal->theData[2] = 0;
- sendSignal(DBTC_REF, GSN_CONTINUEB, signal, 3, JBB);
-}//Dbtc::sendInitialiseRecords()
-
void Dbtc::sendKeyinfo(Signal* signal, BlockReference TBRef, Uint32 len)
{
signal->theData[0] = tcConnectptr.i;
@@ -10861,7 +10887,7 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal)
void Dbtc::execSET_VAR_REQ(Signal* signal)
{
-
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
int val = setVarReq->value();
@@ -10886,7 +10912,7 @@ void Dbtc::execSET_VAR_REQ(Signal* signal)
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
} // switch
-
+#endif
}
void Dbtc::execABORT_ALL_REQ(Signal* signal)
@@ -10933,7 +10959,6 @@ void Dbtc::execABORT_ALL_REQ(Signal* signal)
c_abortRec.oldTimeOutValue = ctimeOutValue;
ctimeOutValue = 0;
-
const Uint32 sleepTime = (2 * 10 * ctimeOutCheckDelay + 199) / 200;
checkAbortAllTimeout(signal, (sleepTime == 0 ? 1 : sleepTime));
diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am
new file mode 100644
index 00000000000..4aa514c0aba
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbtc/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libdbtc.a
+
+libdbtc_a_SOURCES = DbtcInit.cpp DbtcMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbtc/Makefile b/ndb/src/kernel/blocks/dbtc/Makefile_old
index ae876ab1f84..ae876ab1f84 100644
--- a/ndb/src/kernel/blocks/dbtc/Makefile
+++ b/ndb/src/kernel/blocks/dbtc/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
index 053b853fa82..4781230a311 100644
--- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
@@ -996,6 +996,31 @@ public:
Dbtup(const class Configuration &);
virtual ~Dbtup();
+ /*
+ * TUX uses logical tuple address when talking to ACC and LQH.
+ */
+ void tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32& tupAddr);
+
+ /*
+ * TUX index in TUP has single Uint32 array attribute which stores an
+ * index node. TUX reads and writes the node directly via pointer.
+ */
+ int tuxAllocNode(Signal* signal, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node);
+ void tuxFreeNode(Signal* signal, Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node);
+ void tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node);
+
+ /*
+ * TUX reads primary table attributes for index keys. Input is
+ * attribute ids in AttributeHeader format. Output is pointers to
+ * attribute data within tuple or 0 for NULL value.
+ */
+ void tuxReadAttrs(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion, Uint32 numAttrs, const Uint32* attrIds, const Uint32** attrData);
+
+ /*
+ * TUX reads primary key for md5 summing and when returning keyinfo.
+ */
+ void tuxReadKeys(); // under construction
+
private:
BLOCK_DEFINES(Dbtup);
@@ -1029,7 +1054,7 @@ private:
void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execDROP_TAB_REQ(Signal* signal);
void execALTER_TAB_REQ(Signal* signal);
@@ -1900,7 +1925,7 @@ private:
void releaseTabDescr(Tablerec* const regTabPtr);
void getFragmentrec(FragrecordPtr& regFragPtr, Uint32 fragId, Tablerec* const regTabPtr);
- void initialiseRecordsLab(Signal* signal, Uint32 switchData);
+ void initialiseRecordsLab(Signal* signal, Uint32 switchData, Uint32, Uint32);
void initializeAttrbufrec();
void initializeCheckpointInfoRec();
void initializeDiskBufferSegmentRecord();
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index 982e1b8df24..095ea412701 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -27,10 +27,8 @@
#include <signaldata/FsConf.hpp>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsRemoveReq.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/TupCommit.hpp>
#include <signaldata/TupKey.hpp>
-#include <signaldata/TupSizeAltReq.hpp>
#include <signaldata/DropTab.hpp>
#include <new>
@@ -118,7 +116,7 @@ Dbtup::Dbtup(const class Configuration & conf)
addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbtup::execFSREADREF);
addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR);
- addRecSignal(GSN_SIZEALT_REP, &Dbtup::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ);
// Trigger Signals
@@ -538,7 +536,8 @@ void Dbtup::execCONTINUEB(Signal* signal)
break;
case ZINITIALISE_RECORDS:
ljam();
- initialiseRecordsLab(signal, dataPtr);
+ initialiseRecordsLab(signal, dataPtr,
+ signal->theData[2], signal->theData[3]);
break;
case ZREL_FRAG:
ljam();
@@ -610,22 +609,37 @@ void Dbtup::execSTTOR(Signal* signal)
// SIZE_ALTREP INITIALIZE DATA STRUCTURES, FILES AND DS VARIABLES, GET READY FOR EXTERNAL
// CONNECTIONS.
/************************************************************************************************/
-void Dbtup::execSIZEALT_REP(Signal* signal)
+void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
{
- BlockReference tsizealtBlockRef;
-
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
ljamEntry();
- tsizealtBlockRef = signal->theData[TupSizeAltReq::IND_BLOCK_REF];
- cnoOfFragrec = signal->theData[TupSizeAltReq::IND_FRAG];
- cnoOfOprec = signal->theData[TupSizeAltReq::IND_OP_RECS];
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec));
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &cnoOfOprec));
+
// MemorySpaceTuples is specified in 8k pages, divide by 4 for 32k pages
- Uint64 noOfWords = (signal->theData[TupSizeAltReq::IND_PAGE] * 2048) + (ZWORDS_ON_PAGE - 1);
- Uint64 noOfPages = noOfWords / (Uint64)ZWORDS_ON_PAGE;
- cnoOfPage = (Uint32)noOfPages;
- initPageRangeSize(signal->theData[TupSizeAltReq::IND_PAGE_RANGE]);
- cnoOfTablerec = signal->theData[TupSizeAltReq::IND_TABLE];
- cnoOfTabDescrRec = signal->theData[TupSizeAltReq::IND_TABLE_DESC];
- Uint32 noOfStoredProc = signal->theData[TupSizeAltReq::IND_STORED_PROC];
+ Uint32 tmp;
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &tmp));
+ Uint64 pages = (tmp * 2048 + (ZWORDS_ON_PAGE - 1))/ (Uint64)ZWORDS_ON_PAGE;
+ cnoOfPage = (Uint32)pages;
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE_RANGE, &tmp));
+ initPageRangeSize(tmp);
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE_DESC,
+ &cnoOfTabDescrRec));
+ Uint32 noOfStoredProc;
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_STORED_PROC,
+ &noOfStoredProc));
cnoOfTabDescrRec = (cnoOfTabDescrRec & 0xFFFFFFF0) + 16;
c_storedProcPool.setSize(noOfStoredProc);
@@ -639,7 +653,14 @@ void Dbtup::execSIZEALT_REP(Signal* signal)
cnoOfLocalLogInfo = 0;
cnoFreeUndoSeg = 0;
- initialiseRecordsLab(signal, 0);
+ initialiseRecordsLab(signal, 0, ref, senderData);
+
+ clblPagesPerTick = 50;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick);
+
+ clblPagesPerTickAfterSr = 50;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr);
+
}//Dbtup::execSIZEALT_REP()
void Dbtup::initRecords()
@@ -732,7 +753,8 @@ void Dbtup::initRecords()
bat[2].bits.v = 5;
}//Dbtup::initRecords()
-void Dbtup::initialiseRecordsLab(Signal* signal, Uint32 switchData)
+void Dbtup::initialiseRecordsLab(Signal* signal, Uint32 switchData,
+ Uint32 retRef, Uint32 retData)
{
switch (switchData) {
case 0:
@@ -794,19 +816,24 @@ void Dbtup::initialiseRecordsLab(Signal* signal, Uint32 switchData)
case 14:
ljam();
initializeRestartInfoRec();
- signal->theData[0] = cownref;
- sendSignal(CMVMI_REF, GSN_SIZEALT_ACK, signal, 1, JBB);
+
+ {
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = retData;
+ sendSignal(retRef, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
+ }
return;
default:
ndbrequire(false);
break;
}//switch
-/******************************************************************************/
-/* SEND REAL-TIME BREAK DURING INITIALISATION OF VARIABLES IN SYSTEM RESTART */
-/******************************************************************************/
signal->theData[0] = ZINITIALISE_RECORDS;
signal->theData[1] = switchData + 1;
- sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
+ signal->theData[2] = retRef;
+ signal->theData[3] = retData;
+ sendSignal(reference(), GSN_CONTINUEB, signal, 4, JBB);
return;
}//Dbtup::initialiseRecordsLab()
@@ -816,8 +843,6 @@ void Dbtup::execNDB_STTOR(Signal* signal)
cndbcntrRef = signal->theData[0];
Uint32 ownNodeId = signal->theData[1];
Uint32 startPhase = signal->theData[2];
- Uint32 data1 = signal->theData[14];
- Uint32 data2 = signal->theData[15];
switch (startPhase) {
case ZSTARTPHASE1:
ljam();
@@ -829,7 +854,7 @@ void Dbtup::execNDB_STTOR(Signal* signal)
break;
case ZSTARTPHASE3:
ljam();
- startphase3Lab(signal, data1, data2);
+ startphase3Lab(signal, ~0, ~0);
break;
case ZSTARTPHASE4:
ljam();
@@ -856,20 +881,6 @@ void Dbtup::execNDB_STTOR(Signal* signal)
void Dbtup::startphase3Lab(Signal* signal, Uint32 config1, Uint32 config2)
{
- if (config1 > 0) {
- ljam();
- clblPagesPerTick = config1;
- } else {
- ljam();
- clblPagesPerTick = 1;
- }//if
- if (config2 > 0) {
- ljam();
- clblPagesPerTickAfterSr = config2;
- } else {
- ljam();
- clblPagesPerTickAfterSr = 1;
- }//if
clblPageCounter = clblPagesPerTick;
signal->theData[0] = ZLOAD_BAL_LCP_TIMER;
sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 100, 1);
@@ -1291,6 +1302,7 @@ void Dbtup::seizePendingFileOpenInfoRecord(PendingFileOpenInfoPtr& pfoiPtr)
void Dbtup::execSET_VAR_REQ(Signal* signal)
{
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)signal->getDataPtrSend();
ConfigParamId var = setVarReq->variable();
int val = setVarReq->value();
@@ -1310,7 +1322,7 @@ void Dbtup::execSET_VAR_REQ(Signal* signal)
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
} // switch
-
+#endif
}//execSET_VAR_REQ()
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
index 3a074f7fe5b..f11de5238e2 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp
@@ -31,6 +31,154 @@
// methods used by ordered index
void
+Dbtup::tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32& tupAddr)
+{
+ ljamEntry();
+ FragrecordPtr fragPtr;
+ fragPtr.i = fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+ TablerecPtr tablePtr;
+ tablePtr.i = fragPtr.p->fragTableId;
+ ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+ PagePtr pagePtr;
+ pagePtr.i = pageId;
+ ptrCheckGuard(pagePtr, cnoOfPage, page);
+ Uint32 fragPageId = pagePtr.p->pageWord[ZPAGE_FRAG_PAGE_ID_POS];
+ Uint32 tupheadsize = tablePtr.p->tupheadsize;
+ ndbrequire(pageOffset >= ZPAGE_HEADER_SIZE);
+ Uint32 offset = pageOffset - ZPAGE_HEADER_SIZE;
+ ndbrequire(offset % tupheadsize == 0);
+ Uint32 pageIndex = (offset / tupheadsize) << 1;
+ tupAddr = (fragPageId << MAX_TUPLES_BITS) | pageIndex;
+}
+
+int
+Dbtup::tuxAllocNode(Signal* signal, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node)
+{
+ ljamEntry();
+ FragrecordPtr fragPtr;
+ fragPtr.i = fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+ TablerecPtr tablePtr;
+ tablePtr.i = fragPtr.p->fragTableId;
+ ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+ PagePtr pagePtr;
+ terrorCode = 0;
+ if (! allocTh(fragPtr.p, tablePtr.p, NORMAL_PAGE, signal, pageOffset, pagePtr)) {
+ ljam();
+ ndbrequire(terrorCode != 0);
+ return terrorCode;
+ }
+ pageId = pagePtr.i;
+ Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
+ Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr);
+ node = &pagePtr.p->pageWord[pageOffset] + attrDataOffset;
+ return 0;
+}
+
+void
+Dbtup::tuxFreeNode(Signal* signal, Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node)
+{
+ ljamEntry();
+ FragrecordPtr fragPtr;
+ fragPtr.i = fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+ TablerecPtr tablePtr;
+ tablePtr.i = fragPtr.p->fragTableId;
+ ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+ PagePtr pagePtr;
+ pagePtr.i = pageId;
+ ptrCheckGuard(pagePtr, cnoOfPage, page);
+ Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
+ Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr);
+ ndbrequire(node == &pagePtr.p->pageWord[pageOffset] + attrDataOffset);
+ freeTh(fragPtr.p, tablePtr.p, signal, pagePtr.p, pageOffset);
+}
+
+void
+Dbtup::tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node)
+{
+ ljamEntry();
+ FragrecordPtr fragPtr;
+ fragPtr.i = fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+ TablerecPtr tablePtr;
+ tablePtr.i = fragPtr.p->fragTableId;
+ ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+ PagePtr pagePtr;
+ pagePtr.i = pageId;
+ ptrCheckGuard(pagePtr, cnoOfPage, page);
+ Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE);
+ Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr);
+ node = &pagePtr.p->pageWord[pageOffset] + attrDataOffset;
+}
+
+void
+Dbtup::tuxReadAttrs(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion, Uint32 numAttrs, const Uint32* attrIds, const Uint32** attrData)
+{
+ ljamEntry();
+ FragrecordPtr fragPtr;
+ fragPtr.i = fragPtrI;
+ ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
+ TablerecPtr tablePtr;
+ tablePtr.i = fragPtr.p->fragTableId;
+ ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
+ PagePtr pagePtr;
+ pagePtr.i = pageId;
+ ptrCheckGuard(pagePtr, cnoOfPage, page);
+ // search for tuple version if not original
+ if (pagePtr.p->pageWord[pageOffset + 1] != tupVersion) {
+ ljam();
+ OperationrecPtr opPtr;
+ opPtr.i = pagePtr.p->pageWord[pageOffset];
+ Uint32 loopGuard = 0;
+ while (true) {
+ ptrCheckGuard(opPtr, cnoOfOprec, operationrec);
+ if (opPtr.p->realPageIdC != RNIL) {
+ pagePtr.i = opPtr.p->realPageIdC;
+ pageOffset = opPtr.p->pageOffsetC;
+ ptrCheckGuard(pagePtr, cnoOfPage, page);
+ if (pagePtr.p->pageWord[pageOffset + 1] == tupVersion) {
+ ljam();
+ break;
+ }
+ }
+ ljam();
+ opPtr.i = opPtr.p->nextActiveOp;
+ ndbrequire(++loopGuard < (1 << ZTUP_VERSION_BITS));
+ }
+ }
+ const Uint32 tabDescriptor = tablePtr.p->tabDescriptor;
+ const Uint32* tupleHeader = &pagePtr.p->pageWord[pageOffset];
+ for (Uint32 i = 0; i < numAttrs; i++) {
+ AttributeHeader ah(attrIds[i]);
+ Uint32 attrId = ah.getAttributeId();
+ Uint32 index = tabDescriptor + (attrId << ZAD_LOG_SIZE);
+ Uint32 desc1 = tableDescriptor[index].tabDescr;
+ Uint32 desc2 = tableDescriptor[index + 1].tabDescr;
+ if (AttributeDescriptor::getNullable(desc1)) {
+ Uint32 offset = AttributeOffset::getNullFlagOffset(desc2);
+ ndbrequire(offset < tablePtr.p->tupNullWords);
+ offset += tablePtr.p->tupNullIndex;
+ ndbrequire(offset < tablePtr.p->tupheadsize);
+ if (AttributeOffset::isNULL(tupleHeader[offset], desc2)) {
+ ljam();
+ attrData[i] = 0;
+ continue;
+ }
+ }
+ attrData[i] = tupleHeader + AttributeOffset::getOffset(desc2);
+ }
+}
+
+void // under construction
+Dbtup::tuxReadKeys()
+{
+}
+
+// deprecated signal interfaces
+
+void
Dbtup::execTUP_READ_ATTRS(Signal* signal)
{
ljamEntry();
@@ -168,10 +316,10 @@ Dbtup::execTUP_QUERY_TH(Signal* signal)
for this transaction and savepoint id. If its tuple version equals
the requested then we have a visible tuple otherwise not.
*/
- jam();
+ ljam();
Uint32 read_tupVersion = pagePtr.p->pageWord[tempOp.pageOffset + 1];
if (read_tupVersion == req_tupVersion) {
- jam();
+ ljam();
ret_result = 1;
}
}
@@ -425,7 +573,8 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI)
buildPtr.p->m_tupleNo = 0;
break;
}
- pagePtr.i = getRealpid(fragPtr.p, buildPtr.p->m_pageId);
+ Uint32 realPageId = getRealpid(fragPtr.p, buildPtr.p->m_pageId);
+ pagePtr.i = realPageId;
ptrCheckGuard(pagePtr, cnoOfPage, page);
const Uint32 pageState = pagePtr.p->pageWord[ZPAGE_STATE_POS];
if (pageState != ZTH_MM_FREE &&
@@ -439,8 +588,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI)
}
// get tuple
const Uint32 tupheadsize = tablePtr.p->tupheadsize;
- const Uint32 pageOffset = ZPAGE_HEADER_SIZE +
- buildPtr.p->m_tupleNo * tupheadsize;
+ Uint32 pageOffset = ZPAGE_HEADER_SIZE + buildPtr.p->m_tupleNo * tupheadsize;
if (pageOffset + tupheadsize > ZWORDS_ON_PAGE) {
ljam();
buildPtr.p->m_pageId++;
@@ -472,15 +620,14 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI)
buildPtr.p->m_tupleNo++;
break;
}
+ Uint32 tupVersion = pagePtr.p->pageWord[pageOffset + 1];
OperationrecPtr pageOperPtr;
pageOperPtr.i = pagePtr.p->pageWord[pageOffset];
- Uint32 pageId = buildPtr.p->m_pageId;
- Uint32 pageIndex = buildPtr.p->m_tupleNo << 1;
if (pageOperPtr.i != RNIL) {
/*
If there is an ongoing operation on the tuple then it is either a
copy tuple or an original tuple with an ongoing transaction. In
- both cases fragPageId and pageIndex refers to the original tuple.
+ both cases realPageId and pageOffset refer to the original tuple.
The tuple address stored in TUX will always be the original tuple
but with the tuple version of the tuple we found.
@@ -490,12 +637,11 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI)
tuple as a copy tuple. The original tuple is stable and is thus
preferrable to store in TUX.
*/
- jam();
+ ljam();
ptrCheckGuard(pageOperPtr, cnoOfOprec, operationrec);
- pageId = pageOperPtr.p->fragPageId;
- pageIndex = pageOperPtr.p->pageIndex;
+ realPageId = pageOperPtr.p->realPageId;
+ pageOffset = pageOperPtr.p->pageOffset;
}//if
- Uint32 tup_version = pagePtr.p->pageWord[pageOffset + 1];
#ifdef TIME_MEASUREMENT
NdbTick_getMicroTimer(&start);
#endif
@@ -505,8 +651,9 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI)
req->tableId = tablePtr.i;
req->indexId = triggerPtr.p->indexId;
req->fragId = tablePtr.p->fragid[buildPtr.p->m_fragNo];
- req->tupAddr = (pageId << MAX_TUPLES_BITS) | pageIndex;
- req->tupVersion = tup_version;
+ req->pageId = realPageId;
+ req->pageOffset = pageOffset;
+ req->tupVersion = tupVersion;
req->opInfo = TuxMaintReq::OpAdd;
EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ,
signal, TuxMaintReq::SignalLength);
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
index 6fceea31150..a93ff4566e7 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
@@ -962,7 +962,8 @@ Dbtup::executeTuxInsertTriggers(Signal* signal,
// fill in constant part
req->tableId = regOperPtr->tableRef;
req->fragId = regOperPtr->fragId;
- req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex;
+ req->pageId = regOperPtr->realPageId;
+ req->pageOffset = regOperPtr->pageOffset;
req->tupVersion = tupVersion;
req->opInfo = TuxMaintReq::OpAdd;
// loop over index list
@@ -1000,7 +1001,8 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
// fill in constant part
req->tableId = regOperPtr->tableRef;
req->fragId = regOperPtr->fragId;
- req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex;
+ req->pageId = regOperPtr->realPageId;
+ req->pageOffset = regOperPtr->pageOffset;
req->tupVersion = tupVersion;
req->opInfo = TuxMaintReq::OpAdd;
// loop over index list
@@ -1009,7 +1011,6 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
triggerList.first(triggerPtr);
while (triggerPtr.i != RNIL) {
ljam();
- req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex;
req->indexId = triggerPtr.p->indexId;
req->errorCode = RNIL;
EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ,
@@ -1074,7 +1075,8 @@ Dbtup::executeTuxCommitTriggers(Signal* signal,
// fill in constant part
req->tableId = regOperPtr->tableRef;
req->fragId = regOperPtr->fragId;
- req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex;
+ req->pageId = regOperPtr->realPageId;
+ req->pageOffset = regOperPtr->pageOffset;
req->tupVersion = tupVersion;
req->opInfo = TuxMaintReq::OpRemove;
// loop over index list
@@ -1117,7 +1119,8 @@ Dbtup::executeTuxAbortTriggers(Signal* signal,
// fill in constant part
req->tableId = regOperPtr->tableRef;
req->fragId = regOperPtr->fragId;
- req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex;
+ req->pageId = regOperPtr->realPageId;
+ req->pageOffset = regOperPtr->pageOffset;
req->tupVersion = tupVersion;
req->opInfo = TuxMaintReq::OpRemove;
// loop over index list
diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am
new file mode 100644
index 00000000000..7e94a01d43b
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbtup/Makefile.am
@@ -0,0 +1,27 @@
+noinst_LIBRARIES = libdbtup.a
+
+libdbtup_a_SOURCES = \
+ DbtupExecQuery.cpp \
+ DbtupBuffer.cpp \
+ DbtupRoutines.cpp \
+ DbtupCommit.cpp \
+ DbtupFixAlloc.cpp \
+ DbtupTrigger.cpp \
+ DbtupAbort.cpp \
+ DbtupLCP.cpp \
+ DbtupUndoLog.cpp \
+ DbtupPageMap.cpp \
+ DbtupPagMan.cpp \
+ DbtupStoredProcDef.cpp \
+ DbtupMeta.cpp \
+ DbtupTabDesMan.cpp \
+ DbtupGen.cpp \
+ DbtupSystemRestart.cpp \
+ DbtupIndex.cpp \
+ DbtupDebug.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbtup/Makefile b/ndb/src/kernel/blocks/dbtup/Makefile_old
index 87146f4b441..87146f4b441 100644
--- a/ndb/src/kernel/blocks/dbtup/Makefile
+++ b/ndb/src/kernel/blocks/dbtup/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
index 4737c8422c4..25e85ba9f5f 100644
--- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
@@ -20,15 +20,18 @@
#include <new>
#include <ndb_limits.h>
#include <SimulatedBlock.hpp>
+#include <AttributeDescriptor.hpp>
#include <AttributeHeader.hpp>
#include <ArrayPool.hpp>
#include <DataBuffer.hpp>
#include <md5_hash.hpp>
+// big brother
+#include <Dbtup.hpp>
+
// signal classes
#include <signaldata/DictTabInfo.hpp>
#include <signaldata/TuxContinueB.hpp>
-#include <signaldata/TuxSizeAltReq.hpp>
#include <signaldata/BuildIndx.hpp>
#include <signaldata/TupFrag.hpp>
#include <signaldata/AlterIndx.hpp>
@@ -82,6 +85,10 @@
#define jam() jamLine(90000 + __LINE__)
#define jamEntry() jamEntryLine(90000 + __LINE__)
#endif
+#ifndef jam
+#define jam() jamLine(__LINE__)
+#define jamEntry() jamEntryLine(__LINE__)
+#endif
#undef max
#undef min
@@ -93,17 +100,17 @@ public:
Dbtux(const Configuration& conf);
virtual ~Dbtux();
+ // pointer to TUP instance in this thread
+ Dbtup* c_tup;
+
private:
// sizes are in words (Uint32)
static const unsigned MaxIndexFragments = 2 * NO_OF_FRAG_PER_NODE;
static const unsigned MaxIndexAttributes = MAX_ATTRIBUTES_IN_INDEX;
-#ifdef VM_TRACE
- static const unsigned MaxNodeHandles = 10000; // More space for printTree
-#else
- static const unsigned MaxNodeHandles = 128; // enough for 1 operation
-#endif
static const unsigned MaxAttrDataSize = 2048;
+public:
static const unsigned DescPageSize = 256;
+private:
static const unsigned MaxTreeNodeSize = MAX_TTREE_NODE_SIZE;
static const unsigned ScanBoundSegmentSize = 7;
static const unsigned MaxAccLockOps = MAX_PARALLEL_OP_PER_SCAN;
@@ -113,7 +120,7 @@ private:
struct DescEnt;
/*
- * Pointer to Uint32 data. Interpretation is context dependent.
+ * Pointer to array of Uint32.
*/
struct Data {
private:
@@ -126,10 +133,13 @@ private:
Data& operator+=(size_t n);
AttributeHeader& ah() const;
};
+ friend class Data;
/*
- * Pointer to constant Uint32 data.
+ * Pointer to array of constant Uint32.
*/
+ struct ConstData;
+ friend struct ConstData;
struct ConstData {
private:
const Uint32* m_data;
@@ -149,8 +159,12 @@ private:
static const unsigned AttributeHeaderSize = 1;
/*
- * Logical tuple address, "local key". Identifies both table tuples
- * and index tuples. The code assumes it is one word.
+ * Array of pointers to TUP table attributes. Always read-on|y.
+ */
+ typedef const Uint32** TableData;
+
+ /*
+ * Logical tuple address, "local key". Identifies table tuples.
*/
typedef Uint32 TupAddr;
static const unsigned NullTupAddr = (Uint32)-1;
@@ -164,20 +178,32 @@ private:
Uint32 m_pageId; // page i-value
Uint16 m_pageOffset; // page offset in words
TupLoc();
+ TupLoc(Uint32 pageId, Uint16 pageOffset);
+ bool operator==(const TupLoc& loc) const;
+ bool operator!=(const TupLoc& loc) const;
};
+ /*
+ * There is no const member NullTupLoc since the compiler may not be
+ * able to optimize it to TupLoc() constants. Instead null values are
+ * constructed on the stack with TupLoc().
+ */
+#define NullTupLoc TupLoc()
+
// tree definitions
/*
- * Tree entry. Points to a tuple in primary table via logical address
- * of "original" tuple and tuple version. Uses 2 words to get correct
- * aligment (one byte is wasted currently).
+ * Tree entry. Points to a tuple in primary table via physical
+ * address of "original" tuple and tuple version.
+ *
+ * ZTUP_VERSION_BITS must be 15 (or less).
*/
+ struct TreeEnt;
+ friend struct TreeEnt;
struct TreeEnt {
- TupAddr m_tupAddr; // address of original tuple
- Uint16 m_tupVersion; // version
- Uint8 m_fragBit; // which duplicated table fragment
- Uint8 unused1;
+ TupLoc m_tupLoc; // address of original tuple
+ unsigned m_tupVersion : 15; // version
+ unsigned m_fragBit : 1; // which duplicated table fragment
TreeEnt();
// methods
int cmp(const TreeEnt ent) const;
@@ -190,7 +216,7 @@ private:
* prefix 3) max and min entries 4) rest of entries 5) one extra entry
* used as work space.
*
- * struct TreeNode part 1
+ * struct TreeNode part 1, size 6 words
* min prefix part 2, size TreeHead::m_prefSize
* max prefix part 2, size TreeHead::m_prefSize
* max entry part 3
@@ -198,16 +224,23 @@ private:
* rest of entries part 4
* work entry part 5
*
+ * There are 3 links to other nodes: left child, right child, parent.
+ * These are in TupLoc format but the pageIds and pageOffsets are
+ * stored in separate arrays (saves 1 word).
+ *
* Occupancy (number of entries) is at least 1 except temporarily when
* a node is about to be removed. If occupancy is 1, only max entry
* is present but both min and max prefixes are set.
*/
+ struct TreeNode;
+ friend struct TreeNode;
struct TreeNode {
- TupAddr m_link[3]; // link to 0-left child 1-right child 2-parent
- Uint8 m_side; // we are 0-left child 1-right child 2-root
+ Uint32 m_linkPI[3]; // link to 0-left child 1-right child 2-parent
+ Uint16 m_linkPO[3]; // page offsets for above real page ids
+ unsigned m_side : 2; // we are 0-left child 1-right child 2-root
+ int m_balance : 2; // balance -1, 0, +1
+ unsigned pad1 : 4;
Uint8 m_occup; // current number of entries
- Int8 m_balance; // balance -1, 0, +1
- Uint8 unused1;
Uint32 m_nodeScan; // list of scans at this node
TreeNode();
};
@@ -228,12 +261,14 @@ private:
* Tree header. There is one in each fragment. Contains tree
* parameters and address of root node.
*/
+ struct TreeHead;
+ friend struct TreeHead;
struct TreeHead {
Uint8 m_nodeSize; // words in tree node
Uint8 m_prefSize; // words in min/max prefix each
Uint8 m_minOccup; // min entries in internal node
Uint8 m_maxOccup; // max entries in node
- TupAddr m_root; // root node
+ TupLoc m_root; // root node
TreeHead();
// methods
unsigned getSize(AccSize acc) const;
@@ -248,9 +283,10 @@ private:
* also represented by position 0 of next node. Includes direction
* and copy of entry used by scan.
*/
+ struct TreePos;
+ friend struct TreePos;
struct TreePos {
- TupAddr m_addr; // logical node address
- TupLoc m_loc; // physical address
+ TupLoc m_loc; // physical node address
Uint16 m_pos; // position 0 to m_occup
Uint8 m_match; // at an existing entry
Uint8 m_dir; // from link (0-2) or within node (3)
@@ -264,6 +300,8 @@ private:
* Descriptor page. The "hot" metadata for an index is stored as
* a contiguous array of words on some page.
*/
+ struct DescPage;
+ friend struct DescPage;
struct DescPage {
Uint32 m_nextPage;
Uint32 m_numFree; // number of free words
@@ -290,10 +328,9 @@ private:
* Attribute metadata. Size must be multiple of word size.
*/
struct DescAttr {
- unsigned m_primaryAttrId : 16;
- unsigned m_typeId : 8;
- unsigned m_nullable : 1;
- unsigned pad1 : 7;
+ Uint32 m_attrDesc; // standard AttributeDescriptor
+ Uint16 m_primaryAttrId;
+ Uint16 m_typeId;
};
static const unsigned DescAttrSize = sizeof(DescAttr) >> 2;
@@ -301,6 +338,8 @@ private:
* Complete metadata for one index. The array of attributes has
* variable size.
*/
+ struct DescEnt;
+ friend struct DescEnt;
struct DescEnt {
DescHead m_descHead;
DescAttr m_descAttr[1]; // variable size data
@@ -329,6 +368,8 @@ private:
* be for an entry we were moved away from. In any case nothing
* happens with current entry before lock wait flag is cleared.
*/
+ struct ScanOp;
+ friend struct ScanOp;
struct ScanOp {
enum {
Undef = 0,
@@ -382,6 +423,8 @@ private:
* Ordered index. Top level data structure. The primary table (table
* being indexed) lives in TUP.
*/
+ struct Index;
+ friend struct Index;
struct Index {
enum State {
NotDefined = 0,
@@ -412,6 +455,8 @@ private:
* duplicate fragments known to LQH/ACC/TUP. Includes tree header.
* There are no maintenance operation records yet.
*/
+ struct Frag;
+ friend struct Frag;
struct Frag {
Uint32 m_tableId; // copy from index level
Uint32 m_indexId;
@@ -421,9 +466,11 @@ private:
Uint16 m_descOff;
Uint16 m_numAttrs;
TreeHead m_tree;
- Uint32 m_nodeList; // node cache of current operation
- Uint32 m_nodeFree; // one node pre-allocated for insert
+ TupLoc m_freeLoc; // one node pre-allocated for insert
DLList<ScanOp> m_scanList; // current scans on this fragment
+ Uint32 m_tupIndexFragPtrI;
+ Uint32 m_tupTableFragPtrI[2];
+ Uint32 m_accTableFragPtrI[2];
union {
Uint32 nextPool;
};
@@ -454,61 +501,39 @@ private:
// node handles
/*
- * A tree operation builds a cache of accessed nodes. This allows
- * different implementations of index memory access. The cache is
- * committed and released at the end of the operation.
+ * A node handle is a reference to a tree node in TUP. It is used to
+ * operate on the node. Node handles are allocated on the stack.
*/
+ struct NodeHandle;
+ friend struct NodeHandle;
struct NodeHandle {
- enum Flags {
- // bits 0,1 mark need for left,right prefix
- DoInsert = (1 << 2),
- DoDelete = (1 << 3),
- DoUpdate = (1 << 4)
- };
- Dbtux& m_tux; // this block
Frag& m_frag; // fragment using the node
- TupAddr m_addr; // logical node address
TupLoc m_loc; // physical node address
- AccSize m_acc; // accessed size
- unsigned m_flags; // flags
- union {
- Uint32 m_next; // next active node under fragment
- Uint32 nextPool;
- };
TreeNode* m_node; // pointer to node storage
- Uint32 m_cache[MaxTreeNodeSize];
- NodeHandle(Dbtux& tux, Frag& frag);
+ AccSize m_acc; // accessed size
+ NodeHandle(Frag& frag);
+ NodeHandle(const NodeHandle& node);
+ NodeHandle& operator=(const NodeHandle& node);
// getters
- TupAddr getLink(unsigned i);
+ TupLoc getLink(unsigned i);
unsigned getChilds(); // cannot spell
unsigned getSide();
unsigned getOccup();
int getBalance();
Uint32 getNodeScan();
- Data getPref(unsigned i);
- TreeEnt getEnt(unsigned pos);
- TreeEnt getMinMax(unsigned i);
// setters
- void setLink(unsigned i, TupAddr addr);
+ void setLink(unsigned i, TupLoc loc);
void setSide(unsigned i);
void setOccup(unsigned n);
void setBalance(int b);
void setNodeScan(Uint32 scanPtrI);
- // operations XXX maybe these should move to Dbtux level
- void pushUp(Signal* signal, unsigned pos, const TreeEnt& ent);
- void popDown(Signal* signal, unsigned pos, TreeEnt& ent);
- void pushDown(Signal* signal, unsigned pos, TreeEnt& ent);
- void popUp(Signal* signal, unsigned pos, TreeEnt& ent);
- void slide(Signal* signal, Ptr<NodeHandle> nodePtr, unsigned i);
- void linkScan(Dbtux::ScanOpPtr scanPtr);
- void unlinkScan(Dbtux::ScanOpPtr scanPtr);
- bool islinkScan(Dbtux::ScanOpPtr scanPtr);
- // for ndbrequire
- void progError(int line, int cause, const char* extra);
+ // access other parts of the node
+ Data getPref(unsigned i);
+ TreeEnt getEnt(unsigned pos);
+ TreeEnt getMinMax(unsigned i);
+ // for ndbrequire and ndbassert
+ void progError(int line, int cause, const char* file);
};
- typedef Ptr<NodeHandle> NodeHandlePtr;
- ArrayPool<NodeHandle> c_nodeHandlePool;
- friend class NodeHandle;
// parameters for methods
@@ -528,6 +553,8 @@ private:
/*
* Read index key attributes.
*/
+ struct ReadPar;
+ friend struct ReadPar;
struct ReadPar {
TreeEnt m_ent; // tuple to read
unsigned m_first; // first index attribute
@@ -538,40 +565,10 @@ private:
};
/*
- * Node storage operation.
- */
- struct StorePar {
- TupStoreTh::OpCode m_opCode;// operation code
- unsigned m_offset; // data offset in words
- unsigned m_size; // number of words
- Uint32 m_errorCode; // terrorCode from TUP
- StorePar();
- };
-
- /*
- * Tree search for entry.
- */
- struct SearchPar {
- ConstData m_data; // input index key values
- TreeEnt m_ent; // input tuple and version
- SearchPar();
- };
-
- /*
- * Attribute data comparison.
- */
- struct CmpPar {
- ConstData m_data1; // full search key
- ConstData m_data2; // full or prefix data
- unsigned m_len2; // words in data2 buffer
- unsigned m_first; // first attribute
- unsigned m_numEq; // number of initial equal attributes
- CmpPar();
- };
-
- /*
* Scan bound comparison.
*/
+ struct BoundPar;
+ friend struct BoundPar;
struct BoundPar {
ConstData m_data1; // full bound data
ConstData m_data2; // full or prefix data
@@ -588,9 +585,12 @@ private:
*/
void execCONTINUEB(Signal* signal);
void execSTTOR(Signal* signal);
- void execSIZEALT_REP(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
// utils
+ void setKeyAttrs(const Frag& frag);
+ void readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, TableData keyData);
void copyAttrs(Data dst, ConstData src, CopyPar& copyPar);
+ void copyAttrs(const Frag& frag, TableData data1, Data data2, unsigned maxlen2 = MaxAttrDataSize);
/*
* DbtuxMeta.cpp
@@ -602,8 +602,6 @@ private:
bool allocDescEnt(IndexPtr indexPtr);
void freeDescEnt(IndexPtr indexPtr);
void dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 senderData);
- // helpers
- DescEnt& getDescEnt(Uint32 descPage, Uint32 descOff);
/*
* DbtuxMaint.cpp
@@ -611,29 +609,35 @@ private:
void execTUX_MAINT_REQ(Signal* signal);
void tupReadAttrs(Signal* signal, const Frag& frag, ReadPar& readPar);
void tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar);
- void tupStoreTh(Signal* signal, const Frag& frag, NodeHandlePtr nodePtr, StorePar storePar);
/*
* DbtuxNode.cpp
*/
- void seizeNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr);
- void preallocNode(Signal* signal, Frag& frag, Uint32& errorCode);
- void findNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr);
- void selectNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr, AccSize acc);
- void insertNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc);
- void deleteNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr);
- void accessNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc);
- void setNodePref(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i);
- void commitNodes(Signal* signal, Frag& frag, bool updateOk);
+ int allocNode(Signal* signal, NodeHandle& node);
+ void accessNode(Signal* signal, NodeHandle& node, AccSize acc);
+ void selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc);
+ void insertNode(Signal* signal, NodeHandle& node, AccSize acc);
+ void deleteNode(Signal* signal, NodeHandle& node);
+ void setNodePref(Signal* signal, NodeHandle& node, unsigned i);
+ // node operations
+ void nodePushUp(Signal* signal, NodeHandle& node, unsigned pos, const TreeEnt& ent);
+ void nodePopDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent);
+ void nodePushDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent);
+ void nodePopUp(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent);
+ void nodeSlide(Signal* signal, NodeHandle& dstNode, NodeHandle& srcNode, unsigned i);
+ // scans linked to node
+ void linkScan(NodeHandle& node, ScanOpPtr scanPtr);
+ void unlinkScan(NodeHandle& node, ScanOpPtr scanPtr);
+ bool islinkScan(NodeHandle& node, ScanOpPtr scanPtr);
/*
* DbtuxTree.cpp
*/
- void treeSearch(Signal* signal, Frag& frag, SearchPar searchPar, TreePos& treePos);
+ void treeSearch(Signal* signal, Frag& frag, TableData searchKey, TreeEnt searchEnt, TreePos& treePos);
void treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent);
void treeRemove(Signal* signal, Frag& frag, TreePos treePos);
- void treeRotateSingle(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i);
- void treeRotateDouble(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i);
+ void treeRotateSingle(Signal* signal, Frag& frag, NodeHandle& node, unsigned i);
+ void treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i);
/*
* DbtuxScan.cpp
@@ -656,7 +660,8 @@ private:
/*
* DbtuxCmp.cpp
*/
- int cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar);
+ int cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, ConstData data2, unsigned maxlen2 = MaxAttrDataSize);
+ int cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, TableData data2);
int cmpScanBound(const Frag& frag, const BoundPar boundPar);
/*
@@ -667,23 +672,24 @@ private:
struct PrintPar {
char m_path[100]; // LR prefix
unsigned m_side; // expected side
- TupAddr m_parent; // expected parent address
+ TupLoc m_parent; // expected parent address
int m_depth; // returned depth
unsigned m_occup; // returned occupancy
bool m_ok; // returned status
PrintPar();
};
void printTree(Signal* signal, Frag& frag, NdbOut& out);
- void printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar& par);
+ void printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar& par);
+ friend class NdbOut& operator<<(NdbOut&, const TupLoc&);
friend class NdbOut& operator<<(NdbOut&, const TreeEnt&);
friend class NdbOut& operator<<(NdbOut&, const TreeNode&);
friend class NdbOut& operator<<(NdbOut&, const TreeHead&);
friend class NdbOut& operator<<(NdbOut&, const TreePos&);
friend class NdbOut& operator<<(NdbOut&, const DescAttr&);
+ friend class NdbOut& operator<<(NdbOut&, const ScanOp&);
friend class NdbOut& operator<<(NdbOut&, const Index&);
friend class NdbOut& operator<<(NdbOut&, const Frag&);
friend class NdbOut& operator<<(NdbOut&, const NodeHandle&);
- friend class NdbOut& operator<<(NdbOut&, const ScanOp&);
FILE* debugFile;
NdbOut debugOut;
unsigned debugFlags;
@@ -699,10 +705,25 @@ private:
Uint32 c_internalStartPhase;
Uint32 c_typeOfStart;
- // buffers
- Data c_keyBuffer; // search key or scan bound
+ /*
+ * Array of index key attribute ids in AttributeHeader format.
+ * Includes fixed attribute sizes. This is global data set at
+ * operation start and is not passed as a parameter.
+ */
+ Data c_keyAttrs;
- // small stuff
+ // buffer for search key data as pointers to TUP storage
+ TableData c_searchKey;
+
+ // buffer for current entry key data as pointers to TUP storage
+ TableData c_entryKey;
+
+ // buffer for scan bounds and keyinfo (primary key)
+ Data c_dataBuffer;
+
+ // inlined utils
+ DescEnt& getDescEnt(Uint32 descPage, Uint32 descOff);
+ Uint32 getTupAddr(const Frag& frag, TreeEnt ent);
static unsigned min(unsigned x, unsigned y);
static unsigned max(unsigned x, unsigned y);
};
@@ -800,19 +821,58 @@ Dbtux::ConstData::operator=(Data data)
return *this;
}
+// Dbtux::TupLoc
+
+inline
+Dbtux::TupLoc::TupLoc() :
+ m_pageId(RNIL),
+ m_pageOffset(0)
+{
+}
+
+inline
+Dbtux::TupLoc::TupLoc(Uint32 pageId, Uint16 pageOffset) :
+ m_pageId(pageId),
+ m_pageOffset(pageOffset)
+{
+}
+
+inline bool
+Dbtux::TupLoc::operator==(const TupLoc& loc) const
+{
+ return m_pageId == loc.m_pageId && m_pageOffset == loc.m_pageOffset;
+}
+
+inline bool
+Dbtux::TupLoc::operator!=(const TupLoc& loc) const
+{
+ return ! (*this == loc);
+}
+
// Dbtux::TreeEnt
+inline
+Dbtux::TreeEnt::TreeEnt() :
+ m_tupLoc(),
+ m_tupVersion(0),
+ m_fragBit(0)
+{
+}
+
inline int
Dbtux::TreeEnt::cmp(const TreeEnt ent) const
{
- // compare frags first (not optimal but makes easier to read logs)
if (m_fragBit < ent.m_fragBit)
return -1;
if (m_fragBit > ent.m_fragBit)
return +1;
- if (m_tupAddr < ent.m_tupAddr)
+ if (m_tupLoc.m_pageId < ent.m_tupLoc.m_pageId)
+ return -1;
+ if (m_tupLoc.m_pageId > ent.m_tupLoc.m_pageId)
+ return +1;
+ if (m_tupLoc.m_pageOffset < ent.m_tupLoc.m_pageOffset)
return -1;
- if (m_tupAddr > ent.m_tupAddr)
+ if (m_tupLoc.m_pageOffset > ent.m_tupLoc.m_pageOffset)
return +1;
if (m_tupVersion < ent.m_tupVersion)
return -1;
@@ -821,8 +881,36 @@ Dbtux::TreeEnt::cmp(const TreeEnt ent) const
return 0;
}
+// Dbtux::TreeNode
+
+inline
+Dbtux::TreeNode::TreeNode() :
+ m_side(2),
+ m_balance(0),
+ pad1(0),
+ m_occup(0),
+ m_nodeScan(RNIL)
+{
+ m_linkPI[0] = NullTupLoc.m_pageId;
+ m_linkPO[0] = NullTupLoc.m_pageOffset;
+ m_linkPI[1] = NullTupLoc.m_pageId;
+ m_linkPO[1] = NullTupLoc.m_pageOffset;
+ m_linkPI[2] = NullTupLoc.m_pageId;
+ m_linkPO[2] = NullTupLoc.m_pageOffset;
+}
+
// Dbtux::TreeHead
+inline
+Dbtux::TreeHead::TreeHead() :
+ m_nodeSize(0),
+ m_prefSize(0),
+ m_minOccup(0),
+ m_maxOccup(0),
+ m_root()
+{
+}
+
inline unsigned
Dbtux::TreeHead::getSize(AccSize acc) const
{
@@ -854,52 +942,10 @@ Dbtux::TreeHead::getEntList(TreeNode* node) const
return (TreeEnt*)ptr;
}
-// Dbtux
-
-// constructors
-
-inline
-Dbtux::TupLoc::TupLoc() :
- m_pageId(RNIL),
- m_pageOffset(0)
-{
-}
-
-inline
-Dbtux::TreeEnt::TreeEnt() :
- m_tupAddr(NullTupAddr),
- m_tupVersion(0),
- m_fragBit(255),
- unused1(0)
-{
-}
-
-inline
-Dbtux::TreeNode::TreeNode() :
- m_side(255),
- m_occup(0),
- m_balance(0),
- unused1(0xa1),
- m_nodeScan(RNIL)
-{
- m_link[0] = NullTupAddr;
- m_link[1] = NullTupAddr;
- m_link[2] = NullTupAddr;
-}
-
-inline
-Dbtux::TreeHead::TreeHead() :
- m_nodeSize(0),
- m_prefSize(0),
- m_minOccup(0),
- m_maxOccup(0),
- m_root(0)
-{
-}
+// Dbtux::TreePos
inline
Dbtux::TreePos::TreePos() :
- m_addr(NullTupAddr),
m_loc(),
m_pos(ZNIL),
m_match(false),
@@ -908,6 +954,8 @@ Dbtux::TreePos::TreePos() :
{
}
+// Dbtux::DescPage
+
inline
Dbtux::DescPage::DescPage() :
m_nextPage(RNIL),
@@ -922,6 +970,41 @@ Dbtux::DescPage::DescPage() :
}
}
+// Dbtux::ScanOp
+
+inline
+Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) :
+ m_state(Undef),
+ m_lockwait(false),
+ m_userPtr(RNIL),
+ m_userRef(RNIL),
+ m_tableId(RNIL),
+ m_indexId(RNIL),
+ m_fragPtrI(RNIL),
+ m_transId1(0),
+ m_transId2(0),
+ m_savePointId(0),
+ m_accLockOp(RNIL),
+ m_readCommitted(0),
+ m_lockMode(0),
+ m_keyInfo(0),
+ m_boundMin(scanBoundPool),
+ m_boundMax(scanBoundPool),
+ m_scanPos(),
+ m_lastEnt(),
+ m_nodeScan(RNIL)
+{
+ m_bound[0] = &m_boundMin;
+ m_bound[1] = &m_boundMax;
+ m_boundCnt[0] = 0;
+ m_boundCnt[1] = 0;
+ for (unsigned i = 0; i < MaxAccLockOps; i++) {
+ m_accLockOps[i] = RNIL;
+ }
+}
+
+// Dbtux::Index
+
inline
Dbtux::Index::Index() :
m_state(NotDefined),
@@ -938,6 +1021,8 @@ Dbtux::Index::Index() :
};
};
+// Dbtux::Frag
+
inline
Dbtux::Frag::Frag(ArrayPool<ScanOp>& scanOpPool) :
m_tableId(RNIL),
@@ -948,12 +1033,18 @@ Dbtux::Frag::Frag(ArrayPool<ScanOp>& scanOpPool) :
m_descOff(0),
m_numAttrs(ZNIL),
m_tree(),
- m_nodeList(RNIL),
- m_nodeFree(RNIL),
- m_scanList(scanOpPool)
+ m_freeLoc(),
+ m_scanList(scanOpPool),
+ m_tupIndexFragPtrI(RNIL)
{
+ m_tupTableFragPtrI[0] = RNIL;
+ m_tupTableFragPtrI[1] = RNIL;
+ m_accTableFragPtrI[0] = RNIL;
+ m_accTableFragPtrI[1] = RNIL;
}
+// Dbtux::FragOp
+
inline
Dbtux::FragOp::FragOp() :
m_userPtr(RNIL),
@@ -966,160 +1057,107 @@ Dbtux::FragOp::FragOp() :
{
};
+// Dbtux::NodeHandle
+
inline
-Dbtux::NodeHandle::NodeHandle(Dbtux& tux, Frag& frag) :
- m_tux(tux),
+Dbtux::NodeHandle::NodeHandle(Frag& frag) :
m_frag(frag),
- m_addr(NullTupAddr),
m_loc(),
- m_acc(AccNone),
- m_flags(0),
- m_next(RNIL),
- m_node(0)
+ m_node(0),
+ m_acc(AccNone)
{
}
inline
-Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) :
- m_state(Undef),
- m_lockwait(false),
- m_userPtr(RNIL),
- m_userRef(RNIL),
- m_tableId(RNIL),
- m_indexId(RNIL),
- m_fragPtrI(RNIL),
- m_transId1(0),
- m_transId2(0),
- m_savePointId(0),
- m_accLockOp(RNIL),
- m_readCommitted(0),
- m_lockMode(0),
- m_keyInfo(0),
- m_boundMin(scanBoundPool),
- m_boundMax(scanBoundPool),
- m_scanPos(),
- m_lastEnt(),
- m_nodeScan(RNIL)
+Dbtux::NodeHandle::NodeHandle(const NodeHandle& node) :
+ m_frag(node.m_frag),
+ m_loc(node.m_loc),
+ m_node(node.m_node),
+ m_acc(node.m_acc)
{
- m_bound[0] = &m_boundMin;
- m_bound[1] = &m_boundMax;
- m_boundCnt[0] = 0;
- m_boundCnt[1] = 0;
- for (unsigned i = 0; i < MaxAccLockOps; i++) {
- m_accLockOps[i] = RNIL;
- }
}
-inline
-Dbtux::CopyPar::CopyPar() :
- m_items(0),
- m_headers(true),
- m_maxwords(~0), // max unsigned
- // output
- m_numitems(0),
- m_numwords(0)
+inline Dbtux::NodeHandle&
+Dbtux::NodeHandle::operator=(const NodeHandle& node)
{
+ ndbassert(&m_frag == &node.m_frag);
+ m_loc = node.m_loc;
+ m_node = node.m_node;
+ m_acc = node.m_acc;
+ return *this;
}
-inline
-Dbtux::ReadPar::ReadPar() :
- m_first(0),
- m_count(0),
- m_data(0),
- m_size(0)
+inline Dbtux::TupLoc
+Dbtux::NodeHandle::getLink(unsigned i)
{
+ ndbrequire(i <= 2);
+ return TupLoc(m_node->m_linkPI[i], m_node->m_linkPO[i]);
}
-inline
-Dbtux::StorePar::StorePar() :
- m_opCode(TupStoreTh::OpUndefined),
- m_offset(0),
- m_size(0),
- m_errorCode(0)
+inline unsigned
+Dbtux::NodeHandle::getChilds()
{
+ return (getLink(0) != NullTupLoc) + (getLink(1) != NullTupLoc);
}
-inline
-Dbtux::SearchPar::SearchPar() :
- m_data(0),
- m_ent()
+inline unsigned
+Dbtux::NodeHandle::getSide()
{
+ return m_node->m_side;
}
-inline
-Dbtux::CmpPar::CmpPar() :
- m_data1(0),
- m_data2(0),
- m_len2(0),
- m_first(0),
- m_numEq(0)
+inline unsigned
+Dbtux::NodeHandle::getOccup()
{
+ return m_node->m_occup;
}
-inline
-Dbtux::BoundPar::BoundPar() :
- m_data1(0),
- m_data2(0),
- m_count1(0),
- m_len2(0),
- m_dir(255)
+inline int
+Dbtux::NodeHandle::getBalance()
{
+ return m_node->m_balance;
}
-#ifdef VM_TRACE
-inline
-Dbtux::PrintPar::PrintPar() :
- // caller fills in
- m_path(),
- m_side(255),
- m_parent(NullTupAddr),
- // default return values
- m_depth(0),
- m_occup(0),
- m_ok(true)
+inline Uint32
+Dbtux::NodeHandle::getNodeScan()
{
+ return m_node->m_nodeScan;
}
-#endif
-// node handles
-
-inline Dbtux::TupAddr
-Dbtux::NodeHandle::getLink(unsigned i)
+inline void
+Dbtux::NodeHandle::setLink(unsigned i, TupLoc loc)
{
ndbrequire(i <= 2);
- return m_node->m_link[i];
-}
-
-inline unsigned
-Dbtux::NodeHandle::getChilds()
-{
- return
- (m_node->m_link[0] != NullTupAddr) +
- (m_node->m_link[1] != NullTupAddr);
+ m_node->m_linkPI[i] = loc.m_pageId;
+ m_node->m_linkPO[i] = loc.m_pageOffset;
}
-inline Dbtux::TupAddr
-Dbtux::NodeHandle::getSide()
+inline void
+Dbtux::NodeHandle::setSide(unsigned i)
{
- return m_node->m_side;
+ ndbrequire(i <= 2);
+ m_node->m_side = i;
}
-inline unsigned
-Dbtux::NodeHandle::getOccup()
+inline void
+Dbtux::NodeHandle::setOccup(unsigned n)
{
- return m_node->m_occup;
+ TreeHead& tree = m_frag.m_tree;
+ ndbrequire(n <= tree.m_maxOccup);
+ m_node->m_occup = n;
}
-inline int
-Dbtux::NodeHandle::getBalance()
+inline void
+Dbtux::NodeHandle::setBalance(int b)
{
- return m_node->m_balance;
+ ndbrequire(abs(b) <= 1);
+ m_node->m_balance = b;
}
-inline Uint32
-Dbtux::NodeHandle::getNodeScan()
+inline void
+Dbtux::NodeHandle::setNodeScan(Uint32 scanPtrI)
{
- return m_node->m_nodeScan;
+ m_node->m_nodeScan = scanPtrI;
}
inline Dbtux::Data
@@ -1153,47 +1191,54 @@ Dbtux::NodeHandle::getMinMax(unsigned i)
return getEnt(i == 0 ? 0 : occup - 1);
}
-inline void
-Dbtux::NodeHandle::setLink(unsigned i, TupAddr addr)
-{
- ndbrequire(i <= 2);
- m_node->m_link[i] = addr;
- m_flags |= DoUpdate;
-}
+// parameters for methods
-inline void
-Dbtux::NodeHandle::setSide(unsigned i)
+inline
+Dbtux::CopyPar::CopyPar() :
+ m_items(0),
+ m_headers(true),
+ m_maxwords(~0), // max unsigned
+ // output
+ m_numitems(0),
+ m_numwords(0)
{
- // ndbrequire(i <= 1);
- m_node->m_side = i;
- m_flags |= DoUpdate;
}
-inline void
-Dbtux::NodeHandle::setOccup(unsigned n)
+inline
+Dbtux::ReadPar::ReadPar() :
+ m_first(0),
+ m_count(0),
+ m_data(0),
+ m_size(0)
{
- TreeHead& tree = m_frag.m_tree;
- ndbrequire(n <= tree.m_maxOccup);
- m_node->m_occup = n;
- m_flags |= DoUpdate;
}
-inline void
-Dbtux::NodeHandle::setBalance(int b)
+inline
+Dbtux::BoundPar::BoundPar() :
+ m_data1(0),
+ m_data2(0),
+ m_count1(0),
+ m_len2(0),
+ m_dir(255)
{
- ndbrequire(abs(b) <= 1);
- m_node->m_balance = b;
- m_flags |= DoUpdate;
}
-inline void
-Dbtux::NodeHandle::setNodeScan(Uint32 scanPtrI)
+#ifdef VM_TRACE
+inline
+Dbtux::PrintPar::PrintPar() :
+ // caller fills in
+ m_path(),
+ m_side(255),
+ m_parent(),
+ // default return values
+ m_depth(0),
+ m_occup(0),
+ m_ok(true)
{
- m_node->m_nodeScan = scanPtrI;
- m_flags |= DoUpdate;
}
+#endif
-// other methods
+// utils
inline Dbtux::DescEnt&
Dbtux::getDescEnt(Uint32 descPage, Uint32 descOff)
@@ -1206,6 +1251,17 @@ Dbtux::getDescEnt(Uint32 descPage, Uint32 descOff)
return *descEnt;
}
+inline Uint32
+Dbtux::getTupAddr(const Frag& frag, TreeEnt ent)
+{
+ const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit];
+ const TupLoc tupLoc = ent.m_tupLoc;
+ Uint32 tupAddr = NullTupAddr;
+ c_tup->tuxGetTupAddr(tableFragPtrI, tupLoc.m_pageId, tupLoc.m_pageOffset, tupAddr);
+ jamEntry();
+ return tupAddr;
+}
+
inline unsigned
Dbtux::min(unsigned x, unsigned y)
{
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
index 6404cc66213..7601a14a242 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp
@@ -18,50 +18,42 @@
#include "Dbtux.hpp"
/*
- * Search key vs tree entry.
+ * Search key vs node prefix.
*
- * Compare search key and index attribute data. The attribute data may
- * be partial in which case CmpUnknown may be returned. Also counts how
- * many (additional) initial attributes were equal.
+ * The comparison starts at given attribute position (in fact 0). The
+ * position is updated by number of equal initial attributes found. The
+ * prefix may be partial in which case CmpUnknown may be returned.
*/
int
-Dbtux::cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar)
+Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, ConstData data2, unsigned maxlen2)
{
+ const unsigned numAttrs = frag.m_numAttrs;
const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
- ConstData data1 = cmpPar.m_data1;
- ConstData data2 = cmpPar.m_data2;
// number of words of attribute data left
- unsigned len2 = cmpPar.m_len2;
- const unsigned numAttrs = frag.m_numAttrs;
- unsigned index = cmpPar.m_first;
- ndbrequire(index < numAttrs);
- // skip to right position in search key XXX do it before the call
- for (unsigned i = 0; i < index; i++) {
- jam();
- data1 += AttributeHeaderSize + data1.ah().getDataSize();
- }
- unsigned numEq = 0;
+ unsigned len2 = maxlen2;
+ // skip to right position in search key
+ data1 += start;
int ret = 0;
- while (index < numAttrs) {
+ while (start < numAttrs) {
if (len2 < AttributeHeaderSize) {
jam();
ret = NdbSqlUtil::CmpUnknown;
break;
}
len2 -= AttributeHeaderSize;
- if (! data1.ah().isNULL()) {
+ if (*data1 != 0) {
if (! data2.ah().isNULL()) {
jam();
// current attribute
- const DescAttr& descAttr = descEnt.m_descAttr[index];
+ const DescAttr& descAttr = descEnt.m_descAttr[start];
const unsigned typeId = descAttr.m_typeId;
// full data size
- const unsigned size1 = data1.ah().getDataSize();
+ const unsigned size1 = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc);
ndbrequire(size1 != 0 && size1 == data2.ah().getDataSize());
const unsigned size2 = min(size1, len2);
len2 -= size2;
// compare
- const Uint32* const p1 = &data1[AttributeHeaderSize];
+ const Uint32* const p1 = *data1;
const Uint32* const p2 = &data2[AttributeHeaderSize];
ret = NdbSqlUtil::cmp(typeId, p1, p2, size1, size2);
if (ret != 0) {
@@ -82,18 +74,71 @@ Dbtux::cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar)
break;
}
}
- data1 += AttributeHeaderSize + data1.ah().getDataSize();
+ data1 += 1;
data2 += AttributeHeaderSize + data2.ah().getDataSize();
- numEq++;
- index++;
+ start++;
}
// XXX until data format errors are handled
ndbrequire(ret != NdbSqlUtil::CmpError);
- cmpPar.m_numEq += numEq; // add to previous count
return ret;
}
/*
+ * Search key vs tree entry.
+ *
+ * Start position is updated as in previous routine.
+ */
+int
+Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, TableData data2)
+{
+ const unsigned numAttrs = frag.m_numAttrs;
+ const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
+ // skip to right position
+ data1 += start;
+ data2 += start;
+ int ret = 0;
+ while (start < numAttrs) {
+ if (*data1 != 0) {
+ if (*data2 != 0) {
+ jam();
+ // current attribute
+ const DescAttr& descAttr = descEnt.m_descAttr[start];
+ const unsigned typeId = descAttr.m_typeId;
+ // full data size
+ const unsigned size1 = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc);
+ // compare
+ const Uint32* const p1 = *data1;
+ const Uint32* const p2 = *data2;
+ ret = NdbSqlUtil::cmp(typeId, p1, p2, size1, size1);
+ if (ret != 0) {
+ jam();
+ break;
+ }
+ } else {
+ jam();
+ // not NULL < NULL
+ ret = -1;
+ break;
+ }
+ } else {
+ if (*data2 != 0) {
+ jam();
+ // NULL > not NULL
+ ret = +1;
+ break;
+ }
+ }
+ data1 += 1;
+ data2 += 1;
+ start++;
+ }
+ // XXX until data format errors are handled
+ ndbrequire(ret != NdbSqlUtil::CmpError);
+ return ret;
+}
+
+
+/*
* Scan bound vs tree entry.
*
* Compare lower or upper bound and index attribute data. The attribute
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
index c5d24205d1a..c4931685305 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
@@ -97,7 +97,7 @@ Dbtux::printTree(Signal* signal, Frag& frag, NdbOut& out)
PrintPar par;
strcpy(par.m_path, ".");
par.m_side = 2;
- par.m_parent = NullTupAddr;
+ par.m_parent = NullTupLoc;
printNode(signal, frag, out, tree.m_root, par);
out.m_out->flush();
if (! par.m_ok) {
@@ -106,26 +106,24 @@ Dbtux::printTree(Signal* signal, Frag& frag, NdbOut& out)
signal->theData[1] = 1;
execDUMP_STATE_ORD(signal);
if (debugFile != 0) {
- commitNodes(signal, frag, false);
printTree(signal, frag, debugOut);
}
}
ndbrequire(false);
}
- commitNodes(signal, frag, false);
}
void
-Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar& par)
+Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar& par)
{
- if (addr == NullTupAddr) {
+ if (loc == NullTupLoc) {
par.m_depth = 0;
return;
}
TreeHead& tree = frag.m_tree;
- NodeHandlePtr nodePtr;
- selectNode(signal, frag, nodePtr, addr, AccFull);
- out << par.m_path << " " << *nodePtr.p << endl;
+ NodeHandle node(frag);
+ selectNode(signal, node, loc, AccFull);
+ out << par.m_path << " " << node << endl;
// check children
PrintPar cpar[2];
ndbrequire(strlen(par.m_path) + 1 < sizeof(par.m_path));
@@ -133,57 +131,57 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar
sprintf(cpar[i].m_path, "%s%c", par.m_path, "LR"[i]);
cpar[i].m_side = i;
cpar[i].m_depth = 0;
- cpar[i].m_parent = addr;
- printNode(signal, frag, out, nodePtr.p->getLink(i), cpar[i]);
+ cpar[i].m_parent = loc;
+ printNode(signal, frag, out, node.getLink(i), cpar[i]);
if (! cpar[i].m_ok) {
par.m_ok = false;
}
}
// check child-parent links
- if (nodePtr.p->getLink(2) != par.m_parent) {
+ if (node.getLink(2) != par.m_parent) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "parent addr " << hex << nodePtr.p->getLink(2);
+ out << "parent loc " << hex << node.getLink(2);
out << " should be " << hex << par.m_parent << endl;
}
- if (nodePtr.p->getSide() != par.m_side) {
+ if (node.getSide() != par.m_side) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "side " << dec << nodePtr.p->getSide();
+ out << "side " << dec << node.getSide();
out << " should be " << dec << par.m_side << endl;
}
// check balance
const int balance = -cpar[0].m_depth + cpar[1].m_depth;
- if (nodePtr.p->getBalance() != balance) {
+ if (node.getBalance() != balance) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "balance " << nodePtr.p->getBalance();
+ out << "balance " << node.getBalance();
out << " should be " << balance << endl;
}
- if (abs(nodePtr.p->getBalance()) > 1) {
+ if (abs(node.getBalance()) > 1) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "balance " << nodePtr.p->getBalance() << " is invalid" << endl;
+ out << "balance " << node.getBalance() << " is invalid" << endl;
}
// check occupancy
- if (nodePtr.p->getOccup() > tree.m_maxOccup) {
+ if (node.getOccup() > tree.m_maxOccup) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "occupancy " << nodePtr.p->getOccup();
+ out << "occupancy " << node.getOccup();
out << " greater than max " << tree.m_maxOccup << endl;
}
// check for occupancy of interior node
- if (nodePtr.p->getChilds() == 2 && nodePtr.p->getOccup() < tree.m_minOccup) {
+ if (node.getChilds() == 2 && node.getOccup() < tree.m_minOccup) {
par.m_ok = false;
out << par.m_path << " *** ";
- out << "occupancy " << nodePtr.p->getOccup() << " of interior node";
+ out << "occupancy " << node.getOccup() << " of interior node";
out << " less than min " << tree.m_minOccup << endl;
}
// check missed half-leaf/leaf merge
for (unsigned i = 0; i <= 1; i++) {
- if (nodePtr.p->getLink(i) != NullTupAddr &&
- nodePtr.p->getLink(1 - i) == NullTupAddr &&
- nodePtr.p->getOccup() + cpar[i].m_occup <= tree.m_maxOccup) {
+ if (node.getLink(i) != NullTupLoc &&
+ node.getLink(1 - i) == NullTupLoc &&
+ node.getOccup() + cpar[i].m_occup <= tree.m_maxOccup) {
par.m_ok = false;
out << par.m_path << " *** ";
out << "missed merge with child " << i << endl;
@@ -191,14 +189,26 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar
}
// return values
par.m_depth = 1 + max(cpar[0].m_depth, cpar[1].m_depth);
- par.m_occup = nodePtr.p->getOccup();
+ par.m_occup = node.getOccup();
+}
+
+NdbOut&
+operator<<(NdbOut& out, const Dbtux::TupLoc& loc)
+{
+ if (loc == Dbtux::NullTupLoc) {
+ out << "null";
+ } else {
+ out << dec << loc.m_pageId;
+ out << "." << dec << loc.m_pageOffset;
+ }
+ return out;
}
NdbOut&
operator<<(NdbOut& out, const Dbtux::TreeEnt& ent)
{
out << dec << ent.m_fragBit;
- out << "-" << hex << ent.m_tupAddr;
+ out << "-" << ent.m_tupLoc;
out << "-" << dec << ent.m_tupVersion;
return out;
}
@@ -206,10 +216,13 @@ operator<<(NdbOut& out, const Dbtux::TreeEnt& ent)
NdbOut&
operator<<(NdbOut& out, const Dbtux::TreeNode& node)
{
+ Dbtux::TupLoc link0(node.m_linkPI[0], node.m_linkPO[0]);
+ Dbtux::TupLoc link1(node.m_linkPI[1], node.m_linkPO[1]);
+ Dbtux::TupLoc link2(node.m_linkPI[2], node.m_linkPO[2]);
out << "[TreeNode " << hex << &node;
- out << " [left " << hex << node.m_link[0] << "]";
- out << " [right " << hex << node.m_link[1] << "]";
- out << " [up " << hex << node.m_link[2] << "]";
+ out << " [left " << link0 << "]";
+ out << " [right " << link1 << "]";
+ out << " [up " << link2 << "]";
out << " [side " << dec << node.m_side << "]";
out << " [occup " << dec << node.m_occup << "]";
out << " [balance " << dec << (int)node.m_balance << "]";
@@ -238,7 +251,7 @@ NdbOut&
operator<<(NdbOut& out, const Dbtux::TreePos& pos)
{
out << "[TreePos " << hex << &pos;
- out << " [addr " << hex << pos.m_addr << "]";
+ out << " [loc " << pos.m_loc << "]";
out << " [pos " << dec << pos.m_pos << "]";
out << " [match " << dec << pos.m_match << "]";
out << " [dir " << dec << pos.m_dir << "]";
@@ -251,9 +264,9 @@ NdbOut&
operator<<(NdbOut& out, const Dbtux::DescAttr& descAttr)
{
out << "[DescAttr " << hex << &descAttr;
+ out << " [attrDesc " << hex << descAttr.m_attrDesc;
out << " [primaryAttrId " << dec << descAttr.m_primaryAttrId << "]";
out << " [typeId " << dec << descAttr.m_typeId << "]";
- out << " [nullable " << dec << descAttr.m_nullable << "]";
out << "]";
return out;
}
@@ -338,9 +351,8 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node)
const Dbtux::Frag& frag = node.m_frag;
const Dbtux::TreeHead& tree = frag.m_tree;
out << "[NodeHandle " << hex << &node;
- out << " [addr " << hex << node.m_addr << "]";
+ out << " [loc " << node.m_loc << "]";
out << " [acc " << dec << node.m_acc << "]";
- out << " [flags " << hex << node.m_flags << "]";
out << " [node " << *node.m_node << "]";
if (node.m_acc >= Dbtux::AccPref) {
for (unsigned i = 0; i <= 1; i++) {
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
index 32d66422d5c..93a5c78338c 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
@@ -16,9 +16,12 @@
#define DBTUX_GEN_CPP
#include "Dbtux.hpp"
+#include <signaldata/TuxContinueB.hpp>
+#include <signaldata/TuxContinueB.hpp>
Dbtux::Dbtux(const Configuration& conf) :
SimulatedBlock(DBTUX, conf),
+ c_tup(0),
c_descPageList(RNIL),
#ifdef VM_TRACE
debugFile(0),
@@ -27,22 +30,22 @@ Dbtux::Dbtux(const Configuration& conf) :
#endif
c_internalStartPhase(0),
c_typeOfStart(NodeState::ST_ILLEGAL_TYPE),
- c_keyBuffer(0)
+ c_dataBuffer(0)
{
BLOCK_CONSTRUCTOR(Dbtux);
// verify size assumptions (also when release-compiled)
ndbrequire(
- (sizeof(DescHead) & 0x3) == 0 &&
- (sizeof(DescAttr) & 0x3) == 0 &&
(sizeof(TreeEnt) & 0x3) == 0 &&
- (sizeof(TreeNode) & 0x3) == 0
+ (sizeof(TreeNode) & 0x3) == 0 &&
+ (sizeof(DescHead) & 0x3) == 0 &&
+ (sizeof(DescAttr) & 0x3) == 0
);
/*
* DbtuxGen.cpp
*/
addRecSignal(GSN_CONTINUEB, &Dbtux::execCONTINUEB);
addRecSignal(GSN_STTOR, &Dbtux::execSTTOR);
- addRecSignal(GSN_SIZEALT_REP, &Dbtux::execSIZEALT_REP);
+ addRecSignal(GSN_READ_CONFIG_REQ, &Dbtux::execREAD_CONFIG_REQ, true);
/*
* DbtuxMeta.cpp
*/
@@ -121,6 +124,8 @@ Dbtux::execSTTOR(Signal* signal)
case 1:
jam();
CLEAR_ERROR_INSERT_VALUE;
+ c_tup = (Dbtup*)globalData.getBlock(DBTUP);
+ ndbrequire(c_tup != 0);
break;
case 3:
jam();
@@ -143,28 +148,41 @@ Dbtux::execSTTOR(Signal* signal)
}
void
-Dbtux::execSIZEALT_REP(Signal* signal)
+Dbtux::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
- const Uint32* data = signal->getDataPtr();
- BlockReference sender = data[TuxSizeAltReq::IND_BLOCK_REF];
- const Uint32 nIndex = data[TuxSizeAltReq::IND_INDEX];
- const Uint32 nFragment = data[TuxSizeAltReq::IND_FRAGMENT];
- const Uint32 nAttribute = data[TuxSizeAltReq::IND_ATTRIBUTE];
+
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+ ndbrequire(req->noOfParameters == 0);
+
+ Uint32 nIndex;
+ Uint32 nFragment;
+ Uint32 nAttribute;
+ Uint32 nScanOp;
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_INDEX, &nIndex));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_FRAGMENT, &nFragment));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_ATTRIBUTE, &nAttribute));
+ ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
+
const Uint32 nDescPage = (nIndex + nAttribute + DescPageSize - 1) / DescPageSize;
- const Uint32 nScanOp = data[TuxSizeAltReq::IND_SCAN];
const Uint32 nScanBoundWords = nScanOp * ScanBoundSegmentSize * 4;
- // allocate records
+
c_indexPool.setSize(nIndex);
c_fragPool.setSize(nFragment);
c_descPagePool.setSize(nDescPage);
c_fragOpPool.setSize(MaxIndexFragments);
- c_nodeHandlePool.setSize(MaxNodeHandles);
c_scanOpPool.setSize(nScanOp);
c_scanBoundPool.setSize(nScanBoundWords);
/*
* Index id is physical array index. We seize and initialize all
- * index records now. This assumes ArrayPool is an array.
+ * index records now.
*/
IndexPtr indexPtr;
while (1) {
@@ -177,14 +195,52 @@ Dbtux::execSIZEALT_REP(Signal* signal)
new (indexPtr.p) Index();
}
// allocate buffers
- c_keyBuffer = (Uint32*)allocRecord("c_keyBuffer", sizeof(Uint64), (MaxAttrDataSize + 1) >> 1);
+ c_keyAttrs = (Uint32*)allocRecord("c_keyAttrs", sizeof(Uint32), MaxIndexAttributes);
+ c_searchKey = (TableData)allocRecord("c_searchKey", sizeof(Uint32*), MaxIndexAttributes);
+ c_entryKey = (TableData)allocRecord("c_entryKey", sizeof(Uint32*), MaxIndexAttributes);
+ c_dataBuffer = (Uint32*)allocRecord("c_dataBuffer", sizeof(Uint64), (MaxAttrDataSize + 1) >> 1);
// ack
- sendSignal(sender, GSN_SIZEALT_ACK, signal, 1, JBB);
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = senderData;
+ sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
}
// utils
void
+Dbtux::setKeyAttrs(const Frag& frag)
+{
+ Data keyAttrs = c_keyAttrs; // global
+ const unsigned numAttrs = frag.m_numAttrs;
+ const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff);
+ for (unsigned i = 0; i < numAttrs; i++) {
+ const DescAttr& descAttr = descEnt.m_descAttr[i];
+ Uint32 size = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc);
+ // set attr id and fixed size
+ keyAttrs.ah() = AttributeHeader(descAttr.m_primaryAttrId, size);
+ keyAttrs += 1;
+ }
+}
+
+void
+Dbtux::readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, TableData keyData)
+{
+ ConstData keyAttrs = c_keyAttrs; // global
+ const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit];
+ const TupLoc tupLoc = ent.m_tupLoc;
+ const Uint32 tupVersion = ent.m_tupVersion;
+ ndbrequire(start < frag.m_numAttrs);
+ const unsigned numAttrs = frag.m_numAttrs - start;
+ // start applies to both keys and output data
+ keyAttrs += start;
+ keyData += start;
+ c_tup->tuxReadAttrs(tableFragPtrI, tupLoc.m_pageId, tupLoc.m_pageOffset, tupVersion, numAttrs, keyAttrs, keyData);
+ jamEntry();
+}
+
+void
Dbtux::copyAttrs(Data dst, ConstData src, CopyPar& copyPar)
{
CopyPar c = copyPar;
@@ -218,4 +274,46 @@ Dbtux::copyAttrs(Data dst, ConstData src, CopyPar& copyPar)
copyPar = c;
}
+/*
+ * Input is pointers to table attributes. Output is array of attribute
+ * data with headers. Copies whatever fits.
+ */
+void
+Dbtux::copyAttrs(const Frag& frag, TableData data1, Data data2, unsigned maxlen2)
+{
+ ConstData keyAttrs = c_keyAttrs; // global
+ const unsigned numAttrs = frag.m_numAttrs;
+ unsigned len2 = maxlen2;
+ for (unsigned n = 0; n < numAttrs; n++) {
+ jam();
+ const unsigned attrId = keyAttrs.ah().getAttributeId();
+ const unsigned dataSize = keyAttrs.ah().getDataSize();
+ const Uint32* const p1 = *data1;
+ if (p1 != 0) {
+ if (len2 == 0)
+ return;
+ data2.ah() = AttributeHeader(attrId, dataSize);
+ data2 += 1;
+ len2 -= 1;
+ unsigned n = dataSize;
+ for (unsigned i = 0; i < dataSize; i++) {
+ if (len2 == 0)
+ return;
+ *data2 = p1[i];
+ data2 += 1;
+ len2 -= 1;
+ }
+ } else {
+ if (len2 == 0)
+ return;
+ data2.ah() = AttributeHeader(attrId, 0);
+ data2.ah().setNULL();
+ data2 += 1;
+ len2 -= 1;
+ }
+ keyAttrs += 1;
+ data1 += 1;
+ }
+}
+
BLOCK_FUNCTIONS(Dbtux);
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp
index a6b2485067c..fc72611a273 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp
@@ -33,11 +33,12 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
jam();
#ifdef VM_TRACE
if (debugFlags & DebugMaint) {
+ TupLoc tupLoc(sig->pageId, sig->pageOffset);
debugOut << "opInfo=" << hex << sig->opInfo;
debugOut << " tableId=" << dec << sig->tableId;
debugOut << " indexId=" << dec << sig->indexId;
debugOut << " fragId=" << dec << sig->fragId;
- debugOut << " tupAddr=" << hex << sig->tupAddr;
+ debugOut << " tupLoc=" << tupLoc;
debugOut << " tupVersion=" << dec << sig->tupVersion;
debugOut << " -- ignored at ISP=" << dec << c_internalStartPhase;
debugOut << " TOS=" << dec << c_typeOfStart;
@@ -72,31 +73,25 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
}
ndbrequire(fragPtr.i != RNIL);
Frag& frag = *fragPtr.p;
- ndbrequire(frag.m_nodeList == RNIL);
- // set up index entry
+ // set up index keys for this operation
+ setKeyAttrs(frag);
+ // set up search entry
TreeEnt ent;
- ent.m_tupAddr = req->tupAddr;
+ ent.m_tupLoc = TupLoc(req->pageId, req->pageOffset);
ent.m_tupVersion = req->tupVersion;
ent.m_fragBit = fragBit;
// read search key
- ReadPar readPar;
- readPar.m_ent = ent;
- readPar.m_first = 0;
- readPar.m_count = frag.m_numAttrs;
- // output goes here
- readPar.m_data = c_keyBuffer;
- tupReadAttrs(signal, frag, readPar);
+ readKeyAttrs(frag, ent, 0, c_searchKey);
// check if all keys are null
{
+ const unsigned numAttrs = frag.m_numAttrs;
bool allNull = true;
- ConstData data = readPar.m_data;
- for (unsigned i = 0; i < frag.m_numAttrs; i++) {
- if (! data.ah().isNULL()) {
+ for (unsigned i = 0; i < numAttrs; i++) {
+ if (c_searchKey[i] != 0) {
jam();
allNull = false;
break;
}
- data += AttributeHeaderSize + data.ah().getDataSize();
}
if (allNull) {
jam();
@@ -105,11 +100,6 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
return;
}
}
- // find position in tree
- SearchPar searchPar;
- searchPar.m_data = c_keyBuffer;
- searchPar.m_ent = ent;
- TreePos treePos;
#ifdef VM_TRACE
if (debugFlags & DebugMaint) {
debugOut << "opCode=" << dec << opCode;
@@ -121,7 +111,9 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
debugOut << endl;
}
#endif
- treeSearch(signal, frag, searchPar, treePos);
+ // find position in tree
+ TreePos treePos;
+ treeSearch(signal, frag, c_searchKey, ent, treePos);
#ifdef VM_TRACE
if (debugFlags & DebugMaint) {
debugOut << treePos << endl;
@@ -143,17 +135,18 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
}
/*
* At most one new node is inserted in the operation. We keep one
- * free node pre-allocated so the operation cannot fail. This also
- * gives a real TupAddr for links to the new node.
+ * free node pre-allocated so the operation cannot fail.
*/
- if (frag.m_nodeFree == RNIL) {
+ if (frag.m_freeLoc == NullTupLoc) {
jam();
- preallocNode(signal, frag, req->errorCode);
+ NodeHandle node(frag);
+ req->errorCode = allocNode(signal, node);
if (req->errorCode != 0) {
jam();
break;
}
- ndbrequire(frag.m_nodeFree != RNIL);
+ frag.m_freeLoc = node.m_loc;
+ ndbrequire(frag.m_freeLoc != NullTupLoc);
}
treeAdd(signal, frag, treePos, ent);
break;
@@ -175,7 +168,6 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal)
break;
}
// commit and release nodes
- commitNodes(signal, frag, req->errorCode == 0);
#ifdef VM_TRACE
if (debugFlags & DebugTree) {
printTree(signal, frag, debugOut);
@@ -199,11 +191,11 @@ Dbtux::tupReadAttrs(Signal* signal, const Frag& frag, ReadPar& readPar)
req->requestInfo = 0;
req->tableId = frag.m_tableId;
req->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff);
- req->fragPtrI = RNIL;
- req->tupAddr = ent.m_tupAddr;
+ req->fragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit];
+ req->tupAddr = (Uint32)-1;
req->tupVersion = ent.m_tupVersion;
- req->pageId = RNIL;
- req->pageOffset = 0;
+ req->pageId = ent.m_tupLoc.m_pageId;
+ req->pageOffset = ent.m_tupLoc.m_pageOffset;
req->bufferId = 0;
// add count and list of attribute ids
Data data = (Uint32*)req + TupReadAttrs::SignalLength;
@@ -246,11 +238,11 @@ Dbtux::tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar)
req->requestInfo = TupReadAttrs::ReadKeys;
req->tableId = frag.m_tableId;
req->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff);
- req->fragPtrI = RNIL;
- req->tupAddr = ent.m_tupAddr;
+ req->fragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit];
+ req->tupAddr = (Uint32)-1;
req->tupVersion = RNIL; // not used
- req->pageId = RNIL;
- req->pageOffset = 0;
+ req->pageId = ent.m_tupLoc.m_pageId;
+ req->pageOffset = ent.m_tupLoc.m_pageOffset;
req->bufferId = 0;
// execute
EXECUTE_DIRECT(DBTUP, GSN_TUP_READ_ATTRS, signal, TupReadAttrs::SignalLength);
@@ -270,100 +262,3 @@ Dbtux::tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar)
readPar.m_count = numKeys;
readPar.m_size = copyPar.m_numwords;
}
-
-/*
- * Operate on index node tuple in TUP. The data is copied between node
- * cache and index storage via signal data.
- */
-void
-Dbtux::tupStoreTh(Signal* signal, const Frag& frag, NodeHandlePtr nodePtr, StorePar storePar)
-{
- const TreeHead& tree = frag.m_tree;
- // define the direct signal
- TupStoreTh* req = (TupStoreTh*)signal->getDataPtrSend();
- req->errorCode = RNIL;
- req->tableId = frag.m_indexId;
- req->fragId = frag.m_fragId;
- req->fragPtrI = RNIL;
- req->tupAddr = nodePtr.p->m_addr;
- req->tupVersion = 0;
- req->pageId = nodePtr.p->m_loc.m_pageId;
- req->pageOffset = nodePtr.p->m_loc.m_pageOffset;
- req->bufferId = 0;
- req->opCode = storePar.m_opCode;
- ndbrequire(storePar.m_offset + storePar.m_size <= tree.m_nodeSize);
- req->dataOffset = storePar.m_offset;
- req->dataSize = storePar.m_size;
- // the node cache
- ndbrequire(nodePtr.p->m_node != 0);
- // the buffer in signal data
- Uint32* const buffer = (Uint32*)req + TupStoreTh::SignalLength;
- // copy in data
- switch (storePar.m_opCode) {
- case TupStoreTh::OpRead:
- jam();
- #ifdef VM_TRACE
- {
- Uint32* dst = buffer + storePar.m_offset;
- memset(dst, 0xa9, storePar.m_size << 2);
- }
- #endif
- break;
- case TupStoreTh::OpInsert:
- jam();
- // fallthru
- case TupStoreTh::OpUpdate:
- jam();
- // copy from cache to signal data
- {
- Uint32* dst = buffer + storePar.m_offset;
- const Uint32* src = (const Uint32*)nodePtr.p->m_node + storePar.m_offset;
- memcpy(dst, src, storePar.m_size << 2);
- }
- break;
- case TupStoreTh::OpDelete:
- jam();
- break;
- default:
- ndbrequire(false);
- break;
- }
- // execute
- EXECUTE_DIRECT(DBTUP, GSN_TUP_STORE_TH, signal, TupStoreTh::SignalLength);
- jamEntry();
- if (req->errorCode != 0) {
- jam();
- storePar.m_errorCode = req->errorCode;
- return;
- }
- ndbrequire(req->errorCode == 0);
- // copy out data
- switch (storePar.m_opCode) {
- case TupStoreTh::OpRead:
- jam();
- {
- Uint32* dst = (Uint32*)nodePtr.p->m_node + storePar.m_offset;
- const Uint32* src = (const Uint32*)buffer + storePar.m_offset;
- memcpy(dst, src, storePar.m_size << 2);
- }
- // fallthru
- case TupStoreTh::OpInsert:
- jam();
- // fallthru
- case TupStoreTh::OpUpdate:
- jam();
- nodePtr.p->m_addr = req->tupAddr;
- nodePtr.p->m_loc.m_pageId = req->pageId;
- nodePtr.p->m_loc.m_pageOffset = req->pageOffset;
- break;
- case TupStoreTh::OpDelete:
- jam();
- nodePtr.p->m_addr = NullTupAddr;
- nodePtr.p->m_loc.m_pageId = RNIL;
- nodePtr.p->m_loc.m_pageOffset = 0;
- break;
- default:
- ndbrequire(false);
- break;
- }
-}
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
index 2ffd599429c..0612f191830 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp
@@ -85,6 +85,11 @@ Dbtux::execTUXFRAGREQ(Signal* signal)
fragPtr.p->m_fragOff = req->fragOff;
fragPtr.p->m_fragId = req->fragId;
fragPtr.p->m_numAttrs = req->noOfAttr;
+ fragPtr.p->m_tupIndexFragPtrI = req->tupIndexFragPtrI;
+ fragPtr.p->m_tupTableFragPtrI[0] = req->tupTableFragPtrI[0];
+ fragPtr.p->m_tupTableFragPtrI[1] = req->tupTableFragPtrI[1];
+ fragPtr.p->m_accTableFragPtrI[0] = req->accTableFragPtrI[0];
+ fragPtr.p->m_accTableFragPtrI[1] = req->accTableFragPtrI[1];
// add the fragment to the index
indexPtr.p->m_fragId[indexPtr.p->m_numFrags] = req->fragId;
indexPtr.p->m_fragPtrI[indexPtr.p->m_numFrags] = fragPtr.i;
@@ -176,10 +181,9 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal)
// define the attribute
DescEnt& descEnt = getDescEnt(indexPtr.p->m_descPage, indexPtr.p->m_descOff);
DescAttr& descAttr = descEnt.m_descAttr[attrId];
+ descAttr.m_attrDesc = req->attrDescriptor;
descAttr.m_primaryAttrId = req->primaryAttrId;
descAttr.m_typeId = req->extTypeInfo & 0xFF;
- descAttr.m_nullable = AttributeDescriptor::getNullable(req->attrDescriptor);
- descAttr.pad1 = 0;
#ifdef VM_TRACE
if (debugFlags & DebugMeta) {
debugOut << "Add frag " << fragPtr.i << " attr " << attrId << " " << descAttr << endl;
@@ -197,6 +201,7 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal)
jam();
// initialize tree header
TreeHead& tree = fragPtr.p->m_tree;
+ new (&tree) TreeHead();
// make these configurable later
tree.m_nodeSize = MAX_TTREE_NODE_SIZE;
tree.m_prefSize = MAX_TTREE_PREF_SIZE;
@@ -222,8 +227,8 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal)
break;
}
tree.m_minOccup = tree.m_maxOccup - maxSlack;
- // root node does not exist
- tree.m_root = NullTupAddr;
+ // root node does not exist (also set by ctor)
+ tree.m_root = NullTupLoc;
// fragment is defined
c_fragOpPool.release(fragOpPtr);
}
@@ -310,12 +315,6 @@ Dbtux::dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 sen
unsigned i = --indexPtr.p->m_numFrags;
FragPtr fragPtr;
c_fragPool.getPtr(fragPtr, indexPtr.p->m_fragPtrI[i]);
- Frag& frag = *fragPtr.p;
- ndbrequire(frag.m_nodeList == RNIL);
- if (frag.m_nodeFree != RNIL) {
- c_nodeHandlePool.release(frag.m_nodeFree);
- frag.m_nodeFree = RNIL;
- }
c_fragPool.release(fragPtr);
// the real time break is not used for anything currently
signal->theData[0] = TuxContinueB::DropIndex;
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
index 6733a87da97..c969e35dc82 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
@@ -18,241 +18,113 @@
#include "Dbtux.hpp"
/*
- * Node handles.
- *
- * We use the "cache" implementation. Node operations are done on
- * cached copies. Index memory is updated at the end of the operation.
- * At most one node is inserted and it is always pre-allocated.
- *
- * An alternative "pointer" implementation which writes directly into
- * index memory is planned for later.
+ * Allocate index node in TUP.
*/
-
-// Dbtux
-
-void
-Dbtux::seizeNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr)
-{
- if (! c_nodeHandlePool.seize(nodePtr)) {
- jam();
- return;
- }
- new (nodePtr.p) NodeHandle(*this, frag);
- nodePtr.p->m_next = frag.m_nodeList;
- frag.m_nodeList = nodePtr.i;
- // node cache used always
- nodePtr.p->m_node = (TreeNode*)nodePtr.p->m_cache;
- new (nodePtr.p->m_node) TreeNode();
-#ifdef VM_TRACE
- TreeHead& tree = frag.m_tree;
- TreeNode* node = nodePtr.p->m_node;
- memset(tree.getPref(node, 0), 0xa2, tree.m_prefSize << 2);
- memset(tree.getPref(node, 1), 0xa2, tree.m_prefSize << 2);
- TreeEnt* entList = tree.getEntList(node);
- memset(entList, 0xa4, (tree.m_maxOccup + 1) * (TreeEntSize << 2));
-#endif
-}
-
-void
-Dbtux::preallocNode(Signal* signal, Frag& frag, Uint32& errorCode)
-{
- ndbrequire(frag.m_nodeFree == RNIL);
- NodeHandlePtr nodePtr;
- seizeNode(signal, frag, nodePtr);
- ndbrequire(nodePtr.i != RNIL);
- // remove from cache XXX ugly
- frag.m_nodeFree = frag.m_nodeList;
- frag.m_nodeList = nodePtr.p->m_next;
- StorePar storePar;
- storePar.m_opCode = TupStoreTh::OpInsert;
- storePar.m_offset = 0;
- storePar.m_size = 0;
- tupStoreTh(signal, frag, nodePtr, storePar);
- if (storePar.m_errorCode != 0) {
- jam();
- errorCode = storePar.m_errorCode;
- c_nodeHandlePool.release(nodePtr);
- frag.m_nodeFree = RNIL;
- }
-}
-
-/*
- * Find node in the cache. XXX too slow, use direct links instead
- */
-void
-Dbtux::findNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr)
-{
- NodeHandlePtr tmpPtr;
- tmpPtr.i = frag.m_nodeList;
- while (tmpPtr.i != RNIL) {
- jam();
- c_nodeHandlePool.getPtr(tmpPtr);
- if (tmpPtr.p->m_addr == addr) {
- jam();
- nodePtr = tmpPtr;
- return;
- }
- tmpPtr.i = tmpPtr.p->m_next;
- }
- nodePtr.i = RNIL;
- nodePtr.p = 0;
-}
-
-/*
- * Get handle for existing node.
- */
-void
-Dbtux::selectNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr, AccSize acc)
+int
+Dbtux::allocNode(Signal* signal, NodeHandle& node)
{
- ndbrequire(addr != NullTupAddr && acc > AccNone);
- NodeHandlePtr tmpPtr;
- // search in cache
- findNode(signal, frag, tmpPtr, addr);
- if (tmpPtr.i == RNIL) {
+ Frag& frag = node.m_frag;
+ Uint32 pageId = NullTupLoc.m_pageId;
+ Uint32 pageOffset = NullTupLoc.m_pageOffset;
+ Uint32* node32 = 0;
+ int errorCode = c_tup->tuxAllocNode(signal, frag.m_tupIndexFragPtrI, pageId, pageOffset, node32);
+ jamEntry();
+ if (errorCode == 0) {
jam();
- // add new node
- seizeNode(signal, frag, tmpPtr);
- ndbrequire(tmpPtr.i != RNIL);
- tmpPtr.p->m_addr = addr;
+ node.m_loc = TupLoc(pageId, pageOffset);
+ node.m_node = reinterpret_cast<TreeNode*>(node32);
+ node.m_acc = AccNone;
+ ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
}
- if (tmpPtr.p->m_acc < acc) {
- jam();
- accessNode(signal, frag, tmpPtr, acc);
- }
- nodePtr = tmpPtr;
+ return errorCode;
}
/*
- * Create new node in the cache and mark it for insert.
+ * Access more of the node.
*/
void
-Dbtux::insertNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc)
+Dbtux::accessNode(Signal* signal, NodeHandle& node, AccSize acc)
{
- ndbrequire(acc > AccNone);
- NodeHandlePtr tmpPtr;
- // use the pre-allocated node
- tmpPtr.i = frag.m_nodeFree;
- frag.m_nodeFree = RNIL;
- c_nodeHandlePool.getPtr(tmpPtr);
- // move it to the cache
- tmpPtr.p->m_next = frag.m_nodeList;
- frag.m_nodeList = tmpPtr.i;
- tmpPtr.p->m_acc = acc;
- tmpPtr.p->m_flags |= NodeHandle::DoInsert;
- nodePtr = tmpPtr;
+ ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
+ if (node.m_acc >= acc)
+ return;
+ // XXX could do prefetch
+ node.m_acc = acc;
}
/*
- * Mark existing node for deletion.
+ * Set handle to point to existing node.
*/
void
-Dbtux::deleteNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr)
+Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc)
{
- NodeHandlePtr tmpPtr = nodePtr;
- ndbrequire(tmpPtr.p->getOccup() == 0);
- tmpPtr.p->m_flags |= NodeHandle::DoDelete;
- // scans have already been moved by popDown or popUp
+ Frag& frag = node.m_frag;
+ ndbrequire(loc != NullTupLoc);
+ Uint32 pageId = loc.m_pageId;
+ Uint32 pageOffset = loc.m_pageOffset;
+ Uint32* node32 = 0;
+ c_tup->tuxGetNode(frag.m_tupIndexFragPtrI, pageId, pageOffset, node32);
+ jamEntry();
+ node.m_loc = loc;
+ node.m_node = reinterpret_cast<TreeNode*>(node32);
+ node.m_acc = AccNone;
+ ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0);
+ accessNode(signal, node, acc);
}
/*
- * Access more of the node.
+ * Set handle to point to new node. Uses the pre-allocated node.
*/
void
-Dbtux::accessNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc)
+Dbtux::insertNode(Signal* signal, NodeHandle& node, AccSize acc)
{
+ Frag& frag = node.m_frag;
+ TupLoc loc = frag.m_freeLoc;
+ frag.m_freeLoc = NullTupLoc;
+ selectNode(signal, node, loc, acc);
+ new (node.m_node) TreeNode();
+#ifdef VM_TRACE
TreeHead& tree = frag.m_tree;
- NodeHandlePtr tmpPtr = nodePtr;
- if (tmpPtr.p->m_acc >= acc)
- return;
- if (! (tmpPtr.p->m_flags & NodeHandle::DoInsert)) {
- jam();
- StorePar storePar;
- storePar.m_opCode = TupStoreTh::OpRead;
- storePar.m_offset = tree.getSize(tmpPtr.p->m_acc);
- storePar.m_size = tree.getSize(acc) - tree.getSize(tmpPtr.p->m_acc);
- tmpPtr.p->m_tux.tupStoreTh(signal, frag, tmpPtr, storePar);
- ndbrequire(storePar.m_errorCode == 0);
- }
- tmpPtr.p->m_acc = acc;
+ memset(node.getPref(0), 0xa2, tree.m_prefSize << 2);
+ memset(node.getPref(1), 0xa2, tree.m_prefSize << 2);
+ TreeEnt* entList = tree.getEntList(node.m_node);
+ memset(entList, 0xa4, (tree.m_maxOccup + 1) * (TreeEntSize << 2));
+#endif
}
/*
- * Set prefix.
+ * Delete existing node.
*/
void
-Dbtux::setNodePref(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i)
+Dbtux::deleteNode(Signal* signal, NodeHandle& node)
{
- TreeHead& tree = frag.m_tree;
- NodeHandlePtr tmpPtr = nodePtr;
- ReadPar readPar;
- ndbrequire(i <= 1);
- readPar.m_ent = tmpPtr.p->getMinMax(i);
- readPar.m_first = 0;
- readPar.m_count = frag.m_numAttrs;
- // leave in signal data
- readPar.m_data = 0;
- // XXX implement max words to read
- tupReadAttrs(signal, frag, readPar);
- // copy whatever fits
- CopyPar copyPar;
- copyPar.m_items = readPar.m_count;
- copyPar.m_headers = true;
- copyPar.m_maxwords = tree.m_prefSize;
- Data pref = tmpPtr.p->getPref(i);
- copyAttrs(pref, readPar.m_data, copyPar);
- nodePtr.p->m_flags |= NodeHandle::DoUpdate;
+ Frag& frag = node.m_frag;
+ ndbrequire(node.getOccup() == 0);
+ TupLoc loc = node.m_loc;
+ Uint32 pageId = loc.m_pageId;
+ Uint32 pageOffset = loc.m_pageOffset;
+ Uint32* node32 = reinterpret_cast<Uint32*>(node.m_node);
+ c_tup->tuxFreeNode(signal, frag.m_tupIndexFragPtrI, pageId, pageOffset, node32);
+ jamEntry();
+ // invalidate handle and storage
+ node.m_loc = NullTupLoc;
+ node.m_node = 0;
}
/*
- * Commit and release nodes at the end of an operation. Used also on
- * error since no changes have been made (updateOk false).
+ * Set prefix. Copies the number of words that fits. Includes
+ * attribute headers for now. XXX use null mask instead
*/
void
-Dbtux::commitNodes(Signal* signal, Frag& frag, bool updateOk)
+Dbtux::setNodePref(Signal* signal, NodeHandle& node, unsigned i)
{
- TreeHead& tree = frag.m_tree;
- NodeHandlePtr nodePtr;
- nodePtr.i = frag.m_nodeList;
- frag.m_nodeList = RNIL;
- while (nodePtr.i != RNIL) {
- c_nodeHandlePool.getPtr(nodePtr);
- const unsigned flags = nodePtr.p->m_flags;
- if (flags & NodeHandle::DoDelete) {
- jam();
- ndbrequire(updateOk);
- // delete
- StorePar storePar;
- storePar.m_opCode = TupStoreTh::OpDelete;
- nodePtr.p->m_tux.tupStoreTh(signal, frag, nodePtr, storePar);
- ndbrequire(storePar.m_errorCode == 0);
- } else if (flags & NodeHandle::DoUpdate) {
- jam();
- ndbrequire(updateOk);
- // set prefixes
- if (flags & (1 << 0)) {
- jam();
- setNodePref(signal, frag, nodePtr, 0);
- }
- if (flags & (1 << 1)) {
- jam();
- setNodePref(signal, frag, nodePtr, 1);
- }
- // update
- StorePar storePar;
- storePar.m_opCode = TupStoreTh::OpUpdate;
- storePar.m_offset = 0;
- storePar.m_size = tree.getSize(nodePtr.p->m_acc);
- nodePtr.p->m_tux.tupStoreTh(signal, frag, nodePtr, storePar);
- ndbrequire(storePar.m_errorCode == 0);
- }
- // release
- NodeHandlePtr tmpPtr = nodePtr;
- nodePtr.i = nodePtr.p->m_next;
- c_nodeHandlePool.release(tmpPtr);
- }
+ const Frag& frag = node.m_frag;
+ const TreeHead& tree = frag.m_tree;
+ readKeyAttrs(frag, node.getMinMax(i), 0, c_entryKey);
+ copyAttrs(frag, c_entryKey, node.getPref(i), tree.m_prefSize);
}
-// Dbtux::NodeHandle
+// node operations
/*
* Add entry at position. Move entries greater than or equal to the old
@@ -264,25 +136,26 @@ Dbtux::commitNodes(Signal* signal, Frag& frag, bool updateOk)
* 0 1 2 3 4 5 6 0 1 2 3 4 5 6
*/
void
-Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent)
+Dbtux::nodePushUp(Signal* signal, NodeHandle& node, unsigned pos, const TreeEnt& ent)
{
- TreeHead& tree = m_frag.m_tree;
- const unsigned occup = getOccup();
+ Frag& frag = node.m_frag;
+ TreeHead& tree = frag.m_tree;
+ const unsigned occup = node.getOccup();
ndbrequire(occup < tree.m_maxOccup && pos <= occup);
// fix scans
ScanOpPtr scanPtr;
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
if (scanPos.m_pos >= pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At pushUp pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At pushUp pos=" << pos << " " << node << endl;
}
#endif
scanPos.m_pos++;
@@ -290,7 +163,7 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent)
scanPtr.i = scanPtr.p->m_nodeScan;
}
// fix node
- TreeEnt* const entList = tree.getEntList(m_node);
+ TreeEnt* const entList = tree.getEntList(node.m_node);
entList[occup] = entList[0];
TreeEnt* const tmpList = entList + 1;
for (unsigned i = occup; i > pos; i--) {
@@ -298,18 +171,18 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent)
tmpList[i] = tmpList[i - 1];
}
tmpList[pos] = ent;
+ entList[0] = entList[occup + 1];
+ node.setOccup(occup + 1);
+ // fix prefixes
if (occup == 0 || pos == 0)
- m_flags |= (1 << 0);
+ setNodePref(signal, node, 0);
if (occup == 0 || pos == occup)
- m_flags |= (1 << 1);
- entList[0] = entList[occup + 1];
- setOccup(occup + 1);
- m_flags |= DoUpdate;
+ setNodePref(signal, node, 1);
}
/*
* Remove and return entry at position. Move entries greater than the
- * removed one to the left. This is the opposite of pushUp.
+ * removed one to the left. This is the opposite of nodePushUp.
*
* D
* ^ ^
@@ -317,46 +190,47 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent)
* 0 1 2 3 4 5 6 0 1 2 3 4 5 6
*/
void
-Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent)
+Dbtux::nodePopDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent)
{
- TreeHead& tree = m_frag.m_tree;
- const unsigned occup = getOccup();
+ Frag& frag = node.m_frag;
+ TreeHead& tree = frag.m_tree;
+ const unsigned occup = node.getOccup();
ndbrequire(occup <= tree.m_maxOccup && pos < occup);
ScanOpPtr scanPtr;
// move scans whose entry disappears
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
const Uint32 nextPtrI = scanPtr.p->m_nodeScan;
if (scanPos.m_pos == pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At popDown pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At popDown pos=" << pos << " " << node << endl;
}
#endif
- m_tux.scanNext(signal, scanPtr);
+ scanNext(signal, scanPtr);
}
scanPtr.i = nextPtrI;
}
// fix other scans
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
ndbrequire(scanPos.m_pos != pos);
if (scanPos.m_pos > pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At popDown pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At popDown pos=" << pos << " " << node << endl;
}
#endif
scanPos.m_pos--;
@@ -364,7 +238,7 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent)
scanPtr.i = scanPtr.p->m_nodeScan;
}
// fix node
- TreeEnt* const entList = tree.getEntList(m_node);
+ TreeEnt* const entList = tree.getEntList(node.m_node);
entList[occup] = entList[0];
TreeEnt* const tmpList = entList + 1;
ent = tmpList[pos];
@@ -372,13 +246,13 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent)
jam();
tmpList[i] = tmpList[i + 1];
}
+ entList[0] = entList[occup - 1];
+ node.setOccup(occup - 1);
+ // fix prefixes
if (occup != 1 && pos == 0)
- m_flags |= (1 << 0);
+ setNodePref(signal, node, 0);
if (occup != 1 && pos == occup - 1)
- m_flags |= (1 << 1);
- entList[0] = entList[occup - 1];
- setOccup(occup - 1);
- m_flags |= DoUpdate;
+ setNodePref(signal, node, 1);
}
/*
@@ -391,47 +265,48 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent)
* 0 1 2 3 4 5 6 0 1 2 3 4 5 6
*/
void
-Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent)
+Dbtux::nodePushDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent)
{
- TreeHead& tree = m_frag.m_tree;
- const unsigned occup = getOccup();
+ Frag& frag = node.m_frag;
+ TreeHead& tree = frag.m_tree;
+ const unsigned occup = node.getOccup();
ndbrequire(occup <= tree.m_maxOccup && pos < occup);
ScanOpPtr scanPtr;
// move scans whose entry disappears
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
const Uint32 nextPtrI = scanPtr.p->m_nodeScan;
if (scanPos.m_pos == 0) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At pushDown pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At pushDown pos=" << pos << " " << node << endl;
}
#endif
// here we may miss a valid entry "X" XXX known bug
- m_tux.scanNext(signal, scanPtr);
+ scanNext(signal, scanPtr);
}
scanPtr.i = nextPtrI;
}
// fix other scans
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
ndbrequire(scanPos.m_pos != 0);
if (scanPos.m_pos <= pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At pushDown pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At pushDown pos=" << pos << " " << node << endl;
}
#endif
scanPos.m_pos--;
@@ -439,7 +314,7 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent)
scanPtr.i = scanPtr.p->m_nodeScan;
}
// fix node
- TreeEnt* const entList = tree.getEntList(m_node);
+ TreeEnt* const entList = tree.getEntList(node.m_node);
entList[occup] = entList[0];
TreeEnt* const tmpList = entList + 1;
TreeEnt oldMin = tmpList[0];
@@ -449,18 +324,18 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent)
}
tmpList[pos] = ent;
ent = oldMin;
+ entList[0] = entList[occup];
+ // fix prefixes
if (true)
- m_flags |= (1 << 0);
+ setNodePref(signal, node, 0);
if (occup == 1 || pos == occup - 1)
- m_flags |= (1 << 1);
- entList[0] = entList[occup];
- m_flags |= DoUpdate;
+ setNodePref(signal, node, 1);
}
/*
* Remove and return entry at position. Move entries less than the
* removed one to the right. Replace min entry by the input entry.
- * This is the opposite of pushDown.
+ * This is the opposite of nodePushDown.
*
* X D
* v ^ ^
@@ -468,47 +343,48 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent)
* 0 1 2 3 4 5 6 0 1 2 3 4 5 6
*/
void
-Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent)
+Dbtux::nodePopUp(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent)
{
- TreeHead& tree = m_frag.m_tree;
- const unsigned occup = getOccup();
+ Frag& frag = node.m_frag;
+ TreeHead& tree = frag.m_tree;
+ const unsigned occup = node.getOccup();
ndbrequire(occup <= tree.m_maxOccup && pos < occup);
ScanOpPtr scanPtr;
// move scans whose entry disappears
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
const Uint32 nextPtrI = scanPtr.p->m_nodeScan;
if (scanPos.m_pos == pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At popUp pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At popUp pos=" << pos << " " << node << endl;
}
#endif
// here we may miss a valid entry "X" XXX known bug
- m_tux.scanNext(signal, scanPtr);
+ scanNext(signal, scanPtr);
}
scanPtr.i = nextPtrI;
}
// fix other scans
- scanPtr.i = getNodeScan();
+ scanPtr.i = node.getNodeScan();
while (scanPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(scanPtr);
+ c_scanOpPool.getPtr(scanPtr);
TreePos& scanPos = scanPtr.p->m_scanPos;
- ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup);
+ ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup);
ndbrequire(scanPos.m_pos != pos);
if (scanPos.m_pos < pos) {
jam();
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "At popUp pos=" << pos << " " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "At popUp pos=" << pos << " " << node << endl;
}
#endif
scanPos.m_pos++;
@@ -516,7 +392,7 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent)
scanPtr.i = scanPtr.p->m_nodeScan;
}
// fix node
- TreeEnt* const entList = tree.getEntList(m_node);
+ TreeEnt* const entList = tree.getEntList(node.m_node);
entList[occup] = entList[0];
TreeEnt* const tmpList = entList + 1;
TreeEnt newMin = ent;
@@ -526,12 +402,12 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent)
tmpList[i] = tmpList[i - 1];
}
tmpList[0] = newMin;
+ entList[0] = entList[occup];
+ // fix prefixes
if (true)
- m_flags |= (1 << 0);
+ setNodePref(signal, node, 0);
if (occup == 1 || pos == occup - 1)
- m_flags |= (1 << 1);
- entList[0] = entList[occup];
- m_flags |= DoUpdate;
+ setNodePref(signal, node, 1);
}
/*
@@ -539,14 +415,15 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent)
* after the max (i=1). XXX can be optimized
*/
void
-Dbtux::NodeHandle::slide(Signal* signal, NodeHandlePtr nodePtr, unsigned i)
+Dbtux::nodeSlide(Signal* signal, NodeHandle& dstNode, NodeHandle& srcNode, unsigned i)
{
+ Frag& frag = dstNode.m_frag;
+ TreeHead& tree = frag.m_tree;
ndbrequire(i <= 1);
- TreeHead& tree = m_frag.m_tree;
- while (getOccup() < tree.m_maxOccup && nodePtr.p->getOccup() != 0) {
+ while (dstNode.getOccup() < tree.m_maxOccup && srcNode.getOccup() != 0) {
TreeEnt ent;
- nodePtr.p->popDown(signal, i == 0 ? nodePtr.p->getOccup() - 1 : 0, ent);
- pushUp(signal, i == 0 ? 0 : getOccup(), ent);
+ nodePopDown(signal, srcNode, i == 0 ? srcNode.getOccup() - 1 : 0, ent);
+ nodePushUp(signal, dstNode, i == 0 ? 0 : dstNode.getOccup(), ent);
}
}
@@ -555,50 +432,50 @@ Dbtux::NodeHandle::slide(Signal* signal, NodeHandlePtr nodePtr, unsigned i)
* ordering does not matter.
*/
void
-Dbtux::NodeHandle::linkScan(Dbtux::ScanOpPtr scanPtr)
+Dbtux::linkScan(NodeHandle& node, ScanOpPtr scanPtr)
{
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Link scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "To node " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Link scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "To node " << node << endl;
}
#endif
- ndbrequire(! islinkScan(scanPtr) && scanPtr.p->m_nodeScan == RNIL);
- scanPtr.p->m_nodeScan = getNodeScan();
- setNodeScan(scanPtr.i);
+ ndbrequire(! islinkScan(node, scanPtr) && scanPtr.p->m_nodeScan == RNIL);
+ scanPtr.p->m_nodeScan = node.getNodeScan();
+ node.setNodeScan(scanPtr.i);
}
/*
* Unlink a scan from the list under the node.
*/
void
-Dbtux::NodeHandle::unlinkScan(Dbtux::ScanOpPtr scanPtr)
+Dbtux::unlinkScan(NodeHandle& node, ScanOpPtr scanPtr)
{
#ifdef VM_TRACE
- if (m_tux.debugFlags & m_tux.DebugScan) {
- m_tux.debugOut << "Unlink scan " << scanPtr.i << " " << *scanPtr.p << endl;
- m_tux.debugOut << "From node " << *this << endl;
+ if (debugFlags & DebugScan) {
+ debugOut << "Unlink scan " << scanPtr.i << " " << *scanPtr.p << endl;
+ debugOut << "From node " << node << endl;
}
#endif
- Dbtux::ScanOpPtr currPtr;
- currPtr.i = getNodeScan();
- Dbtux::ScanOpPtr prevPtr;
+ ScanOpPtr currPtr;
+ currPtr.i = node.getNodeScan();
+ ScanOpPtr prevPtr;
prevPtr.i = RNIL;
while (true) {
jam();
- m_tux.c_scanOpPool.getPtr(currPtr);
+ c_scanOpPool.getPtr(currPtr);
Uint32 nextPtrI = currPtr.p->m_nodeScan;
if (currPtr.i == scanPtr.i) {
jam();
if (prevPtr.i == RNIL) {
- setNodeScan(nextPtrI);
+ node.setNodeScan(nextPtrI);
} else {
jam();
prevPtr.p->m_nodeScan = nextPtrI;
}
scanPtr.p->m_nodeScan = RNIL;
// check for duplicates
- ndbrequire(! islinkScan(scanPtr));
+ ndbrequire(! islinkScan(node, scanPtr));
return;
}
prevPtr = currPtr;
@@ -610,13 +487,13 @@ Dbtux::NodeHandle::unlinkScan(Dbtux::ScanOpPtr scanPtr)
* Check if a scan is linked to this node. Only for ndbrequire.
*/
bool
-Dbtux::NodeHandle::islinkScan(Dbtux::ScanOpPtr scanPtr)
+Dbtux::islinkScan(NodeHandle& node, ScanOpPtr scanPtr)
{
- Dbtux::ScanOpPtr currPtr;
- currPtr.i = getNodeScan();
+ ScanOpPtr currPtr;
+ currPtr.i = node.getNodeScan();
while (currPtr.i != RNIL) {
jam();
- m_tux.c_scanOpPool.getPtr(currPtr);
+ c_scanOpPool.getPtr(currPtr);
if (currPtr.i == scanPtr.i) {
jam();
return true;
@@ -627,7 +504,7 @@ Dbtux::NodeHandle::islinkScan(Dbtux::ScanOpPtr scanPtr)
}
void
-Dbtux::NodeHandle::progError(int line, int cause, const char* extra)
+Dbtux::NodeHandle::progError(int line, int cause, const char* file)
{
- m_tux.progError(line, cause, extra);
+ ErrorReporter::handleAssert("Dbtux::NodeHandle: assert failed", file, line);
}
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
index eaa539d9cfc..703b0abb683 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
@@ -42,12 +42,11 @@ Dbtux::execACC_SCANREQ(Signal* signal)
}
ndbrequire(fragPtr.i != RNIL);
Frag& frag = *fragPtr.p;
- ndbrequire(frag.m_nodeList == RNIL);
// must be normal DIH/TC fragment
ndbrequire(frag.m_fragId < (1 << frag.m_fragOff));
TreeHead& tree = frag.m_tree;
// check for empty fragment
- if (tree.m_root == NullTupAddr) {
+ if (tree.m_root == NullTupLoc) {
jam();
AccScanConf* const conf = (AccScanConf*)signal->getDataPtrSend();
conf->scanPtr = req->senderData;
@@ -241,7 +240,6 @@ Dbtux::execNEXT_SCANREQ(Signal* signal)
debugOut << "NEXT_SCANREQ scan " << scanPtr.i << " " << scan << endl;
}
#endif
- ndbrequire(frag.m_nodeList == RNIL);
// handle unlock previous and close scan
switch (req->scanFlag) {
case NextScanReq::ZSCAN_NEXT:
@@ -275,13 +273,13 @@ Dbtux::execNEXT_SCANREQ(Signal* signal)
case NextScanReq::ZSCAN_CLOSE:
jam();
// unlink from tree node first to avoid state changes
- if (scan.m_scanPos.m_addr != NullTupAddr) {
+ if (scan.m_scanPos.m_loc != NullTupLoc) {
jam();
- const TupAddr addr = scan.m_scanPos.m_addr;
- NodeHandlePtr nodePtr;
- selectNode(signal, frag, nodePtr, addr, AccHead);
- nodePtr.p->unlinkScan(scanPtr);
- scan.m_scanPos.m_addr = NullTupAddr;
+ const TupLoc loc = scan.m_scanPos.m_loc;
+ NodeHandle node(frag);
+ selectNode(signal, node, loc, AccHead);
+ unlinkScan(node, scanPtr);
+ scan.m_scanPos.m_loc = NullTupLoc;
}
if (scan.m_lockwait) {
jam();
@@ -295,7 +293,6 @@ Dbtux::execNEXT_SCANREQ(Signal* signal)
jamEntry();
ndbrequire(lockReq->returnCode == AccLockReq::Success);
scan.m_state = ScanOp::Aborting;
- commitNodes(signal, frag, true);
return;
}
if (scan.m_state == ScanOp::Locked) {
@@ -350,7 +347,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
signal->theData[1] = true;
EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2);
jamEntry();
- commitNodes(signal, frag, true);
return; // stop
}
if (scan.m_lockwait) {
@@ -365,7 +361,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
// if TC has ordered scan close, it will be detected here
sendSignal(scan.m_userRef, GSN_NEXT_SCANCONF,
signal, signalLength, JBB);
- commitNodes(signal, frag, true);
return; // stop
}
if (scan.m_state == ScanOp::First) {
@@ -395,7 +390,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
const TreeEnt ent = scan.m_scanPos.m_ent;
// read tuple key
keyPar.m_ent = ent;
- keyPar.m_data = c_keyBuffer;
+ keyPar.m_data = c_dataBuffer;
tupReadKeys(signal, frag, keyPar);
// get read lock or exclusive lock
AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend();
@@ -407,12 +402,11 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
lockReq->userRef = reference();
lockReq->tableId = scan.m_tableId;
lockReq->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff);
- // should cache this at fragment create
- lockReq->fragPtrI = RNIL;
+ lockReq->fragPtrI = frag.m_accTableFragPtrI[ent.m_fragBit];
const Uint32* const buf32 = static_cast<Uint32*>(keyPar.m_data);
const Uint64* const buf64 = reinterpret_cast<const Uint64*>(buf32);
lockReq->hashValue = md5_hash(buf64, keyPar.m_size);
- lockReq->tupAddr = ent.m_tupAddr;
+ lockReq->tupAddr = getTupAddr(frag, ent);
lockReq->transId1 = scan.m_transId1;
lockReq->transId2 = scan.m_transId2;
// execute
@@ -445,7 +439,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
signal->theData[1] = true;
EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2);
jamEntry();
- commitNodes(signal, frag, true);
return; // stop
break;
case AccLockReq::Refused:
@@ -458,7 +451,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
signal->theData[1] = true;
EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2);
jamEntry();
- commitNodes(signal, frag, true);
return; // stop
break;
case AccLockReq::NoFreeOp:
@@ -471,7 +463,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
signal->theData[1] = true;
EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2);
jamEntry();
- commitNodes(signal, frag, true);
return; // stop
break;
default:
@@ -492,7 +483,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
if (keyPar.m_data == 0) {
jam();
keyPar.m_ent = ent;
- keyPar.m_data = c_keyBuffer;
+ keyPar.m_data = c_dataBuffer;
tupReadKeys(signal, frag, keyPar);
}
}
@@ -512,7 +503,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
}
conf->accOperationPtr = accLockOp;
conf->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff);
- conf->localKey[0] = ent.m_tupAddr;
+ conf->localKey[0] = getTupAddr(frag, ent);
conf->localKey[1] = 0;
conf->localKeyLength = 1;
unsigned signalLength = 6;
@@ -555,7 +546,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
scan.m_lastEnt = ent;
// next time look for next entry
scan.m_state = ScanOp::Next;
- commitNodes(signal, frag, true);
return;
}
// XXX in ACC this is checked before req->checkLcpStop
@@ -569,7 +559,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal)
unsigned signalLength = 3;
sendSignal(scanPtr.p->m_userRef, GSN_NEXT_SCANCONF,
signal, signalLength, JBB);
- commitNodes(signal, frag, true);
return;
}
ndbrequire(false);
@@ -700,45 +689,45 @@ Dbtux::scanFirst(Signal* signal, ScanOpPtr scanPtr)
ScanOp& scan = *scanPtr.p;
Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI);
TreeHead& tree = frag.m_tree;
- if (tree.m_root == NullTupAddr) {
+ if (tree.m_root == NullTupLoc) {
// tree may have become empty
jam();
scan.m_state = ScanOp::Last;
return;
}
TreePos pos;
- pos.m_addr = tree.m_root;
- NodeHandlePtr nodePtr;
+ pos.m_loc = tree.m_root;
+ NodeHandle node(frag);
// unpack lower bound
const ScanBound& bound = *scan.m_bound[0];
ScanBoundIterator iter;
bound.first(iter);
for (unsigned j = 0; j < bound.getSize(); j++) {
jam();
- c_keyBuffer[j] = *iter.data;
+ c_dataBuffer[j] = *iter.data;
bound.next(iter);
}
// comparison parameters
BoundPar boundPar;
- boundPar.m_data1 = c_keyBuffer;
+ boundPar.m_data1 = c_dataBuffer;
boundPar.m_count1 = scan.m_boundCnt[0];
boundPar.m_dir = 0;
loop: {
jam();
- selectNode(signal, frag, nodePtr, pos.m_addr, AccPref);
- const unsigned occup = nodePtr.p->getOccup();
+ selectNode(signal, node, pos.m_loc, AccPref);
+ const unsigned occup = node.getOccup();
ndbrequire(occup != 0);
for (unsigned i = 0; i <= 1; i++) {
jam();
// compare prefix
- boundPar.m_data2 = nodePtr.p->getPref(i);
+ boundPar.m_data2 = node.getPref(i);
boundPar.m_len2 = tree.m_prefSize;
int ret = cmpScanBound(frag, boundPar);
if (ret == NdbSqlUtil::CmpUnknown) {
jam();
// read full value
ReadPar readPar;
- readPar.m_ent = nodePtr.p->getMinMax(i);
+ readPar.m_ent = node.getMinMax(i);
readPar.m_first = 0;
readPar.m_count = frag.m_numAttrs;
readPar.m_data = 0; // leave in signal data
@@ -751,11 +740,11 @@ loop: {
}
if (i == 0 && ret < 0) {
jam();
- const TupAddr tupAddr = nodePtr.p->getLink(i);
- if (tupAddr != NullTupAddr) {
+ const TupLoc loc = node.getLink(i);
+ if (loc != NullTupLoc) {
jam();
// continue to left subtree
- pos.m_addr = tupAddr;
+ pos.m_loc = loc;
goto loop;
}
// start scanning this node
@@ -764,34 +753,34 @@ loop: {
pos.m_dir = 3;
scan.m_scanPos = pos;
scan.m_state = ScanOp::Next;
- nodePtr.p->linkScan(scanPtr);
+ linkScan(node, scanPtr);
return;
}
if (i == 1 && ret > 0) {
jam();
- const TupAddr tupAddr = nodePtr.p->getLink(i);
- if (tupAddr != NullTupAddr) {
+ const TupLoc loc = node.getLink(i);
+ if (loc != NullTupLoc) {
jam();
// continue to right subtree
- pos.m_addr = tupAddr;
+ pos.m_loc = loc;
goto loop;
}
// start scanning upwards
pos.m_dir = 1;
scan.m_scanPos = pos;
scan.m_state = ScanOp::Next;
- nodePtr.p->linkScan(scanPtr);
+ linkScan(node, scanPtr);
return;
}
}
// read rest of current node
- accessNode(signal, frag, nodePtr, AccFull);
+ accessNode(signal, node, AccFull);
// look for first entry
ndbrequire(occup >= 2);
for (unsigned j = 1; j < occup; j++) {
jam();
ReadPar readPar;
- readPar.m_ent = nodePtr.p->getEnt(j);
+ readPar.m_ent = node.getEnt(j);
readPar.m_first = 0;
readPar.m_count = frag.m_numAttrs;
readPar.m_data = 0; // leave in signal data
@@ -809,7 +798,7 @@ loop: {
pos.m_dir = 3;
scan.m_scanPos = pos;
scan.m_state = ScanOp::Next;
- nodePtr.p->linkScan(scanPtr);
+ linkScan(node, scanPtr);
return;
}
}
@@ -858,42 +847,42 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
bound.first(iter);
for (unsigned j = 0; j < bound.getSize(); j++) {
jam();
- c_keyBuffer[j] = *iter.data;
+ c_dataBuffer[j] = *iter.data;
bound.next(iter);
}
// comparison parameters
BoundPar boundPar;
- boundPar.m_data1 = c_keyBuffer;
+ boundPar.m_data1 = c_dataBuffer;
boundPar.m_count1 = scan.m_boundCnt[1];
boundPar.m_dir = 1;
// use copy of position
TreePos pos = scan.m_scanPos;
// get and remember original node
- NodeHandlePtr origNodePtr;
- selectNode(signal, frag, origNodePtr, pos.m_addr, AccHead);
- ndbrequire(origNodePtr.p->islinkScan(scanPtr));
+ NodeHandle origNode(frag);
+ selectNode(signal, origNode, pos.m_loc, AccHead);
+ ndbrequire(islinkScan(origNode, scanPtr));
// current node in loop
- NodeHandlePtr nodePtr = origNodePtr;
+ NodeHandle node = origNode;
while (true) {
jam();
if (pos.m_dir == 2) {
// coming up from root ends the scan
jam();
- pos.m_addr = NullTupAddr;
+ pos.m_loc = NullTupLoc;
scan.m_state = ScanOp::Last;
break;
}
- if (nodePtr.p->m_addr != pos.m_addr) {
+ if (node.m_loc != pos.m_loc) {
jam();
- selectNode(signal, frag, nodePtr, pos.m_addr, AccHead);
+ selectNode(signal, node, pos.m_loc, AccHead);
}
if (pos.m_dir == 4) {
// coming down from parent proceed to left child
jam();
- TupAddr addr = nodePtr.p->getLink(0);
- if (addr != NullTupAddr) {
+ TupLoc loc = node.getLink(0);
+ if (loc != NullTupLoc) {
jam();
- pos.m_addr = addr;
+ pos.m_loc = loc;
pos.m_dir = 4; // unchanged
continue;
}
@@ -910,10 +899,10 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
if (pos.m_dir == 3) {
// within node
jam();
- unsigned occup = nodePtr.p->getOccup();
+ unsigned occup = node.getOccup();
ndbrequire(occup >= 1);
// access full node
- accessNode(signal, frag, nodePtr, AccFull);
+ accessNode(signal, node, AccFull);
// advance position
if (! pos.m_match)
pos.m_match = true;
@@ -921,7 +910,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
pos.m_pos++;
if (pos.m_pos < occup) {
jam();
- pos.m_ent = nodePtr.p->getEnt(pos.m_pos);
+ pos.m_ent = node.getEnt(pos.m_pos);
pos.m_dir = 3; // unchanged
// XXX implement prefix optimization
ReadPar readPar;
@@ -938,7 +927,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
if (ret < 0) {
jam();
// hit upper bound of single range scan
- pos.m_addr = NullTupAddr;
+ pos.m_loc = NullTupLoc;
scan.m_state = ScanOp::Last;
break;
}
@@ -952,10 +941,10 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
break;
}
// after node proceed to right child
- TupAddr addr = nodePtr.p->getLink(1);
- if (addr != NullTupAddr) {
+ TupLoc loc = node.getLink(1);
+ if (loc != NullTupLoc) {
jam();
- pos.m_addr = addr;
+ pos.m_loc = loc;
pos.m_dir = 4;
continue;
}
@@ -965,8 +954,8 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
if (pos.m_dir == 1) {
// coming from right child proceed to parent
jam();
- pos.m_addr = nodePtr.p->getLink(2);
- pos.m_dir = nodePtr.p->getSide();
+ pos.m_loc = node.getLink(2);
+ pos.m_dir = node.getSide();
continue;
}
ndbrequire(false);
@@ -975,16 +964,16 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr)
scan.m_scanPos = pos;
// relink
if (scan.m_state == ScanOp::Current) {
- ndbrequire(pos.m_addr == nodePtr.p->m_addr);
- if (origNodePtr.i != nodePtr.i) {
+ ndbrequire(pos.m_loc == node.m_loc);
+ if (origNode.m_loc != node.m_loc) {
jam();
- origNodePtr.p->unlinkScan(scanPtr);
- nodePtr.p->linkScan(scanPtr);
+ unlinkScan(origNode, scanPtr);
+ linkScan(node, scanPtr);
}
} else if (scan.m_state == ScanOp::Last) {
jam();
- ndbrequire(pos.m_addr == NullTupAddr);
- origNodePtr.p->unlinkScan(scanPtr);
+ ndbrequire(pos.m_loc == NullTupLoc);
+ unlinkScan(origNode, scanPtr);
} else {
ndbrequire(false);
}
@@ -1012,10 +1001,10 @@ Dbtux::scanVisible(Signal* signal, ScanOpPtr scanPtr, TreeEnt ent)
Uint32 tableId = frag.m_tableId;
Uint32 fragBit = ent.m_fragBit;
Uint32 fragId = frag.m_fragId | (fragBit << frag.m_fragOff);
- Uint32 tupAddr = ent.m_tupAddr;
+ Uint32 tupAddr = getTupAddr(frag, ent);
Uint32 tupVersion = ent.m_tupVersion;
/* Check for same tuple twice in row */
- if (scan.m_lastEnt.m_tupAddr == tupAddr &&
+ if (scan.m_lastEnt.m_tupLoc == ent.m_tupLoc &&
scan.m_lastEnt.m_fragBit == fragBit) {
jam();
return false;
@@ -1044,7 +1033,6 @@ void
Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr)
{
ScanOp& scan = *scanPtr.p;
- Frag& frag = *c_fragPool.getPtr(scanPtr.p->m_fragPtrI);
ndbrequire(! scan.m_lockwait && scan.m_accLockOp == RNIL);
// unlock all not unlocked by LQH
for (unsigned i = 0; i < MaxAccLockOps; i++) {
@@ -1069,7 +1057,6 @@ Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr)
sendSignal(scanPtr.p->m_userRef, GSN_NEXT_SCANCONF,
signal, signalLength, JBB);
releaseScanOp(scanPtr);
- commitNodes(signal, frag, true);
}
void
diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
index 860aa65414f..7c3f5fa36b8 100644
--- a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
+++ b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp
@@ -26,71 +26,55 @@
* same in min/max need not be checked.
*/
void
-Dbtux::treeSearch(Signal* signal, Frag& frag, SearchPar searchPar, TreePos& treePos)
+Dbtux::treeSearch(Signal* signal, Frag& frag, TableData searchKey, TreeEnt searchEnt, TreePos& treePos)
{
const TreeHead& tree = frag.m_tree;
const unsigned numAttrs = frag.m_numAttrs;
- treePos.m_addr = tree.m_root;
- NodeHandlePtr nodePtr;
- if (treePos.m_addr == NullTupAddr) {
+ treePos.m_loc = tree.m_root;
+ if (treePos.m_loc == NullTupLoc) {
// empty tree
jam();
treePos.m_pos = 0;
treePos.m_match = false;
return;
}
+ NodeHandle node(frag);
loop: {
jam();
- selectNode(signal, frag, nodePtr, treePos.m_addr, AccPref);
- const unsigned occup = nodePtr.p->getOccup();
+ selectNode(signal, node, treePos.m_loc, AccPref);
+ const unsigned occup = node.getOccup();
ndbrequire(occup != 0);
// number of equal initial attributes in bounding node
- unsigned numEq = ZNIL;
+ unsigned start = ZNIL;
for (unsigned i = 0; i <= 1; i++) {
jam();
+ unsigned start1 = 0;
// compare prefix
- CmpPar cmpPar;
- cmpPar.m_data1 = searchPar.m_data;
- cmpPar.m_data2 = nodePtr.p->getPref(i);
- cmpPar.m_len2 = tree.m_prefSize;
- cmpPar.m_first = 0;
- cmpPar.m_numEq = 0;
- int ret = cmpTreeAttrs(frag, cmpPar);
+ int ret = cmpSearchKey(frag, start1, searchKey, node.getPref(i), tree.m_prefSize);
if (ret == NdbSqlUtil::CmpUnknown) {
jam();
- // read full value
- ReadPar readPar;
- readPar.m_ent = nodePtr.p->getMinMax(i);
- ndbrequire(cmpPar.m_numEq < numAttrs);
- readPar.m_first = cmpPar.m_numEq;
- readPar.m_count = numAttrs - cmpPar.m_numEq;
- readPar.m_data = 0; // leave in signal data
- tupReadAttrs(signal, frag, readPar);
- // compare full value
- cmpPar.m_data2 = readPar.m_data;
- cmpPar.m_len2 = ZNIL; // big
- cmpPar.m_first = readPar.m_first;
- ret = cmpTreeAttrs(frag, cmpPar);
+ // read and compare remaining attributes
+ readKeyAttrs(frag, node.getMinMax(i), start1, c_entryKey);
+ ret = cmpSearchKey(frag, start1, searchKey, c_entryKey);
ndbrequire(ret != NdbSqlUtil::CmpUnknown);
}
- if (numEq > cmpPar.m_numEq)
- numEq = cmpPar.m_numEq;
+ if (start > start1)
+ start = start1;
if (ret == 0) {
jam();
// keys are equal, compare entry values
- ret = searchPar.m_ent.cmp(nodePtr.p->getMinMax(i));
+ ret = searchEnt.cmp(node.getMinMax(i));
}
if (i == 0 ? (ret < 0) : (ret > 0)) {
jam();
- const TupAddr tupAddr = nodePtr.p->getLink(i);
- if (tupAddr != NullTupAddr) {
+ const TupLoc loc = node.getLink(i);
+ if (loc != NullTupLoc) {
jam();
// continue to left/right subtree
- treePos.m_addr = tupAddr;
+ treePos.m_loc = loc;
goto loop;
}
// position is immediately before/after this node
- // XXX disallow second case
treePos.m_pos = (i == 0 ? 0 : occup);
treePos.m_match = false;
return;
@@ -103,36 +87,26 @@ loop: {
return;
}
}
- // read rest of the bounding node
- accessNode(signal, frag, nodePtr, AccFull);
+ // access rest of the bounding node
+ accessNode(signal, node, AccFull);
// position is strictly within the node
ndbrequire(occup >= 2);
const unsigned numWithin = occup - 2;
for (unsigned j = 1; j <= numWithin; j++) {
jam();
int ret = 0;
- // compare remaining attributes
- if (numEq < numAttrs) {
+ if (start < numAttrs) {
jam();
- ReadPar readPar;
- readPar.m_ent = nodePtr.p->getEnt(j);
- readPar.m_first = numEq;
- readPar.m_count = numAttrs - numEq;
- readPar.m_data = 0; // leave in signal data
- tupReadAttrs(signal, frag, readPar);
- // compare
- CmpPar cmpPar;
- cmpPar.m_data1 = searchPar.m_data;
- cmpPar.m_data2 = readPar.m_data;
- cmpPar.m_len2 = ZNIL; // big
- cmpPar.m_first = readPar.m_first;
- ret = cmpTreeAttrs(frag, cmpPar);
+ // read and compare remaining attributes
+ unsigned start1 = start;
+ readKeyAttrs(frag, node.getEnt(j), start1, c_entryKey);
+ ret = cmpSearchKey(frag, start1, searchKey, c_entryKey);
ndbrequire(ret != NdbSqlUtil::CmpUnknown);
}
if (ret == 0) {
jam();
// keys are equal, compare entry values
- ret = searchPar.m_ent.cmp(nodePtr.p->getEnt(j));
+ ret = searchEnt.cmp(node.getEnt(j));
}
if (ret <= 0) {
jam();
@@ -157,94 +131,94 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
{
TreeHead& tree = frag.m_tree;
unsigned pos = treePos.m_pos;
- NodeHandlePtr nodePtr;
+ NodeHandle node(frag);
// check for empty tree
- if (treePos.m_addr == NullTupAddr) {
+ if (treePos.m_loc == NullTupLoc) {
jam();
- insertNode(signal, frag, nodePtr, AccPref);
- nodePtr.p->pushUp(signal, 0, ent);
- nodePtr.p->setSide(2);
- tree.m_root = nodePtr.p->m_addr;
+ insertNode(signal, node, AccPref);
+ nodePushUp(signal, node, 0, ent);
+ node.setSide(2);
+ tree.m_root = node.m_loc;
return;
}
// access full node
- selectNode(signal, frag, nodePtr, treePos.m_addr, AccFull);
+ selectNode(signal, node, treePos.m_loc, AccFull);
// check if it is bounding node
- if (pos != 0 && pos != nodePtr.p->getOccup()) {
+ if (pos != 0 && pos != node.getOccup()) {
jam();
// check if room for one more
- if (nodePtr.p->getOccup() < tree.m_maxOccup) {
+ if (node.getOccup() < tree.m_maxOccup) {
jam();
- nodePtr.p->pushUp(signal, pos, ent);
+ nodePushUp(signal, node, pos, ent);
return;
}
// returns min entry
- nodePtr.p->pushDown(signal, pos - 1, ent);
+ nodePushDown(signal, node, pos - 1, ent);
// find position to add the removed min entry
- TupAddr childAddr = nodePtr.p->getLink(0);
- if (childAddr == NullTupAddr) {
+ TupLoc childLoc = node.getLink(0);
+ if (childLoc == NullTupLoc) {
jam();
// left child will be added
pos = 0;
} else {
jam();
// find glb node
- while (childAddr != NullTupAddr) {
+ while (childLoc != NullTupLoc) {
jam();
- selectNode(signal, frag, nodePtr, childAddr, AccHead);
- childAddr = nodePtr.p->getLink(1);
+ selectNode(signal, node, childLoc, AccHead);
+ childLoc = node.getLink(1);
}
// access full node again
- accessNode(signal, frag, nodePtr, AccFull);
- pos = nodePtr.p->getOccup();
+ accessNode(signal, node, AccFull);
+ pos = node.getOccup();
}
// fall thru to next case
}
// adding new min or max
unsigned i = (pos == 0 ? 0 : 1);
- ndbrequire(nodePtr.p->getLink(i) == NullTupAddr);
+ ndbrequire(node.getLink(i) == NullTupLoc);
// check if the half-leaf/leaf has room for one more
- if (nodePtr.p->getOccup() < tree.m_maxOccup) {
+ if (node.getOccup() < tree.m_maxOccup) {
jam();
- nodePtr.p->pushUp(signal, pos, ent);
+ nodePushUp(signal, node, pos, ent);
return;
}
// add a new node
- NodeHandlePtr childPtr;
- insertNode(signal, frag, childPtr, AccPref);
- childPtr.p->pushUp(signal, 0, ent);
+ NodeHandle childNode(frag);
+ insertNode(signal, childNode, AccPref);
+ nodePushUp(signal, childNode, 0, ent);
// connect parent and child
- nodePtr.p->setLink(i, childPtr.p->m_addr);
- childPtr.p->setLink(2, nodePtr.p->m_addr);
- childPtr.p->setSide(i);
+ node.setLink(i, childNode.m_loc);
+ childNode.setLink(2, node.m_loc);
+ childNode.setSide(i);
// re-balance tree at each node
while (true) {
// height of subtree i has increased by 1
int j = (i == 0 ? -1 : +1);
- int b = nodePtr.p->getBalance();
+ int b = node.getBalance();
if (b == 0) {
// perfectly balanced
jam();
- nodePtr.p->setBalance(j);
+ node.setBalance(j);
// height change propagates up
} else if (b == -j) {
// height of shorter subtree increased
jam();
- nodePtr.p->setBalance(0);
+ node.setBalance(0);
// height of tree did not change - done
break;
} else if (b == j) {
// height of longer subtree increased
jam();
- NodeHandlePtr childPtr;
- selectNode(signal, frag, childPtr, nodePtr.p->getLink(i), AccHead);
- int b2 = childPtr.p->getBalance();
+ NodeHandle childNode(frag);
+ selectNode(signal, childNode, node.getLink(i), AccHead);
+ int b2 = childNode.getBalance();
if (b2 == b) {
jam();
- treeRotateSingle(signal, frag, nodePtr, i);
+ treeRotateSingle(signal, frag, node, i);
} else if (b2 == -b) {
jam();
- treeRotateDouble(signal, frag, nodePtr, i);
+ treeRotateDouble(signal, frag, node, i);
} else {
// height of subtree increased so it cannot be perfectly balanced
ndbrequire(false);
@@ -254,14 +228,14 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent)
} else {
ndbrequire(false);
}
- TupAddr parentAddr = nodePtr.p->getLink(2);
- if (parentAddr == NullTupAddr) {
+ TupLoc parentLoc = node.getLink(2);
+ if (parentLoc == NullTupLoc) {
jam();
// root node - done
break;
}
- i = nodePtr.p->getSide();
- selectNode(signal, frag, nodePtr, parentAddr, AccHead);
+ i = node.getSide();
+ selectNode(signal, node, parentLoc, AccHead);
}
}
@@ -273,101 +247,101 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
{
TreeHead& tree = frag.m_tree;
unsigned pos = treePos.m_pos;
- NodeHandlePtr nodePtr;
+ NodeHandle node(frag);
// access full node
- selectNode(signal, frag, nodePtr, treePos.m_addr, AccFull);
+ selectNode(signal, node, treePos.m_loc, AccFull);
TreeEnt ent;
// check interior node first
- if (nodePtr.p->getChilds() == 2) {
+ if (node.getChilds() == 2) {
jam();
- ndbrequire(nodePtr.p->getOccup() >= tree.m_minOccup);
+ ndbrequire(node.getOccup() >= tree.m_minOccup);
// check if no underflow
- if (nodePtr.p->getOccup() > tree.m_minOccup) {
+ if (node.getOccup() > tree.m_minOccup) {
jam();
- nodePtr.p->popDown(signal, pos, ent);
+ nodePopDown(signal, node, pos, ent);
return;
}
// save current handle
- NodeHandlePtr parentPtr = nodePtr;
+ NodeHandle parentNode = node;
// find glb node
- TupAddr childAddr = nodePtr.p->getLink(0);
- while (childAddr != NullTupAddr) {
+ TupLoc childLoc = node.getLink(0);
+ while (childLoc != NullTupLoc) {
jam();
- selectNode(signal, frag, nodePtr, childAddr, AccHead);
- childAddr = nodePtr.p->getLink(1);
+ selectNode(signal, node, childLoc, AccHead);
+ childLoc = node.getLink(1);
}
// access full node again
- accessNode(signal, frag, nodePtr, AccFull);
+ accessNode(signal, node, AccFull);
// use glb max as new parent min
- ent = nodePtr.p->getEnt(nodePtr.p->getOccup() - 1);
- parentPtr.p->popUp(signal, pos, ent);
+ ent = node.getEnt(node.getOccup() - 1);
+ nodePopUp(signal, parentNode, pos, ent);
// set up to remove glb max
- pos = nodePtr.p->getOccup() - 1;
+ pos = node.getOccup() - 1;
// fall thru to next case
}
// remove the element
- nodePtr.p->popDown(signal, pos, ent);
- ndbrequire(nodePtr.p->getChilds() <= 1);
+ nodePopDown(signal, node, pos, ent);
+ ndbrequire(node.getChilds() <= 1);
// handle half-leaf
for (unsigned i = 0; i <= 1; i++) {
jam();
- TupAddr childAddr = nodePtr.p->getLink(i);
- if (childAddr != NullTupAddr) {
+ TupLoc childLoc = node.getLink(i);
+ if (childLoc != NullTupLoc) {
// move to child
- selectNode(signal, frag, nodePtr, childAddr, AccFull);
+ selectNode(signal, node, childLoc, AccFull);
// balance of half-leaf parent requires child to be leaf
break;
}
}
- ndbrequire(nodePtr.p->getChilds() == 0);
+ ndbrequire(node.getChilds() == 0);
// get parent if any
- TupAddr parentAddr = nodePtr.p->getLink(2);
- NodeHandlePtr parentPtr;
- unsigned i = nodePtr.p->getSide();
+ TupLoc parentLoc = node.getLink(2);
+ NodeHandle parentNode(frag);
+ unsigned i = node.getSide();
// move all that fits into parent
- if (parentAddr != NullTupAddr) {
+ if (parentLoc != NullTupLoc) {
jam();
- selectNode(signal, frag, parentPtr, nodePtr.p->getLink(2), AccFull);
- parentPtr.p->slide(signal, nodePtr, i);
+ selectNode(signal, parentNode, node.getLink(2), AccFull);
+ nodeSlide(signal, parentNode, node, i);
// fall thru to next case
}
// non-empty leaf
- if (nodePtr.p->getOccup() >= 1) {
+ if (node.getOccup() >= 1) {
jam();
return;
}
// remove empty leaf
- deleteNode(signal, frag, nodePtr);
- if (parentAddr == NullTupAddr) {
+ deleteNode(signal, node);
+ if (parentLoc == NullTupLoc) {
jam();
// tree is now empty
- tree.m_root = NullTupAddr;
+ tree.m_root = NullTupLoc;
return;
}
- nodePtr = parentPtr;
- nodePtr.p->setLink(i, NullTupAddr);
+ node = parentNode;
+ node.setLink(i, NullTupLoc);
#ifdef dbtux_min_occup_less_max_occup
// check if we created a half-leaf
- if (nodePtr.p->getBalance() == 0) {
+ if (node.getBalance() == 0) {
jam();
// move entries from the other child
- TupAddr childAddr = nodePtr.p->getLink(1 - i);
- NodeHandlePtr childPtr;
- selectNode(signal, frag, childPtr, childAddr, AccFull);
- nodePtr.p->slide(signal, childPtr, 1 - i);
- if (childPtr.p->getOccup() == 0) {
+ TupLoc childLoc = node.getLink(1 - i);
+ NodeHandle childNode(frag);
+ selectNode(signal, childNode, childLoc, AccFull);
+ nodeSlide(signal, node, childNode, 1 - i);
+ if (childNode.getOccup() == 0) {
jam();
- deleteNode(signal, frag, childPtr);
- nodePtr.p->setLink(1 - i, NullTupAddr);
+ deleteNode(signal, childNode);
+ node.setLink(1 - i, NullTupLoc);
// we are balanced again but our parent balance changes by -1
- parentAddr = nodePtr.p->getLink(2);
- if (parentAddr == NullTupAddr) {
+ parentLoc = node.getLink(2);
+ if (parentLoc == NullTupLoc) {
jam();
return;
}
// fix side and become parent
- i = nodePtr.p->getSide();
- selectNode(signal, frag, nodePtr, parentAddr, AccHead);
+ i = node.getSide();
+ selectNode(signal, node, parentLoc, AccHead);
}
}
#endif
@@ -375,50 +349,50 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
while (true) {
// height of subtree i has decreased by 1
int j = (i == 0 ? -1 : +1);
- int b = nodePtr.p->getBalance();
+ int b = node.getBalance();
if (b == 0) {
// perfectly balanced
jam();
- nodePtr.p->setBalance(-j);
+ node.setBalance(-j);
// height of tree did not change - done
return;
} else if (b == j) {
// height of longer subtree has decreased
jam();
- nodePtr.p->setBalance(0);
+ node.setBalance(0);
// height change propagates up
} else if (b == -j) {
// height of shorter subtree has decreased
jam();
- NodeHandlePtr childPtr;
// child on the other side
- selectNode(signal, frag, childPtr, nodePtr.p->getLink(1 - i), AccHead);
- int b2 = childPtr.p->getBalance();
+ NodeHandle childNode(frag);
+ selectNode(signal, childNode, node.getLink(1 - i), AccHead);
+ int b2 = childNode.getBalance();
if (b2 == b) {
jam();
- treeRotateSingle(signal, frag, nodePtr, 1 - i);
+ treeRotateSingle(signal, frag, node, 1 - i);
// height of tree decreased and propagates up
} else if (b2 == -b) {
jam();
- treeRotateDouble(signal, frag, nodePtr, 1 - i);
+ treeRotateDouble(signal, frag, node, 1 - i);
// height of tree decreased and propagates up
} else {
jam();
- treeRotateSingle(signal, frag, nodePtr, 1 - i);
+ treeRotateSingle(signal, frag, node, 1 - i);
// height of tree did not change - done
return;
}
} else {
ndbrequire(false);
}
- TupAddr parentAddr = nodePtr.p->getLink(2);
- if (parentAddr == NullTupAddr) {
+ TupLoc parentLoc = node.getLink(2);
+ if (parentLoc == NullTupLoc) {
jam();
// root node - done
return;
}
- i = nodePtr.p->getSide();
- selectNode(signal, frag, nodePtr, parentAddr, AccHead);
+ i = node.getSide();
+ selectNode(signal, node, parentLoc, AccHead);
}
}
@@ -441,55 +415,55 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos)
void
Dbtux::treeRotateSingle(Signal* signal,
Frag& frag,
- NodeHandlePtr& nodePtr,
+ NodeHandle& node,
unsigned i)
{
ndbrequire(i <= 1);
/*
5 is the old top node that have been unbalanced due to an insert or
delete. The balance is still the old balance before the update.
- Verify that n5Bal is 1 if RR rotate and -1 if LL rotate.
+ Verify that bal5 is 1 if RR rotate and -1 if LL rotate.
*/
- NodeHandlePtr n5Ptr = nodePtr;
- const TupAddr n5Addr = n5Ptr.p->m_addr;
- const int n5Bal = n5Ptr.p->getBalance();
- const int n5side = n5Ptr.p->getSide();
- ndbrequire(n5Bal + (1 - i) == i);
+ NodeHandle node5 = node;
+ const TupLoc loc5 = node5.m_loc;
+ const int bal5 = node5.getBalance();
+ const int side5 = node5.getSide();
+ ndbrequire(bal5 + (1 - i) == i);
/*
3 is the new root of this part of the tree which is to swap place with
node 5. For an insert to cause this it must have the same balance as 5.
For deletes it can have the balance 0.
*/
- TupAddr n3Addr = n5Ptr.p->getLink(i);
- NodeHandlePtr n3Ptr;
- selectNode(signal, frag, n3Ptr, n3Addr, AccHead);
- const int n3Bal = n3Ptr.p->getBalance();
+ TupLoc loc3 = node5.getLink(i);
+ NodeHandle node3(frag);
+ selectNode(signal, node3, loc3, AccHead);
+ const int bal3 = node3.getBalance();
/*
2 must always be there but is not changed. Thus we mereley check that it
exists.
*/
- ndbrequire(n3Ptr.p->getLink(i) != NullTupAddr);
+ ndbrequire(node3.getLink(i) != NullTupLoc);
/*
4 is not necessarily there but if it is there it will move from one
side of 3 to the other side of 5. For LL it moves from the right side
to the left side and for RR it moves from the left side to the right
side. This means that it also changes parent from 3 to 5.
*/
- TupAddr n4Addr = n3Ptr.p->getLink(1 - i);
- NodeHandlePtr n4Ptr;
- if (n4Addr != NullTupAddr) {
+ TupLoc loc4 = node3.getLink(1 - i);
+ NodeHandle node4(frag);
+ if (loc4 != NullTupLoc) {
jam();
- selectNode(signal, frag, n4Ptr, n4Addr, AccHead);
- ndbrequire(n4Ptr.p->getSide() == (1 - i) &&
- n4Ptr.p->getLink(2) == n3Addr);
- n4Ptr.p->setSide(i);
- n4Ptr.p->setLink(2, n5Addr);
+ selectNode(signal, node4, loc4, AccHead);
+ ndbrequire(node4.getSide() == (1 - i) &&
+ node4.getLink(2) == loc3);
+ node4.setSide(i);
+ node4.setLink(2, loc5);
}//if
/*
Retrieve the address of 5's parent before it is destroyed
*/
- TupAddr n0Addr = n5Ptr.p->getLink(2);
+ TupLoc loc0 = node5.getLink(2);
/*
The next step is to perform the rotation. 3 will inherit 5's parent
@@ -503,22 +477,22 @@ Dbtux::treeRotateSingle(Signal* signal,
1. 3 must have had 5 as parent before the change.
2. 3's side is left for LL and right for RR before change.
*/
- ndbrequire(n3Ptr.p->getLink(2) == n5Addr);
- ndbrequire(n3Ptr.p->getSide() == i);
- n3Ptr.p->setLink(1 - i, n5Addr);
- n3Ptr.p->setLink(2, n0Addr);
- n3Ptr.p->setSide(n5side);
- n5Ptr.p->setLink(i, n4Addr);
- n5Ptr.p->setLink(2, n3Addr);
- n5Ptr.p->setSide(1 - i);
- if (n0Addr != NullTupAddr) {
+ ndbrequire(node3.getLink(2) == loc5);
+ ndbrequire(node3.getSide() == i);
+ node3.setLink(1 - i, loc5);
+ node3.setLink(2, loc0);
+ node3.setSide(side5);
+ node5.setLink(i, loc4);
+ node5.setLink(2, loc3);
+ node5.setSide(1 - i);
+ if (loc0 != NullTupLoc) {
jam();
- NodeHandlePtr n0Ptr;
- selectNode(signal, frag, n0Ptr, n0Addr, AccHead);
- n0Ptr.p->setLink(n5side, n3Addr);
+ NodeHandle node0(frag);
+ selectNode(signal, node0, loc0, AccHead);
+ node0.setLink(side5, loc3);
} else {
jam();
- frag.m_tree.m_root = n3Addr;
+ frag.m_tree.m_root = loc3;
}//if
/* The final step of the change is to update the balance of 3 and
5 that changed places. There are two cases here. The first case is
@@ -531,22 +505,22 @@ Dbtux::treeRotateSingle(Signal* signal,
In this case 5 will change balance but still be unbalanced and 3 will
be unbalanced in the opposite direction of 5.
*/
- if (n3Bal == n5Bal) {
+ if (bal3 == bal5) {
jam();
- n3Ptr.p->setBalance(0);
- n5Ptr.p->setBalance(0);
- } else if (n3Bal == 0) {
+ node3.setBalance(0);
+ node5.setBalance(0);
+ } else if (bal3 == 0) {
jam();
- n3Ptr.p->setBalance(-n5Bal);
- n5Ptr.p->setBalance(n5Bal);
+ node3.setBalance(-bal5);
+ node5.setBalance(bal5);
} else {
ndbrequire(false);
}//if
/*
- Set nodePtr to 3 as return parameter for enabling caller to continue
+ Set node to 3 as return parameter for enabling caller to continue
traversing the tree.
*/
- nodePtr = n3Ptr;
+ node = node3;
}
/*
@@ -651,105 +625,105 @@ Dbtux::treeRotateSingle(Signal* signal,
*
*/
void
-Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i)
+Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i)
{
// old top node
- NodeHandlePtr n6Ptr = nodePtr;
- const TupAddr n6Addr = n6Ptr.p->m_addr;
+ NodeHandle node6 = node;
+ const TupLoc loc6 = node6.m_loc;
// the un-updated balance
- const int n6Bal = n6Ptr.p->getBalance();
- const unsigned n6Side = n6Ptr.p->getSide();
+ const int bal6 = node6.getBalance();
+ const unsigned side6 = node6.getSide();
// level 1
- TupAddr n2Addr = n6Ptr.p->getLink(i);
- NodeHandlePtr n2Ptr;
- selectNode(signal, frag, n2Ptr, n2Addr, AccHead);
- const int n2Bal = n2Ptr.p->getBalance();
+ TupLoc loc2 = node6.getLink(i);
+ NodeHandle node2(frag);
+ selectNode(signal, node2, loc2, AccHead);
+ const int bal2 = node2.getBalance();
// level 2
- TupAddr n4Addr = n2Ptr.p->getLink(1 - i);
- NodeHandlePtr n4Ptr;
- selectNode(signal, frag, n4Ptr, n4Addr, AccHead);
- const int n4Bal = n4Ptr.p->getBalance();
+ TupLoc loc4 = node2.getLink(1 - i);
+ NodeHandle node4(frag);
+ selectNode(signal, node4, loc4, AccHead);
+ const int bal4 = node4.getBalance();
ndbrequire(i <= 1);
- ndbrequire(n6Bal + (1 - i) == i);
- ndbrequire(n2Bal == -n6Bal);
- ndbrequire(n2Ptr.p->getLink(2) == n6Addr);
- ndbrequire(n2Ptr.p->getSide() == i);
- ndbrequire(n4Ptr.p->getLink(2) == n2Addr);
+ ndbrequire(bal6 + (1 - i) == i);
+ ndbrequire(bal2 == -bal6);
+ ndbrequire(node2.getLink(2) == loc6);
+ ndbrequire(node2.getSide() == i);
+ ndbrequire(node4.getLink(2) == loc2);
// level 3
- TupAddr n3Addr = n4Ptr.p->getLink(i);
- TupAddr n5Addr = n4Ptr.p->getLink(1 - i);
+ TupLoc loc3 = node4.getLink(i);
+ TupLoc loc5 = node4.getLink(1 - i);
// fill up leaf before it becomes internal
- if (n3Addr == NullTupAddr && n5Addr == NullTupAddr) {
+ if (loc3 == NullTupLoc && loc5 == NullTupLoc) {
jam();
TreeHead& tree = frag.m_tree;
- accessNode(signal, frag, n2Ptr, AccFull);
- accessNode(signal, frag, n4Ptr, AccFull);
- n4Ptr.p->slide(signal, n2Ptr, i);
+ accessNode(signal, node2, AccFull);
+ accessNode(signal, node4, AccFull);
+ nodeSlide(signal, node4, node2, i);
// implied by rule of merging half-leaves with leaves
- ndbrequire(n4Ptr.p->getOccup() >= tree.m_minOccup);
- ndbrequire(n2Ptr.p->getOccup() != 0);
+ ndbrequire(node4.getOccup() >= tree.m_minOccup);
+ ndbrequire(node2.getOccup() != 0);
} else {
- if (n3Addr != NullTupAddr) {
+ if (loc3 != NullTupLoc) {
jam();
- NodeHandlePtr n3Ptr;
- selectNode(signal, frag, n3Ptr, n3Addr, AccHead);
- n3Ptr.p->setLink(2, n2Addr);
- n3Ptr.p->setSide(1 - i);
+ NodeHandle node3(frag);
+ selectNode(signal, node3, loc3, AccHead);
+ node3.setLink(2, loc2);
+ node3.setSide(1 - i);
}
- if (n5Addr != NullTupAddr) {
+ if (loc5 != NullTupLoc) {
jam();
- NodeHandlePtr n5Ptr;
- selectNode(signal, frag, n5Ptr, n5Addr, AccHead);
- n5Ptr.p->setLink(2, n6Ptr.p->m_addr);
- n5Ptr.p->setSide(i);
+ NodeHandle node5(frag);
+ selectNode(signal, node5, loc5, AccHead);
+ node5.setLink(2, node6.m_loc);
+ node5.setSide(i);
}
}
// parent
- TupAddr n0Addr = n6Ptr.p->getLink(2);
- NodeHandlePtr n0Ptr;
+ TupLoc loc0 = node6.getLink(2);
+ NodeHandle node0(frag);
// perform the rotation
- n6Ptr.p->setLink(i, n5Addr);
- n6Ptr.p->setLink(2, n4Addr);
- n6Ptr.p->setSide(1 - i);
+ node6.setLink(i, loc5);
+ node6.setLink(2, loc4);
+ node6.setSide(1 - i);
- n2Ptr.p->setLink(1 - i, n3Addr);
- n2Ptr.p->setLink(2, n4Addr);
+ node2.setLink(1 - i, loc3);
+ node2.setLink(2, loc4);
- n4Ptr.p->setLink(i, n2Addr);
- n4Ptr.p->setLink(1 - i, n6Addr);
- n4Ptr.p->setLink(2, n0Addr);
- n4Ptr.p->setSide(n6Side);
+ node4.setLink(i, loc2);
+ node4.setLink(1 - i, loc6);
+ node4.setLink(2, loc0);
+ node4.setSide(side6);
- if (n0Addr != NullTupAddr) {
+ if (loc0 != NullTupLoc) {
jam();
- selectNode(signal, frag, n0Ptr, n0Addr, AccHead);
- n0Ptr.p->setLink(n6Side, n4Addr);
+ selectNode(signal, node0, loc0, AccHead);
+ node0.setLink(side6, loc4);
} else {
jam();
- frag.m_tree.m_root = n4Addr;
+ frag.m_tree.m_root = loc4;
}
// set balance of changed nodes
- n4Ptr.p->setBalance(0);
- if (n4Bal == 0) {
+ node4.setBalance(0);
+ if (bal4 == 0) {
jam();
- n2Ptr.p->setBalance(0);
- n6Ptr.p->setBalance(0);
- } else if (n4Bal == -n2Bal) {
+ node2.setBalance(0);
+ node6.setBalance(0);
+ } else if (bal4 == -bal2) {
jam();
- n2Ptr.p->setBalance(0);
- n6Ptr.p->setBalance(n2Bal);
- } else if (n4Bal == n2Bal) {
+ node2.setBalance(0);
+ node6.setBalance(bal2);
+ } else if (bal4 == bal2) {
jam();
- n2Ptr.p->setBalance(-n2Bal);
- n6Ptr.p->setBalance(0);
+ node2.setBalance(-bal2);
+ node6.setBalance(0);
} else {
ndbrequire(false);
}
// new top node
- nodePtr = n4Ptr;
+ node = node4;
}
diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am
new file mode 100644
index 00000000000..0b48ad5724f
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbtux/Makefile.am
@@ -0,0 +1,19 @@
+noinst_LIBRARIES = libdbtux.a
+
+libdbtux_a_SOURCES = \
+ DbtuxGen.cpp \
+ DbtuxMeta.cpp \
+ DbtuxMaint.cpp \
+ DbtuxNode.cpp \
+ DbtuxTree.cpp \
+ DbtuxScan.cpp \
+ DbtuxCmp.cpp \
+ DbtuxDebug.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/kernel/blocks/dbtup
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbtux/Makefile b/ndb/src/kernel/blocks/dbtux/Makefile_old
index 30927c31848..30927c31848 100644
--- a/ndb/src/kernel/blocks/dbtux/Makefile
+++ b/ndb/src/kernel/blocks/dbtux/Makefile_old
diff --git a/ndb/src/kernel/blocks/dbtux/Times.txt b/ndb/src/kernel/blocks/dbtux/Times.txt
new file mode 100644
index 00000000000..16c4102249b
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbtux/Times.txt
@@ -0,0 +1,52 @@
+index maintenance overhead
+==========================
+
+"mc02" 2x1700 MHz linux-2.4.9 gcc-2.96 -O3 one db-node
+
+case a: index on Unsigned
+testOIBasic -case u -table 1 -index 1 -fragtype small -threads 10 -rows 100000 -subloop 1 -nologging
+
+case b: index on Varchar(5) + Varchar(5) + Varchar(20) + Unsigned
+testOIBasic -case u -table 2 -index 4 -fragtype small -threads 10 -rows 100000 -subloop 1 -nologging
+
+1 million rows, pk update without index, pk update with index
+shows ms / 1000 rows for each and pct overhead
+the figures are based on single run on idle machine
+
+040616 mc02/a 40 ms 87 ms 114 pct
+ mc02/b 51 ms 128 ms 148 pct
+
+optim 1 mc02/a 38 ms 85 ms 124 pct
+ mc02/b 51 ms 123 ms 140 pct
+
+optim 2 mc02/a 41 ms 80 ms 96 pct
+ mc02/b 51 ms 117 ms 128 pct
+
+optim 3 mc02/a 43 ms 80 ms 85 pct
+ mc02/b 54 ms 118 ms 117 pct
+
+optim 4 mc02/a 42 ms 80 ms 87 pct
+ mc02/b 51 ms 119 ms 129 pct
+
+optim 5 mc02/a 43 ms 77 ms 77 pct
+ mc02/b 54 ms 118 ms 117 pct
+
+optim 6 mc02/a 42 ms 70 ms 66 pct
+ mc02/b 53 ms 109 ms 105 pct
+
+optim 7 mc02/a 42 ms 69 ms 61 pct
+ mc02/b 52 ms 106 ms 101 pct
+
+optim 8 mc02/a 42 ms 69 ms 62 pct
+ mc02/b 54 ms 104 ms 92 pct
+
+optim 9 mc02/a 43 ms 67 ms 54 pct
+ mc02/b 53 ms 102 ms 91 pct
+
+optim 10 mc02/a 44 ms 65 ms 46 pct
+ mc02/b 53 ms 88 ms 66 pct
+
+optim 11 mc02/a 43 ms 63 ms 46 pct
+ mc02/b 52 ms 86 ms 63 pct
+
+vim: set et:
diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am
new file mode 100644
index 00000000000..763875d578f
--- /dev/null
+++ b/ndb/src/kernel/blocks/dbutil/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libdbutil.a
+
+libdbutil_a_SOURCES = DbUtil.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/dbutil/Makefile b/ndb/src/kernel/blocks/dbutil/Makefile_old
index 54b7326e4e5..54b7326e4e5 100644
--- a/ndb/src/kernel/blocks/dbutil/Makefile
+++ b/ndb/src/kernel/blocks/dbutil/Makefile_old
diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am
new file mode 100644
index 00000000000..31081c7b6a0
--- /dev/null
+++ b/ndb/src/kernel/blocks/grep/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libgrep.a
+
+libgrep_a_SOURCES = Grep.cpp GrepInit.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/grep/Makefile b/ndb/src/kernel/blocks/grep/Makefile_old
index 5ad5a0bce3b..5ad5a0bce3b 100644
--- a/ndb/src/kernel/blocks/grep/Makefile
+++ b/ndb/src/kernel/blocks/grep/Makefile_old
diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am
new file mode 100644
index 00000000000..9230b55b374
--- /dev/null
+++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am
@@ -0,0 +1,12 @@
+noinst_LIBRARIES = libndbcntr.a
+
+libndbcntr_a_SOURCES = \
+ NdbcntrInit.cpp \
+ NdbcntrSysTable.cpp \
+ NdbcntrMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile b/ndb/src/kernel/blocks/ndbcntr/Makefile_old
index 8e9c4f01027..8e9c4f01027 100644
--- a/ndb/src/kernel/blocks/ndbcntr/Makefile
+++ b/ndb/src/kernel/blocks/ndbcntr/Makefile_old
diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp
index a481573e370..639d300d6df 100644
--- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp
+++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp
@@ -21,10 +21,13 @@
#include <pc.hpp>
#include <SimulatedBlock.hpp>
#include <ndb_limits.h>
-#include <signaldata/CmvmiCfgConf.hpp>
#include <signaldata/StopReq.hpp>
#include <signaldata/ResumeReq.hpp>
#include <signaldata/DictTabInfo.hpp>
+#include <signaldata/CntrStart.hpp>
+#include <signaldata/CheckNodeGroups.hpp>
+
+#include <signaldata/UpgradeStartup.hpp>
#include <NodeState.hpp>
#include <NdbTick.h>
@@ -39,70 +42,13 @@
-----------------
*/
#define ZNO_NDB_BLOCKS 6 /* ACC, DICT, DIH, LQH, TC, TUP */
-#define ZDELAY_NODERESTART 5 /* MASTER REFUSED NODERESTART, WAIT SEC */
-#define ZDELAY_START 25 /* WAIT SECONDS FOR OTHER NODES, RESTART*/
-#define ZHB_INTERVAL 10 /* HEART BEAT INTERVAL TIME MS */
-#define ZNO_NDB_NODES 1
-#define ZHB_TYPE 1
-
-//------- ERROR CODES -----------------------------------------
-#define ZERROR_ALREADY_EXISTS 901
-#define ZERROR_DOESNT_EXIST 902
-#define ZERROR_VALUE_OUT_OF_RANGE 903
-#define ZERROR_NOT_STARTED 904
-#define ZERROR_NODE_RESTART 905
-#define ZERROR_NO_RESTART_NODES 906
-#define ZERROR_STARTPHASE_VALUE 907
-#define ZERROR_CNTR_MASTERREQ 908
-#define ZERROR_CNTR_MASTERREF 909
-#define ZERROR_CNTR_MASTERCONF 910
-#define ZERROR_NOT_RUNNING 911
-#define ZERROR_CNTR_WAITREP 912
+
#define ZNOT_AVAILABLE 913
-#define ZERROR_DISK_FAILURE 914
-#define ZERROR_TOO_MANY_NODES 915
-#define ZERROR_TYPEOFSTART 916
-#define ZERROR_CTYPE_OF_START 917
-#define ZERROR_ZSTART 918
-#define ZERROR_AT_SELECT_START 919
-#define ZERROR_CNTR_CHANGEREP 920
-#define ZERR_DETECT_NODERESTART_1 921
-#define ZERR_DETECT_NODERESTART_2 922
-#define ZERROR_CONTINUEB 923
-#define ZERR_APPL_REGREF 924
-#define ZERR_DICTADDATTRREF 925
-#define ZERR_DICTPREPAREREF 926
-#define ZERR_DICTRELEASEREF 927
-#define ZERR_DICTTABREF 928
-#define ZERR_DICTSEIZEREF 929
-#define ZERR_NDB_STARTREF 930
-#define ZERR_NODE_STATESREF 931
-#define ZERR_READ_NODESREF 932
-#define ZERR_TCKEYREF 933
-#define ZERR_TCRELEASEREF 934
-#define ZERR_TCSEIZEREF 935
-#define ZNOTVALIDSTATE_1 936
-#define ZNOTVALIDSTATE_2 937
-#define ZNODE_FAILURE_DURING_RESTART 938
-#define ZSTART_IN_PROGRESS_ERROR 939
-#define ZCOULD_NOT_OCCUR_ERROR 940
-#define ZTOO_MANY_NODES_ERROR 941
-#define ZNODE_RESTART_ONGOING_ERROR 942
-#define ZWE_ARE_DECLARED_DEAD_ERROR 943
-#define ZTIME_OUT_ERROR 944
-#define ZTYPE_OF_START_ERROR 945
-#define ZMASTER_CONFLICT_ERROR 946
-#define ZNODE_CONFLICT_ERROR 947
//------- OTHERS ---------------------------------------------
-#define ZCONTINUEB_1 1
-#define ZCONTINUEB_2 2
-#define ZSHUTDOWN 3
-
-#define ZAPPL_SUBTYPE 0
-#define ZNAME_OF_APPL "NDB"
-#define ZVOTING 2
-#define ZSIZE_CFG_BLOCK_REC 8
+#define ZSTARTUP 1
+#define ZSHUTDOWN 2
+
#define ZSIZE_NDB_BLOCKS_REC 16 /* MAX BLOCKS IN NDB */
#define ZSIZE_SYSTAB 2048
#define ZSTART_PHASE_1 1
@@ -124,28 +70,10 @@
#define ZWAITPOINT_7_1 7
#define ZWAITPOINT_7_2 8
#define ZSYSTAB_VERSION 1
-/*
-------- SIGNAL CONSTANTS -----------------------------------
-*/
-#define ZNOT_MASTER 0
-/* REASON OF CNTR_MASTERREF */
-#define ZTOO_FEW_NODES 1
-#define ZNEW_MASTER 0
-#define ZDELETE_NODE 1
-#define ZSYSTAB_EXIST 3
-#define ZVOTE_NEW_NODE 4
-#define ZVARIABLE_NO 1
-#define ZAMOUNT_PAGES 8
#endif
class Ndbcntr: public SimulatedBlock {
public:
- // State values
- enum State {
- NOT_ACTIVE = 0,
- ACTIVE = 1
- };
-
// Records
/* FSREADREQ FSWRITEREQ */
@@ -154,59 +82,27 @@ public:
* ------------------------------------------------------------
*/
-/**
- * CFG_BLOCK_REC CONTAINS ALL CONFIG DATA SENT IN EACH NDB_STTOR
- * SOME OTHER CONFIG DATA IS STORED IN RECORD 0
- *
- * WHEN CFG_BLOCK_PTR = ZSTART_PHASE_X ( CINTERNAL_STARTPHASE )
- * WORD 0 DICT_1
- * WORD 1 DICT_2
- * WORD 2 DIH_1
- * WORD 3 DIH_2
- * WORD 4 LQH_1
- * WORD 5 LQH_2
- * WORD 6 TC_1
- * WORD 7 TC_2
- * WORD 8 TUP_1
- * WORD 9 TUP_2
- * WORD 10 ACC_1
- * WORD 11 ACC_2
- *
- * CFG_BLOCK_PTR = 0
- * WORD 0 CDELAY_START
- * WORD 1 CDELAY_NODERESTART
- *------------------------------------------------------------------------*/
- struct CfgBlockRec {
- UintR cfgData[CmvmiCfgConf::NO_OF_WORDS];
- }; /* p2c: size = 64 bytes */
+ struct StartRecord {
+ Uint64 m_startTime;
+
+ void reset();
+ NdbNodeBitmask m_starting;
+ NdbNodeBitmask m_waiting; // == (m_withLog | m_withoutLog)
+ NdbNodeBitmask m_withLog;
+ NdbNodeBitmask m_withoutLog;
+ Uint32 m_lastGci;
+ Uint32 m_lastGciNodeId;
+
+ Uint64 m_startPartialTimeout;
+ Uint64 m_startPartitionedTimeout;
+ Uint64 m_startFailureTimeout;
+ struct {
+ Uint32 m_nodeId;
+ Uint32 m_lastGci;
+ } m_logNodes[MAX_NDB_NODES];
+ Uint32 m_logNodesCount;
+ } c_start;
- typedef Ptr<CfgBlockRec> CfgBlockRecPtr;
-
-/*------------------------------------------------------------------------*/
-// CONTAIN INFO ABOUT ALL NODES IN CLUSTER. NODE_PTR ARE USED AS NODE NUMBER.
-// IF THE STATE ARE ZDELETE THEN THE NODE DOESN'T EXIST. NODES ARE ALLOWED
-// TO REGISTER (ZADD) DURING RESTART.
-// WHEN THE SYSTEM IS RUNNING THE MASTER WILL CHECK IF ANY NODE HAS MADE A
-// CNTR_MASTERREQ AND TAKE CARE OF THE
-// REQUEST. TO CONFIRM THE REQ, THE MASTER DEMANDS THAT ALL RUNNING NODES HAS
-// VOTED FOR THE NEW NODE.
-// NODE_PTR:MASTER_REQ IS USED DURING RESTART TO LOG POSTPONED
-// CNTR_MASTERREQ'S
-/*------------------------------------------------------------------------*/
- struct NodeRec {
- UintR dynamicId;
- BlockReference cntrBlockref;
- Uint16 masterReq;
- Uint16 state;
- Uint16 ndbVersion;
- Uint16 subType;
- Uint8 votes;
- Uint8 voter;
- UintR nodeDefined;
- }; /* p2c: size = 16 bytes */
-
- typedef Ptr<NodeRec> NodeRecPtr;
-
struct NdbBlocksRec {
BlockReference blockref;
}; /* p2c: size = 2 bytes */
@@ -266,16 +162,14 @@ private:
void execCONTINUEB(Signal* signal);
void execREAD_NODESCONF(Signal* signal);
void execREAD_NODESREF(Signal* signal);
- void execCNTR_MASTERREQ(Signal* signal);
- void execCNTR_MASTERCONF(Signal* signal);
- void execCNTR_MASTERREF(Signal* signal);
+ void execCM_ADD_REP(Signal* signal);
+ void execCNTR_START_REQ(Signal* signal);
+ void execCNTR_START_REF(Signal* signal);
+ void execCNTR_START_CONF(Signal* signal);
+ void execCNTR_START_REP(Signal* signal);
void execCNTR_WAITREP(Signal* signal);
- void execNODE_STATESREQ(Signal* signal);
- void execNODE_STATESCONF(Signal* signal);
- void execNODE_STATESREF(Signal* signal);
void execNODE_FAILREP(Signal* signal);
void execSYSTEM_ERROR(Signal* signal);
- void execVOTE_MASTERORD(Signal* signal);
// Received signals
void execDUMP_STATE_ORD(Signal* signal);
@@ -295,12 +189,7 @@ private:
void execNDB_STTORRY(Signal* signal);
void execNDB_STARTCONF(Signal* signal);
void execREAD_NODESREQ(Signal* signal);
- void execAPPL_REGCONF(Signal* signal);
- void execAPPL_REGREF(Signal* signal);
- void execAPPL_CHANGEREP(Signal* signal);
- void execAPPL_STARTCONF(Signal* signal);
void execNDB_STARTREF(Signal* signal);
- void execCMVMI_CFGCONF(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execSTOP_PERM_REF(Signal* signal);
@@ -323,19 +212,17 @@ private:
// Statement blocks
void sendCreateTabReq(Signal* signal, const char* buffer, Uint32 bufLen);
void startInsertTransactions(Signal* signal);
- UintR checkNodelist(Signal* signal, Uint16 TnoRestartNodes);
- void chooseRestartNodes(Signal* signal);
- void copyCfgVariables(Signal* signal);
- void deleteNode(Signal* signal);
- void detectNoderestart(Signal* signal);
- void getStartNodes(Signal* signal);
void initData(Signal* signal);
- void replyMasterconfToAll(Signal* signal);
void resetStartVariables(Signal* signal);
- void sendCntrMasterreq(Signal* signal);
+ void sendCntrStartReq(Signal* signal);
+ void sendCntrStartRef(Signal*, Uint32 nodeId, CntrStartRef::ErrorCode);
void sendNdbSttor(Signal* signal);
void sendSttorry(Signal* signal);
+ bool trySystemRestart(Signal* signal);
+ void startWaitingNodes(Signal* signal);
+ CheckNodeGroups::Output checkNodeGroups(Signal*, const NdbNodeBitmask &);
+
// Generated statement blocks
void systemErrorLab(Signal* signal);
@@ -367,13 +254,6 @@ private:
void ph7ALab(Signal* signal);
void ph8ALab(Signal* signal);
- void masterreq010Lab(Signal* signal,
- Uint16 TnoRestartNodes,
- Uint16 TuserNodeId);
- void masterreq020Lab(Signal* signal);
- void masterreq030Lab(Signal* signal,
- Uint16 TnoRestartNodes,
- Uint16 TuserNodeId);
void waitpoint41Lab(Signal* signal);
void waitpoint51Lab(Signal* signal);
@@ -401,62 +281,40 @@ private:
* NODE_PTR:MASTER_REQ IS USED DURING RESTART TO LOG
* POSTPONED CNTR_MASTERREQ'S
*------------------------------------------------------------------------*/
- CfgBlockRec *cfgBlockRec;
- NodeRec *nodeRec;
NdbBlocksRec *ndbBlocksRec;
- NodeRecPtr nodePtr;
-/*
-2.4 COMMON STORED VARIABLES
-*/
- Uint16 cstartNodes[MAX_NDB_NODES];
- BlockReference ccmvmiBlockref;
- BlockReference cqmgrBlockref;
- BlockReference cdictBlockref;
- BlockReference cdihBlockref;
- BlockReference clqhBlockref;
- BlockReference cownBlockref;
- BlockReference ctcBlockref;
- UintR cnoNdbNodes;
- UintR capplStartconfFlag;
+
+ /*
+ 2.4 COMMON STORED VARIABLES
+ */
UintR cgciSystab;
UintR ckey;
- UintR cnoRegNodes;
- UintR cnoRunNodes;
- UintR cnoNeedNodes;
- UintR cnoWaitrep;
+ //UintR csystabId;
UintR cnoWaitrep6;
UintR cnoWaitrep7;
- //UintR csystabId;
UintR ctcConnectionP;
UintR ctcReqInfo;
- UintR clastGci;
- UintR cmasterLastGci;
- UintR cmasterCurrentId;
- Uint16 cmasterDihId;
+ Uint8 ctransidPhase;
Uint16 cresponses;
- Uint16 cdelayStart;
+ Uint8 cstartPhase;
Uint16 cinternalStartphase;
+
Uint16 cmasterNodeId;
- Uint16 cmasterCandidateId;
Uint16 cndbBlocksCount;
Uint16 cnoStartNodes;
- Uint16 cnoVoters;
- Uint16 cstartProgressFlag;
- Uint16 cqmgrConnectionP;
- Uint16 csignalKey;
+ UintR cnoWaitrep;
NodeState::StartType ctypeOfStart;
- Uint16 cmasterVoters;
Uint16 cdynamicNodeId;
- Uint8 cwaitContinuebFlag;
- Uint8 cstartPhase;
- Uint8 ctransidPhase;
Uint32 c_fsRemoveCount;
Uint32 c_nodeGroup;
void clearFilesystem(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execFSREMOVECONF(Signal* signal);
+
+ NdbNodeBitmask c_allDefinedNodes;
+ NdbNodeBitmask c_clusterNodes; // All members of qmgr cluster
+ NdbNodeBitmask c_startedNodes; // All cntr started nodes
public:
struct StopRecord {
@@ -495,6 +353,8 @@ private:
void execSTART_ORD(Signal* signal);
void execSTTORRY(Signal* signal);
void sendNextSTTOR(Signal* signal);
+ void execREAD_CONFIG_CONF(Signal* signal);
+ void sendNextREAD_CONFIG_REQ(Signal* signal);
BlockNumber number() const { return cntr.number(); }
void progError(int line, int cause, const char * extra) {
@@ -508,6 +368,9 @@ private:
void execSTTORRY(Signal* signal);
void execSTART_ORD(Signal* signal);
+ void execREAD_CONFIG_CONF(Signal*);
+
+ friend struct UpgradeStartup;
};
#endif
diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
index 9af6359876b..1069cf93b06 100644
--- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
+++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
@@ -27,8 +27,6 @@ void Ndbcntr::initData()
{
// Records with constant sizes
- cfgBlockRec = new CfgBlockRec[ZSIZE_CFG_BLOCK_REC];
- nodeRec = new NodeRec[MAX_NDB_NODES];
ndbBlocksRec = new NdbBlocksRec[ZSIZE_NDB_BLOCKS_REC];
}//Ndbcntr::initData()
@@ -51,17 +49,15 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
addRecSignal(GSN_CONTINUEB, &Ndbcntr::execCONTINUEB);
addRecSignal(GSN_READ_NODESCONF, &Ndbcntr::execREAD_NODESCONF);
addRecSignal(GSN_READ_NODESREF, &Ndbcntr::execREAD_NODESREF);
- addRecSignal(GSN_CNTR_MASTERREQ, &Ndbcntr::execCNTR_MASTERREQ);
- addRecSignal(GSN_CNTR_MASTERCONF, &Ndbcntr::execCNTR_MASTERCONF);
- addRecSignal(GSN_CNTR_MASTERREF, &Ndbcntr::execCNTR_MASTERREF);
+ addRecSignal(GSN_CM_ADD_REP, &Ndbcntr::execCM_ADD_REP);
+ addRecSignal(GSN_CNTR_START_REQ, &Ndbcntr::execCNTR_START_REQ);
+ addRecSignal(GSN_CNTR_START_REF, &Ndbcntr::execCNTR_START_REF);
+ addRecSignal(GSN_CNTR_START_CONF, &Ndbcntr::execCNTR_START_CONF);
addRecSignal(GSN_CNTR_WAITREP, &Ndbcntr::execCNTR_WAITREP);
- addRecSignal(GSN_NODE_STATESREQ, &Ndbcntr::execNODE_STATESREQ);
- addRecSignal(GSN_NODE_STATESCONF, &Ndbcntr::execNODE_STATESCONF);
- addRecSignal(GSN_NODE_STATESREF, &Ndbcntr::execNODE_STATESREF);
+ addRecSignal(GSN_CNTR_START_REP, &Ndbcntr::execCNTR_START_REP);
addRecSignal(GSN_NODE_FAILREP, &Ndbcntr::execNODE_FAILREP);
addRecSignal(GSN_SYSTEM_ERROR , &Ndbcntr::execSYSTEM_ERROR);
- addRecSignal(GSN_VOTE_MASTERORD, &Ndbcntr::execVOTE_MASTERORD);
-
+
// Received signals
addRecSignal(GSN_DUMP_STATE_ORD, &Ndbcntr::execDUMP_STATE_ORD);
addRecSignal(GSN_STTOR, &Ndbcntr::execSTTOR);
@@ -80,12 +76,7 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
addRecSignal(GSN_NDB_STTORRY, &Ndbcntr::execNDB_STTORRY);
addRecSignal(GSN_NDB_STARTCONF, &Ndbcntr::execNDB_STARTCONF);
addRecSignal(GSN_READ_NODESREQ, &Ndbcntr::execREAD_NODESREQ);
- addRecSignal(GSN_APPL_REGCONF, &Ndbcntr::execAPPL_REGCONF);
- addRecSignal(GSN_APPL_REGREF, &Ndbcntr::execAPPL_REGREF);
- addRecSignal(GSN_APPL_CHANGEREP, &Ndbcntr::execAPPL_CHANGEREP);
- addRecSignal(GSN_APPL_STARTCONF, &Ndbcntr::execAPPL_STARTCONF);
addRecSignal(GSN_NDB_STARTREF, &Ndbcntr::execNDB_STARTREF);
- addRecSignal(GSN_CMVMI_CFGCONF, &Ndbcntr::execCMVMI_CFGCONF);
addRecSignal(GSN_SET_VAR_REQ, &Ndbcntr::execSET_VAR_REQ);
addRecSignal(GSN_STOP_PERM_REF, &Ndbcntr::execSTOP_PERM_REF);
@@ -107,18 +98,18 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
addRecSignal(GSN_START_ORD, &Ndbcntr::execSTART_ORD);
addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY);
+ addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF);
addRecSignal(GSN_FSREMOVEREF, &Ndbcntr::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF);
initData();
ctypeOfStart = NodeState::ST_ILLEGAL_TYPE;
+ c_start.m_startTime = NdbTick_CurrentMillisecond();
}//Ndbcntr::Ndbcntr()
Ndbcntr::~Ndbcntr()
{
- delete []cfgBlockRec;
- delete []nodeRec;
delete []ndbBlocksRec;
}//Ndbcntr::~Ndbcntr()
diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
index 4211645ace6..06453155f33 100644
--- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
+++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
@@ -23,13 +23,10 @@
#include <signaldata/DictTabInfo.hpp>
#include <signaldata/CreateTable.hpp>
#include <signaldata/ReadNodesConf.hpp>
-#include <signaldata/CntrMasterReq.hpp>
-#include <signaldata/CntrMasterConf.hpp>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/TcKeyReq.hpp>
#include <signaldata/TcKeyConf.hpp>
#include <signaldata/EventReport.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/NodeStateSignalData.hpp>
#include <signaldata/StopPerm.hpp>
#include <signaldata/StopMe.hpp>
@@ -39,9 +36,11 @@
#include <signaldata/AbortAll.hpp>
#include <signaldata/SystemError.hpp>
#include <signaldata/NdbSttor.hpp>
+#include <signaldata/CntrStart.hpp>
#include <signaldata/DumpStateOrd.hpp>
#include <signaldata/FsRemoveReq.hpp>
+#include <signaldata/ReadConfig.hpp>
#include <AttributeHeader.hpp>
#include <Configuration.hpp>
@@ -50,8 +49,6 @@
#include <NdbOut.hpp>
#include <NdbTick.h>
-#define ZSYSTEM_RUN 256
-
/**
* ALL_BLOCKS Used during start phases and while changing node state
*
@@ -60,25 +57,27 @@
struct BlockInfo {
BlockReference Ref; // BlockReference
Uint32 NextSP; // Next start phase
+ Uint32 ErrorInsertStart;
+ Uint32 ErrorInsertStop;
};
static BlockInfo ALL_BLOCKS[] = {
- { DBTC_REF, 1 },
- { DBDIH_REF, 1 },
- { DBLQH_REF, 1 },
- { DBACC_REF, 1 },
- { DBTUP_REF, 1 },
- { DBDICT_REF, 1 },
- { NDBFS_REF, 0 },
- { NDBCNTR_REF, 0 },
- { QMGR_REF, 1 },
- { CMVMI_REF, 1 },
- { TRIX_REF, 1 },
- { BACKUP_REF, 1 },
- { DBUTIL_REF, 1 },
- { SUMA_REF, 1 },
- { GREP_REF, 1 },
- { DBTUX_REF, 1 }
+ { DBTC_REF, 1 , 8000, 8035 },
+ { DBDIH_REF, 1 , 7000, 7173 },
+ { DBLQH_REF, 1 , 5000, 5030 },
+ { DBACC_REF, 1 , 3000, 3999 },
+ { DBTUP_REF, 1 , 4000, 4007 },
+ { DBDICT_REF, 1 , 6000, 6003 },
+ { NDBFS_REF, 0 , 2000, 2999 },
+ { NDBCNTR_REF, 0 , 1000, 1999 },
+ { QMGR_REF, 1 , 1, 999 },
+ { CMVMI_REF, 1 , 9000, 9999 },
+ { TRIX_REF, 1 , 0, 0 },
+ { BACKUP_REF, 1 , 10000, 10999 },
+ { DBUTIL_REF, 1 , 11000, 11999 },
+ { SUMA_REF, 1 , 13000, 13999 },
+ { GREP_REF, 1 , 0, 0 },
+ { DBTUX_REF, 1 , 12000, 12999 }
};
static const Uint32 ALL_BLOCKS_SZ = sizeof(ALL_BLOCKS)/sizeof(BlockInfo);
@@ -91,33 +90,27 @@ void Ndbcntr::execCONTINUEB(Signal* signal)
jamEntry();
UintR Ttemp1 = signal->theData[0];
switch (Ttemp1) {
- case ZCONTINUEB_1:
- jam();
- if (cwaitContinuebFlag == ZFALSE) {
- jam();
-/*******************************/
-/* SIGNAL NOT WANTED ANYMORE */
-/*******************************/
- return;
- } else {
+ case ZSTARTUP:{
+ if(getNodeState().startLevel == NodeState::SL_STARTED){
jam();
-/*******************************/
-/* START ALREADY IN PROGRESS */
-/*******************************/
- if (cstartProgressFlag == ZVOTING) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- if (ctypeOfStart == NodeState::ST_NODE_RESTART) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- ph2ELab(signal);
return;
- }//if
+ }
+
+ if(cmasterNodeId == getOwnNodeId() && c_start.m_starting.isclear()){
+ jam();
+ trySystemRestart(signal);
+ // Fall-through
+ }
+
+ Uint64 now = NdbTick_CurrentMillisecond();
+ if(c_start.m_startFailureTimeout > now){
+ ndbrequire(false);
+ }
+
+ signal->theData[0] = ZSTARTUP;
+ sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 1);
break;
+ }
case ZSHUTDOWN:
jam();
c_stopRec.checkTimeout(signal);
@@ -189,28 +182,18 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
return;
}//Ndbcntr::execSYSTEM_ERROR()
-/*---------------------------------------------------------------------------*/
-/* The STTOR signal is on level C, we use CONTINUEB to get into level B */
-/*---------------------------------------------------------------------------*/
-/**************************** >----------------------------------------------*/
-/* STTOR > SENDER : MISSRA */
-/**************************** >------------------+ RECEIVER : NDBCNTR */
- /* INPUT : CSTART_PHASE */
- /* CSIGNAL_KEY */
- /*---------------------------*/
-/*******************************/
-/* STTOR */
-/*******************************/
void Ndbcntr::execSTTOR(Signal* signal)
{
jamEntry();
cstartPhase = signal->theData[1];
- csignalKey = signal->theData[6];
NodeState newState(NodeState::SL_STARTING, cstartPhase,
(NodeState::StartType)ctypeOfStart);
updateNodeState(signal, newState);
+ cndbBlocksCount = 0;
+ cinternalStartphase = cstartPhase - 1;
+
switch (cstartPhase) {
case 0:
if(theConfiguration.getInitialStart()){
@@ -244,6 +227,7 @@ void Ndbcntr::execSTTOR(Signal* signal)
case 6:
jam();
getNodeGroup(signal);
+ // Fall through
break;
case ZSTART_PHASE_8:
jam();
@@ -327,80 +311,37 @@ void Ndbcntr::execNDB_STTORRY(Signal* signal)
}//switch
}//Ndbcntr::execNDB_STTORRY()
-/*
-4.2 START PHASE 1 */
-/*###########################################################################*/
-/*LOAD OUR BLOCK REFERENCE AND OUR NODE ID. LOAD NODE IDS OF ALL NODES IN */
-/* CLUSTER CALCULATE BLOCK REFERENCES OF ALL BLOCKS IN THIS NODE */
-/*---------------------------------------------------------------------------*/
-/*******************************/
-/* STTOR */
-/*******************************/
void Ndbcntr::startPhase1Lab(Signal* signal)
{
jamEntry();
initData(signal);
- cownBlockref = calcNdbCntrBlockRef(0);
- cnoRunNodes = 0;
- cnoRegNodes = 0;
-
- NdbBlocksRecPtr ndbBlocksPtr;
cdynamicNodeId = 0;
- cownBlockref = calcNdbCntrBlockRef(getOwnNodeId());
- cqmgrBlockref = calcQmgrBlockRef(getOwnNodeId());
- cdictBlockref = calcDictBlockRef(getOwnNodeId());
- cdihBlockref = calcDihBlockRef(getOwnNodeId());
- clqhBlockref = calcLqhBlockRef(getOwnNodeId());
- ctcBlockref = calcTcBlockRef(getOwnNodeId());
- ccmvmiBlockref = numberToRef(CMVMI, getOwnNodeId());
+ NdbBlocksRecPtr ndbBlocksPtr;
ndbBlocksPtr.i = 0;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = clqhBlockref;
+ ndbBlocksPtr.p->blockref = DBLQH_REF;
ndbBlocksPtr.i = 1;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = cdictBlockref;
+ ndbBlocksPtr.p->blockref = DBDICT_REF;
ndbBlocksPtr.i = 2;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = calcTupBlockRef(getOwnNodeId());
+ ndbBlocksPtr.p->blockref = DBTUP_REF;
ndbBlocksPtr.i = 3;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = calcAccBlockRef(getOwnNodeId());
+ ndbBlocksPtr.p->blockref = DBACC_REF;
ndbBlocksPtr.i = 4;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = ctcBlockref;
+ ndbBlocksPtr.p->blockref = DBTC_REF;
ndbBlocksPtr.i = 5;
ptrAss(ndbBlocksPtr, ndbBlocksRec);
- ndbBlocksPtr.p->blockref = cdihBlockref;
+ ndbBlocksPtr.p->blockref = DBDIH_REF;
sendSttorry(signal);
return;
}
-/*
-4.3 START PHASE 2 */
-/*###########################################################################*/
-// SEND A REGISTATION REQUEST TO QMGR AND WAIT FOR REPLY APPL_REGCONF OR
-// APPL_REGREF COLLECT ALL OTHER NDB NODES
-// AND THEIR STATES FIND OUT WHAT KIND OF START THIS NODE ARE GOING TO PERFORM
-// IF THIS IS A SYSTEM OR INITIAL
-// RESTART THEN FIND OUT WHO IS THE MASTER IF THIS NODE BECOME THE CNTR MASTER
-// THEN COLLECT CNTR_MASTERREQ FROM
-// ALL OTHER REGISTRATED CNTR THE MASTER WILL SEND BACK A CNTR_MASTERCONF WITH
-// FINAL DECISSION ABOUT WHAT TYPE
-// OF START AND WHICH NODES ARE APPROVED TO PARTICIPATE IN THE START IF THE
-// RECEIVER OF CNTR_MASTERREQ HAVE A
-// BETTER CHOICE OF MASTER THEN SEND CNTR_MASTERREF. NEW NODES ARE ALWAYS
-// ALLOWED TO REGISTER, EVEN DURING
-// RESTART BUT THEY WILL BE IGNORED UNTIL THE START HAVE FINISHED.
-// SEND SIGNAL NDBSTTOR TO ALL BLOCKS, ACC, DICT, DIH, LQH, TC AND TUP
-// SEND SIGNAL APPL_REGREQ TO QMGR IN THIS NODE AND WAIT FOR REPLY
-// APPL_REGCONF OR APPL_REGREF */
-/*--------------------------------------------------------------------------*/
-/*******************************/
-/* READ_NODESREF */
-/*******************************/
void Ndbcntr::execREAD_NODESREF(Signal* signal)
{
jamEntry();
@@ -408,25 +349,6 @@ void Ndbcntr::execREAD_NODESREF(Signal* signal)
return;
}//Ndbcntr::execREAD_NODESREF()
-/*******************************/
-/* APPL_REGREF */
-/*******************************/
-void Ndbcntr::execAPPL_REGREF(Signal* signal)
-{
- jamEntry();
- systemErrorLab(signal);
- return;
-}//Ndbcntr::execAPPL_REGREF()
-
-/*******************************/
-/* CNTR_MASTERREF */
-/*******************************/
-void Ndbcntr::execCNTR_MASTERREF(Signal* signal)
-{
- jamEntry();
- systemErrorLab(signal);
- return;
-}//Ndbcntr::execCNTR_MASTERREF()
/*******************************/
/* NDB_STARTREF */
@@ -443,17 +365,11 @@ void Ndbcntr::execNDB_STARTREF(Signal* signal)
/*******************************/
void Ndbcntr::startPhase2Lab(Signal* signal)
{
- cinternalStartphase = cstartPhase - 1;
-/*--------------------------------------*/
-/* CASE: CSTART_PHASE = ZSTART_PHASE_2 */
-/*--------------------------------------*/
- cndbBlocksCount = 0;
- cwaitContinuebFlag = ZFALSE;
-/* NOT WAITING FOR SIGNAL CONTINUEB */
-
- clastGci = 0;
- signal->theData[0] = cownBlockref;
- sendSignal(cdihBlockref, GSN_DIH_RESTARTREQ, signal, 1, JBB);
+ c_start.m_lastGci = 0;
+ c_start.m_lastGciNodeId = getOwnNodeId();
+
+ signal->theData[0] = reference();
+ sendSignal(DBDIH_REF, GSN_DIH_RESTARTREQ, signal, 1, JBB);
return;
}//Ndbcntr::startPhase2Lab()
@@ -463,8 +379,8 @@ void Ndbcntr::startPhase2Lab(Signal* signal)
void Ndbcntr::execDIH_RESTARTCONF(Signal* signal)
{
jamEntry();
- cmasterDihId = signal->theData[0];
- clastGci = signal->theData[1];
+ //cmasterDihId = signal->theData[0];
+ c_start.m_lastGci = signal->theData[1];
ctypeOfStart = NodeState::ST_SYSTEM_RESTART;
ph2ALab(signal);
return;
@@ -488,370 +404,443 @@ void Ndbcntr::ph2ALab(Signal* signal)
/* from QMGR */
/* READ_NODESREQ */
/******************************/
- signal->theData[0] = cownBlockref;
- sendSignal(cqmgrBlockref, GSN_READ_NODESREQ, signal, 1, JBB);
+ signal->theData[0] = reference();
+ sendSignal(QMGR_REF, GSN_READ_NODESREQ, signal, 1, JBB);
return;
}//Ndbcntr::ph2ALab()
+inline
+Uint64
+setTimeout(Uint64 time, Uint32 timeoutValue){
+ if(timeoutValue == 0)
+ return ~0;
+ return time + timeoutValue;
+}
+
/*******************************/
/* READ_NODESCONF */
/*******************************/
void Ndbcntr::execREAD_NODESCONF(Signal* signal)
{
jamEntry();
- ReadNodesConf * const readNodes = (ReadNodesConf *)&signal->theData[0];
+ const ReadNodesConf * readNodes = (ReadNodesConf *)&signal->theData[0];
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if(NodeBitmask::get(readNodes->allNodes, nodePtr.i)){
- jam();
- nodePtr.p->nodeDefined = ZTRUE;
- } else {
- jam();
- nodePtr.p->nodeDefined = ZFALSE;
- }//if
- }//for
+ cmasterNodeId = readNodes->masterNodeId;
+ cdynamicNodeId = readNodes->ndynamicId;
+
+ /**
+ * All defined nodes...
+ */
+ c_allDefinedNodes.assign(NdbNodeBitmask::Size, readNodes->allNodes);
+ c_clusterNodes.assign(NdbNodeBitmask::Size, readNodes->clusterNodes);
- CfgBlockRecPtr cfgBlockPtr;
+ Uint32 to_1 = 30000;
+ Uint32 to_2 = 0;
+ Uint32 to_3 = 0;
+
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+
+ ndbrequire(p != 0);
+ ndb_mgm_get_int_parameter(p, CFG_DB_START_PARTIAL_TIMEOUT, &to_1);
+ ndb_mgm_get_int_parameter(p, CFG_DB_START_PARTITION_TIMEOUT, &to_2);
+ ndb_mgm_get_int_parameter(p, CFG_DB_START_FAILURE_TIMEOUT, &to_3);
+
+ c_start.m_startPartialTimeout = setTimeout(c_start.m_startTime, to_1);
+ c_start.m_startPartitionedTimeout = setTimeout(c_start.m_startTime, to_2);
+ c_start.m_startFailureTimeout = setTimeout(c_start.m_startTime, to_3);
+
+ UpgradeStartup::sendCmAppChg(* this, signal, 0); // ADD
+
+ sendCntrStartReq(signal);
- cfgBlockPtr.i = 0;
- ptrAss(cfgBlockPtr, cfgBlockRec);
- signal->theData[0] = cownBlockref;
- signal->theData[1] = cfgBlockPtr.i;
- sendSignal(ccmvmiBlockref, GSN_CMVMI_CFGREQ, signal, 2, JBB);
return;
}
-/*******************************/
-/* CMVMI_CFGCONF */
-/*******************************/
-void Ndbcntr::execCMVMI_CFGCONF(Signal* signal)
-{
- CfgBlockRecPtr cfgBlockPtr;
+void
+Ndbcntr::execCM_ADD_REP(Signal* signal){
+ jamEntry();
+ c_clusterNodes.set(signal->theData[0]);
+}
+
+void
+Ndbcntr::sendCntrStartReq(Signal * signal){
jamEntry();
- CmvmiCfgConf * const cfgConf = (CmvmiCfgConf *)&signal->theData[0];
+ CntrStartReq * req = (CntrStartReq*)signal->getDataPtrSend();
+ req->startType = ctypeOfStart;
+ req->lastGci = c_start.m_lastGci;
+ req->nodeId = getOwnNodeId();
+ sendSignal(calcNdbCntrBlockRef(cmasterNodeId), GSN_CNTR_START_REQ,
+ signal, CntrStartReq::SignalLength, JBB);
+}
- cfgBlockPtr.i = cfgConf->startPhase;
- ptrCheckGuard(cfgBlockPtr, ZSIZE_CFG_BLOCK_REC, cfgBlockRec);
- for(unsigned int i = 0; i<CmvmiCfgConf::NO_OF_WORDS; i++)
- cfgBlockPtr.p->cfgData[i] = cfgConf->theData[i];
+void
+Ndbcntr::execCNTR_START_REF(Signal * signal){
+ jamEntry();
+ const CntrStartRef * ref = (CntrStartRef*)signal->getDataPtr();
- if (cfgBlockPtr.i < 4) {
+ switch(ref->errorCode){
+ case CntrStartRef::NotMaster:
jam();
- cfgBlockPtr.i = cfgBlockPtr.i + 1;
- signal->theData[0] = cownBlockref;
- signal->theData[1] = cfgBlockPtr.i;
- sendSignal(ccmvmiBlockref, GSN_CMVMI_CFGREQ, signal, 2, JBB);
+ cmasterNodeId = ref->masterNodeId;
+ sendCntrStartReq(signal);
return;
- }
+ }
+ ndbrequire(false);
+}
+
+void
+Ndbcntr::StartRecord::reset(){
+ m_starting.clear();
+ m_waiting.clear();
+ m_withLog.clear();
+ m_withoutLog.clear();
+ m_lastGci = m_lastGciNodeId = 0;
+ m_startPartialTimeout = ~0;
+ m_startPartitionedTimeout = ~0;
+ m_startFailureTimeout = ~0;
- jam();
+ m_logNodesCount = 0;
+}
+
+void
+Ndbcntr::execCNTR_START_CONF(Signal * signal){
+ jamEntry();
+ const CntrStartConf * conf = (CntrStartConf*)signal->getDataPtr();
+
+ cnoStartNodes = conf->noStartNodes;
+ ctypeOfStart = (NodeState::StartType)conf->startType;
+ c_start.m_lastGci = conf->startGci;
+ cmasterNodeId = conf->masterNodeId;
+ NdbNodeBitmask tmp;
+ tmp.assign(NdbNodeBitmask::Size, conf->startedNodes);
+ c_startedNodes.bitOR(tmp);
+ c_start.m_starting.assign(NdbNodeBitmask::Size, conf->startingNodes);
+ ph2GLab(signal);
+
+ UpgradeStartup::sendCmAppChg(* this, signal, 2); //START
+}
+
+/**
+ * Tried with parallell nr, but it crashed in DIH
+ * so I turned it off, as I don't want to debug DIH now...
+ * Jonas 19/11-03
+ *
+ * After trying for 2 hours, I gave up.
+ * DIH is not designed to support it, and
+ * it requires quite of lot of changes to
+ * make it work
+ * Jonas 5/12-03
+ */
+#define PARALLELL_NR 0
+
+#if PARALLELL_NR
+const bool parallellNR = true;
+#else
+const bool parallellNR = false;
+#endif
- cfgBlockPtr.i = 0;
- ptrAss(cfgBlockPtr, cfgBlockRec);
+void
+Ndbcntr::execCNTR_START_REP(Signal* signal){
+ jamEntry();
+ Uint32 nodeId = signal->theData[0];
+ c_startedNodes.set(nodeId);
+ c_start.m_starting.clear(nodeId);
- cdelayStart = cfgBlockPtr.p->cfgData[0];
+ if(!c_start.m_starting.isclear()){
+ jam();
+ return;
+ }
- signal->theData[0] = cownBlockref;
- signal->theData[1] = strlen(ZNAME_OF_APPL) | (ZNAME_OF_APPL[0] << 8);
- signal->theData[2] = ZNAME_OF_APPL[1] | (ZNAME_OF_APPL[2] << 8);
- signal->theData[9] = ZAPPL_SUBTYPE;
- signal->theData[10] = 0; //NDB_VERSION;
- sendSignal(cqmgrBlockref, GSN_APPL_REGREQ, signal, 11, JBB);
- return; /* WAIT FOR APPL_REGCONF */
-}//Ndbcntr::execCMVMI_CFGCONF()
+ if(cmasterNodeId != getOwnNodeId()){
+ c_start.reset();
+ return;
+ }
-/*******************************/
-/* APPL_REGCONF */
-/*******************************/
-void Ndbcntr::execAPPL_REGCONF(Signal* signal)
-{
- jamEntry();
- cqmgrConnectionP = signal->theData[0];
- cnoNdbNodes = signal->theData[1];
- if(ctypeOfStart == NodeState::ST_INITIAL_START){
- cmasterCandidateId = signal->theData[2];
- } else {
- cmasterCandidateId = ZNIL;
+ if(c_start.m_waiting.isclear()){
+ c_start.reset();
+ return;
}
- nodePtr.i = getOwnNodeId();
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
+ startWaitingNodes(signal);
+}
+
+void
+Ndbcntr::execCNTR_START_REQ(Signal * signal){
+ jamEntry();
+ const CntrStartReq * req = (CntrStartReq*)signal->getDataPtr();
- /*----------------------------------------------------------------------*/
- /* CALCULATE HOW MANY NODES THAT WE NEED TO PERFORM A START. MAKE A */
- /* DECISION ABOUT WAITING FOR MORE NODES OR TO CONTINUE AT ONCE */
- /*----------------------------------------------------------------------*/
- nodePtr.p->state = ZADD;
- nodePtr.p->ndbVersion = 0; //NDB_VERSION;
- nodePtr.p->subType = ZAPPL_SUBTYPE;
- nodePtr.p->dynamicId = signal->theData[3];
- // Save dynamic nodeid in global variable
- cdynamicNodeId = nodePtr.p->dynamicId;
- cnoRegNodes = cnoRegNodes + 1;
- switch((NodeState::StartType)ctypeOfStart){
- case NodeState::ST_INITIAL_START:
+ const Uint32 nodeId = req->nodeId;
+ const Uint32 lastGci = req->lastGci;
+ const NodeState::StartType st = (NodeState::StartType)req->startType;
+
+ if(cmasterNodeId == 0){
jam();
- cnoNeedNodes = cnoNdbNodes;
- break;
- case NodeState::ST_SYSTEM_RESTART:
- if (cnoNdbNodes == 2) {
- jam();
- /*--------------------------------------*/
- /* NEED > 50% OF ALL NODES. */
- /* WE WILL SEND CONTINUEB WHEN THE WE */
- /* RECEIVE THE FIRST APPL_CHANGEREP. */
- /*--------------------------------------*/
- cnoNeedNodes = 1; /* IF ONLY 2 NODES IN CLUSTER, 1 WILL DO*/
- } else {
- jam();
- cnoNeedNodes = (cnoNdbNodes >> 1) + 1;
- }//if
- break;
- case NodeState::ST_NODE_RESTART:
- case NodeState::ST_INITIAL_NODE_RESTART:
- break;
- default:
- ndbrequire(false);
- }//if
+ // Has not completed READNODES yet
+ sendSignalWithDelay(reference(), GSN_CNTR_START_REQ, signal, 100,
+ signal->getLength());
+ return;
+ }
- /*--------------------------------------------------------------*/
- /* WE CAN COME HERE ALSO IN A NODE RESTART IF THE */
- /* REGISTRATION OF A RUNNING NODE HAPPENS TO ARRIVE BEFORE*/
- /* THE APPL_REGCONF SIGNAL. */
- /* IN THAT CASE CNO_NEED_NODES = ZNIL IF NOT NODE_STATE */
- /* SIGNAL HAS RETURNED THE PROPER VALUE. IN BOTH CASES WE */
- /* DO NOT NEED TO ASSIGN IT HERE. */
- /*--------------------------------------------------------------*/
- ph2CLab(signal);
- return;
-}//Ndbcntr::execAPPL_REGCONF()
-
-/*--------------------------------------------------------------*/
-/* CHECK THAT WE GOT ALL NODES REGISTRATED AS WE NEED FOR THIS */
-/* KIND OF START. WE ALWAYS END UP HERE AFTER HANDLING OF */
-/* APPL_CHANGEREP AND NODE_STATESCONF */
-/*--------------------------------------------------------------*/
-void Ndbcntr::ph2CLab(Signal* signal)
-{
- NodeRecPtr ownNodePtr;
- ownNodePtr.i = getOwnNodeId();
- ptrCheckGuard(ownNodePtr, MAX_NDB_NODES, nodeRec);
- if (ownNodePtr.p->state != ZADD) {
+ if(cmasterNodeId != getOwnNodeId()){
jam();
+ sendCntrStartRef(signal, nodeId, CntrStartRef::NotMaster);
return;
- }//if
- switch (ctypeOfStart) {
- case NodeState::ST_INITIAL_START:
+ }
+
+ const NodeState & nodeState = getNodeState();
+ switch(nodeState.startLevel){
+ case NodeState::SL_NOTHING:
+ case NodeState::SL_CMVMI:
jam();
- if (cnoRegNodes == cnoNeedNodes) {
- jam();
- ph2ELab(signal);
-/*******************************/
-/* ALL NODES ADDED */
-/*******************************/
- return;
- }//if
+ ndbrequire(false);
+ case NodeState::SL_STARTING:
+ case NodeState::SL_STARTED:
+ break;
+
+ case NodeState::SL_STOPPING_1:
+ case NodeState::SL_STOPPING_2:
+ case NodeState::SL_STOPPING_3:
+ case NodeState::SL_STOPPING_4:
+ jam();
+ sendCntrStartRef(signal, nodeId, CntrStartRef::StopInProgress);
+ return;
+ }
+
+ /**
+ * Am I starting (or started)
+ */
+ const bool starting = (nodeState.startLevel != NodeState::SL_STARTED);
+
+ c_start.m_waiting.set(nodeId);
+ switch(st){
+ case NodeState::ST_INITIAL_START:
+ c_start.m_withoutLog.set(nodeId);
break;
case NodeState::ST_SYSTEM_RESTART:
- ndbrequire(cnoRunNodes == 0);
- if (cnoRegNodes == cnoNdbNodes) {
+ c_start.m_withLog.set(nodeId);
+ if(starting && lastGci > c_start.m_lastGci){
jam();
- /*******************************/
- /* ALL NODES ADDED */
- /*******************************/
- ph2ELab(signal);
+ CntrStartRef * ref = (CntrStartRef*)signal->getDataPtrSend();
+ ref->errorCode = CntrStartRef::NotMaster;
+ ref->masterNodeId = nodeId;
+ NodeReceiverGroup rg (NDBCNTR, c_start.m_waiting);
+ sendSignal(rg, GSN_CNTR_START_REF, signal,
+ CntrStartRef::SignalLength, JBB);
return;
- }//if
- if (cwaitContinuebFlag == ZFALSE) {
- if (cnoRegNodes == cnoNeedNodes) {
- jam();
- /****************************************/
- /* ENOUGH NODES ADDED, WAIT CDELAY_START*/
- /****************************************/
- cwaitContinuebFlag = ZTRUE;
- /*******************************/
- /* A DELAY SIGNAL TO MYSELF */
- /*******************************/
- signal->theData[0] = ZCONTINUEB_1;
- sendSignalWithDelay(cownBlockref, GSN_CONTINUEB,
- signal, cdelayStart * 1000, 1);
- return;
- }//if
- }//if
+ }
+ if(starting){
+ Uint32 i = c_start.m_logNodesCount++;
+ c_start.m_logNodes[i].m_nodeId = nodeId;
+ c_start.m_logNodes[i].m_lastGci = req->lastGci;
+ }
break;
case NodeState::ST_NODE_RESTART:
case NodeState::ST_INITIAL_NODE_RESTART:
- jam();
- if (cnoNeedNodes <= cnoRunNodes) {
- /*----------------------------------------------*/
- /* GOT ALL RUNNING NODES */
- /* " =< " :NODES MAY HAVE FINISHED A NODERESTART*/
- /* WHILE WE WERE WAITING FOR NODE_STATESCONF */
- /*----------------------------------------------*/
- if (cnoRegNodes != (cnoRunNodes + 1)) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- getStartNodes(signal);
- cwaitContinuebFlag = ZFALSE;
- cstartProgressFlag = ZTRUE;
- /*--------------------------------------------------------------*/
- /* IF SOMEONE ELSE IS PERFORMING NODERESTART THEN WE GOT A REF */
- /* AND WE HAVE TO MAKE A NEW NODE_STATESREQ */
- /*--------------------------------------------------------------*/
- sendCntrMasterreq(signal);
- }//if
- break;
- default:
- jam();
- systemErrorLab(signal);
- return;
- break;
- }//switch
- /*--------------------------------------------------------------*/
- /* WAIT FOR THE CONTINUEB SIGNAL */
- /* AND / OR MORE NODES TO REGISTER */
- /*--------------------------------------------------------------*/
- return;
-}//Ndbcntr::ph2CLab()
+ case NodeState::ST_ILLEGAL_TYPE:
+ ndbrequire(false);
+ }
-/*******************************/
-/* CONTINUEB */
-/*******************************/
-/*--------------------------------------------------------------*/
-/* WE COME HERE ONLY IN SYSTEM RESTARTS AND INITIAL START. FOR */
-/* INITIAL START WE HAVE ALREADY CALCULATED THE MASTER. FOR */
-/* SYSTEM RESTART WE NEED TO PERFORM A VOTING SCHEME TO AGREE */
-/* ON A COMMON MASTER. WE GET OUR VOTE FROM DIH AND THE RESTART */
-/* INFORMATION IN DIH. */
-/*--------------------------------------------------------------*/
-void Ndbcntr::ph2ELab(Signal* signal)
-{
- cwaitContinuebFlag = ZFALSE;
-/*--------------------------------------*/
-/* JMP TO THIS WHEN ENOUGH NO OF */
-/* NODES ADDED */
-/*--------------------------------------*/
-/*--------------------------------------*/
-/* IGNORE CONTINUEB SIGNAL */
-/* CONTINUEB SIGNALS WILL EXIT AT */
-/* SIGNAL RECEPTION */
-/*--------------------------------------*/
- if (cnoRegNodes >= cnoNeedNodes) {
+ const bool startInProgress = !c_start.m_starting.isclear();
+
+ if((starting && startInProgress) || (startInProgress && !parallellNR)){
jam();
- getStartNodes(signal);
- if (ctypeOfStart == NodeState::ST_INITIAL_START) {
- if (cmasterCandidateId != getOwnNodeId()) {
- jam();
-/*--------------------------------------*/
-/* THIS NODE IS NOT THE MASTER */
-/* DON'T SEND ANY MORE CNTR_MASTERREQ */
-/* VOTE FOR MASTER */
-/*--------------------------------------*/
- cstartProgressFlag = ZTRUE;
- sendCntrMasterreq(signal);
- resetStartVariables(signal);
- } else {
- jam();
- masterreq020Lab(signal);
- }//if
- } else if (ctypeOfStart == NodeState::ST_SYSTEM_RESTART) {
- jam();
-/*--------------------------------------------------------------*/
-/* WE START THE SELECTION OF MASTER PROCESS. IF WE HAVE NOT */
-/* COMPLETED THIS BEFORE THE TIME OUT WE WILL TRY A NEW RESTART.*/
-/*--------------------------------------------------------------*/
- cwaitContinuebFlag = ZTRUE;
- cstartProgressFlag = ZVOTING;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->state == ZADD) {
- jam();
- signal->theData[0] = getOwnNodeId();
- signal->theData[1] = cmasterDihId;
- signal->theData[2] = clastGci;
- sendSignal(nodePtr.p->cntrBlockref, GSN_VOTE_MASTERORD,
- signal, 3, JBB);
- }//if
- }//for
- } else {
- jam();
- systemErrorLab(signal);
- }//if
+ // We're already starting together with a bunch of nodes
+ // Let this node wait...
+ return;
+ }
+
+ if(starting){
+ trySystemRestart(signal);
} else {
- jam();
-/*--------------------------------------------------------------*/
-/* TOO FEW NODES TO START */
-/* WE HAVE WAITED FOR THE GIVEN TIME OUT AND NOT ENOUGH NODES */
-/* HAS REGISTERED. WE WILL CRASH AND RENEW THE ATTEMPT TO START */
-/* THE SYSTEM. */
-/*--------------------------------------------------------------*/
- systemErrorLab(signal);
- }//if
+ startWaitingNodes(signal);
+ }
+
return;
-}//Ndbcntr::ph2ELab()
+}
-/*******************************/
-/* MASTER NODE CONFIRMS REQ */
-/* CNTR_MASTERCONF */
-/*******************************/
-void Ndbcntr::execCNTR_MASTERCONF(Signal* signal)
-{
+void
+Ndbcntr::startWaitingNodes(Signal * signal){
+
+#if ! PARALLELL_NR
+ const Uint32 nodeId = c_start.m_waiting.find(0);
+ const Uint32 Tref = calcNdbCntrBlockRef(nodeId);
+ ndbrequire(nodeId != c_start.m_waiting.NotFound);
+
+ NodeState::StartType nrType = NodeState::ST_NODE_RESTART;
+ if(c_start.m_withoutLog.get(nodeId)){
+ nrType = NodeState::ST_INITIAL_NODE_RESTART;
+ }
+
+ /**
+ * Let node perform restart
+ */
+ CntrStartConf * conf = (CntrStartConf*)signal->getDataPtrSend();
+ conf->noStartNodes = 1;
+ conf->startType = nrType;
+ conf->startGci = ~0; // Not used
+ conf->masterNodeId = getOwnNodeId();
+ BitmaskImpl::clear(NdbNodeBitmask::Size, conf->startingNodes);
+ BitmaskImpl::set(NdbNodeBitmask::Size, conf->startingNodes, nodeId);
+ c_startedNodes.copyto(NdbNodeBitmask::Size, conf->startedNodes);
+ sendSignal(Tref, GSN_CNTR_START_CONF, signal,
+ CntrStartConf::SignalLength, JBB);
+
+ c_start.m_waiting.clear(nodeId);
+ c_start.m_withLog.clear(nodeId);
+ c_start.m_withoutLog.clear(nodeId);
+ c_start.m_starting.set(nodeId);
+#else
+ // Parallell nr
+
+ c_start.m_starting = c_start.m_waiting;
+ c_start.m_waiting.clear();
+
+ CntrStartConf * conf = (CntrStartConf*)signal->getDataPtrSend();
+ conf->noStartNodes = 1;
+ conf->startGci = ~0; // Not used
+ conf->masterNodeId = getOwnNodeId();
+ c_start.m_starting.copyto(NdbNodeBitmask::Size, conf->startingNodes);
+ c_startedNodes.copyto(NdbNodeBitmask::Size, conf->startedNodes);
+
+ char buf[100];
+ if(!c_start.m_withLog.isclear()){
+ ndbout_c("Starting nodes w/ log: %s", c_start.m_withLog.getText(buf));
+
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_withLog);
+ conf->startType = NodeState::ST_NODE_RESTART;
+
+ sendSignal(rg, GSN_CNTR_START_CONF, signal,
+ CntrStartConf::SignalLength, JBB);
+ }
+
+ if(!c_start.m_withoutLog.isclear()){
+ ndbout_c("Starting nodes wo/ log: %s", c_start.m_withoutLog.getText(buf));
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_withoutLog);
+ conf->startType = NodeState::ST_INITIAL_NODE_RESTART;
+
+ sendSignal(rg, GSN_CNTR_START_CONF, signal,
+ CntrStartConf::SignalLength, JBB);
+ }
+
+ c_start.m_waiting.clear();
+ c_start.m_withLog.clear();
+ c_start.m_withoutLog.clear();
+#endif
+}
+
+void
+Ndbcntr::sendCntrStartRef(Signal * signal,
+ Uint32 nodeId, CntrStartRef::ErrorCode code){
+ CntrStartRef * ref = (CntrStartRef*)signal->getDataPtrSend();
+ ref->errorCode = code;
+ ref->masterNodeId = cmasterNodeId;
+ sendSignal(calcNdbCntrBlockRef(nodeId), GSN_CNTR_START_REF, signal,
+ CntrStartRef::SignalLength, JBB);
+}
+
+CheckNodeGroups::Output
+Ndbcntr::checkNodeGroups(Signal* signal, const NdbNodeBitmask & mask){
+ CheckNodeGroups* sd = (CheckNodeGroups*)&signal->theData[0];
+ sd->blockRef = reference();
+ sd->requestType = CheckNodeGroups::Direct | CheckNodeGroups::ArbitCheck;
+ sd->mask = mask;
+ EXECUTE_DIRECT(DBDIH, GSN_CHECKNODEGROUPSREQ, signal,
+ CheckNodeGroups::SignalLength);
jamEntry();
+ return (CheckNodeGroups::Output)sd->output;
+}
- CntrMasterConf * const cntrMasterConf =
- (CntrMasterConf *)&signal->theData[0];
+bool
+Ndbcntr::trySystemRestart(Signal* signal){
+ /**
+ * System restart something
+ */
+ const bool allNodes = c_start.m_waiting.equal(c_allDefinedNodes);
+ const bool allClusterNodes = c_start.m_waiting.equal(c_clusterNodes);
+ const Uint64 now = NdbTick_CurrentMillisecond();
- cnoStartNodes = cntrMasterConf->noStartNodes;
- int index = 0;
- unsigned i;
- for (i = 1; i < MAX_NDB_NODES; i++) {
+ if(!allClusterNodes){
jam();
- if (NodeBitmask::get(cntrMasterConf->theNodes, i)) {
- jam();
- cstartNodes[index] = i;
- index++;
- }//if
- }//for
- if (cnoStartNodes != index) {
+ return false;
+ }
+
+ if(!allNodes && c_start.m_startPartialTimeout > now){
jam();
- systemErrorLab(signal);
- }//if
- ph2FLab(signal);
- return;
-}//Ndbcntr::execCNTR_MASTERCONF()
+ return false;
+ }
-void Ndbcntr::ph2FLab(Signal* signal)
-{
-/*--------------------------------------------------------------*/
-//The nodes have been selected and we now know which nodes are
-// included in the system restart. We can reset wait for CONTINUEB
-// flag to ensure system is not restarted when CONTINUEB after the
-// delay.
-/*--------------------------------------------------------------*/
- cmasterNodeId = cmasterCandidateId;
- cwaitContinuebFlag = ZFALSE;
- ph2GLab(signal);
- return;
-}//Ndbcntr::ph2FLab()
+ NodeState::StartType srType = NodeState::ST_SYSTEM_RESTART;
+ if(c_start.m_waiting.equal(c_start.m_withoutLog)){
+ if(!allNodes){
+ jam();
+ return false;
+ }
+ srType = NodeState::ST_INITIAL_START;
+ c_start.m_starting = c_start.m_withoutLog; // Used for starting...
+ c_start.m_withoutLog.clear();
+ } else {
+
+ CheckNodeGroups::Output wLog = checkNodeGroups(signal, c_start.m_withLog);
+
+ switch (wLog) {
+ case CheckNodeGroups::Win:
+ jam();
+ break;
+ case CheckNodeGroups::Lose:
+ jam();
+ // If we lose with all nodes, then we're in trouble
+ ndbrequire(!allNodes);
+ return false;
+ break;
+ case CheckNodeGroups::Partitioning:
+ jam();
+ bool allowPartition = (c_start.m_startPartitionedTimeout != (Uint64)~0);
+
+ if(allNodes){
+ jam();
+ if(allowPartition){
+ jam();
+ break;
+ }
+ ndbrequire(false); // All nodes -> partitioning, which is not allowed
+ }
+
+ if(c_start.m_startPartitionedTimeout > now){
+ jam();
+ return false;
+ }
+ break;
+ }
+
+ // For now only with the "logged"-ones.
+ // Let the others do node restart afterwards...
+ c_start.m_starting = c_start.m_withLog;
+ c_start.m_withLog.clear();
+ }
+
+ /**
+ * Okidoki, we try to start
+ */
+ CntrStartConf * conf = (CntrStartConf*)signal->getDataPtr();
+ conf->noStartNodes = c_start.m_starting.count();
+ conf->startType = srType;
+ conf->startGci = c_start.m_lastGci;
+ conf->masterNodeId = c_start.m_lastGciNodeId;
+ c_start.m_starting.copyto(NdbNodeBitmask::Size, conf->startingNodes);
+ c_startedNodes.copyto(NdbNodeBitmask::Size, conf->startedNodes);
+
+ ndbrequire(c_start.m_lastGciNodeId == getOwnNodeId());
+
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_starting);
+ sendSignal(rg, GSN_CNTR_START_CONF, signal, CntrStartConf::SignalLength,JBB);
+
+ c_start.m_waiting.bitANDC(c_start.m_starting);
+
+ return true;
+}
-/*--------------------------------------*/
-/* RECEIVED CNTR_MASTERCONF */
-/*--------------------------------------*/
-/*******************************/
-/* NDB_STTORRY */
-/*******************************/
-/*---------------------------------------------------------------------------*/
-// NOW WE CAN START NDB START PHASE 1. IN THIS PHASE ALL BLOCKS
-// (EXCEPT DIH THAT INITIALISED WHEN
-// RECEIVING DIH_RESTARTREQ) WILL INITIALISE THEIR DATA, COMMON VARIABLES,
-// LINKED LISTS AND RECORD VARIABLES.
-/*---------------------------------------------------------------------------*/
void Ndbcntr::ph2GLab(Signal* signal)
{
if (cndbBlocksCount < ZNO_NDB_BLOCKS) {
@@ -879,11 +868,6 @@ void Ndbcntr::ph2GLab(Signal* signal)
/*******************************/
void Ndbcntr::startPhase3Lab(Signal* signal)
{
- cinternalStartphase = cstartPhase - 1;
-/*--------------------------------------*/
-/* CASE: CSTART_PHASE = ZSTART_PHASE_3 */
-/*--------------------------------------*/
- cndbBlocksCount = 0;
ph3ALab(signal);
return;
}//Ndbcntr::startPhase3Lab()
@@ -893,29 +877,12 @@ void Ndbcntr::startPhase3Lab(Signal* signal)
/*******************************/
void Ndbcntr::ph3ALab(Signal* signal)
{
- Uint16 tnoStartNodes;
-
if (cndbBlocksCount < ZNO_NDB_BLOCKS) {
jam();
sendNdbSttor(signal);
return;
}//if
-/*******************************/
-/*< APPL_STARTREG <*/
-/*******************************/
- if (ctypeOfStart == NodeState::ST_NODE_RESTART) {
- jam();
- tnoStartNodes = 1;
- } else if (ctypeOfStart == NodeState::ST_INITIAL_NODE_RESTART) {
- jam();
- tnoStartNodes = 1;
- } else {
- jam();
- tnoStartNodes = cnoStartNodes;
- }//if
- signal->theData[0] = cqmgrConnectionP;
- signal->theData[1] = tnoStartNodes;
- sendSignal(cqmgrBlockref, GSN_APPL_STARTREG, signal, 2, JBB);
+
sendSttorry(signal);
return;
}//Ndbcntr::ph3ALab()
@@ -933,49 +900,12 @@ void Ndbcntr::ph3ALab(Signal* signal)
/*******************************/
void Ndbcntr::startPhase4Lab(Signal* signal)
{
- cinternalStartphase = cstartPhase - 1;
-/*--------------------------------------*/
-/* CASE: CSTART_PHASE = ZSTART_PHASE_4 */
-/*--------------------------------------*/
- cndbBlocksCount = 0;
- cnoWaitrep = 0;
- if (capplStartconfFlag != ZTRUE) {
- jam();
-/*------------------------------------------------------*/
-/* HAVE WE ALREADY RECEIVED APPL_STARTCONF */
-/*------------------------------------------------------*/
- return;
- }//if
ph4ALab(signal);
- return;
}//Ndbcntr::startPhase4Lab()
-/*******************************/
-/* APPL_STARTCONF */
-/*******************************/
-void Ndbcntr::execAPPL_STARTCONF(Signal* signal)
-{
- jamEntry();
- if (cstartPhase == ZSTART_PHASE_4) {
- jam();
- ph4ALab(signal);
- return;
- } else {
- jam();
- capplStartconfFlag = ZTRUE;
-//------------------------------------------------
-/* FLAG WILL BE CHECKED WHEN WE RECEIVED STTOR */
-/* SIGNAL MAY BE RECEIVED IN STARTPHASE 3 */
-//------------------------------------------------
- return;
- }//if
-}//Ndbcntr::execAPPL_STARTCONF()
void Ndbcntr::ph4ALab(Signal* signal)
{
- nodePtr.i = getOwnNodeId();
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- nodePtr.p->state = ZSTART;
ph4BLab(signal);
return;
}//Ndbcntr::ph4ALab()
@@ -1014,6 +944,7 @@ void Ndbcntr::waitpoint41Lab(Signal* signal)
cnoWaitrep++;
if (cnoWaitrep == cnoStartNodes) {
jam();
+ cnoWaitrep = 0;
/*---------------------------------------------------------------------------*/
// NDB_STARTREQ STARTS UP ALL SET UP OF DISTRIBUTION INFORMATION IN DIH AND
// DICT. AFTER SETTING UP THIS
@@ -1025,9 +956,9 @@ void Ndbcntr::waitpoint41Lab(Signal* signal)
// 3) EXECUTING THE FRAGMENT REDO LOG FROM ONE OR SEVERAL NODES TO
// RESTORE THE RESTART CONFIGURATION OF DATA IN NDB CLUSTER.
/*---------------------------------------------------------------------------*/
- signal->theData[0] = cownBlockref;
+ signal->theData[0] = reference();
signal->theData[1] = ctypeOfStart;
- sendSignal(cdihBlockref, GSN_NDB_STARTREQ, signal, 2, JBB);
+ sendSignal(DBDIH_REF, GSN_NDB_STARTREQ, signal, 2, JBB);
}//if
} else {
jam();
@@ -1037,11 +968,10 @@ void Ndbcntr::waitpoint41Lab(Signal* signal)
/* SLAVES WONT DO ANYTHING UNTIL THEY */
/* RECEIVE A WAIT REPORT FROM THE MASTER*/
/*--------------------------------------*/
- nodePtr.i = cmasterNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
signal->theData[0] = getOwnNodeId();
signal->theData[1] = ZWAITPOINT_4_1;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
+ sendSignal(calcNdbCntrBlockRef(cmasterNodeId),
+ GSN_CNTR_WAITREP, signal, 2, JBB);
}//if
return;
}//Ndbcntr::waitpoint41Lab()
@@ -1052,23 +982,11 @@ void Ndbcntr::waitpoint41Lab(Signal* signal)
void Ndbcntr::execNDB_STARTCONF(Signal* signal)
{
jamEntry();
- UintR guard0;
- UintR Ttemp1;
- guard0 = cnoStartNodes - 1;
- arrGuard(guard0, MAX_NDB_NODES);
- for (Ttemp1 = 0; Ttemp1 <= guard0; Ttemp1++) {
- jam();
- if (cstartNodes[Ttemp1] != getOwnNodeId()) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = getOwnNodeId();
- signal->theData[1] = ZWAITPOINT_4_2;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
- }//if
- }//for
- sendSttorry(signal);
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_starting);
+ signal->theData[0] = getOwnNodeId();
+ signal->theData[1] = ZWAITPOINT_4_2;
+ sendSignal(rg, GSN_CNTR_WAITREP, signal, 2, JBB);
return;
}//Ndbcntr::execNDB_STARTCONF()
@@ -1084,9 +1002,6 @@ void Ndbcntr::execNDB_STARTCONF(Signal* signal)
/*******************************/
void Ndbcntr::startPhase5Lab(Signal* signal)
{
- cinternalStartphase = cstartPhase - 1;
- cndbBlocksCount = 0;
- cnoWaitrep = 0;
ph5ALab(signal);
return;
}//Ndbcntr::startPhase5Lab()
@@ -1147,16 +1062,17 @@ void Ndbcntr::ph5ALab(Signal* signal)
// SEND NDB START PHASE 5 IN NODE RESTARTS TO COPY DATA TO THE NEWLY
// STARTED NODE.
/*----------------------------------------------------------------------*/
- req->senderRef = cownBlockref;
+ req->senderRef = reference();
req->nodeId = getOwnNodeId();
req->internalStartPhase = cinternalStartphase;
req->typeOfStart = ctypeOfStart;
req->masterNodeId = cmasterNodeId;
+ //#define TRACE_STTOR
#ifdef TRACE_STTOR
ndbout_c("sending NDB_STTOR(%d) to DIH", cinternalStartphase);
#endif
- sendSignal(cdihBlockref, GSN_NDB_STTOR, signal,
+ sendSignal(DBDIH_REF, GSN_NDB_STTOR, signal,
NdbSttor::SignalLength, JBB);
return;
case NodeState::ST_INITIAL_START:
@@ -1170,11 +1086,10 @@ void Ndbcntr::ph5ALab(Signal* signal)
/* RECEIVE A WAIT REPORT FROM THE MASTER*/
/* WHEN THE MASTER HAS FINISHED HIS WORK*/
/*--------------------------------------*/
- nodePtr.i = cmasterNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
signal->theData[0] = getOwnNodeId();
signal->theData[1] = ZWAITPOINT_5_2;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
+ sendSignal(calcNdbCntrBlockRef(cmasterNodeId),
+ GSN_CNTR_WAITREP, signal, 2, JBB);
return;
default:
ndbrequire(false);
@@ -1198,8 +1113,10 @@ void Ndbcntr::waitpoint52Lab(Signal* signal)
/*--------------------------------------*/
if (cnoWaitrep == cnoStartNodes) {
jam();
+ cnoWaitrep = 0;
+
NdbSttor * const req = (NdbSttor*)signal->getDataPtrSend();
- req->senderRef = cownBlockref;
+ req->senderRef = reference();
req->nodeId = getOwnNodeId();
req->internalStartPhase = cinternalStartphase;
req->typeOfStart = ctypeOfStart;
@@ -1207,7 +1124,7 @@ void Ndbcntr::waitpoint52Lab(Signal* signal)
#ifdef TRACE_STTOR
ndbout_c("sending NDB_STTOR(%d) to DIH", cinternalStartphase);
#endif
- sendSignal(cdihBlockref, GSN_NDB_STTOR, signal,
+ sendSignal(DBDIH_REF, GSN_NDB_STTOR, signal,
NdbSttor::SignalLength, JBB);
}//if
return;
@@ -1218,28 +1135,19 @@ void Ndbcntr::waitpoint52Lab(Signal* signal)
/*******************************/
void Ndbcntr::ph6ALab(Signal* signal)
{
- UintR guard0;
- UintR Ttemp1;
-
if ((ctypeOfStart == NodeState::ST_NODE_RESTART) ||
(ctypeOfStart == NodeState::ST_INITIAL_NODE_RESTART)) {
jam();
waitpoint51Lab(signal);
return;
}//if
- guard0 = cnoStartNodes - 1;
- arrGuard(guard0, MAX_NDB_NODES);
- for (Ttemp1 = 0; Ttemp1 <= guard0; Ttemp1++) {
- jam();
- if (cstartNodes[Ttemp1] != getOwnNodeId()) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = getOwnNodeId();
- signal->theData[1] = ZWAITPOINT_5_1;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
- }//if
- }//for
+
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_starting);
+ rg.m_nodes.clear(getOwnNodeId());
+ signal->theData[0] = getOwnNodeId();
+ signal->theData[1] = ZWAITPOINT_5_1;
+ sendSignal(rg, GSN_CNTR_WAITREP, signal, 2, JBB);
+
waitpoint51Lab(signal);
return;
}//Ndbcntr::ph6ALab()
@@ -1283,28 +1191,18 @@ void Ndbcntr::waitpoint61Lab(Signal* signal)
cnoWaitrep6++;
if (cnoWaitrep6 == cnoStartNodes) {
jam();
- Uint32 guard0 = cnoStartNodes - 1;
- arrGuard(guard0, MAX_NDB_NODES);
- for (Uint32 Ttemp1 = 0; Ttemp1 <= guard0; Ttemp1++) {
- jam();
- if (cstartNodes[Ttemp1] != getOwnNodeId()) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = getOwnNodeId();
- signal->theData[1] = ZWAITPOINT_6_2;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
- }
- }
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_starting);
+ rg.m_nodes.clear(getOwnNodeId());
+ signal->theData[0] = getOwnNodeId();
+ signal->theData[1] = ZWAITPOINT_6_2;
+ sendSignal(rg, GSN_CNTR_WAITREP, signal, 2, JBB);
sendSttorry(signal);
}
} else {
jam();
- nodePtr.i = cmasterNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
signal->theData[0] = getOwnNodeId();
signal->theData[1] = ZWAITPOINT_6_1;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
+ sendSignal(calcNdbCntrBlockRef(cmasterNodeId), GSN_CNTR_WAITREP, signal, 2, JBB);
}
}
@@ -1339,28 +1237,18 @@ void Ndbcntr::waitpoint71Lab(Signal* signal)
cnoWaitrep7++;
if (cnoWaitrep7 == cnoStartNodes) {
jam();
- Uint32 guard0 = cnoStartNodes - 1;
- arrGuard(guard0, MAX_NDB_NODES);
- for (Uint32 Ttemp1 = 0; Ttemp1 <= guard0; Ttemp1++) {
- jam();
- if (cstartNodes[Ttemp1] != getOwnNodeId()) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = getOwnNodeId();
- signal->theData[1] = ZWAITPOINT_7_2;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
- }
- }
+ NodeReceiverGroup rg(NDBCNTR, c_start.m_starting);
+ rg.m_nodes.clear(getOwnNodeId());
+ signal->theData[0] = getOwnNodeId();
+ signal->theData[1] = ZWAITPOINT_7_2;
+ sendSignal(rg, GSN_CNTR_WAITREP, signal, 2, JBB);
sendSttorry(signal);
}
} else {
jam();
- nodePtr.i = cmasterNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
signal->theData[0] = getOwnNodeId();
signal->theData[1] = ZWAITPOINT_7_1;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_WAITREP, signal, 2, JBB);
+ sendSignal(calcNdbCntrBlockRef(cmasterNodeId), GSN_CNTR_WAITREP, signal, 2, JBB);
}
}
@@ -1378,315 +1266,11 @@ void Ndbcntr::ph8ALab(Signal* signal)
// NODES WHICH PERFORM A NODE RESTART NEEDS TO GET THE DYNAMIC ID'S
// OF THE OTHER NODES HERE.
/*---------------------------------------------------------------------------*/
- signal->theData[0] = cqmgrConnectionP;
- sendSignal(cqmgrBlockref, GSN_APPL_RUN, signal, 1, JBB);
- nodePtr.i = getOwnNodeId();
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- nodePtr.p->state = ZRUN;
- cnoRunNodes = cnoRunNodes + 1;
sendSttorry(signal);
- cstartProgressFlag = ZFALSE;
- ctypeOfStart = (NodeState::StartType)ZSYSTEM_RUN;
resetStartVariables(signal);
return;
}//Ndbcntr::ph8BLab()
-/*
-4.7 HANDLE GLOBAL EVENTS, NOT BOUNDED TO INITIALSTART OR SYSTEM RESTART */
-/*#######################################################################*/
-/*******************************/
-/* APPL_CHANGEREP */
-/*******************************/
-void Ndbcntr::execAPPL_CHANGEREP(Signal* signal)
-{
- jamEntry();
- Uint16 TapplEvent = signal->theData[0];
- Uint16 TapplVersion = signal->theData[1];
- Uint16 TapplNodeId = signal->theData[2];
- Uint16 TapplSubType = signal->theData[3];
-
- nodePtr.i = TapplNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- nodePtr.p->subType = TapplSubType;
- nodePtr.p->ndbVersion = TapplVersion;
- nodePtr.p->dynamicId = signal->theData[4];
-
- switch (TapplEvent) {
- case ZADD:
-/*----------------------------*/
-/* ADD A NEW NDB NODE TO FILE */
-/*----------------------------*/
- if (nodePtr.p->state == ZREMOVE) {
- jam();
- if (cnoRegNodes == cnoNdbNodes) {
- jam();
-/*----------------------------------------------*/
-/* DON'T ACCEPT MORE NODES THAN SYSFILE.CFG SPEC*/
-/*----------------------------------------------*/
- systemErrorLab(signal);
- return;
- }//if
- nodePtr.p->state = ZADD;
- cnoRegNodes = cnoRegNodes + 1;
- } else {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- if (cstartProgressFlag == ZFALSE) {
-/*----------------------------------------------*/
-/* FLAG = TRUE WHEN CNTR_MASTERREQ IS SENT */
-/*----------------------------------------------*/
- switch (ctypeOfStart) {
- case NodeState::ST_INITIAL_START:
- case NodeState::ST_SYSTEM_RESTART:
- jam();
- ph2CLab(signal);
-/*----------------------------------------------*/
-/* CHECK IF READY TO MAKE A CNTR_MASTERREQ */
-/*----------------------------------------------*/
- break;
- case NodeState::ST_NODE_RESTART:
- case NodeState::ST_INITIAL_NODE_RESTART:
- jam();
-/*------------------------------------------------------------------------*/
-/* THIS SHOULD NEVER OCCUR SINCE WE HAVE ALREADY BEEN ALLOWED TO */
-/* START OUR NODE. THE NEXT NODE CANNOT START UNTIL WE ARE FINISHED */
-/*------------------------------------------------------------------------*/
- systemErrorLab(signal);
- break;
- case ZSYSTEM_RUN:
- jam();
- /*empty*/;
- break;
- default:
- jam();
-/*------------------------------------------------------------------------*/
-/* NO PARTICULAR ACTION IS NEEDED. THE NODE WILL PERFORM A NODE */
-/* RESTART BUT NO ACTION IS NEEDED AT THIS STAGE IN THE RESTART. */
-/*------------------------------------------------------------------------*/
- systemErrorLab(signal);
- break;
- }//switch
- } else {
- jam();
-/*--------------------------------------------------------------------------*/
-// WHEN A RESTART IS IN PROGRESS THERE IS A POSSIBILITY THAT A NODE
-// REGISTER AND
-// THINKS THAT HE WOULD BE THE MASTER (LOWER NODE ID) BUT THE OTHER NODE IS
-// ALREADY RUNNING THE RESTART. THIS WILL BE DETECTED WHEN HE ATTEMPTS A
-// CNTR_MASTERREQ AND RECEIVES A REFUSE SIGNAL IN RETURN. THIS WILL CAUSE HIM
-// TO CRASH. IF HE ATTEMPTS TO JOIN AS A NON-MASTER HE WILL WAIT FOR THE MASTER.
-// IN THIS CASE IT IS BETTER TO SHOT HIM DOWN. FOR SAFETY REASONS WE WILL ALWAYS
-// SHOT HIM DOWN.
-/*--------------------------------------------------------------------------*/
- const BlockReference tblockref = calcNdbCntrBlockRef(nodePtr.i);
-
- SystemError * const sysErr = (SystemError*)&signal->theData[0];
- sysErr->errorCode = SystemError::StartInProgressError;
- sysErr->errorRef = reference();
- sendSignal(tblockref, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBA);
- }//if
- break;
- case ZSTART:
- jam();
- if (nodePtr.p->state != ZADD) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- nodePtr.p->state = ZSTART;
- break;
- case ZRUN:
- if (nodePtr.p->state == ZREMOVE) {
- jam();
- cnoRegNodes = cnoRegNodes + 1;
- } else {
- jam();
- if (nodePtr.p->state != ZSTART) {
- jam();
-/*----------------------------------------------*/
-/* STATE ZADD OR ZRUN -> ZRUN NOT ALLOWED */
-/*----------------------------------------------*/
- systemErrorLab(signal);
- return;
- }//if
- }//if
- cnoRunNodes = cnoRunNodes + 1;
- nodePtr.p->state = ZRUN;
- switch (ctypeOfStart) {
- case NodeState::ST_INITIAL_START:
- jam();
- detectNoderestart(signal);
- if (ctypeOfStart == NodeState::ST_NODE_RESTART) {
- jam();
-/*--------------------------------------------------------------------------*/
-/* WE DISCOVERED THAT WE ARE TRYING TO PERFORM A INITIAL START WHEN THERE */
-/* ARE ALREADY RUNNING NODES. THIS MEANS THAT THE NODE HAS CLEANED THE */
-/* FILE SYSTEM AND CONTAINS NO DATA. THIS IS AN INITIAL NODE RESTART WHICH */
-/* IS NECESSARY TO START A NODE THAT HAS BEEN TAKEN OVER. */
-/*--------------------------------------------------------------------------*/
- ctypeOfStart = NodeState::ST_INITIAL_NODE_RESTART;
- }//if
- break;
- case NodeState::ST_SYSTEM_RESTART:
- jam();
- detectNoderestart(signal);
-/*----------------------------------------------*/
-/* SHOULD THIS NODE PERFORM A NODE RESTART? */
-/* THEN CHANGE CTYPE_OF_START TO NodeState::ST_NODE_RESTART */
-/* AND SEND NODE_STATESREQ. */
-/* WAIT FOR NODE_STATESCONF. */
-/*----------------------------------------------*/
- break;
- case NodeState::ST_NODE_RESTART:
- case NodeState::ST_INITIAL_NODE_RESTART:
- jam();
-/*----------------------------------------------*/
-/* IF WE ARE WAITING FOR NODE_STATESCONF, THIS */
-/* JUMP WILL EXIT BECAUSE CNO_NEED_NODES = ZNIL */
-/* UNTIL WE RECEIVE NODE_STATESCONF */
-/*----------------------------------------------*/
- ph2CLab(signal);
- break;
- case ZSYSTEM_RUN:
- jam();
- break;
- default:
- jam();
- systemErrorLab(signal);
- break;
- }//switch
- break;
- default:
- jam();
- systemErrorLab(signal);
- break;
- }//switch
- return;
-}//Ndbcntr::execAPPL_CHANGEREP()
-
-/*--------------------------------------------------------------------------*/
-// A NODE HAS ADDED HAS VOTE ON WHICH MASTER IS TO BE CHOOSEN IN A SYSTEM
-// RESTART. WHEN ALL VOTES HAVE
-// BEEN ADDED THEN WE ARE PREPARED TO CHOOSE MASTER AND CONTINUE WITH THE
-// RESTART PROCESSING.
-/*--------------------------------------------------------------------------*/
-
-/*******************************/
-/* VOT_MASTERORD */
-/*******************************/
-void Ndbcntr::execVOTE_MASTERORD(Signal* signal)
-{
- jamEntry();
- nodePtr.i = signal->theData[0];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- UintR TmasterCandidateId = signal->theData[1];
- UintR TlastGci = signal->theData[2];
- if (ctypeOfStart != NodeState::ST_SYSTEM_RESTART) {
- jam();
- progError(__LINE__,
- ERR_SR_RESTARTCONFLICT,
- "One ore more nodes probably requested an initial SR");
- return;
- }//if
- cmasterVoters = cmasterVoters + 1;
- if (cmasterVoters == 1) {
- jam();
- cmasterCurrentId = TmasterCandidateId;
- cmasterLastGci = TlastGci;
- } else {
- if (cmasterLastGci < TlastGci) {
- jam();
- cmasterCurrentId = TmasterCandidateId;
- cmasterLastGci = TlastGci;
- } else if (cmasterLastGci == TlastGci) {
- jam();
- if (cmasterCurrentId != TmasterCandidateId) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- }//if
- }//if
- if (cstartProgressFlag == ZVOTING) {
-/*--------------------------------------------------------------------------*/
-// UNLESS START PROGRESS FLAG IS SET TO VOTING WE HAVE NOT YET REACHED A
-// STATE WHERE WE ARE READY TO
-// PROCEED WITH THE SYSTEM RESTART. OUR OWN NOTE HAVE AT LEAST NOT BEEN
-// CAST INTO THE BALLOT YET.
-/*--------------------------------------------------------------------------*/
- if (cmasterVoters == cnoRegNodes) {
- cmasterCandidateId = cmasterCurrentId;
- if (cmasterCandidateId == getOwnNodeId()) {
- jam();
- masterreq020Lab(signal);
- return;
- } else {
- jam();
- cstartProgressFlag = ZTRUE;
- sendCntrMasterreq(signal);
- resetStartVariables(signal);
- }//if
- }//if
- }//if
- return;
-}//Ndbcntr::execVOTE_MASTERORD()
-
-/*******************************/
-/* CNTR_MASTERREQ */
-/*******************************/
-void Ndbcntr::execCNTR_MASTERREQ(Signal* signal)
-{
- Uint16 ttypeOfStart;
-
- jamEntry();
-
- CntrMasterReq * const cntrMasterReq =
- (CntrMasterReq *)&signal->theData[0];
-
-//-----------------------------------------------
-// cntrMasterReq->userBlockRef NOT USED
-//-----------------------------------------------
- Uint16 TuserNodeId = cntrMasterReq->userNodeId;
- ttypeOfStart = cntrMasterReq->typeOfStart;
- Uint16 TnoRestartNodes = cntrMasterReq->noRestartNodes;
- int index = 0;
- unsigned i;
- for (i = 1; i < MAX_NDB_NODES; i++) {
- jam();
- if (NodeBitmask::get(cntrMasterReq->theNodes, i)) {
- jam();
- cstartNodes[index] = i;
- index++;
- }//if
- }//for
- if (TnoRestartNodes != index) {
- jam();
- systemErrorLab(signal);
- }//if
- switch (ttypeOfStart) {
- case NodeState::ST_INITIAL_START:
- case NodeState::ST_SYSTEM_RESTART:
- jam();
-//--------------------------------
-/* ELECTION OF MASTER AT */
-/* INITIAL OR SYSTEM RESTART */
-//--------------------------------
- masterreq010Lab(signal, TnoRestartNodes, TuserNodeId);
- break;
- case NodeState::ST_NODE_RESTART:
- case NodeState::ST_INITIAL_NODE_RESTART:
- jam();
- masterreq030Lab(signal, TnoRestartNodes, TuserNodeId);
- break;
- default:
- jam();
- systemErrorLab(signal);
- break;
- }//switch
-}//Ndbcntr::execCNTR_MASTERREQ()
-
/*******************************/
/* CNTR_WAITREP */
/*******************************/
@@ -1736,243 +1320,102 @@ void Ndbcntr::execCNTR_WAITREP(Signal* signal)
}//switch
}//Ndbcntr::execCNTR_WAITREP()
-/*
-4.7.4 MASTERREQ_010 ( CASE: INITIALSTART OR SYSTEMRESTART ) */
-/*--------------------------------------------------------------------------*/
-// ELECTION OF MASTER AND ELECTION OF PARTICIPANTS IN START. SENDER OF
-// CNTR_MASTERREQ THINKS THAT THIS NODE
-// SHOULD BE THE MASTER. WE CAN'T MAKE A DECISION ABOUT WHO THE MASTER
-// SHOULD BE UNTIL TIMELIMIT HAS EXPIRED AND
-// THAT AT LEAST CNO_NEED_NODES ARE ZADD IN NODE_PTR_REC. IF THIS NODE IS
-// MASTER THEN MAKE SURE THAT ALL NODES IN
-// THE CLUSTER COMES TO AN AGREEMENT ABOUT A SUBSET OF NODES THAT SATISFIES
-// THE NUMBER CNO_NEED_NODES. THERE IS
-// A POSSIBILITY THAT THE RECEIVER OF CNTR_MASTERREQ DOESN'T HAS CHOOSEN
-// A MASTER, THEN THE RECEIVER CAN'T
-// EITHER CONFIRM OR REFUSE JUST STORE THE VOTES OF THE CLUSTERMEMBERS.
-// IF THIS NODE BECOME AWARE OF THAT ANOTHER NODE IS MASTER THEN CHECK IF
-// ANYONE HAS VOTED (SENT CNTR_MASTERREQ) */
-// AND THEN SEND THEM CNTR_MASTERREF BACK.
-/*--------------------------------------------------------------------------*/
-void Ndbcntr::masterreq010Lab(Signal* signal,
- Uint16 TnoRestartNodes,
- Uint16 TuserNodeId)
-{
- UintR guard0;
- UintR Ttemp1;
-
- nodePtr.i = TuserNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- if (cstartProgressFlag == ZTRUE) {
- jam();
-/*--------------------------------------*/
-/* RESTART ALREADY IN PROGRESS */
-/*--------------------------------------*/
- if (ctypeOfStart == NodeState::ST_INITIAL_START) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- signal->theData[0] = cownBlockref;
- signal->theData[1] = getOwnNodeId();
- signal->theData[2] = ZSTART_IN_PROGRESS_ERROR;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_MASTERREF, signal, 3, JBB);
- return;
- }//if
- cnoVoters = cnoVoters + 1;
- nodePtr.p->voter = ZTRUE;
- guard0 = TnoRestartNodes - 1;
- arrGuard(guard0, MAX_NDB_NODES);
- for (Ttemp1 = 0; Ttemp1 <= guard0; Ttemp1++) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- nodePtr.p->votes = nodePtr.p->votes + 1;
- }//for
- masterreq020Lab(signal);
- return;
-}//Ndbcntr::masterreq010Lab()
-
-/*----------------------------------------------------------------------*/
-/* WHEN WE JUST WANT TO CHECK OUR VOTES IT IS POSSIBLE TO JUMP TO THIS */
-/* LABEL. IF WE HAVEN'T RECEIVED ANY VOTES SINCE OUR LASTCHECK WE WILL */
-/* JUST PERFORM AN EXIT */
-/*----------------------------------------------------------------------*/
-void Ndbcntr::masterreq020Lab(Signal* signal)
-{
- if (cmasterCandidateId == ZNIL) {
- jam();
-/*--------------------------------------*/
-/* MASTER UNKNOWN */
-/*--------------------------------------*/
- return;
- } else if (cmasterCandidateId == getOwnNodeId()) {
- jam();
-/*--------------------------------------*/
-/* SATISFIED WHEN WE HAVE AS MANY VOTERS*/
-/* AS RESTARTNODES - 1, DIFFERENT NODES?*/
-/* <- CNO_START_NODES, ALL NODES AGREED */
-/* ON THESE CNO_START_NODES */
-/*--------------------------------------*/
- if ((cnoStartNodes - 1) == cnoVoters) {
- chooseRestartNodes(signal);
- if (cnoStartNodes >= cnoNeedNodes) {
- jam();
- cstartProgressFlag = ZTRUE;
-/*--------------------------------------*/
-/* DON'T SEND ANY MORE CNTR_MASTERREQ */
-/*--------------------------------------*/
- replyMasterconfToAll(signal);
-/*--------------------------------------*/
-/* SEND CONF TO ALL PASSED REQ */
-/* DON'T SEND ANYTHING TO REJECTED NODES*/
-/* BLOCK THEM UNTIL SYSTEM IS RUNNING */
-/* CONTINUE RESTART */
-/*--------------------------------------*/
- ph2FLab(signal);
- } else {
- jam();
- systemErrorLab(signal);
- }//if
- }//if
- } else {
- jam();
-/*----------------------------------------------------------------------*/
-/* WE RECEIVED A REQUEST TO A MASTER WHILE NOT BEING MASTER. THIS */
-/* MUST BE AN ERROR INDICATION. WE CRASH. */
-/*----------------------------------------------------------------------*/
- systemErrorLab(signal);
- }//if
- return; /* WAIT FOR MORE CNTR_MASTERREQ */
-}//Ndbcntr::masterreq020Lab()
-
-void Ndbcntr::masterreq030Lab(Signal* signal,
- Uint16 TnoRestartNodes,
- Uint16 TuserNodeId)
-{
- UintR TretCode;
- if (cmasterNodeId == getOwnNodeId()) {
- jam();
- TretCode = checkNodelist(signal, TnoRestartNodes);
- nodePtr.i = TuserNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- if (TretCode == 1) {
- jam();
-/*******************************************************<*/
-/* CSTART_NODES IS OVERWRITTEN IN RECEIVING BLOCK, */
-/* SO WE MUST SEND CNTR_MASTERCONF TO THE SAME */
-/* CSTART_NODES AS WE RECEIVED IN CNTR_MASTERREQ */
-/*******************************************************<*/
-
- CntrMasterConf * const cntrMasterConf =
- (CntrMasterConf *)&signal->theData[0];
- NodeBitmask::clear(cntrMasterConf->theNodes);
- for (int i = 0; i < TnoRestartNodes; i++){
- jam();
- UintR Tnode = cstartNodes[i];
- arrGuard(Tnode, MAX_NDB_NODES);
- NodeBitmask::set(cntrMasterConf->theNodes, Tnode);
- }//for
- cntrMasterConf->noStartNodes = TnoRestartNodes;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_MASTERCONF,
- signal, CntrMasterConf::SignalLength, JBB);
- } else {
- jam();
- signal->theData[0] = cownBlockref;
- signal->theData[1] = getOwnNodeId();
- signal->theData[2] = ZTOO_FEW_NODES;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_MASTERREF, signal, 3, JBB);
- }//if
- } else {
- jam();
- nodePtr.i = TuserNodeId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = cownBlockref;
- signal->theData[1] = getOwnNodeId();
- signal->theData[2] = ZNOT_MASTER;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_MASTERREF, signal, 3, JBB);
- }//if
- return;
-}//Ndbcntr::masterreq030Lab()
-
/*******************************/
/* NODE_FAILREP */
/*******************************/
void Ndbcntr::execNODE_FAILREP(Signal* signal)
{
- UintR TfailureNr;
- UintR TnoOfNodes;
- UintR TreadNodes[MAX_NDB_NODES];
-
jamEntry();
+ const NodeFailRep * nodeFail = (NodeFailRep *)&signal->theData[0];
+ NdbNodeBitmask allFailed;
+ allFailed.assign(NdbNodeBitmask::Size, nodeFail->theNodes);
+
+ NdbNodeBitmask failedStarted = c_startedNodes;
+ NdbNodeBitmask failedStarting = c_start.m_starting;
+ NdbNodeBitmask failedWaiting = c_start.m_waiting;
+
+ failedStarted.bitAND(allFailed);
+ failedStarting.bitAND(allFailed);
+ failedWaiting.bitAND(allFailed);
+
+ const bool tMasterFailed = allFailed.get(cmasterNodeId);
+ const bool tStarted = !failedStarted.isclear();
+ const bool tStarting = !failedStarting.isclear();
+ const bool tWaiting = !failedWaiting.isclear();
+
+ if(tMasterFailed){
+ jam();
+ /**
+ * If master has failed choose qmgr president as master
+ */
+ cmasterNodeId = nodeFail->masterNodeId;
+ }
+
+ /**
+ * Clear node bitmasks from failed nodes
+ */
+ c_start.m_starting.bitANDC(allFailed);
+ c_start.m_waiting.bitANDC(allFailed);
+ c_start.m_withLog.bitANDC(allFailed);
+ c_start.m_withoutLog.bitANDC(allFailed);
+ c_clusterNodes.bitANDC(allFailed);
+ c_startedNodes.bitANDC(allFailed);
+
const NodeState & st = getNodeState();
if(st.startLevel == st.SL_STARTING){
- if(!st.getNodeRestartInProgress()){
+ jam();
+
+ const Uint32 phase = st.starting.startPhase;
+
+ const bool tStartConf = (phase > 2) || (phase == 2 && cndbBlocksCount > 0);
+
+ if(tMasterFailed){
progError(__LINE__,
ERR_SR_OTHERNODEFAILED,
- "Unhandled node failure during system restart");
+ "Unhandled node failure during restart");
+ }
+
+ if(tStartConf && tStarting){
+ // One of other starting nodes has crashed...
+ progError(__LINE__,
+ ERR_SR_OTHERNODEFAILED,
+ "Unhandled node failure of starting node during restart");
}
- }
-
- {
- NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
- TfailureNr = nodeFail->failNo;
- TnoOfNodes = nodeFail->noOfNodes;
- unsigned index = 0;
- unsigned i;
- for (i = 0; i < MAX_NDB_NODES; i++) {
- jam();
- if (NodeBitmask::get(nodeFail->theNodes, i)) {
- jam();
- TreadNodes[index] = i;
- index++;
- ndbrequire(getOwnNodeId() != i);
- }//if
+ if(tStartConf && tStarted){
+ // One of other started nodes has crashed...
+ progError(__LINE__,
+ ERR_SR_OTHERNODEFAILED,
+ "Unhandled node failure of started node during restart");
+ }
+
+ Uint32 nodeId = 0;
+ while(!allFailed.isclear()){
+ nodeId = allFailed.find(nodeId + 1);
+ allFailed.clear(nodeId);
+ signal->theData[0] = nodeId;
+ sendSignal(QMGR_REF, GSN_NDB_FAILCONF, signal, 1, JBB);
}//for
- ndbrequire(TnoOfNodes == index);
+
+ return;
}
- for (Uint32 i = 0; i < TnoOfNodes; i++) {
- jam();
- nodePtr.i = TreadNodes[i];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- signal->theData[0] = EventReport::NODE_FAILREP;
- signal->theData[1] = nodePtr.i;
- signal->theData[2] = nodePtr.p->state;
- sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
- if (nodePtr.p->state != ZREMOVE) {
- jam();
- deleteNode(signal);
- }//if
- }//for
+ ndbrequire(!allFailed.get(getOwnNodeId()));
-/*******************************/
-/*< NODE_FAILREP <*/
-/*******************************/
- NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
-
- nodeFail->failNo = TfailureNr;
- nodeFail->masterNodeId = cmasterNodeId;
+ NodeFailRep * rep = (NodeFailRep *)&signal->theData[0];
+ rep->masterNodeId = cmasterNodeId;
- nodeFail->noOfNodes = TnoOfNodes;
- NodeBitmask::clear(nodeFail->theNodes);
- for (unsigned i = 0; i < TnoOfNodes; i++) {
- jam();
- NodeBitmask::set(nodeFail->theNodes, TreadNodes[i]);
- }//for
-
- sendSignal(ctcBlockref, GSN_NODE_FAILREP, signal,
+ sendSignal(DBTC_REF, GSN_NODE_FAILREP, signal,
NodeFailRep::SignalLength, JBB);
- sendSignal(clqhBlockref, GSN_NODE_FAILREP, signal,
+ sendSignal(DBLQH_REF, GSN_NODE_FAILREP, signal,
NodeFailRep::SignalLength, JBB);
- sendSignal(cdihBlockref, GSN_NODE_FAILREP, signal,
+ sendSignal(DBDIH_REF, GSN_NODE_FAILREP, signal,
NodeFailRep::SignalLength, JBB);
- sendSignal(cdictBlockref, GSN_NODE_FAILREP, signal,
+ sendSignal(DBDICT_REF, GSN_NODE_FAILREP, signal,
NodeFailRep::SignalLength, JBB);
sendSignal(BACKUP_REF, GSN_NODE_FAILREP, signal,
@@ -1983,80 +1426,25 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal)
sendSignal(GREP_REF, GSN_NODE_FAILREP, signal,
NodeFailRep::SignalLength, JBB);
- return;
-}//Ndbcntr::execNODE_FAILREP()
-/*******************************/
-/* NODE_STATESCONF */
-/*******************************/
-void Ndbcntr::execNODE_STATESCONF(Signal* signal)
-{
- jamEntry();
- cmasterCandidateId = signal->theData[0];
- cnoNeedNodes = signal->theData[1];
-/*----------------------------------------------------------------------*/
-// Now that we have knowledge of how many nodes are needed we will call
-// ph2CLab to ensure that node restart continues if we already received
-// all APPL_CHANGEREP signals.
-/*----------------------------------------------------------------------*/
- ph2CLab(signal);
- return;
-}//Ndbcntr::execNODE_STATESCONF()
-
-/*******************************/
-/* NODE_STATESREF */
-/*******************************/
-void Ndbcntr::execNODE_STATESREF(Signal* signal)
-{
- jamEntry();
- systemErrorLab(signal);
- return;
-}//Ndbcntr::execNODE_STATESREF()
+ Uint32 nodeId = 0;
+ while(!allFailed.isclear()){
+ nodeId = allFailed.find(nodeId + 1);
+ allFailed.clear(nodeId);
+ signal->theData[0] = EventReport::NODE_FAILREP;
+ signal->theData[1] = nodeId;
+ signal->theData[2] = 0;
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
+ }//for
-/*******************************/
-/* NODE_STATESREQ */
-/*******************************/
-void Ndbcntr::execNODE_STATESREQ(Signal* signal)
-{
- UintR TnoNeedNodes = 0;
- NodeRecPtr TNodePtr;
- jamEntry();
- BlockReference TuserBlockref = signal->theData[0];
-/*----------------------------------------------------------------------*/
-// IF WE ARE RUNNING, WE WILL ANSWER THIS SIGNAL WITH THE AMOUNT OF NODES
-// THAT ARE IN THE RUN STATE OR START STATE.
-/*----------------------------------------------------------------------*/
- TNodePtr.i = getOwnNodeId();
- ptrCheckGuard(TNodePtr, MAX_NDB_NODES, nodeRec);
- if (TNodePtr.p->state == ZRUN) {
- jam();
- for (TNodePtr.i = 1; TNodePtr.i < MAX_NDB_NODES; TNodePtr.i++) {
- jam();
- ptrAss(TNodePtr, nodeRec);
- if ((TNodePtr.p->state == ZRUN) ||
- (TNodePtr.p->state == ZSTART)) {
- jam();
- TnoNeedNodes++;
- }//if
- }//for
- signal->theData[0] = cmasterNodeId;
- signal->theData[1] = TnoNeedNodes;
- sendSignal(TuserBlockref, GSN_NODE_STATESCONF, signal, 2, JBB);
- } else {
- jam();
- signal->theData[0] = ZERROR_NOT_RUNNING;
- sendSignal(TuserBlockref, GSN_NODE_STATESREF, signal, 1, JBB);
- }//if
return;
-}//Ndbcntr::execNODE_STATESREQ()
+}//Ndbcntr::execNODE_FAILREP()
/*******************************/
/* READ_NODESREQ */
/*******************************/
void Ndbcntr::execREAD_NODESREQ(Signal* signal)
{
- UintR TnoNodes = 0;
- NodeRecPtr TNodePtr;
jamEntry();
/*----------------------------------------------------------------------*/
@@ -2067,59 +1455,36 @@ void Ndbcntr::execREAD_NODESREQ(Signal* signal)
BlockReference TuserBlockref = signal->theData[0];
ReadNodesConf * const readNodes = (ReadNodesConf *)&signal->theData[0];
- if (cstartPhase > ZSTART_PHASE_2) {
- ndbrequire(cstartProgressFlag == ZTRUE);
-
- NodeBitmask::clear(readNodes->allNodes);
- NodeBitmask::clear(readNodes->inactiveNodes);
-
- /**
- * Add started nodes
- */
- for (int i = 0; i < cnoStartNodes; i++){
- jam();
- TNodePtr.i = cstartNodes[i];
- ptrCheckGuard(TNodePtr, MAX_NDB_NODES, nodeRec);
-
- NodeBitmask::set(readNodes->allNodes, TNodePtr.i);
- readNodes->setVersionId(TNodePtr.i, TNodePtr.p->ndbVersion,
- readNodes->theVersionIds);
- TnoNodes++;
- }//for
-
- /**
- * Sometimes add myself
- */
- if ((ctypeOfStart == NodeState::ST_NODE_RESTART) ||
- (ctypeOfStart == NodeState::ST_INITIAL_NODE_RESTART)) {
- jam();
-
- NodeBitmask::set(readNodes->allNodes, getOwnNodeId());
- readNodes->setVersionId(getOwnNodeId(), NDB_VERSION,
- readNodes->theVersionIds);
- TnoNodes++;
- }//if
- /**
- * Check all nodes which are defined but not already added
- */
- for (TNodePtr.i = 1; TNodePtr.i < MAX_NDB_NODES; TNodePtr.i++) {
- jam();
- ptrAss(TNodePtr, nodeRec);
- if ((TNodePtr.p->nodeDefined == ZTRUE) &&
- (NodeBitmask::get(readNodes->allNodes, TNodePtr.i) == false)){
- jam();
+ /**
+ * Prepare inactiveNodes bitmask.
+ * The concept as such is by the way pretty useless.
+ * It makes parallell starts more or less impossible...
+ */
+ NdbNodeBitmask tmp1;
+ tmp1.bitOR(c_startedNodes);
+ if(!getNodeState().getNodeRestartInProgress()){
+ tmp1.bitOR(c_start.m_starting);
+ } else {
+ tmp1.set(getOwnNodeId());
+ }
- NodeBitmask::set(readNodes->allNodes, TNodePtr.i);
- NodeBitmask::set(readNodes->inactiveNodes, TNodePtr.i);
- readNodes->setVersionId(TNodePtr.i, NDB_VERSION,
- readNodes->theVersionIds);
-
- TnoNodes++;
- }//if
- }//for
-
- readNodes->noOfNodes = TnoNodes;
- readNodes->masterNodeId = cmasterNodeId;
+ NdbNodeBitmask tmp2;
+ tmp2.bitOR(c_allDefinedNodes);
+ tmp2.bitANDC(tmp1);
+ /**
+ * Fill in return signal
+ */
+ tmp2.copyto(NdbNodeBitmask::Size, readNodes->inactiveNodes);
+ c_allDefinedNodes.copyto(NdbNodeBitmask::Size, readNodes->allNodes);
+ c_clusterNodes.copyto(NdbNodeBitmask::Size, readNodes->clusterNodes);
+ c_startedNodes.copyto(NdbNodeBitmask::Size, readNodes->startedNodes);
+ c_start.m_starting.copyto(NdbNodeBitmask::Size, readNodes->startingNodes);
+
+ readNodes->noOfNodes = c_allDefinedNodes.count();
+ readNodes->masterNodeId = cmasterNodeId;
+ readNodes->ndynamicId = cdynamicNodeId;
+ if (cstartPhase > ZSTART_PHASE_2) {
+ jam();
sendSignal(TuserBlockref, GSN_READ_NODESCONF, signal,
ReadNodesConf::SignalLength, JBB);
@@ -2237,8 +1602,8 @@ void Ndbcntr::startInsertTransactions(Signal* signal)
ckey = 1;
ctransidPhase = ZTRUE;
- signal->theData[1] = cownBlockref;
- sendSignal(ctcBlockref, GSN_TCSEIZEREQ, signal, 2, JBB);
+ signal->theData[1] = reference();
+ sendSignal(DBTC_REF, GSN_TCSEIZEREQ, signal, 2, JBB);
return;
}//Ndbcntr::startInsertTransactions()
@@ -2312,7 +1677,7 @@ void Ndbcntr::crSystab7Lab(Signal* signal)
AttributeHeader::init(&tAIDataPtr[2], 1, 2);
tAIDataPtr[3] = (tkey << 16);
tAIDataPtr[4] = 1;
- sendSignal(ctcBlockref, GSN_TCKEYREQ, signal,
+ sendSignal(DBTC_REF, GSN_TCKEYREQ, signal,
TcKeyReq::StaticLength + 6, JBB);
}//for
ckey = ckey + RowsPerCommit;
@@ -2335,7 +1700,7 @@ void Ndbcntr::execTCKEYCONF(Signal* signal)
Uint32 transId2 = keyConf->transId2;
signal->theData[0] = transId1;
signal->theData[1] = transId2;
- sendSignal(ctcBlockref, GSN_TC_COMMIT_ACK, signal, 2, JBB);
+ sendSignal(DBTC_REF, GSN_TC_COMMIT_ACK, signal, 2, JBB);
}//if
cresponses = cresponses + TcKeyConf::getNoOfOperations(confInfo);
@@ -2363,8 +1728,8 @@ void Ndbcntr::crSystab8Lab(Signal* signal)
return;
}//if
signal->theData[0] = ctcConnectionP;
- signal->theData[1] = cownBlockref;
- sendSignal(ctcBlockref, GSN_TCRELEASEREQ, signal, 2, JBB);
+ signal->theData[1] = reference();
+ sendSignal(DBTC_REF, GSN_TCRELEASEREQ, signal, 2, JBB);
return;
}//Ndbcntr::crSystab8Lab()
@@ -2380,8 +1745,8 @@ void Ndbcntr::execTCRELEASECONF(Signal* signal)
void Ndbcntr::crSystab9Lab(Signal* signal)
{
- signal->theData[1] = cownBlockref;
- sendSignalWithDelay(cdihBlockref, GSN_GETGCIREQ, signal, 100, 2);
+ signal->theData[1] = reference();
+ sendSignalWithDelay(DBDIH_REF, GSN_GETGCIREQ, signal, 100, 2);
return;
}//Ndbcntr::crSystab9Lab()
@@ -2435,309 +1800,28 @@ void Ndbcntr::execTCSEIZEREF(Signal* signal)
return;
}//Ndbcntr::execTCSEIZEREF()
-/*
-4.10 SUBROUTINES */
-/*##########################################################################*/
-/*
-4.10.1 CHECK_NODELIST */
-/*---------------------------------------------------------------------------*/
-/*CHECK THAT ALL THE NEW NODE HAS DETECTED ALL RUNNING NODES */
-/*INPUT: CSTART_NODES */
-/* TNO_RESTART_NODES */
-/* TUSER_NODE_ID */
-/*RET: CNODE_RESTART */
-/*---------------------------------------------------------------------------*/
-UintR Ndbcntr::checkNodelist(Signal* signal, Uint16 TnoRestartNodes)
-{
- UintR guard1;
- UintR Ttemp1;
-
- if (cnoRunNodes == TnoRestartNodes) {
- jam();
- guard1 = TnoRestartNodes - 1;
- arrGuard(guard1, MAX_NDB_NODES);
- for (Ttemp1 = 0; Ttemp1 <= guard1; Ttemp1++) {
- jam();
- nodePtr.i = cstartNodes[Ttemp1];
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- if (nodePtr.p->state != ZRUN) {
- jam();
- return 0;
- }//if
- }//for
- return 1;
- }//if
- return 0;
-}//Ndbcntr::checkNodelist()
-
-/*---------------------------------------------------------------------------*/
-// SELECT NODES THAT ARE IN THE STATE TO PERFORM A INITIALSTART OR
-// SYSTEMRESTART.
-// THIS SUBROUTINE CAN ONLY BE INVOKED BY THE MASTER NODE.
-// TO BE CHOOSEN A NODE NEED AS MANY VOTES AS THERE ARE VOTERS, AND OF
-// COURSE THE NODE HAS TO BE KNOWN BY THE
-// MASTER
-// INPUT: NODE_REC
-// CNO_NEED_NODES
-// RETURN:CNO_START_NODES
-// CSTART_NODES
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::chooseRestartNodes(Signal* signal)
-{
- cnoStartNodes = 0;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->votes == cnoVoters) {
- jam();
- if (nodePtr.p->state == ZADD) {
- jam();
- arrGuard(cnoStartNodes, MAX_NDB_NODES);
- cstartNodes[cnoStartNodes] = nodePtr.i;
- cnoStartNodes++;
- }//if
- } else {
- jam();
- if (nodePtr.p->votes > 0) {
- jam();
- systemErrorLab(signal);
- return;
- }//if
- }//if
- }//for
-}//Ndbcntr::chooseRestartNodes()
-
-/*
-4.10.6 DELETE_NODE */
-/*---------------------------------------------------------------------------*/
-// INPUT: NODE_PTR
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::deleteNode(Signal* signal)
-{
- UintR tminDynamicId;
-
- if (nodePtr.p->state == ZRUN) {
- jam();
- cnoRunNodes = cnoRunNodes - 1;
- }//if
- nodePtr.p->state = ZREMOVE;
- nodePtr.p->votes = 0;
- nodePtr.p->voter = ZFALSE;
- cnoRegNodes--;
- if (nodePtr.i == cmasterNodeId) {
- jam();
- cmasterNodeId = ZNIL;
-/*---------------------------------------------------------------------------*/
-// IF MASTER HAVE CRASHED WE NEED TO SELECT A NEW MASTER.
-/*---------------------------------------------------------------------------*/
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->state == ZRUN) {
- if (cmasterNodeId == ZNIL) {
- jam();
- cmasterNodeId = nodePtr.i;
- tminDynamicId = nodePtr.p->dynamicId;
- } else {
- jam();
- if (nodePtr.p->dynamicId < tminDynamicId) {
- jam();
- cmasterNodeId = nodePtr.i;
- tminDynamicId = nodePtr.p->dynamicId;
- }//if
- }//if
- }//if
- }//for
- }//if
-}//Ndbcntr::deleteNode()
-
-/*---------------------------------------------------------------------------*/
-// A NEW NODE TRIES TO DETECT A NODE RESTART. NodeState::ST_NODE_RESTART IS A POSSIBLE
-// STATE ONLY WHEN THE SYSTEM IS RUNNING.
-// IF THE SYSTEM IS RUNNING THEN
-// CTYPE_OF_START = NodeState::ST_SYSTEM_RESTART UNTIL THE FIRST NODE HAS REGISTERED.
-// IF SYSTEM IS */
-// RUNNING THE FIRST NODE TO REGISTER WILL BE ZRUN AND CTYPE_OF_START
-// WILL BE CHANGED */
-// TO NodeState::ST_NODE_RESTART AT PH_2C. WHEN A NodeState::ST_NODE_RESTART IS DETECTED THE NEW NODE
-// HAS TO SEND */
-// A CNTR_MASTERREQ TO THE MASTER
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::detectNoderestart(Signal* signal)
-{
- NodeRecPtr ownNodePtr;
- ownNodePtr.i = getOwnNodeId();
- ptrCheckGuard(ownNodePtr, MAX_NDB_NODES, nodeRec);
- if (ownNodePtr.p->state != ZADD) {
- if (ownNodePtr.p->state != ZREMOVE) {
- jam();
- return;
- }//if
- }//if
- ctypeOfStart = NodeState::ST_NODE_RESTART;
-/*----------------------------------------------*/
-/* THIS NODE WILL PERFORM A NODE RESTART */
-/* REQUEST OF ALL NODES STATES IN SYSTEM */
-// The purpose of this signal is to ensure that
-// the starting node knows when it has received
-// all APPL_CHANGEREP signals and thus can continue
-// to the next step of the node restart. Thus we
-// need to know the amount of nodes that are in the
-// RUN state and in the START state (more than one
-// node can be copying data simultaneously in the
-// cluster.
-/*----------------------------------------------*/
- signal->theData[0] = cownBlockref;
- sendSignal(nodePtr.p->cntrBlockref, GSN_NODE_STATESREQ, signal, 1, JBB);
- cnoNeedNodes = ZNIL;
-/*---------------------------------*/
-/* PREVENT TO SEND NODE_STATESREQ */
-/*---------------------------------------------------------------------------*/
-/* WE NEED TO WATCH THE NODE RESTART WITH A TIME OUT TO NOT WAIT FOR EVER. */
-/*---------------------------------------------------------------------------*/
- cwaitContinuebFlag = ZTRUE;
- signal->theData[0] = ZCONTINUEB_1;
- sendSignalWithDelay(cownBlockref, GSN_CONTINUEB, signal, 3 * 1000, 1);
-}//Ndbcntr::detectNoderestart()
-
-/*---------------------------------------------------------------------------*/
-// SCAN NODE_REC FOR APPROPRIATE NODES FOR A START.
-// SYSTEMRESTART AND INITALSTART DEMANDS NODES OF STATE ZADD.
-// NODERESTART DEMANDS NODE OF THE STATE ZRUN.
-// INPUT: CTYPE_OF_START, NODE_REC
-// RETURN: CSTART_NODES(), CNO_START_NODES, CMASTER_CANDIDATE_ID
-// (SYSTEMRESTART AND INITALSTART)
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::getStartNodes(Signal* signal)
-{
- UintR Ttemp1;
- if ((ctypeOfStart == NodeState::ST_NODE_RESTART) ||
- (ctypeOfStart == NodeState::ST_INITIAL_NODE_RESTART)) {
- jam();
- Ttemp1 = ZRUN;
- } else {
- jam();
-/*---------------------------------*/
-/* SYSTEM RESTART AND INITIAL START*/
-/*---------------------------------*/
- Ttemp1 = ZADD;
- }//if
- cnoStartNodes = 0;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->state == Ttemp1) {
- jam();
- cstartNodes[cnoStartNodes] = nodePtr.i;/*OVERWRITTEN AT CNTR_MASTERCONF*/
- cnoStartNodes++;
- }//if
- }//for
-}//Ndbcntr::getStartNodes()
/*---------------------------------------------------------------------------*/
/*INITIALIZE VARIABLES AND RECORDS */
/*---------------------------------------------------------------------------*/
void Ndbcntr::initData(Signal* signal)
{
- cmasterNodeId = ZNIL;
- cmasterCandidateId = ZNIL;
- cmasterVoters = 0;
- cstartProgressFlag = ZFALSE;
- capplStartconfFlag = ZFALSE;
- cnoVoters = 0;
+ c_start.reset();
+ cmasterNodeId = 0;
cnoStartNodes = 0;
- for (nodePtr.i = 0; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- ptrAss(nodePtr, nodeRec);
- nodePtr.p->cntrBlockref = calcNdbCntrBlockRef(nodePtr.i);
- nodePtr.p->state = ZREMOVE;
- nodePtr.p->dynamicId = 0;
- nodePtr.p->votes = 0; /* USED BY MASTER */
- nodePtr.p->voter = ZFALSE; /* USED BY MASTER */
- nodePtr.p->masterReq = ZFALSE; /* USED BY MASTER */
- }//for
+ cnoWaitrep = 0;
}//Ndbcntr::initData()
-/*---------------------------------------------------------------------------*/
-// THE MASTER NODE HAS CHOOSEN THE NODES WHO WERE QUALIFIED TO
-// PARTICIPATE IN A INITIALSTART OR SYSTEMRESTART.
-// THIS SUBROTINE SENDS A CNTR_MASTERCONF TO THESE NODES
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::replyMasterconfToAll(Signal* signal)
-{
- if (cnoStartNodes > 1) {
- /**
- * Construct a MasterConf signal
- */
-
- CntrMasterConf * const cntrMasterConf =
- (CntrMasterConf *)&signal->theData[0];
- NodeBitmask::clear(cntrMasterConf->theNodes);
-
- cntrMasterConf->noStartNodes = cnoStartNodes;
-
- for(int i = 0; i<cnoStartNodes; i++)
- NodeBitmask::set(cntrMasterConf->theNodes, cstartNodes[i]);
-
- /**
- * Then distribute it to everyone but myself
- */
- for(int i = 0; i<cnoStartNodes; i++){
- const NodeId nodeId = cstartNodes[i];
- if(nodeId != getOwnNodeId()){
- sendSignal(numberToRef(number(), nodeId),
- GSN_CNTR_MASTERCONF,
- signal, CntrMasterConf::SignalLength, JBB);
- }
- }
- }
-}//Ndbcntr::replyMasterconfToAll()
/*---------------------------------------------------------------------------*/
/*RESET VARIABLES USED DURING THE START */
/*---------------------------------------------------------------------------*/
void Ndbcntr::resetStartVariables(Signal* signal)
{
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- ptrAss(nodePtr, nodeRec);
- nodePtr.p->votes = 0;
- nodePtr.p->voter = ZFALSE;
- nodePtr.p->masterReq = ZFALSE;
- }//for
- cnoVoters = 0;
cnoStartNodes = 0;
cnoWaitrep6 = cnoWaitrep7 = 0;
}//Ndbcntr::resetStartVariables()
-/*---------------------------------------------------------------------------*/
-// SENDER OF THIS SIGNAL HAS CHOOSEN A MASTER NODE AND SENDS A REQUEST
-// TO THE MASTER_CANDIDATE AS AN VOTE FOR
-// THE MASTER. THE SIGNAL ALSO INCLUDES VOTES FOR NODES WHICH SENDER
-// THINKS SHOULD PARTICIPATE IN THE START.
-// INPUT: CNO_START_NODES
-// CSTART_NODES
-/*---------------------------------------------------------------------------*/
-void Ndbcntr::sendCntrMasterreq(Signal* signal)
-{
- nodePtr.i = cmasterCandidateId;
- ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
-/*--------------------------------------------------------------*/
-/* O:INITIALSTART, 1:SYSTEMRESTART (ELECTION OF MASTER) */
-/* 2:NODE RESTART (SENDER NODE NOT INCLUDED IN CSTART_NODES) */
-/*--------------------------------------------------------------*/
- CntrMasterReq * const cntrMasterReq = (CntrMasterReq*)&signal->theData[0];
- NodeBitmask::clear(cntrMasterReq->theNodes);
- for (int i = 0; i < cnoStartNodes; i++){
- jam();
- UintR Tnode = cstartNodes[i];
- arrGuard(Tnode, MAX_NDB_NODES);
- NodeBitmask::set(cntrMasterReq->theNodes, Tnode);
- }//for
- cntrMasterReq->userBlockRef = cownBlockref;
- cntrMasterReq->userNodeId = getOwnNodeId();
- cntrMasterReq->typeOfStart = ctypeOfStart;
- cntrMasterReq->noRestartNodes = cnoStartNodes;
- sendSignal(nodePtr.p->cntrBlockref, GSN_CNTR_MASTERREQ,
- signal, CntrMasterReq::SignalLength, JBB);
-}//Ndbcntr::sendCntrMasterreq()
/*---------------------------------------------------------------------------*/
// SEND THE SIGNAL
@@ -2745,25 +1829,24 @@ void Ndbcntr::sendCntrMasterreq(Signal* signal)
/*---------------------------------------------------------------------------*/
void Ndbcntr::sendNdbSttor(Signal* signal)
{
- CfgBlockRecPtr cfgBlockPtr;
NdbBlocksRecPtr ndbBlocksPtr;
ndbBlocksPtr.i = cndbBlocksCount;
ptrCheckGuard(ndbBlocksPtr, ZSIZE_NDB_BLOCKS_REC, ndbBlocksRec);
- cfgBlockPtr.i = cinternalStartphase;
- ptrCheckGuard(cfgBlockPtr, ZSIZE_CFG_BLOCK_REC, cfgBlockRec);
+
NdbSttor * const req = (NdbSttor*)signal->getDataPtrSend();
- req->senderRef = cownBlockref;
+ req->senderRef = reference();
req->nodeId = getOwnNodeId();
req->internalStartPhase = cinternalStartphase;
req->typeOfStart = ctypeOfStart;
req->masterNodeId = cmasterNodeId;
for (int i = 0; i < 16; i++) {
- req->config[i] = cfgBlockPtr.p->cfgData[i];
+ // Garbage
+ req->config[i] = 0x88776655;
+ //cfgBlockPtr.p->cfgData[i];
}
- //#define TRACE_STTOR
//#define MAX_STARTPHASE 2
#ifdef TRACE_STTOR
ndbout_c("sending NDB_STTOR(%d) to %s",
@@ -2779,9 +1862,6 @@ void Ndbcntr::sendNdbSttor(Signal* signal)
/*---------------------------------------------------------------------------*/
void Ndbcntr::sendSttorry(Signal* signal)
{
- signal->theData[0] = csignalKey;
- signal->theData[1] = 3;
- signal->theData[2] = 2;
signal->theData[3] = ZSTART_PHASE_1;
signal->theData[4] = ZSTART_PHASE_2;
signal->theData[5] = ZSTART_PHASE_3;
@@ -2801,9 +1881,8 @@ Ndbcntr::execDUMP_STATE_ORD(Signal* signal)
DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0];
if(signal->theData[0] == 13){
infoEvent("Cntr: cstartPhase = %d, cinternalStartphase = %d, block = %d",
- cstartPhase, cinternalStartphase, cndbBlocksCount);
- infoEvent("Cntr: cmasterNodeId = %d, cmasterCandidateId = %d",
- cmasterNodeId, cmasterCandidateId);
+ cstartPhase, cinternalStartphase, cndbBlocksCount);
+ infoEvent("Cntr: cmasterNodeId = %d", cmasterNodeId);
}
if (dumpState->args[0] == DumpStateOrd::NdbcntrTestStopOnError){
@@ -2823,6 +1902,7 @@ Ndbcntr::execDUMP_STATE_ORD(Signal* signal)
}//Ndbcntr::execDUMP_STATE_ORD()
void Ndbcntr::execSET_VAR_REQ(Signal* signal) {
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
@@ -2835,6 +1915,7 @@ void Ndbcntr::execSET_VAR_REQ(Signal* signal) {
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
}// switch
+#endif
}//Ndbcntr::execSET_VAR_REQ()
void Ndbcntr::updateNodeState(Signal* signal, const NodeState& newState) const{
@@ -2947,7 +2028,7 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
}
updateNodeState(signal, newState);
signal->theData[0] = ZSHUTDOWN;
- sendSignalWithDelay(cownBlockref, GSN_CONTINUEB, signal, 100, 1);
+ sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, 1);
}
void
@@ -2991,14 +2072,9 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){
/**
* Check if I can survive me stopping
*/
- NodeBitmask ndbMask; ndbMask.clear();
- NodeRecPtr aPtr;
- for(aPtr.i = 1; aPtr.i < MAX_NDB_NODES; aPtr.i++){
- ptrAss(aPtr, cntr.nodeRec);
- if(aPtr.i != cntr.getOwnNodeId() && aPtr.p->state == ZRUN){
- ndbMask.set(aPtr.i);
- }
- }
+ NodeBitmask ndbMask;
+ ndbMask.assign(cntr.c_startedNodes);
+ ndbMask.clear(cntr.getOwnNodeId());
CheckNodeGroups* sd = (CheckNodeGroups*)&signal->theData[0];
sd->blockRef = cntr.reference();
@@ -3194,7 +2270,7 @@ void Ndbcntr::execSTOP_ME_CONF(Signal* signal){
c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond();
signal->theData[0] = ZSHUTDOWN;
- sendSignalWithDelay(cownBlockref, GSN_CONTINUEB, signal, 100, 1);
+ sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, 1);
}
void
@@ -3255,6 +2331,11 @@ void Ndbcntr::execSTTORRY(Signal* signal){
c_missra.execSTTORRY(signal);
}
+void Ndbcntr::execREAD_CONFIG_CONF(Signal* signal){
+ jamEntry();
+ c_missra.execREAD_CONFIG_CONF(signal);
+}
+
void Ndbcntr::execSTART_ORD(Signal* signal){
jamEntry();
ndbrequire(NO_OF_BLOCKS == ALL_BLOCKS_SZ);
@@ -3299,7 +2380,38 @@ void Ndbcntr::Missra::execSTART_ORD(Signal* signal){
signal->theData[0] = EventReport::NDBStartStarted;
signal->theData[1] = NDB_VERSION;
cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
+
+ currentBlockIndex = 0;
+ sendNextREAD_CONFIG_REQ(signal);
+}
+
+void Ndbcntr::Missra::sendNextREAD_CONFIG_REQ(Signal* signal){
+
+ if(currentBlockIndex < ALL_BLOCKS_SZ){
+ jam();
+
+ ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtrSend();
+ req->senderData = 0;
+ req->senderRef = cntr.reference();
+ req->noOfParameters = 0;
+
+ const BlockReference ref = ALL_BLOCKS[currentBlockIndex].Ref;
+
+#if 0
+ ndbout_c("sending READ_CONFIG_REQ to %s(ref=%x index=%d)",
+ getBlockName( refToBlock(ref)),
+ ref,
+ currentBlockIndex);
+#endif
+
+ cntr.sendSignal(ref, GSN_READ_CONFIG_REQ, signal,
+ ReadConfigReq::SignalLength, JBB);
+ return;
+ }
+ /**
+ * Finished...
+ */
currentStartPhase = 0;
for(Uint32 i = 0; i<NO_OF_BLOCKS; i++){
if(ALL_BLOCKS[i].NextSP < currentStartPhase)
@@ -3307,10 +2419,19 @@ void Ndbcntr::Missra::execSTART_ORD(Signal* signal){
}
currentBlockIndex = 0;
-
sendNextSTTOR(signal);
}
+void Ndbcntr::Missra::execREAD_CONFIG_CONF(Signal* signal){
+ const ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtr();
+
+ const Uint32 ref = conf->senderRef;
+ ndbrequire(refToBlock(ALL_BLOCKS[currentBlockIndex].Ref) == refToBlock(ref));
+
+ currentBlockIndex++;
+ sendNextREAD_CONFIG_REQ(signal);
+}
+
void Ndbcntr::Missra::execSTTORRY(Signal* signal){
const BlockReference ref = signal->senderBlockRef();
ndbrequire(refToBlock(ref) == refToBlock(ALL_BLOCKS[currentBlockIndex].Ref));
@@ -3365,8 +2486,8 @@ void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){
currentBlockIndex);
#endif
- cntr.sendSignal(ref, GSN_STTOR,
- signal, 8, JBB);
+ cntr.sendSignal(ref, GSN_STTOR, signal, 8, JBB);
+
return;
}
}
@@ -3391,4 +2512,145 @@ void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){
NodeState newState(NodeState::SL_STARTED);
cntr.updateNodeState(signal, newState);
+
+ /**
+ * Backward
+ */
+ UpgradeStartup::sendCmAppChg(cntr, signal, 3); //RUN
+
+ NdbNodeBitmask nodes = cntr.c_clusterNodes;
+ Uint32 node = 0;
+ while((node = nodes.find(node+1)) != NdbNodeBitmask::NotFound){
+ if(cntr.getNodeInfo(node).m_version < MAKE_VERSION(3,5,0)){
+ nodes.clear(node);
+ }
+ }
+
+ NodeReceiverGroup rg(NDBCNTR, nodes);
+ signal->theData[0] = cntr.getOwnNodeId();
+ cntr.sendSignal(rg, GSN_CNTR_START_REP, signal, 1, JBB);
+}
+
+/**
+ * Backward compatible code
+ */
+void
+UpgradeStartup::sendCmAppChg(Ndbcntr& cntr, Signal* signal, Uint32 startLevel){
+
+ if(cntr.getNodeInfo(cntr.cmasterNodeId).m_version >= MAKE_VERSION(3,5,0)){
+ jam();
+ return;
+ }
+
+ /**
+ * Old NDB running
+ */
+
+ signal->theData[0] = startLevel;
+ signal->theData[1] = cntr.getOwnNodeId();
+ signal->theData[2] = 3 | ('N' << 8);
+ signal->theData[3] = 'D' | ('B' << 8);
+ signal->theData[4] = 0;
+ signal->theData[5] = 0;
+ signal->theData[6] = 0;
+ signal->theData[7] = 0;
+ signal->theData[8] = 0;
+ signal->theData[9] = 0;
+ signal->theData[10] = 0;
+ signal->theData[11] = 0;
+
+ NdbNodeBitmask nodes = cntr.c_clusterNodes;
+ nodes.clear(cntr.getOwnNodeId());
+ Uint32 node = 0;
+ while((node = nodes.find(node+1)) != NdbNodeBitmask::NotFound){
+ if(cntr.getNodeInfo(node).m_version < MAKE_VERSION(3,5,0)){
+ cntr.sendSignal(cntr.calcQmgrBlockRef(node),
+ GSN_CM_APPCHG, signal, 12, JBB);
+ } else {
+ cntr.c_startedNodes.set(node); // Fake started
+ }
+ }
+}
+
+void
+UpgradeStartup::execCM_APPCHG(SimulatedBlock & block, Signal* signal){
+ Uint32 state = signal->theData[0];
+ Uint32 nodeId = signal->theData[1];
+ if(block.number() == QMGR){
+ Ndbcntr& cntr = * (Ndbcntr*)globalData.getBlock(CNTR);
+ switch(state){
+ case 0: // ZADD
+ break;
+ case 2: // ZSTART
+ break;
+ case 3: // ZRUN{
+ cntr.c_startedNodes.set(nodeId);
+
+ Uint32 recv = cntr.c_startedNodes.count();
+ Uint32 cnt = cntr.c_clusterNodes.count();
+ if(recv + 1 == cnt){ //+1 == own node
+ /**
+ * Check master
+ */
+ sendCntrMasterReq(cntr, signal, 0);
+ }
+ return;
+ }
+ }
+ block.progError(0,0);
+}
+
+void
+UpgradeStartup::sendCntrMasterReq(Ndbcntr& cntr, Signal* signal, Uint32 n){
+ Uint32 node = cntr.c_startedNodes.find(n);
+ if(node != NdbNodeBitmask::NotFound &&
+ (node == cntr.getOwnNodeId() ||
+ cntr.getNodeInfo(node).m_version >= MAKE_VERSION(3,5,0))){
+ node = cntr.c_startedNodes.find(node+1);
+ }
+
+ if(node == NdbNodeBitmask::NotFound){
+ cntr.progError(0,0);
+ }
+
+ CntrMasterReq * const cntrMasterReq = (CntrMasterReq*)&signal->theData[0];
+ cntr.c_clusterNodes.copyto(NdbNodeBitmask::Size, cntrMasterReq->theNodes);
+ NdbNodeBitmask::clear(cntrMasterReq->theNodes, cntr.getOwnNodeId());
+ cntrMasterReq->userBlockRef = 0;
+ cntrMasterReq->userNodeId = cntr.getOwnNodeId();
+ cntrMasterReq->typeOfStart = NodeState::ST_INITIAL_NODE_RESTART;
+ cntrMasterReq->noRestartNodes = cntr.c_clusterNodes.count() - 1;
+ cntr.sendSignal(cntr.calcNdbCntrBlockRef(node), GSN_CNTR_MASTERREQ,
+ signal, CntrMasterReq::SignalLength, JBB);
+}
+
+void
+UpgradeStartup::execCNTR_MASTER_REPLY(SimulatedBlock & block, Signal* signal){
+ Uint32 gsn = signal->header.theVerId_signalNumber;
+ Uint32 node = refToNode(signal->getSendersBlockRef());
+ if(block.number() == CNTR){
+ Ndbcntr& cntr = (Ndbcntr&)block;
+ switch(gsn){
+ case GSN_CNTR_MASTERREF:
+ sendCntrMasterReq(cntr, signal, node + 1);
+ return;
+ break;
+ case GSN_CNTR_MASTERCONF:{
+ CntrStartConf* conf = (CntrStartConf*)signal->getDataPtrSend();
+ conf->startGci = 0;
+ conf->masterNodeId = node;
+ conf->noStartNodes = 1;
+ conf->startType = NodeState::ST_INITIAL_NODE_RESTART;
+ NodeBitmask mask;
+ mask.clear();
+ mask.copyto(NdbNodeBitmask::Size, conf->startedNodes);
+ mask.clear();
+ mask.set(cntr.getOwnNodeId());
+ mask.copyto(NdbNodeBitmask::Size, conf->startingNodes);
+ cntr.execCNTR_START_CONF(signal);
+ return;
+ }
+ }
+ }
+ block.progError(0,0);
}
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index f73c1ec5ee7..7ba7d0d25c6 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -17,7 +17,8 @@
/**
* O_DIRECT
*/
-#ifdef NDB_LINUX
+#if 0
+//#ifdef NDB_LINUX
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@@ -34,12 +35,14 @@
#include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp>
-#ifdef NDB_LINUX
+#if 0
+#ifdef HAVE_PREAD
// This is for pread and pwrite
#ifndef __USE_UNIX98
#define __USE_UNIX98
#endif
#endif
+#endif
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
#else
@@ -343,12 +346,11 @@ void AsyncFile::openReq(Request* request)
}
#if 0
-#if NDB_LINUX
+ //#if NDB_LINUX
if(Global_useO_DIRECT){
new_flags |= O_DIRECT;
}
#endif
-#endif
switch(flags & 0x3){
case FsOpenReq::OM_READONLY:
diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am
new file mode 100644
index 00000000000..c2b663c5042
--- /dev/null
+++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am
@@ -0,0 +1,13 @@
+noinst_LIBRARIES = libndbfs.a
+
+libndbfs_a_SOURCES = \
+ AsyncFile.cpp \
+ Ndbfs.cpp VoidFs.cpp \
+ Filename.cpp \
+ CircularIndex.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile b/ndb/src/kernel/blocks/ndbfs/Makefile_old
index 58e1458bf16..58e1458bf16 100644
--- a/ndb/src/kernel/blocks/ndbfs/Makefile
+++ b/ndb/src/kernel/blocks/ndbfs/Makefile_old
diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
index 36322ffad1e..c763d3b4786 100644
--- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
@@ -60,10 +60,11 @@ Ndbfs::Ndbfs(const Configuration & conf) :
theFileSystemPath = conf.fileSystemPath();
theRequestPool = new Pool<Request>;
- const Properties * p = conf.getOwnProperties();
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
- ndbrequire(p->get("MaxNoOfOpenFiles", &m_maxFiles));
+ m_maxOpenedFiles = 40;
+ //ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
// Create idle AsyncFiles
Uint32 noIdleFiles = 16;
diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am
new file mode 100644
index 00000000000..52cadb3bd3d
--- /dev/null
+++ b/ndb/src/kernel/blocks/qmgr/Makefile.am
@@ -0,0 +1,11 @@
+noinst_LIBRARIES = libqmgr.a
+
+libqmgr_a_SOURCES = \
+ QmgrInit.cpp \
+ QmgrMain.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/qmgr/Makefile b/ndb/src/kernel/blocks/qmgr/Makefile_old
index cd15643ea60..cd15643ea60 100644
--- a/ndb/src/kernel/blocks/qmgr/Makefile
+++ b/ndb/src/kernel/blocks/qmgr/Makefile_old
diff --git a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
index 7d2abd34ebe..0ff7cea6d9f 100644
--- a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
+++ b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
@@ -22,6 +22,8 @@
#include <NdbTick.h>
#include <SimulatedBlock.hpp>
#include <NodeBitmask.hpp>
+#include <SignalCounter.hpp>
+
#include <signaldata/EventReport.hpp>
#include <signaldata/ArbitSignalData.hpp>
#include <signaldata/CmRegSignalData.hpp>
@@ -33,24 +35,10 @@
#ifdef QMGR_C
#define NO_REG_APP 1
-/* Boolean flags --------------------------------*/
-#define ZNULL 0xfffe
/* Delay values, ms -----------------------------*/
#define ZDELAY_REGREQ 1000
-/* Phase of QMGR node ------------------------*/
-#define ZINIT 1 /* All nodes start in phase INIT */
-#define ZWAITING 2 /* Node is connecting to cluster */
-#define ZRUNNING 3 /* Node is running in the cluster */
-#define ZBLOCKED 4 /* Node is blocked from the cluster */
-#define ZWAIT_PRESIDENT 5
-#define ZDEAD 6
-#define ZAPI_ACTIVE 7 /* API IS RUNNING IN NODE */
-#define ZFAIL_CLOSING 8 /* API/NDB IS DISCONNECTING */
-#define ZPREPARE_FAIL 9 /* PREPARATION FOR FAILURE */
-#define ZAPI_INACTIVE 10 /* Inactive API */
-
/* Type of refuse in CM_NODEINFOREF -------------*/
#define ZNOT_RUNNING 0
@@ -100,18 +88,40 @@ public:
WAITING_FOR_FAILCONF2 = 2,
WAITING_FOR_NDB_FAILCONF = 3
};
+
+ enum Phase {
+ ZINIT = 1, /* All nodes start in phase INIT */
+ ZSTARTING = 2, /* Node is connecting to cluster */
+ ZRUNNING = 3, /* Node is running in the cluster */
+ ZPREPARE_FAIL = 4, /* PREPARATION FOR FAILURE */
+ ZFAIL_CLOSING = 5, /* API/NDB IS DISCONNECTING */
+ ZAPI_ACTIVE = 6, /* API IS RUNNING IN NODE */
+ ZAPI_INACTIVE = 7 /* Inactive API */
+ };
+
+ struct StartRecord {
+ void reset(){ m_startKey++; m_startNode = 0;}
+ Uint32 m_startKey;
+ Uint32 m_startNode;
+ Uint64 m_startTimeout;
+
+ Uint32 m_gsn;
+ SignalCounter m_nodes;
+ } c_start;
+
+ NdbNodeBitmask c_definedNodes; // DB nodes in config
+ NdbNodeBitmask c_clusterNodes; // DB nodes in cluster
+ NodeBitmask c_connectedNodes; // All kinds of connected nodes
+ Uint32 c_maxDynamicId;
// Records
struct NodeRec {
UintR ndynamicId;
- UintR phase;
+ Phase phase;
UintR alarmCount;
- bool m_connected;
QmgrState sendPrepFailReqStatus;
QmgrState sendCommitFailReqStatus;
- QmgrState sendCmAddPrepStatus;
- QmgrState sendCmAddCommitStatus;
QmgrState sendPresToStatus;
FailState failState;
BlockReference rcv[2]; // remember which failconf we have received
@@ -122,18 +132,6 @@ public:
typedef Ptr<NodeRec> NodeRecPtr;
- struct RegApp {
- NdbNodeBitmask m_runNodes;
- char name[15 + 1];
- UintR noofapps;
- UintR noofpending;
- BlockReference blockref;
- Uint16 version;
- Uint16 activity;
- };
-
- typedef Ptr<RegApp> RegAppPtr;
-
enum ArbitState {
ARBIT_NULL = 0,
ARBIT_INIT = 1, // create new ticket
@@ -191,7 +189,6 @@ private:
void execCM_HEARTBEAT(Signal* signal);
void execCM_ADD(Signal* signal);
void execCM_ACKADD(Signal* signal);
- void execCM_APPCHG(Signal* signal);
void execCM_REGREQ(Signal* signal);
void execCM_REGCONF(Signal* signal);
void execCM_REGREF(Signal* signal);
@@ -214,10 +211,6 @@ private:
void execCONNECT_REP(Signal* signal);
void execNDB_FAILCONF(Signal* signal);
void execSTTOR(Signal* signal);
- void execAPPL_REGREQ(Signal* signal);
- void execAPPL_STARTREG(Signal* signal);
- void execAPPL_RUN(Signal* signal);
- void execCM_INIT(Signal* signal);
void execCM_INFOCONF(Signal* signal);
void execCLOSE_COMCONF(Signal* signal);
void execAPI_REGREQ(Signal* signal);
@@ -242,53 +235,31 @@ private:
// Statement blocks
void node_failed(Signal* signal, Uint16 aFailedNode);
void checkStartInterface(Signal* signal);
- void applchangerep(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion);
- void cmappAdd(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion);
- void cmappStart(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion);
void failReport(Signal* signal,
Uint16 aFailedNode,
UintR aSendFailRep,
FailRep::FailCause failCause);
void findNeighbours(Signal* signal);
Uint16 translateDynamicIdToNodeId(Signal* signal, UintR TdynamicId);
- UintR getDynamicId(Signal* signal);
+
void initData(Signal* signal);
- void prepareAdd(Signal* signal, Uint16 addNode);
- void sendappchg(Signal* signal, UintR aRegApp, Uint16 aNode);
void sendCloseComReq(Signal* signal, BlockReference TBRef, Uint16 TfailNo);
void sendPrepFailReq(Signal* signal, Uint16 aNode);
void sendApiFailReq(Signal* signal, Uint16 aFailedNode);
void sendApiRegRef(Signal*, Uint32 ref, ApiRegRef::ErrorCode);
// Generated statement blocks
+ void startphase1(Signal* signal);
void electionWon();
void cmInfoconf010Lab(Signal* signal);
void apiHbHandlingLab(Signal* signal);
void timerHandlingLab(Signal* signal);
void hbReceivedLab(Signal* signal);
- void cmAdd010Lab(Signal* signal);
- void cmAckadd010Lab(Signal* signal);
- void cmAppchg010Lab(Signal* signal);
void sendCmRegrefLab(Signal* signal, BlockReference ref,
CmRegRef::ErrorCode);
void systemErrorBecauseOtherNodeFailed(Signal* signal, NodeId);
void systemErrorLab(Signal* signal,
const char* message = NULL);
- void cmRegref010Lab(Signal* signal);
- void cmNodeinforeq010Lab(Signal* signal);
- void cmNodeinfoconf010Lab(Signal* signal);
void prepFailReqLab(Signal* signal);
void prepFailConfLab(Signal* signal);
void prepFailRefLab(Signal* signal);
@@ -300,13 +271,10 @@ private:
void presToConfLab(Signal* signal);
void sendSttorryLab(Signal* signal);
void sttor020Lab(Signal* signal);
- void applRegreq010Lab(Signal* signal);
- void applStartreg010Lab(Signal* signal);
- void applRun010Lab(Signal* signal);
- void cmInit010Lab(Signal* signal);
void closeComConfLab(Signal* signal);
void apiRegReqLab(Signal* signal);
- void regreqTimelimitLab(Signal* signal, UintR callTime);
+ void regreqTimeLimitLab(Signal* signal);
+ void regreqTimeMasterLimitLab(Signal* signal);
void cmRegreq010Lab(Signal* signal);
void cmRegconf010Lab(Signal* signal);
void sttor010Lab(Signal* signal);
@@ -347,6 +315,12 @@ private:
bool checkAPIVersion(NodeId, Uint32 nodeVersion, Uint32 ownVersion) const;
bool checkNDBVersion(NodeId, Uint32 nodeVersion, Uint32 ownVersion) const;
+ void cmAddPrepare(Signal* signal, NodeRecPtr nodePtr, const NodeRec* self);
+ void sendCmAckAdd(Signal *, Uint32 nodeId, CmAdd::RequestType);
+ void joinedCluster(Signal* signal, NodeRecPtr nodePtr);
+ void sendCmRegReq(Signal * signal, Uint32 nodeId);
+ void sendCmNodeInfoReq(Signal* signal, Uint32 nodeId, const NodeRec * self);
+
private:
void sendPrepFailReqRef(Signal* signal,
Uint32 dstBlockRef,
@@ -364,7 +338,6 @@ private:
/**** Common stored variables ****/
NodeRec *nodeRec;
- RegApp * regApp;
ArbitRec arbitRec;
/* Block references ------------------------------*/
@@ -377,27 +350,17 @@ private:
/* Counters --------------------------------------*/
Uint16 cnoOfNodes; /* Static node counter */
- Uint16 cclustersize; /* Currently not used */
/* Status flags ----------------------------------*/
- Uint16 cstartseq; /* Marks what startseq we are in according to
- STTOR */
+ Uint32 c_restartPartialTimeout;
- Uint16 cpresidentBusy; /* Only used by the president, ZTRUE / ZFALSE */
- Uint16 cacceptRegreq; /* Used by president, ZTRUE / ZFALSE */
- Uint16 cwaitContinuebPhase1;
- Uint16 cwaitContinuebPhase2;
Uint16 creadyDistCom;
-
- UintR cstartNo;
Uint16 c_regReqReqSent;
Uint16 c_regReqReqRecv;
Uint64 c_stopElectionTime;
Uint16 cpresidentCandidate;
Uint16 cdelayRegreq;
Uint16 cpresidentAlive;
- Uint16 csignalkey;
- Uint16 cstartNode;
Uint16 cnoFailedNodes;
Uint16 cnoPrepFailedNodes;
Uint16 cnoCommitFailedNodes;
@@ -410,7 +373,6 @@ private:
UintR cfailureNr;
QmgrState ctoStatus;
- UintR ccm_infoconfCounter;
UintR cLqhTimeSignalCount;
bool cHbSent;
NDB_TICKS clatestTransactionCheck;
@@ -421,68 +383,10 @@ private:
class Timer hb_api_timer;
- UintR cnodemask[NdbNodeBitmask::Size];
Uint16 cfailedNodes[MAX_NDB_NODES];
Uint16 cprepFailedNodes[MAX_NDB_NODES];
Uint16 ccommitFailedNodes[MAX_NDB_NODES];
- /***************************************************************************/
- /* RECORD NODE_REC: The NodeList contains information about all other nodes
- * in the cluster.
- * Member variables:
- * NTYPE [ ZACTIVE,
- * ZPASSIVE, Marks the level of activity the
- * node will show in the cluster.
- * ZLISTENER ]
- * PHASE [ ZINIT, = Initial face, before node is added
- * to cluster
- * ZWAITING, = Node is added to the cluster and
- * ready to run
- * ZRUNNING, = Node is up and running.
- * ZBLOCKED = Node is not in the cluster
- * ZAPI_ACTIVE = Node has an active application
- * ZFAIL_CLOSING = Node is disconnecting
- * ZDEAD ] = Node has been declared as dead
- * ALARM_COUNT No of times an alarm has been sent before it is
- * acknowledged
- ***************************************************************************/
- /*************************************************************************
- * RECORD REG_APP: The REG_APP record is used to store information about
- * each registered application running on the current node.
- * Member variables:
- * BLOCKREF Reference of application block to receive cluster
- * signals
- * PTR Not used today but may be used by appl. in future
- * NAME Unique name of application, max 15 char. long
- * SUBTYPE Provided as a mechanism for applications to have
- * more than one type running in the same application
- * ring. i.e. NDB & NDB-API
- * VERSION Version no. of application. Two different versions
- * will be handled as different applications.
- * TYPE [ ZACTIVE,
- * ZPASSIVE,
- * ZLISTENER ] Type of member in the cluster
- * ACTIVITY [ ZADD, Application has been registered on
- * node.
- * ZSTART, Application is ready to start
- * running distributed.
- * ZRUN, Application is running actively.
- * ZDELETE ] Application is beeing removed from
- * the node.
- * HBDELAY Delay time for periodic intervalls.
- * STATUS Heartbeat status, indicates if app is responding
- * to HBREQ.
- * RUNNODES() If value is ZTRUE -> app. is also running on the
- * indexed node.
- * NOOFAPPS No. of applications left to register themselves as
- * ready to start, STATUS = ZSTART before we can send
- * APPL_STARTCONF.
- * NOOFPENDING No. of apps that have registered themselfs as ready
- * to start before this app has. We need this since
- * we set NOOFAPPS when we receive the local
- * APPL_START. NOOFPENDING is subtracted from NOOFAPPS
- * when NOOFAPPS is set.
- **************************************************************************/
-
};
+
#endif
diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
index ffc1448548d..b0f1088779c 100644
--- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
+++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
@@ -18,7 +18,6 @@
#define QMGR_C
#include "Qmgr.hpp"
-#include <Configuration.hpp>
#define DEBUG(x) { ndbout << "Qmgr::" << x << endl; }
@@ -29,10 +28,13 @@ void Qmgr::initData()
// Records with constant sizes
nodeRec = new NodeRec[MAX_NODES];
- regApp = new RegApp[NO_REG_APP];
- cclustersize = 0;
cnoCommitFailedNodes = 0;
+ c_maxDynamicId = 0;
+ c_clusterNodes.clear();
+
+ Uint32 hbDBAPI = 500;
+ setHbApiDelay(hbDBAPI);
}//Qmgr::initData()
void Qmgr::initRecords()
@@ -52,7 +54,6 @@ Qmgr::Qmgr(const class Configuration & conf)
addRecSignal(GSN_CM_HEARTBEAT, &Qmgr::execCM_HEARTBEAT);
addRecSignal(GSN_CM_ADD, &Qmgr::execCM_ADD);
addRecSignal(GSN_CM_ACKADD, &Qmgr::execCM_ACKADD);
- addRecSignal(GSN_CM_APPCHG, &Qmgr::execCM_APPCHG);
addRecSignal(GSN_CM_REGREQ, &Qmgr::execCM_REGREQ);
addRecSignal(GSN_CM_REGCONF, &Qmgr::execCM_REGCONF);
addRecSignal(GSN_CM_REGREF, &Qmgr::execCM_REGREF);
@@ -67,16 +68,11 @@ Qmgr::Qmgr(const class Configuration & conf)
addRecSignal(GSN_FAIL_REP, &Qmgr::execFAIL_REP);
addRecSignal(GSN_PRES_TOREQ, &Qmgr::execPRES_TOREQ);
addRecSignal(GSN_PRES_TOCONF, &Qmgr::execPRES_TOCONF);
- addRecSignal(GSN_CM_INFOCONF, &Qmgr::execCM_INFOCONF);
// Received signals
addRecSignal(GSN_CONNECT_REP, &Qmgr::execCONNECT_REP);
addRecSignal(GSN_NDB_FAILCONF, &Qmgr::execNDB_FAILCONF);
addRecSignal(GSN_STTOR, &Qmgr::execSTTOR);
- addRecSignal(GSN_APPL_REGREQ, &Qmgr::execAPPL_REGREQ);
- addRecSignal(GSN_APPL_STARTREG, &Qmgr::execAPPL_STARTREG);
- addRecSignal(GSN_APPL_RUN, &Qmgr::execAPPL_RUN);
- addRecSignal(GSN_CM_INIT, &Qmgr::execCM_INIT);
addRecSignal(GSN_CLOSE_COMCONF, &Qmgr::execCLOSE_COMCONF);
addRecSignal(GSN_API_REGREQ, &Qmgr::execAPI_REGREQ);
addRecSignal(GSN_API_VERSION_REQ, &Qmgr::execAPI_VERSION_REQ);
@@ -86,7 +82,6 @@ Qmgr::Qmgr(const class Configuration & conf)
addRecSignal(GSN_SET_VAR_REQ, &Qmgr::execSET_VAR_REQ);
// Arbitration signals
- addRecSignal(GSN_ARBIT_CFG, &Qmgr::execARBIT_CFG);
addRecSignal(GSN_ARBIT_PREPREQ, &Qmgr::execARBIT_PREPREQ);
addRecSignal(GSN_ARBIT_PREPCONF, &Qmgr::execARBIT_PREPCONF);
addRecSignal(GSN_ARBIT_PREPREF, &Qmgr::execARBIT_PREPREF);
@@ -97,18 +92,11 @@ Qmgr::Qmgr(const class Configuration & conf)
addRecSignal(GSN_ARBIT_STOPREP, &Qmgr::execARBIT_STOPREP);
initData();
-
- const ClusterConfiguration::ClusterData & clusterConf =
- theConfiguration.clusterConfigurationData() ;
- setHbDelay(clusterConf.ispValues[0][2]); //cmInit->heartbeatDbDb);
- setHbApiDelay(clusterConf.ispValues[0][3]); //;cmInit->heartbeatDbApi);
- setArbitTimeout(clusterConf.ispValues[0][5]); //cmInit->arbitTimeout);
}//Qmgr::Qmgr()
Qmgr::~Qmgr()
{
delete []nodeRec;
- delete []regApp;
}//Qmgr::~Qmgr()
diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 0f82f8def6f..f2d2edb615d 100644
--- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -20,7 +20,6 @@
#include <pc.hpp>
#include <NdbTick.h>
#include <signaldata/EventReport.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/StartOrd.hpp>
#include <signaldata/CmInit.hpp>
#include <signaldata/CloseComReqConf.hpp>
@@ -42,6 +41,20 @@
#include <NdbOut.hpp>
#endif
+//#define DEBUG_QMGR_START
+#ifdef DEBUG_QMGR_START
+#include <DebuggerNames.hpp>
+#define DEBUG(x) ndbout << "QMGR " << __LINE__ << ": " << x << endl
+#define DEBUG_START(gsn, node, msg) DEBUG(getSignalName(gsn) << " to: " << node << " - " << msg)
+#define DEBUG_START2(gsn, rg, msg) { char nodes[255]; DEBUG(getSignalName(gsn) << " to: " << rg.m_nodes.getText(nodes) << " - " << msg); }
+#define DEBUG_START3(signal, msg) DEBUG(getSignalName(signal->header.theVerId_signalNumber) << " from " << refToNode(signal->getSendersBlockRef()) << " - " << msg);
+#else
+#define DEBUG(x)
+#define DEBUG_START(gsn, node, msg)
+#define DEBUG_START2(gsn, rg, msg)
+#define DEBUG_START3(signal, msg)
+#endif
+
// Signal entries and statement blocks
/* 4 P R O G R A M */
/*******************************/
@@ -72,32 +85,27 @@ void Qmgr::execCM_NODEINFOREF(Signal* signal)
/*******************************/
void Qmgr::execCONTINUEB(Signal* signal)
{
- UintR tdata0;
- UintR tcontinuebType;
-
jamEntry();
- tcontinuebType = signal->theData[0];
- tdata0 = signal->theData[1];
+ const Uint32 tcontinuebType = signal->theData[0];
+ const Uint32 tdata0 = signal->theData[1];
+ const Uint32 tdata1 = signal->theData[2];
switch (tcontinuebType) {
case ZREGREQ_TIMELIMIT:
jam();
- if (cstartNo == tdata0) {
+ if (c_start.m_startKey != tdata0 || c_start.m_startNode != tdata1) {
jam();
- regreqTimelimitLab(signal, signal->theData[2]);
return;
- }
+ }//if
+ regreqTimeLimitLab(signal);
break;
case ZREGREQ_MASTER_TIMELIMIT:
jam();
- if (cstartNo != tdata0) {
+ if (c_start.m_startKey != tdata0 || c_start.m_startNode != tdata1) {
jam();
return;
}//if
- if (cpresidentBusy != ZTRUE) {
- jam();
- return;
- }//if
- failReportLab(signal, cstartNode, FailRep::ZSTART_IN_REGREQ);
+ //regreqMasterTimeLimitLab(signal);
+ failReportLab(signal, c_start.m_startNode, FailRep::ZSTART_IN_REGREQ);
return;
break;
case ZTIMER_HANDLING:
@@ -173,15 +181,23 @@ void Qmgr::execPRES_TOREQ(Signal* signal)
void Qmgr::execSTTOR(Signal* signal)
{
jamEntry();
- cstartseq = signal->theData[1];
- csignalkey = signal->theData[6];
- if (cstartseq == 1) {
- jam();
+
+ switch(signal->theData[1]){
+ case 1:
initData(signal);
+ startphase1(signal);
+ return;
+ case 7:
+ cactivateApiCheck = 1;
+ /**
+ * Start arbitration thread. This could be done as soon as
+ * we have all nodes (or a winning majority).
+ */
+ if (cpresident == getOwnNodeId())
+ handleArbitStart(signal);
+ break;
}
- setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
-
sendSttorryLab(signal);
return;
}//Qmgr::execSTTOR()
@@ -191,85 +207,32 @@ void Qmgr::sendSttorryLab(Signal* signal)
/****************************<*/
/*< STTORRY <*/
/****************************<*/
- signal->theData[0] = csignalkey;
- signal->theData[1] = 3;
- signal->theData[2] = 2;
- signal->theData[3] = 2;
+ signal->theData[3] = 7;
signal->theData[4] = 255;
sendSignal(NDBCNTR_REF, GSN_STTORRY, signal, 5, JBB);
return;
}//Qmgr::sendSttorryLab()
-/*
-4.2.2 CM_INIT */
-/**--------------------------------------------------------------------------
- * This signal is sent by the CLUSTERCTRL block.
- * It initiates the QMGR and provides needed info about the
- * cluster configuration (read from file).
- *
- * The signal starts all QMGR functions.
- * It is possible to register applications before this but the QMGR will
- * not be active before the registration face is complete.
- *
- * The CM_INIT will result in a one CM_NODEINFOREQ for each ndb node.
- * We will also send a CONTINUEB to ourselves as a timelimit.
- * If anyone sends a REF, CONF or a ( REQ with a lower NODENO than us ) during
- * this time, we are not the president .
- *--------------------------------------------------------------------------*/
-/*******************************/
-/* CM_INIT */
-/*******************************/
-void Qmgr::execCM_INIT(Signal* signal)
+void Qmgr::startphase1(Signal* signal)
{
jamEntry();
- CmInit * const cmInit = (CmInit *)&signal->theData[0];
-
- for(unsigned int i = 0; i<NdbNodeBitmask::Size; i++)
- cnodemask[i] = cmInit->allNdbNodes[i];
-
- cnoOfNodes = 0;
- setHbDelay(cmInit->heartbeatDbDb);
- setHbApiDelay(cmInit->heartbeatDbApi);
- setArbitTimeout(cmInit->arbitTimeout);
- arbitRec.state = ARBIT_NULL; // start state for all nodes
- arbitRec.apiMask[0].clear(); // prepare for ARBIT_CFG
NodeRecPtr nodePtr;
- for (nodePtr.i = 0; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (NdbNodeBitmask::get(cnodemask, nodePtr.i)) {
- jam();
-
- nodePtr.p->blockRef = calcQmgrBlockRef(nodePtr.i);
- nodePtr.p->phase = ZINIT; /* Not added to cluster */
- cnoOfNodes = cnoOfNodes + 1; /* Should never be changed after this loop. */
- ndbrequire(getNodeInfo(nodePtr.i).m_type == NodeInfo::DB);
- } else {
- jam();
- nodePtr.p->phase = ZBLOCKED;
- }//if
- }//for
- for (nodePtr.i = MAX_NDB_NODES; nodePtr.i < MAX_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- nodePtr.p->phase = ZBLOCKED;
- }//for
-
nodePtr.i = getOwnNodeId();
ptrAss(nodePtr, nodeRec);
- nodePtr.p->phase = ZINIT;
- nodePtr.p->m_connected = true;
+ nodePtr.p->phase = ZSTARTING;
+ nodePtr.p->blockRef = reference();
+ c_connectedNodes.set(nodePtr.i);
- /****************************<*/
- /*< CM_INFOREQ <*/
- /****************************<*/
- signal->theData[0] = reference();
- signal->theData[1] = getOwnNodeId();
- sendSignal(CMVMI_REF, GSN_CM_INFOREQ, signal, 2, JBB);
+ signal->theData[0] = 0; // no answer
+ signal->theData[1] = 0; // no id
+ signal->theData[2] = NodeInfo::DB;
+ sendSignal(CMVMI_REF, GSN_OPEN_COMREQ, signal, 3, JBB);
+
+ execCM_INFOCONF(signal);
return;
-}//Qmgr::execCM_INIT()
+}
void Qmgr::setHbDelay(UintR aHbDelay)
{
@@ -293,11 +256,46 @@ void Qmgr::setArbitTimeout(UintR aArbitTimeout)
void Qmgr::execCONNECT_REP(Signal* signal)
{
- NodeRecPtr connectNodePtr;
- connectNodePtr.i = signal->theData[0];
- ptrCheckGuard(connectNodePtr, MAX_NODES, nodeRec);
- connectNodePtr.p->m_connected = true;
+ const Uint32 nodeId = signal->theData[0];
+ c_connectedNodes.set(nodeId);
+ NodeRecPtr nodePtr;
+ nodePtr.i = getOwnNodeId();
+ ptrCheckGuard(nodePtr, MAX_NODES, nodeRec);
+ switch(nodePtr.p->phase){
+ case ZSTARTING:
+ jam();
+ break;
+ case ZRUNNING:
+ case ZPREPARE_FAIL:
+ case ZFAIL_CLOSING:
+ jam();
+ return;
+ case ZINIT:
+ ndbrequire(false);
+ case ZAPI_ACTIVE:
+ case ZAPI_INACTIVE:
+ return;
+ }
+
+ if(!c_start.m_nodes.isWaitingFor(nodeId)){
+ jam();
+ return;
+ }
+
+ switch(c_start.m_gsn){
+ case GSN_CM_REGREQ:
+ jam();
+ sendCmRegReq(signal, nodeId);
+ return;
+ case GSN_CM_NODEINFOREQ:{
+ jam();
+ sendCmNodeInfoReq(signal, nodeId, nodePtr.p);
+ return;
+ }
+ default:
+ return;
+ }
return;
}//Qmgr::execCONNECT_REP()
@@ -310,25 +308,22 @@ void Qmgr::execCM_INFOCONF(Signal* signal)
cpresidentCandidate = getOwnNodeId();
cpresidentAlive = ZFALSE;
c_stopElectionTime = NdbTick_CurrentMillisecond();
- c_stopElectionTime += 30000; // 30s
+ c_stopElectionTime += c_restartPartialTimeout;
cmInfoconf010Lab(signal);
-#if 0
- /*****************************************************/
- /* Allow the CLUSTER CONTROL to send STTORRY */
- /* CM_RUN */
- /* so we can receive APPL_REGREQ from applications. */
- /*****************************************************/
- signal->theData[0] = 0;
- sendSignal(CMVMI_REF, GSN_CM_RUN, signal, 1, JBB);
-#endif
return;
}//Qmgr::execCM_INFOCONF()
void Qmgr::cmInfoconf010Lab(Signal* signal)
{
+ c_start.m_startKey = 0;
+ c_start.m_startNode = getOwnNodeId();
+ c_start.m_nodes.clearWaitingFor();
+ c_start.m_gsn = GSN_CM_REGREQ;
+
NodeRecPtr nodePtr;
c_regReqReqSent = c_regReqReqRecv = 0;
+ cnoOfNodes = 0;
for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
jam();
ptrAss(nodePtr, nodeRec);
@@ -336,19 +331,15 @@ void Qmgr::cmInfoconf010Lab(Signal* signal)
if(getNodeInfo(nodePtr.i).getType() != NodeInfo::DB)
continue;
- if(!nodePtr.p->m_connected)
+ c_start.m_nodes.setWaitingFor(nodePtr.i);
+ cnoOfNodes++;
+
+ if(!c_connectedNodes.get(nodePtr.i))
continue;
- c_regReqReqSent++;
- CmRegReq * const cmRegReq = (CmRegReq *)&signal->theData[0];
- cmRegReq->blockRef = reference();
- cmRegReq->nodeId = getOwnNodeId();
- cmRegReq->version = NDB_VERSION;
- sendSignal(nodePtr.p->blockRef, GSN_CM_REGREQ, signal,
- CmRegReq::SignalLength, JBB);
+ sendCmRegReq(signal, nodePtr.i);
}
- cstartNo = cstartNo + 1;
-
+
//----------------------------------------
/* Wait for a while. When it returns */
/* we will check if we got any CM_REGREF*/
@@ -356,14 +347,26 @@ void Qmgr::cmInfoconf010Lab(Signal* signal)
/* own). */
//----------------------------------------
signal->theData[0] = ZREGREQ_TIMELIMIT;
- signal->theData[1] = cstartNo;
- signal->theData[2] = 0;
- sendSignalWithDelay(QMGR_REF, GSN_CONTINUEB, signal, 3 * cdelayRegreq, 3);
- cwaitContinuebPhase1 = ZTRUE;
+ signal->theData[1] = c_start.m_startKey;
+ signal->theData[2] = c_start.m_startNode;
+ sendSignalWithDelay(QMGR_REF, GSN_CONTINUEB, signal, 3000, 3);
+
creadyDistCom = ZTRUE;
return;
}//Qmgr::cmInfoconf010Lab()
+void
+Qmgr::sendCmRegReq(Signal * signal, Uint32 nodeId){
+ c_regReqReqSent++;
+ CmRegReq * const cmRegReq = (CmRegReq *)&signal->theData[0];
+ cmRegReq->blockRef = reference();
+ cmRegReq->nodeId = getOwnNodeId();
+ cmRegReq->version = NDB_VERSION;
+ const Uint32 ref = calcQmgrBlockRef(nodeId);
+ sendSignal(ref, GSN_CM_REGREQ, signal, CmRegReq::SignalLength, JBB);
+ DEBUG_START(GSN_CM_REGREQ, nodeId, "");
+}
+
/*
4.4.11 CM_REGREQ */
/**--------------------------------------------------------------------------
@@ -403,6 +406,8 @@ void Qmgr::cmInfoconf010Lab(Signal* signal)
/*******************************/
void Qmgr::execCM_REGREQ(Signal* signal)
{
+ DEBUG_START3(signal, "");
+
NodeRecPtr addNodePtr;
jamEntry();
@@ -451,27 +456,15 @@ void Qmgr::execCM_REGREQ(Signal* signal)
return;
}//if
- if (cpresidentBusy == ZTRUE) {
+ if (c_start.m_startNode != 0){
jam();
/**
- * President busy by adding another node
+ * President busy by adding another node
*/
sendCmRegrefLab(signal, Tblockref, CmRegRef::ZBUSY_PRESIDENT);
return;
}//if
- if (cacceptRegreq == ZFALSE &&
- getNodeState().startLevel != NodeState::SL_STARTING) {
- jam();
- /**
- * These checks are really confusing!
- * The variables that is being checked are probably not
- * set in the correct places.
- */
- sendCmRegrefLab(signal, Tblockref, CmRegRef::ZBUSY);
- return;
- }//if
-
if (ctoStatus == Q_ACTIVE) {
jam();
/**
@@ -481,7 +474,7 @@ void Qmgr::execCM_REGREQ(Signal* signal)
return;
}//if
- if (addNodePtr.p->phase == ZBLOCKED) {
+ if (getNodeInfo(addNodePtr.i).m_type != NodeInfo::DB) {
jam();
/**
* The new node is not in config file
@@ -489,9 +482,11 @@ void Qmgr::execCM_REGREQ(Signal* signal)
sendCmRegrefLab(signal, Tblockref, CmRegRef::ZNOT_IN_CFG);
return;
}
-
- if (addNodePtr.p->phase != ZINIT) {
+
+ Phase phase = addNodePtr.p->phase;
+ if (phase != ZINIT){
jam();
+ DEBUG("phase = " << phase);
sendCmRegrefLab(signal, Tblockref, CmRegRef::ZNOT_DEAD);
return;
}//if
@@ -506,45 +501,56 @@ void Qmgr::execCM_REGREQ(Signal* signal)
* THE SIGNAL ARRIVES. IF IT HAS CHANGED THEN WE SIMPLY IGNORE
* THE TIMED SIGNAL.
*/
- cpresidentBusy = ZTRUE;
/**
- * Indicates that we are busy with node start/restart and do
- * not accept another start until this node is up and running
- * (cpresidentBusy is released a little too early to use for this
- * purpose).
+ * Update start record
*/
- cacceptRegreq = ZFALSE;
- cstartNo = cstartNo + 1;
- cstartNode = addNodePtr.i;
- signal->theData[0] = ZREGREQ_MASTER_TIMELIMIT;
- signal->theData[1] = cstartNo;
- sendSignalWithDelay(QMGR_REF, GSN_CONTINUEB, signal, 30000, 2);
- UintR TdynId = getDynamicId(signal); /* <- CDYNAMIC_ID */
- prepareAdd(signal, addNodePtr.i);
- setNodeInfo(addNodePtr.i).m_version = startingVersion;
-
+ c_start.m_startKey++;
+ c_start.m_startNode = addNodePtr.i;
+
/**
- * Send "prepare for adding a new node" to all
- * running nodes in cluster + the new node.
- * Give permission to the new node to join the
- * cluster
+ * Assign dynamic id
*/
- /*******************************/
- /*< CM_REGCONF <*/
- /*******************************/
+ UintR TdynId = ++c_maxDynamicId;
+ setNodeInfo(addNodePtr.i).m_version = startingVersion;
+ addNodePtr.p->ndynamicId = TdynId;
+ /**
+ * Reply with CM_REGCONF
+ */
CmRegConf * const cmRegConf = (CmRegConf *)&signal->theData[0];
-
cmRegConf->presidentBlockRef = reference();
cmRegConf->presidentNodeId = getOwnNodeId();
cmRegConf->presidentVersion = getNodeInfo(getOwnNodeId()).m_version;
cmRegConf->dynamicId = TdynId;
- for(unsigned int i = 0; i<NdbNodeBitmask::Size; i++)
- cmRegConf->allNdbNodes[i] = cnodemask[i];
-
+ c_clusterNodes.copyto(NdbNodeBitmask::Size, cmRegConf->allNdbNodes);
sendSignal(Tblockref, GSN_CM_REGCONF, signal,
- CmRegConf::SignalLength, JBB);
+ CmRegConf::SignalLength, JBA);
+ DEBUG_START(GSN_CM_REGCONF, refToNode(Tblockref), "");
+
+ /**
+ * Send CmAdd to all nodes (including starting)
+ */
+ c_start.m_nodes = c_clusterNodes;
+ c_start.m_nodes.setWaitingFor(addNodePtr.i);
+ c_start.m_gsn = GSN_CM_ADD;
+
+ NodeReceiverGroup rg(QMGR, c_start.m_nodes);
+ CmAdd * const cmAdd = (CmAdd*)signal->getDataPtrSend();
+ cmAdd->requestType = CmAdd::Prepare;
+ cmAdd->startingNodeId = addNodePtr.i;
+ cmAdd->startingVersion = startingVersion;
+ sendSignal(rg, GSN_CM_ADD, signal, CmAdd::SignalLength, JBA);
+ DEBUG_START2(GSN_CM_ADD, rg, "Prepare");
+
+ /**
+ * Set timer
+ */
+ return;
+ signal->theData[0] = ZREGREQ_MASTER_TIMELIMIT;
+ signal->theData[1] = c_start.m_startKey;
+ sendSignalWithDelay(QMGR_REF, GSN_CONTINUEB, signal, 30000, 2);
+
return;
}//Qmgr::execCM_REGREQ()
@@ -555,9 +561,10 @@ void Qmgr::sendCmRegrefLab(Signal* signal, BlockReference TBRef,
ref->blockRef = reference();
ref->nodeId = getOwnNodeId();
ref->errorCode = Terror;
- ref->presidentCandidate = cpresidentCandidate;
+ ref->presidentCandidate = (cpresident == ZNIL ? cpresidentCandidate : cpresident);
sendSignal(TBRef, GSN_CM_REGREF, signal,
CmRegRef::SignalLength, JBB);
+ DEBUG_START(GSN_CM_REGREF, refToNode(TBRef), "");
return;
}//Qmgr::sendCmRegrefLab()
@@ -575,14 +582,13 @@ void Qmgr::sendCmRegrefLab(Signal* signal, BlockReference TBRef,
/*******************************/
void Qmgr::execCM_REGCONF(Signal* signal)
{
+ DEBUG_START3(signal, "");
+
NodeRecPtr myNodePtr;
NodeRecPtr nodePtr;
- NodeRecPtr presidentNodePtr;
jamEntry();
- CmRegConf * const cmRegConf = (CmRegConf *)&signal->theData[0];
- cwaitContinuebPhase1 = ZFALSE;
- cwaitContinuebPhase2 = ZTRUE;
+ const CmRegConf * const cmRegConf = (CmRegConf *)&signal->theData[0];
if (!ndbCompatible_ndb_ndb(NDB_VERSION, cmRegConf->presidentVersion)) {
jam();
@@ -592,46 +598,12 @@ void Qmgr::execCM_REGCONF(Signal* signal)
return;
}
- /**
- * Check if all necessary connections has been established
- */
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- if (NodeBitmask::get(cmRegConf->allNdbNodes, nodePtr.i) == true){
- jam();
- ptrAss(nodePtr, nodeRec);
- if (!nodePtr.p->m_connected) {
- jam();
-
- /**
- * Missing connection
- */
-#ifdef VM_TRACE
- ndbout_c("Resending CM_REGCONF, node %d is not connected", nodePtr.i);
- ndbout << " presidentBlockRef="<<cmRegConf->presidentBlockRef<<endl
- << " presidentNodeId="<<cmRegConf->presidentNodeId<<endl
- << " presidentVersion="<<cmRegConf->presidentVersion<<endl
- << " dynamicId="<<cmRegConf->dynamicId<<endl;
-#endif
- for(unsigned int i = 0; i<NdbNodeBitmask::Size; i++) {
- jam();
-#ifdef VM_TRACE
- ndbout << " " << i << ": "
- << hex << cmRegConf->allNdbNodes[i]<<endl;
-#endif
- }
- sendSignalWithDelay(reference(), GSN_CM_REGCONF, signal, 100,
- signal->getLength());
- return;
- }
- }
- }
-
+
cpdistref = cmRegConf->presidentBlockRef;
cpresident = cmRegConf->presidentNodeId;
UintR TdynamicId = cmRegConf->dynamicId;
- for(unsigned int i = 0; i<NdbNodeBitmask::Size; i++)
- cnodemask[i] = cmRegConf->allNdbNodes[i];
+ c_maxDynamicId = TdynamicId;
+ c_clusterNodes.assign(NdbNodeBitmask::Size, cmRegConf->allNdbNodes);
/*--------------------------------------------------------------*/
// Send this as an EVENT REPORT to inform about hearing about
@@ -646,67 +618,40 @@ void Qmgr::execCM_REGCONF(Signal* signal)
myNodePtr.i = getOwnNodeId();
ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
myNodePtr.p->ndynamicId = TdynamicId;
- presidentNodePtr.i = cpresident;
- ptrCheckGuard(presidentNodePtr, MAX_NDB_NODES, nodeRec);
- cpdistref = presidentNodePtr.p->blockRef;
-
- CmNodeInfoReq * const req = (CmNodeInfoReq*)signal->getDataPtrSend();
- req->nodeId = getOwnNodeId();
- req->dynamicId = myNodePtr.p->ndynamicId;
- req->version = getNodeInfo(getOwnNodeId()).m_version;
for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
jam();
- if (NdbNodeBitmask::get(cnodemask, nodePtr.i) == true){
+ if (c_clusterNodes.get(nodePtr.i)){
jam();
ptrAss(nodePtr, nodeRec);
- switch(nodePtr.p->phase){
- case ZINIT: /* All nodes start in phase INIT */
- jam();
- break;
- case ZWAITING: /* Node is connecting to cluster */
- jam();
- break;
- case ZRUNNING: /* Node is running in the cluster */
- jam();
- break;
- case ZBLOCKED: /* Node is blocked from the cluster */
- jam();
- break;
- case ZWAIT_PRESIDENT:
- jam();
- break;
- case ZDEAD:
- jam();
- break;
- case ZAPI_ACTIVE: /* API IS RUNNING IN NODE */
- jam();
- break;
- case ZFAIL_CLOSING: /* API/NDB IS DISCONNECTING */
- jam();
- break;
- case ZPREPARE_FAIL: /* PREPARATION FOR FAILURE */
- jam();
- break;
- case ZAPI_INACTIVE: /* Inactive API */
- jam();
- break;
- default:
+
+ ndbrequire(nodePtr.p->phase == ZINIT);
+ nodePtr.p->phase = ZRUNNING;
+
+ if(c_connectedNodes.get(nodePtr.i)){
jam();
- ndbout << "phase="<<nodePtr.p->phase<<endl;
- break;
+ sendCmNodeInfoReq(signal, nodePtr.i, myNodePtr.p);
}
- ndbrequire(nodePtr.p->phase == ZINIT);
- ndbrequire(nodePtr.i != getOwnNodeId());
- nodePtr.p->phase = ZWAITING;
-
- sendSignal(nodePtr.p->blockRef, GSN_CM_NODEINFOREQ,
- signal, CmNodeInfoReq::SignalLength, JBB);
}
}
+
+ c_start.m_gsn = GSN_CM_NODEINFOREQ;
+ c_start.m_nodes = c_clusterNodes;
+
return;
}//Qmgr::execCM_REGCONF()
+void
+Qmgr::sendCmNodeInfoReq(Signal* signal, Uint32 nodeId, const NodeRec * self){
+ CmNodeInfoReq * const req = (CmNodeInfoReq*)signal->getDataPtrSend();
+ req->nodeId = getOwnNodeId();
+ req->dynamicId = self->ndynamicId;
+ req->version = getNodeInfo(getOwnNodeId()).m_version;
+ const Uint32 ref = calcQmgrBlockRef(nodeId);
+ sendSignal(ref,GSN_CM_NODEINFOREQ, signal, CmNodeInfoReq::SignalLength, JBB);
+ DEBUG_START(GSN_CM_NODEINFOREQ, nodeId, "");
+}
+
/*
4.4.11 CM_REGREF */
/**--------------------------------------------------------------------------
@@ -735,9 +680,11 @@ void Qmgr::execCM_REGREF(Signal* signal)
UintR TrefuseReason = signal->theData[2];
Uint32 candidate = signal->theData[3];
+ DEBUG_START3(signal, TrefuseReason);
+
if(candidate != cpresidentCandidate){
jam();
- c_regReqReqRecv = c_regReqReqSent + 1;
+ c_regReqReqRecv = ~0;
}
switch (TrefuseReason) {
@@ -758,25 +705,16 @@ void Qmgr::execCM_REGREF(Signal* signal)
break;
case CmRegRef::ZNOT_DEAD:
jam();
- if(TaddNodeno == getOwnNodeId() && cpresident == getOwnNodeId()){
- jam();
- cwaitContinuebPhase1 = ZFALSE;
- cwaitContinuebPhase2 = ZFALSE;
- return;
- }
progError(__LINE__, ERR_NODE_NOT_DEAD);
break;
case CmRegRef::ZELECTION:
jam();
- if (cwaitContinuebPhase1 == ZFALSE) {
- jam();
- signal->theData[3] = 1;
- } else if (cpresidentCandidate > TaddNodeno) {
+ if (cpresidentCandidate > TaddNodeno) {
jam();
-//----------------------------------------
-/* We may already have a candidate */
-/* choose the lowest nodeno */
-//----------------------------------------
+ //----------------------------------------
+ /* We may already have a candidate */
+ /* choose the lowest nodeno */
+ //----------------------------------------
signal->theData[3] = 2;
cpresidentCandidate = TaddNodeno;
} else {
@@ -808,16 +746,19 @@ void Qmgr::execCM_REGREF(Signal* signal)
if(cpresidentAlive == ZTRUE){
jam();
+ DEBUG("");
return;
}
if(c_regReqReqSent != c_regReqReqRecv){
jam();
+ DEBUG( c_regReqReqSent << " != " << c_regReqReqRecv);
return;
}
if(cpresidentCandidate != getOwnNodeId()){
jam();
+ DEBUG("");
return;
}
@@ -829,10 +770,8 @@ void Qmgr::execCM_REGREF(Signal* signal)
jam();
electionWon();
-#if 1
- signal->theData[0] = 0;
- sendSignal(CMVMI_REF, GSN_CM_RUN, signal, 1, JBB);
-#endif
+ sendSttorryLab(signal);
+
/**
* Start timer handling
*/
@@ -851,14 +790,18 @@ Qmgr::electionWon(){
ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
myNodePtr.p->phase = ZRUNNING;
+
cpdistref = reference();
- cclustersize = 1;
cneighbourl = ZNIL;
cneighbourh = ZNIL;
myNodePtr.p->ndynamicId = 1;
-
+ c_maxDynamicId = 1;
+ c_clusterNodes.clear();
+ c_clusterNodes.set(getOwnNodeId());
+
cpresidentAlive = ZTRUE;
c_stopElectionTime = ~0;
+ c_start.reset();
}
/*
@@ -870,38 +813,11 @@ Qmgr::electionWon(){
/* CONTINUEB > SENDER: Own block, Own node */
/****************************>-------+INPUT : TCONTINUEB_TYPE */
/*--------------------------------------------------------------*/
-void Qmgr::regreqTimelimitLab(Signal* signal, UintR callTime)
+void Qmgr::regreqTimeLimitLab(Signal* signal)
{
- if (cwaitContinuebPhase1 == ZFALSE) {
- if (cwaitContinuebPhase2 == ZFALSE) {
- jam();
- return;
- } else {
- jam();
- if (callTime < 10) {
- /*-------------------------------------------------------------*/
- // We experienced a time-out of inclusion. Give it another few
- // seconds before crashing.
- /*-------------------------------------------------------------*/
- signal->theData[0] = ZREGREQ_TIMELIMIT;
- signal->theData[1] = cstartNo;
- signal->theData[2] = callTime + 1;
- sendSignalWithDelay(QMGR_REF, GSN_CONTINUEB, signal, 3000, 3);
- return;
- }//if
- /*-------------------------------------------------------------*/
- /* WE HAVE COME HERE BECAUSE THE INCLUSION SUFFERED FROM */
- /* TIME OUT. WE CRASH AND RESTART. */
- /*-------------------------------------------------------------*/
- systemErrorLab(signal);
- return;
- }//if
- } else {
- jam();
- cwaitContinuebPhase1 = ZFALSE;
- }//if
-
- cmInfoconf010Lab(signal);
+ if(cpresident == ZNIL){
+ cmInfoconf010Lab(signal);
+ }
}//Qmgr::regreqTimelimitLab()
/**---------------------------------------------------------------------------
@@ -917,32 +833,37 @@ void Qmgr::regreqTimelimitLab(Signal* signal, UintR callTime)
/*******************************/
void Qmgr::execCM_NODEINFOCONF(Signal* signal)
{
- NodeRecPtr replyNodePtr;
- NodeRecPtr nodePtr;
+ DEBUG_START3(signal, "");
+
jamEntry();
CmNodeInfoConf * const conf = (CmNodeInfoConf*)signal->getDataPtr();
- replyNodePtr.i = conf->nodeId;
- ptrCheckGuard(replyNodePtr, MAX_NDB_NODES, nodeRec);
- replyNodePtr.p->ndynamicId = conf->dynamicId;
- setNodeInfo(replyNodePtr.i).m_version = conf->version;
- replyNodePtr.p->phase = ZRUNNING;
-
+ const Uint32 nodeId = conf->nodeId;
+ const Uint32 dynamicId = conf->dynamicId;
+ const Uint32 version = conf->version;
+
+ NodeRecPtr nodePtr;
+ nodePtr.i = getOwnNodeId();
+ ptrAss(nodePtr, nodeRec);
+ ndbrequire(nodePtr.p->phase == ZSTARTING);
+ ndbrequire(c_start.m_gsn == GSN_CM_NODEINFOREQ);
+ c_start.m_nodes.clearWaitingFor(nodeId);
+
/**
- * A node in the cluster has replied nodeinfo about himself.
- * He is already running in the cluster.
+ * Update node info
*/
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
+ NodeRecPtr replyNodePtr;
+ replyNodePtr.i = nodeId;
+ ptrCheckGuard(replyNodePtr, MAX_NDB_NODES, nodeRec);
+ replyNodePtr.p->ndynamicId = dynamicId;
+ replyNodePtr.p->blockRef = signal->getSendersBlockRef();
+ setNodeInfo(replyNodePtr.i).m_version = version;
+
+ if(!c_start.m_nodes.done()){
jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->phase == ZWAITING) {
- if (nodePtr.i != getOwnNodeId()) {
- jam();
- return;
- }//if
- }//if
- }//for
+ return;
+ }
/**********************************************<*/
/* Send an ack. back to the president. */
@@ -953,11 +874,7 @@ void Qmgr::execCM_NODEINFOCONF(Signal* signal)
/* for CM_ADD (commit) from president to become */
/* a running node in the cluster. */
/**********************************************<*/
- CmAckAdd * const cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
- cmAckAdd->requestType = CmAdd::Prepare;
- cmAckAdd->senderNodeId = getOwnNodeId();
- cmAckAdd->startingNodeId = getOwnNodeId();
- sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
+ sendCmAckAdd(signal, getOwnNodeId(), CmAdd::Prepare);
return;
}//Qmgr::execCM_NODEINFOCONF()
@@ -970,59 +887,99 @@ void Qmgr::execCM_NODEINFOCONF(Signal* signal)
/*******************************/
void Qmgr::execCM_NODEINFOREQ(Signal* signal)
{
- NodeRecPtr addNodePtr;
- NodeRecPtr myNodePtr;
jamEntry();
+ const Uint32 Tblockref = signal->getSendersBlockRef();
+
+ NodeRecPtr nodePtr;
+ nodePtr.i = getOwnNodeId();
+ ptrAss(nodePtr, nodeRec);
+ if(nodePtr.p->phase != ZRUNNING){
+ jam();
+ signal->theData[0] = reference();
+ signal->theData[1] = getOwnNodeId();
+ signal->theData[2] = ZNOT_RUNNING;
+ sendSignal(Tblockref, GSN_CM_NODEINFOREF, signal, 3, JBB);
+ return;
+ }
+
+ NodeRecPtr addNodePtr;
CmNodeInfoReq * const req = (CmNodeInfoReq*)signal->getDataPtr();
addNodePtr.i = req->nodeId;
ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec);
addNodePtr.p->ndynamicId = req->dynamicId;
+ addNodePtr.p->blockRef = signal->getSendersBlockRef();
setNodeInfo(addNodePtr.i).m_version = req->version;
-
- const BlockReference Tblockref = signal->getSendersBlockRef();
+ c_maxDynamicId = req->dynamicId;
- myNodePtr.i = getOwnNodeId();
- ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
- if (myNodePtr.p->phase == ZRUNNING) {
- if (addNodePtr.p->phase == ZWAITING) {
- jam();
- /* President have prepared us */
- /****************************<*/
- /*< CM_NODEINFOCONF <*/
- /****************************<*/
- CmNodeInfoConf * const conf = (CmNodeInfoConf*)signal->getDataPtrSend();
- conf->nodeId = getOwnNodeId();
- conf->dynamicId = myNodePtr.p->ndynamicId;
- conf->version = getNodeInfo(getOwnNodeId()).m_version;
- sendSignal(Tblockref, GSN_CM_NODEINFOCONF, signal,
- CmNodeInfoConf::SignalLength, JBB);
- /****************************************/
- /* Send an ack. back to the president */
- /* CM_ACKADD */
- /****************************************/
- CmAckAdd * const cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
- cmAckAdd->requestType = CmAdd::Prepare;
- cmAckAdd->senderNodeId = getOwnNodeId();
- cmAckAdd->startingNodeId = addNodePtr.i;
- sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
- } else {
- jam();
- addNodePtr.p->phase = ZWAIT_PRESIDENT;
- }//if
- } else {
- jam();
- /****************************<*/
- /*< CM_NODEINFOREF <*/
- /****************************<*/
- signal->theData[0] = myNodePtr.p->blockRef;
- signal->theData[1] = myNodePtr.i;
- signal->theData[2] = ZNOT_RUNNING;
- sendSignal(Tblockref, GSN_CM_NODEINFOREF, signal, 3, JBB);
- }//if
- return;
+ cmAddPrepare(signal, addNodePtr, nodePtr.p);
}//Qmgr::execCM_NODEINFOREQ()
+void
+Qmgr::cmAddPrepare(Signal* signal, NodeRecPtr nodePtr, const NodeRec * self){
+ jam();
+
+ switch(nodePtr.p->phase){
+ case ZINIT:
+ jam();
+ nodePtr.p->phase = ZSTARTING;
+ return;
+ case ZFAIL_CLOSING:
+ jam();
+#ifdef VM_TRACE
+ ndbout_c("Enabling communication to CM_ADD node state=%d",
+ nodePtr.p->phase);
+#endif
+ nodePtr.p->phase = ZSTARTING;
+ nodePtr.p->failState = NORMAL;
+ signal->theData[0] = 0;
+ signal->theData[1] = nodePtr.i;
+ sendSignal(CMVMI_REF, GSN_OPEN_COMREQ, signal, 2, JBA);
+ return;
+ case ZSTARTING:
+ break;
+ case ZRUNNING:
+ case ZPREPARE_FAIL:
+ case ZAPI_ACTIVE:
+ case ZAPI_INACTIVE:
+ ndbrequire(false);
+ }
+
+ sendCmAckAdd(signal, nodePtr.i, CmAdd::Prepare);
+
+ /* President have prepared us */
+ CmNodeInfoConf * conf = (CmNodeInfoConf*)signal->getDataPtrSend();
+ conf->nodeId = getOwnNodeId();
+ conf->dynamicId = self->ndynamicId;
+ conf->version = getNodeInfo(getOwnNodeId()).m_version;
+ sendSignal(nodePtr.p->blockRef, GSN_CM_NODEINFOCONF, signal,
+ CmNodeInfoConf::SignalLength, JBB);
+ DEBUG_START(GSN_CM_NODEINFOCONF, refToNode(nodePtr.p->blockRef), "");
+}
+
+void
+Qmgr::sendCmAckAdd(Signal * signal, Uint32 nodeId, CmAdd::RequestType type){
+
+ CmAckAdd * cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
+ cmAckAdd->requestType = type;
+ cmAckAdd->startingNodeId = nodeId;
+ cmAckAdd->senderNodeId = getOwnNodeId();
+ sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
+ DEBUG_START(GSN_CM_ACKADD, cpresident, "");
+
+ switch(type){
+ case CmAdd::Prepare:
+ return;
+ case CmAdd::AddCommit:
+ case CmAdd::CommitNew:
+ break;
+ }
+
+ signal->theData[0] = nodeId;
+ EXECUTE_DIRECT(NDBCNTR, GSN_CM_ADD_REP, signal, 1);
+ jamEntry();
+}
+
/*
4.4.11 CM_ADD */
/**--------------------------------------------------------------------------
@@ -1040,156 +997,130 @@ void Qmgr::execCM_NODEINFOREQ(Signal* signal)
void Qmgr::execCM_ADD(Signal* signal)
{
NodeRecPtr addNodePtr;
- NodeRecPtr nodePtr;
- NodeRecPtr myNodePtr;
jamEntry();
+ NodeRecPtr nodePtr;
+ nodePtr.i = getOwnNodeId();
+ ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
+
CmAdd * const cmAdd = (CmAdd*)signal->getDataPtr();
const CmAdd::RequestType type = (CmAdd::RequestType)cmAdd->requestType;
addNodePtr.i = cmAdd->startingNodeId;
//const Uint32 startingVersion = cmAdd->startingVersion;
ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec);
- if(addNodePtr.p->phase == ZFAIL_CLOSING){
+ DEBUG_START3(signal, type);
+
+ if(nodePtr.p->phase == ZSTARTING){
jam();
-#ifdef VM_TRACE
- ndbout_c("Enabling communication to CM_ADD node state=%d",
- addNodePtr.p->phase);
-#endif
- addNodePtr.p->failState = NORMAL;
- signal->theData[0] = 0;
- signal->theData[1] = addNodePtr.i;
- sendSignal(CMVMI_REF, GSN_OPEN_COMREQ, signal, 2, JBA);
+ /**
+ * We are joining...
+ */
+ ndbrequire(addNodePtr.i == nodePtr.i);
+ switch(type){
+ case CmAdd::Prepare:
+ ndbrequire(c_start.m_gsn == GSN_CM_NODEINFOREQ);
+ /**
+ * Wait for CM_NODEINFO_CONF
+ */
+ return;
+ case CmAdd::CommitNew:
+ /**
+ * Tata. we're in the cluster
+ */
+ joinedCluster(signal, addNodePtr);
+ return;
+ case CmAdd::AddCommit:
+ ndbrequire(false);
+ }
}
-
+
switch (type) {
case CmAdd::Prepare:
- jam();
- if (addNodePtr.i != getOwnNodeId()) {
- jam();
- if (addNodePtr.p->phase == ZWAIT_PRESIDENT) {
- jam();
- /****************************<*/
- /*< CM_NODEINFOCONF <*/
- /****************************<*/
- myNodePtr.i = getOwnNodeId();
- ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
-
- CmNodeInfoConf * const conf = (CmNodeInfoConf*)signal->getDataPtrSend();
- conf->nodeId = getOwnNodeId();
- conf->dynamicId = myNodePtr.p->ndynamicId;
- conf->version = getNodeInfo(getOwnNodeId()).m_version;
- sendSignal(addNodePtr.p->blockRef, GSN_CM_NODEINFOCONF, signal,
- CmNodeInfoConf::SignalLength, JBB);
- /****************************<*/
- /* Send an ack. back to the president */
- /*< CM_ACKADD <*/
- /****************************<*/
- CmAckAdd * const cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
- cmAckAdd->requestType = CmAdd::Prepare;
- cmAckAdd->senderNodeId = getOwnNodeId();
- cmAckAdd->startingNodeId = addNodePtr.i;
- sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
- }//if
- // -----------------------------------------
- /* Wait for the new node's CM_NODEINFOREQ.*/
- // -----------------------------------------
- addNodePtr.p->phase = ZWAITING;
- }//if
+ cmAddPrepare(signal, addNodePtr, nodePtr.p);
break;
case CmAdd::AddCommit:{
jam();
+ ndbrequire(addNodePtr.p->phase == ZSTARTING);
addNodePtr.p->phase = ZRUNNING;
addNodePtr.p->alarmCount = 0;
+ c_clusterNodes.set(addNodePtr.i);
findNeighbours(signal);
- /**-----------------------------------------------------------------------
+
+ /**
* SEND A HEARTBEAT IMMEDIATELY TO DECREASE THE RISK THAT WE MISS EARLY
* HEARTBEATS.
- *-----------------------------------------------------------------------*/
+ */
sendHeartbeat(signal);
- /*-----------------------------------------------------------------------*/
- /* ENABLE COMMUNICATION WITH ALL BLOCKS WITH THE NEWLY ADDED NODE. */
- /*-----------------------------------------------------------------------*/
+
+ /**
+ * ENABLE COMMUNICATION WITH ALL BLOCKS WITH THE NEWLY ADDED NODE
+ */
signal->theData[0] = addNodePtr.i;
sendSignal(CMVMI_REF, GSN_ENABLE_COMORD, signal, 1, JBA);
- /****************************<*/
- /*< CM_ACKADD <*/
- /****************************<*/
- CmAckAdd * const cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
- cmAckAdd->requestType = CmAdd::AddCommit;
- cmAckAdd->senderNodeId = getOwnNodeId();
- cmAckAdd->startingNodeId = addNodePtr.i;
- sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
+
+ sendCmAckAdd(signal, addNodePtr.i, CmAdd::AddCommit);
+ if(getOwnNodeId() != cpresident){
+ jam();
+ c_start.reset();
+ }
break;
}
- case CmAdd::CommitNew:{
+ case CmAdd::CommitNew:
jam();
- /*-----------------------------------------------------------------------*/
- /* WE HAVE BEEN INCLUDED IN THE CLUSTER WE CAN START BEING PART OF THE
- * HEARTBEAT PROTOCOL AND WE WILL ALSO ENABLE COMMUNICATION WITH ALL
- * NODES IN THE CLUSTER.
- *-----------------------------------------------------------------------*/
- addNodePtr.p->phase = ZRUNNING;
- addNodePtr.p->alarmCount = 0;
- findNeighbours(signal);
- /**-----------------------------------------------------------------------
- * SEND A HEARTBEAT IMMEDIATELY TO DECREASE THE RISK THAT WE MISS EARLY
- * HEARTBEATS.
- *-----------------------------------------------------------------------*/
- sendHeartbeat(signal);
- cwaitContinuebPhase2 = ZFALSE;
- /**-----------------------------------------------------------------------
- * ENABLE COMMUNICATION WITH ALL BLOCKS IN THE CURRENT CLUSTER AND SET
- * THE NODES IN THE CLUSTER TO BE RUNNING.
- *-----------------------------------------------------------------------*/
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if ((nodePtr.p->phase == ZRUNNING) &&
- (nodePtr.i != getOwnNodeId())) {
- /*-------------------------------------------------------------------*/
- // Enable full communication to all other nodes. Not really necessary
- // to open communication to ourself.
- /*-------------------------------------------------------------------*/
- jam();
- signal->theData[0] = nodePtr.i;
- sendSignal(CMVMI_REF, GSN_ENABLE_COMORD, signal, 1, JBA);
- }//if
- }//for
-
- /****************************<*/
- /*< CM_ACKADD <*/
- /****************************<*/
- CmAckAdd * const cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
- cmAckAdd->requestType = CmAdd::CommitNew;
- cmAckAdd->senderNodeId = getOwnNodeId();
- cmAckAdd->startingNodeId = addNodePtr.i;
- sendSignal(cpdistref, GSN_CM_ACKADD, signal, CmAckAdd::SignalLength, JBA);
-
-#if 1
- /**********************************************<*/
- /* Allow the CLUSTER CONTROL to send STTORRY */
- /* so we can receive CM_REG from applications. */
- /**********************************************<*/
- signal->theData[0] = 0;
- sendSignal(CMVMI_REF, GSN_CM_RUN, signal, 1, JBB);
-#endif
-
- /**
- * Start timer handling
- */
- signal->theData[0] = ZTIMER_HANDLING;
- sendSignal(QMGR_REF, GSN_CONTINUEB, signal, 10, JBB);
+ ndbrequire(false);
}
- break;
- default:
- jam();
- /*empty*/;
- break;
- }//switch
- return;
+
}//Qmgr::execCM_ADD()
+void
+Qmgr::joinedCluster(Signal* signal, NodeRecPtr nodePtr){
+ /**
+ * WE HAVE BEEN INCLUDED IN THE CLUSTER WE CAN START BEING PART OF THE
+ * HEARTBEAT PROTOCOL AND WE WILL ALSO ENABLE COMMUNICATION WITH ALL
+ * NODES IN THE CLUSTER.
+ */
+ nodePtr.p->phase = ZRUNNING;
+ nodePtr.p->alarmCount = 0;
+ findNeighbours(signal);
+ c_clusterNodes.set(nodePtr.i);
+ c_start.reset();
+
+ /**
+ * SEND A HEARTBEAT IMMEDIATELY TO DECREASE THE RISK
+ * THAT WE MISS EARLY HEARTBEATS.
+ */
+ sendHeartbeat(signal);
+
+ /**
+ * ENABLE COMMUNICATION WITH ALL BLOCKS IN THE CURRENT CLUSTER AND SET
+ * THE NODES IN THE CLUSTER TO BE RUNNING.
+ */
+ for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
+ jam();
+ ptrAss(nodePtr, nodeRec);
+ if ((nodePtr.p->phase == ZRUNNING) && (nodePtr.i != getOwnNodeId())) {
+ /*-------------------------------------------------------------------*/
+ // Enable full communication to all other nodes. Not really necessary
+ // to open communication to ourself.
+ /*-------------------------------------------------------------------*/
+ jam();
+ signal->theData[0] = nodePtr.i;
+ sendSignal(CMVMI_REF, GSN_ENABLE_COMORD, signal, 1, JBA);
+ }//if
+ }//for
+
+ sendSttorryLab(signal);
+
+ /**
+ * Start timer handling
+ */
+ signal->theData[0] = ZTIMER_HANDLING;
+ sendSignal(QMGR_REF, GSN_CONTINUEB, signal, 10, JBB);
+
+ sendCmAckAdd(signal, getOwnNodeId(), CmAdd::CommitNew);
+}
+
/* 4.10.7 CM_ACKADD - PRESIDENT IS RECEIVER - */
/*---------------------------------------------------------------------------*/
/* Entry point for an ack add signal.
@@ -1198,7 +1129,6 @@ void Qmgr::execCM_ADD(Signal* signal)
void Qmgr::execCM_ACKADD(Signal* signal)
{
NodeRecPtr addNodePtr;
- NodeRecPtr nodePtr;
NodeRecPtr senderNodePtr;
jamEntry();
@@ -1206,109 +1136,86 @@ void Qmgr::execCM_ACKADD(Signal* signal)
const CmAdd::RequestType type = (CmAdd::RequestType)cmAckAdd->requestType;
addNodePtr.i = cmAckAdd->startingNodeId;
senderNodePtr.i = cmAckAdd->senderNodeId;
+
+ DEBUG_START3(signal, type);
+
if (cpresident != getOwnNodeId()) {
jam();
/*-----------------------------------------------------------------------*/
/* IF WE ARE NOT PRESIDENT THEN WE SHOULD NOT RECEIVE THIS MESSAGE. */
/*------------------------------------------------------------_----------*/
+ warningEvent("Received CM_ACKADD from %d president=%d",
+ senderNodePtr.i, cpresident);
return;
}//if
- if (cpresidentBusy != ZTRUE) {
- jam();
- /**----------------------------------------------------------------------
- * WE ARE PRESIDENT BUT WE ARE NOT BUSY ADDING ANY NODE. THUS WE MUST
- * HAVE STOPPED THIS ADDING OF THIS NODE.
- *----------------------------------------------------------------------*/
- return;
- }//if
- if (addNodePtr.i != cstartNode) {
+
+ if (addNodePtr.i != c_start.m_startNode) {
jam();
/*----------------------------------------------------------------------*/
/* THIS IS NOT THE STARTING NODE. WE ARE ACTIVE NOW WITH ANOTHER START. */
/*----------------------------------------------------------------------*/
+ warningEvent("Received CM_ACKADD from %d with startNode=%d != own %d",
+ senderNodePtr.i, addNodePtr.i, c_start.m_startNode);
return;
}//if
+
+ ndbrequire(c_start.m_gsn == GSN_CM_ADD);
+ c_start.m_nodes.clearWaitingFor(senderNodePtr.i);
+ if(!c_start.m_nodes.done()){
+ jam();
+ return;
+ }
+
switch (type) {
case CmAdd::Prepare:{
jam();
- ptrCheckGuard(senderNodePtr, MAX_NDB_NODES, nodeRec);
- senderNodePtr.p->sendCmAddPrepStatus = Q_NOT_ACTIVE;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- /* Check if all prepare are acknowledged*/
- if (nodePtr.p->sendCmAddPrepStatus == Q_ACTIVE) {
- jam();
- return; /* Wait for more acknowledge's */
- }//if
- }//for
+
/*----------------------------------------------------------------------*/
/* ALL RUNNING NODES HAVE PREPARED THE INCLUSION OF THIS NEW NODE. */
/*----------------------------------------------------------------------*/
+ c_start.m_gsn = GSN_CM_ADD;
+ c_start.m_nodes = c_clusterNodes;
+
CmAdd * const cmAdd = (CmAdd*)signal->getDataPtrSend();
cmAdd->requestType = CmAdd::AddCommit;
cmAdd->startingNodeId = addNodePtr.i;
cmAdd->startingVersion = getNodeInfo(addNodePtr.i).m_version;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->phase == ZRUNNING) {
- jam();
- sendSignal(nodePtr.p->blockRef, GSN_CM_ADD, signal,
- CmAdd::SignalLength, JBA);
- nodePtr.p->sendCmAddCommitStatus = Q_ACTIVE;
- }//if
- }//for
+ NodeReceiverGroup rg(QMGR, c_clusterNodes);
+ sendSignal(rg, GSN_CM_ADD, signal, CmAdd::SignalLength, JBA);
+ DEBUG_START2(GSN_CM_ADD, rg, "AddCommit");
return;
- break;
}
case CmAdd::AddCommit:{
jam();
- ptrCheckGuard(senderNodePtr, MAX_NDB_NODES, nodeRec);
- senderNodePtr.p->sendCmAddCommitStatus = Q_NOT_ACTIVE;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- /* Check to see if we need to wait for */
- if (nodePtr.p->sendCmAddCommitStatus == Q_ACTIVE) {
- jam();
- /* any more ack. commit add. */
- return; /* Exit and continue waiting. */
- }//if
- }//for
+
/****************************************/
/* Send commit to the new node so he */
/* will change PHASE into ZRUNNING */
/****************************************/
+ c_start.m_gsn = GSN_CM_ADD;
+ c_start.m_nodes.clearWaitingFor();
+ c_start.m_nodes.setWaitingFor(addNodePtr.i);
+
CmAdd * const cmAdd = (CmAdd*)signal->getDataPtrSend();
cmAdd->requestType = CmAdd::CommitNew;
cmAdd->startingNodeId = addNodePtr.i;
cmAdd->startingVersion = getNodeInfo(addNodePtr.i).m_version;
- ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec);
- sendSignal(addNodePtr.p->blockRef, GSN_CM_ADD, signal,
+ sendSignal(calcQmgrBlockRef(addNodePtr.i), GSN_CM_ADD, signal,
CmAdd::SignalLength, JBA);
- break;
+ DEBUG_START(GSN_CM_ADD, addNodePtr.i, "CommitNew");
+ return;
}
case CmAdd::CommitNew:
jam();
- /*----------------------------------------------------------------------*/
- /* Increment the amount of nodes in the cluster in waiting mode. */
- /* President now ready for more CM_REGREQ */
- /*----------------------------------------------------------------------*/
- cclustersize = cclustersize + 1;
/**
* Tell arbitration about new node.
*/
handleArbitNdbAdd(signal, addNodePtr.i);
- cpresidentBusy = ZFALSE;
- break;
- default:
- jam();
- /*empty*/;
- break;
+ c_start.reset();
+ return;
}//switch
- return;
+ ndbrequire(false);
}//Qmgr::execCM_ACKADD()
/**-------------------------------------------------------------------------
@@ -1433,51 +1340,30 @@ void Qmgr::findNeighbours(Signal* signal)
/*---------------------------------------------------------------------------*/
void Qmgr::initData(Signal* signal)
{
- RegAppPtr localRegAppptr;
-
- for (localRegAppptr.i = 0;
- localRegAppptr.i < NO_REG_APP; localRegAppptr.i++) {
- ptrAss(localRegAppptr, regApp);
- localRegAppptr.p->version = 0;
- localRegAppptr.p->blockref = 0;
- memset(localRegAppptr.p->name, 0, sizeof(localRegAppptr.p->name));
- localRegAppptr.p->activity = ZREMOVE;
- localRegAppptr.p->noofapps = 0;
- localRegAppptr.p->noofpending = 0;
- localRegAppptr.p->m_runNodes.clear();
- }//for
-
NodeRecPtr nodePtr;
for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++) {
ptrAss(nodePtr, nodeRec);
nodePtr.p->ndynamicId = 0;
- /* Subr NEXT_DYNAMIC_ID will use this to find */
- /* a unique higher value than any of these */
-
- /* Not in config file */
- nodePtr.p->phase = ZBLOCKED;
+ if(getNodeInfo(nodePtr.i).m_type == NodeInfo::DB){
+ nodePtr.p->phase = ZINIT;
+ c_definedNodes.set(nodePtr.i);
+ } else {
+ nodePtr.p->phase = ZAPI_INACTIVE;
+ }
+
nodePtr.p->alarmCount = 0;
nodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
nodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
- nodePtr.p->sendCmAddPrepStatus = Q_NOT_ACTIVE;
- nodePtr.p->sendCmAddCommitStatus = Q_NOT_ACTIVE;
nodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
- nodePtr.p->m_connected = false;
nodePtr.p->failState = NORMAL;
nodePtr.p->rcv[0] = 0;
nodePtr.p->rcv[1] = 0;
}//for
- ccm_infoconfCounter = 0;
cfailureNr = 1;
ccommitFailureNr = 1;
cprepareFailureNr = 1;
cnoFailedNodes = 0;
cnoPrepFailedNodes = 0;
- cwaitContinuebPhase1 = ZFALSE;
- cwaitContinuebPhase2 = ZFALSE;
- cstartNo = 0;
- cpresidentBusy = ZFALSE;
- cacceptRegreq = ZTRUE;
creadyDistCom = ZFALSE;
cpresident = ZNIL;
cpresidentCandidate = ZNIL;
@@ -1496,55 +1382,58 @@ void Qmgr::initData(Signal* signal)
// catch-all for missing initializations
memset(&arbitRec, 0, sizeof(arbitRec));
-}//Qmgr::initData()
-/*
-4.10.7 PREPARE_ADD */
-/**--------------------------------------------------------------------------
- * President sends CM_ADD to prepare all running nodes to add a new node.
- * Even the president node will get a CM_ADD (prepare).
- * The new node will make REQs to all running nodes after it has received the
- * CM_REGCONF. The president will just coordinate the adding of new nodes.
- * The CM_ADD (prepare) is sent to the cluster before the CM_REGCONF signal
- * to the new node.
- *
- * At the same time we will store all running nodes in CNODEMASK,
- * which will be sent to the new node
- * Scan the NODE_REC for all running nodes and create a nodemask where
- * each bit represents a node.
- * --------------------------------------------------------------------------*/
-void Qmgr::prepareAdd(Signal* signal, Uint16 anAddedNode)
-{
- NodeRecPtr nodePtr;
- NdbNodeBitmask::clear(cnodemask);
+ /**
+ * Timeouts
+ */
+ const ndb_mgm_configuration_iterator * p =
+ theConfiguration.getOwnConfigIterator();
+ ndbrequire(p != 0);
- CmAdd * const cmAdd = (CmAdd*)signal->getDataPtrSend();
- cmAdd->requestType = CmAdd::Prepare;
- cmAdd->startingNodeId = anAddedNode;
- cmAdd->startingVersion = getNodeInfo(anAddedNode).m_version;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->phase == ZRUNNING) {
- jam();
- /* We found a node to prepare. */
- NdbNodeBitmask::set(cnodemask, nodePtr.i);
- sendSignal(nodePtr.p->blockRef, GSN_CM_ADD, signal, CmAdd::SignalLength, JBA);
- nodePtr.p->sendCmAddPrepStatus = Q_ACTIVE;
- }//if
- }//for
+ Uint32 hbDBDB = 1500;
+ Uint32 hbDBAPI = 1500;
+ Uint32 arbitTimeout = 1000;
+ c_restartPartialTimeout = 30000;
+ ndb_mgm_get_int_parameter(p, CFG_DB_HEARTBEAT_INTERVAL, &hbDBDB);
+ ndb_mgm_get_int_parameter(p, CFG_DB_API_HEARTBEAT_INTERVAL, &hbDBAPI);
+ ndb_mgm_get_int_parameter(p, CFG_DB_ARBIT_TIMEOUT, &arbitTimeout);
+ ndb_mgm_get_int_parameter(p, CFG_DB_START_PARTIAL_TIMEOUT,
+ &c_restartPartialTimeout);
+ if(c_restartPartialTimeout == 0){
+ c_restartPartialTimeout = ~0;
+ }
+
+ setHbDelay(hbDBDB);
+ setHbApiDelay(hbDBAPI);
+ setArbitTimeout(arbitTimeout);
+
+ arbitRec.state = ARBIT_NULL; // start state for all nodes
+ arbitRec.apiMask[0].clear(); // prepare for ARBIT_CFG
+
+ ArbitSignalData* const sd = (ArbitSignalData*)&signal->theData[0];
+ for (unsigned rank = 1; rank <= 2; rank++) {
+ sd->sender = getOwnNodeId();
+ sd->code = rank;
+ sd->node = 0;
+ sd->ticket.clear();
+ sd->mask.clear();
+ ndb_mgm_configuration_iterator * iter =
+ theConfiguration.getClusterConfigIterator();
+ for (ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)) {
+ Uint32 tmp = 0;
+ if (ndb_mgm_get_int_parameter(iter, CFG_NODE_ARBIT_RANK, &tmp) == 0 &&
+ tmp == rank){
+ Uint32 nodeId = 0;
+ ndbrequire(!ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, &nodeId));
+ sd->mask.set(nodeId);
+ }
+ }
+
+ execARBIT_CFG(signal);
+ }
+ setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
+}//Qmgr::initData()
- NodeRecPtr addNodePtr;
- addNodePtr.i = anAddedNode;
- ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec);
- /*****************************<
- * We send to the node to be added a CM_ADD as well.
- * We want him to send an ack when he has
- * received all CM_NODEINFOCONF.
- */
- sendSignal(addNodePtr.p->blockRef, GSN_CM_ADD, signal, CmAdd::SignalLength, JBA);
- addNodePtr.p->sendCmAddPrepStatus = Q_ACTIVE;
-}//Qmgr::prepareAdd()
/**---------------------------------------------------------------------------
* HERE WE RECEIVE THE JOB TABLE SIGNAL EVERY 10 MILLISECONDS.
@@ -1695,22 +1584,23 @@ void Qmgr::apiHbHandlingLab(Signal* signal)
NodeRecPtr TnodePtr;
for (TnodePtr.i = 1; TnodePtr.i < MAX_NODES; TnodePtr.i++) {
+ const Uint32 nodeId = TnodePtr.i;
ptrAss(TnodePtr, nodeRec);
- const NodeInfo::NodeType type = getNodeInfo(TnodePtr.i).getType();
+ const NodeInfo::NodeType type = getNodeInfo(nodeId).getType();
if(type == NodeInfo::DB)
continue;
if(type == NodeInfo::INVALID)
continue;
- if (TnodePtr.p->m_connected && TnodePtr.p->phase != ZAPI_INACTIVE){
+ if (TnodePtr.p->phase == ZAPI_ACTIVE){
jam();
TnodePtr.p->alarmCount ++;
-
+
if(TnodePtr.p->alarmCount > 2){
signal->theData[0] = EventReport::MissedHeartbeat;
- signal->theData[1] = TnodePtr.i;
+ signal->theData[1] = nodeId;
signal->theData[2] = TnodePtr.p->alarmCount - 1;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
}
@@ -1725,10 +1615,10 @@ void Qmgr::apiHbHandlingLab(Signal* signal)
/* We call node_failed to release all connections for this api node */
/*------------------------------------------------------------------*/
signal->theData[0] = EventReport::DeadDueToHeartbeat;
- signal->theData[1] = TnodePtr.i;
+ signal->theData[1] = nodeId;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
- node_failed(signal, TnodePtr.i);
+ node_failed(signal, nodeId);
}//if
}//if
}//for
@@ -1748,7 +1638,7 @@ void Qmgr::checkStartInterface(Signal* signal)
if (nodePtr.p->phase == ZFAIL_CLOSING) {
jam();
nodePtr.p->alarmCount = nodePtr.p->alarmCount + 1;
- if (nodePtr.p->m_connected) {
+ if (c_connectedNodes.get(nodePtr.i)){
jam();
/*-------------------------------------------------------------------*/
// We need to ensure that the connection is not restored until it has
@@ -1766,11 +1656,12 @@ void Qmgr::checkStartInterface(Signal* signal)
nodePtr.p->failState = NORMAL;
if (getNodeInfo(nodePtr.i).m_type != NodeInfo::DB){
jam();
- nodePtr.p->phase = ZBLOCKED;
+ nodePtr.p->phase = ZAPI_INACTIVE;
} else {
jam();
nodePtr.p->phase = ZINIT;
}//if
+
nodePtr.p->alarmCount = 0;
signal->theData[0] = 0;
signal->theData[1] = nodePtr.i;
@@ -1908,13 +1799,13 @@ void Qmgr::execNDB_FAILCONF(Signal* signal)
for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++) {
jam();
ptrAss(nodePtr, nodeRec);
- if ((nodePtr.p->phase == ZAPI_ACTIVE) && nodePtr.p->m_connected) {
+ if (nodePtr.p->phase == ZAPI_ACTIVE){
jam();
sendSignal(nodePtr.p->blockRef, GSN_NF_COMPLETEREP, signal,
NFCompleteRep::SignalLength, JBA);
}//if
}//for
- }//if
+ }
return;
}//Qmgr::execNDB_FAILCONF()
@@ -1923,14 +1814,28 @@ void Qmgr::execNDB_FAILCONF(Signal* signal)
/*******************************/
void Qmgr::execDISCONNECT_REP(Signal* signal)
{
+ jamEntry();
const DisconnectRep * const rep = (DisconnectRep *)&signal->theData[0];
- NodeRecPtr failedNodePtr;
+ const Uint32 nodeId = rep->nodeId;
+ c_connectedNodes.clear(nodeId);
- jamEntry();
- failedNodePtr.i = rep->nodeId;
- ptrCheckGuard(failedNodePtr, MAX_NODES, nodeRec);
- failedNodePtr.p->m_connected = false;
- node_failed(signal, failedNodePtr.i);
+ NodeRecPtr nodePtr;
+ nodePtr.i = getOwnNodeId();
+ ptrCheckGuard(nodePtr, MAX_NODES, nodeRec);
+ switch(nodePtr.p->phase){
+ case ZRUNNING:
+ jam();
+ break;
+ case ZINIT:
+ case ZSTARTING:
+ case ZPREPARE_FAIL:
+ case ZFAIL_CLOSING:
+ case ZAPI_ACTIVE:
+ case ZAPI_INACTIVE:
+ ndbrequire(false);
+ }
+
+ node_failed(signal, nodeId);
}//DISCONNECT_REP
void Qmgr::node_failed(Signal* signal, Uint16 aFailedNode)
@@ -1957,6 +1862,9 @@ void Qmgr::node_failed(Signal* signal, Uint16 aFailedNode)
case ZFAIL_CLOSING:
jam();
return;
+ case ZSTARTING:
+ c_start.reset();
+ // Fall-through
default:
jam();
/*---------------------------------------------------------------------*/
@@ -1987,11 +1895,11 @@ void Qmgr::node_failed(Signal* signal, Uint16 aFailedNode)
jam();
if (failedNodePtr.p->phase != ZFAIL_CLOSING){
jam();
- //--------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
// The API was active and has now failed. We need to initiate API failure
// handling. If the API had already failed then we can ignore this
// discovery.
- //--------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
failedNodePtr.p->phase = ZFAIL_CLOSING;
sendApiFailReq(signal, aFailedNode);
@@ -2056,11 +1964,6 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
apiRegConf->qmgrRef = reference();
apiRegConf->apiHeartbeatFrequency = (chbApiDelay / 10);
apiRegConf->version = NDB_VERSION;
-
-
- // if(apiNodePtr.i == getNodeState.single. && NodeState::SL_MAINTENANCE)
- // apiRegConf->nodeState = NodeState::SL_STARTED;
- //else
apiRegConf->nodeState = getNodeState();
{
NodeRecPtr nodePtr;
@@ -2079,7 +1982,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
if ((getNodeState().startLevel == NodeState::SL_STARTED ||
getNodeState().getSingleUserMode())
- && apiNodePtr.p->phase == ZBLOCKED) {
+ && apiNodePtr.p->phase == ZAPI_INACTIVE) {
jam();
/**----------------------------------------------------------------------
* THE API NODE IS REGISTERING. WE WILL ACCEPT IT BY CHANGING STATE AND
@@ -2186,15 +2089,6 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
failReport(signal, failedNodePtr.i, (UintR)ZTRUE, aFailCause);
if (cpresident == getOwnNodeId()) {
jam();
- if (cpresidentBusy == ZTRUE) {
- jam();
-/**-------------------------------------------------------------------
-* ALL STARTING NODES ARE CRASHED WHEN AN ALIVE NODE FAILS DURING ITS
-* START-UP. AS PRESIDENT OF THE CLUSTER IT IS OUR DUTY TO INFORM OTHERS
-* ABOUT THIS.
-*---------------------------------------------------------------------*/
- failReport(signal, cstartNode, (UintR)ZTRUE, FailRep::ZOTHER_NODE_WHEN_WE_START);
- }//if
if (ctoStatus == Q_NOT_ACTIVE) {
jam();
/**--------------------------------------------------------------------
@@ -2525,9 +2419,7 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
return;
}//if
UintR guard0;
- UintR Ti;
UintR Tj;
- RegAppPtr localRegAppptr;
/**
* Block commit until node failures has stabilized
@@ -2547,37 +2439,19 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
* SIGNAL. WE CAN HEAR IT SEVERAL TIMES IF THE PRESIDENTS KEEP FAILING.
*-----------------------------------------------------------------------*/
ccommitFailureNr = TfailureNr;
- for (localRegAppptr.i = 0;
- localRegAppptr.i < NO_REG_APP; localRegAppptr.i++) {
+ NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
+
+ nodeFail->failNo = ccommitFailureNr;
+ nodeFail->noOfNodes = cnoCommitFailedNodes;
+ nodeFail->masterNodeId = cpresident;
+ NodeBitmask::clear(nodeFail->theNodes);
+ for(unsigned i = 0; i < cnoCommitFailedNodes; i++) {
jam();
- ptrAss(localRegAppptr, regApp);
- if (localRegAppptr.p->activity != ZREMOVE) {
- /*------------------------------------------------------------------*/
- // We need to remove the failed nodes from the set of running nodes
- // in the registered application.
- //------------------------------------------------------------------*/
- for (Ti = 0; Ti < cnoCommitFailedNodes; Ti++) {
- jam();
- arrGuard(ccommitFailedNodes[Ti], MAX_NDB_NODES);
- localRegAppptr.p->m_runNodes.clear(ccommitFailedNodes[Ti]);
- }//for
- /*------------------------------------------------------------------*/
- // Send a signal to the registered application to inform him of the
- // node failure(s).
- /*------------------------------------------------------------------*/
- NodeFailRep * const nodeFail = (NodeFailRep *)&signal->theData[0];
+ NodeBitmask::set(nodeFail->theNodes, ccommitFailedNodes[i]);
+ }//if
+ sendSignal(NDBCNTR_REF, GSN_NODE_FAILREP, signal,
+ NodeFailRep::SignalLength, JBB);
- nodeFail->failNo = ccommitFailureNr;
- nodeFail->noOfNodes = cnoCommitFailedNodes;
- NodeBitmask::clear(nodeFail->theNodes);
- for(unsigned i = 0; i < cnoCommitFailedNodes; i++) {
- jam();
- NodeBitmask::set(nodeFail->theNodes, ccommitFailedNodes[i]);
- }//if
- sendSignal(localRegAppptr.p->blockref, GSN_NODE_FAILREP, signal,
- NodeFailRep::SignalLength, JBB);
- }//if
- }//for
guard0 = cnoCommitFailedNodes - 1;
arrGuard(guard0, MAX_NDB_NODES);
/**--------------------------------------------------------------------
@@ -2591,6 +2465,7 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
nodePtr.p->phase = ZFAIL_CLOSING;
nodePtr.p->failState = WAITING_FOR_NDB_FAILCONF;
nodePtr.p->alarmCount = 0;
+ c_clusterNodes.clear(nodePtr.i);
}//for
/*----------------------------------------------------------------------*/
/* WE INFORM THE API'S WE HAVE CONNECTED ABOUT THE FAILED NODES. */
@@ -2753,226 +2628,31 @@ void Qmgr::execPRES_TOCONF(Signal* signal)
/*--------------------------------------------------------------------------*/
void Qmgr::execREAD_NODESREQ(Signal* signal)
{
- NodeRecPtr nodePtr;
- UintR TnoOfNodes = 0;
+ jamEntry();
+
BlockReference TBref = signal->theData[0];
ReadNodesConf * const readNodes = (ReadNodesConf *)&signal->theData[0];
- NodeBitmask::clear(readNodes->allNodes);
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (getNodeInfo(nodePtr.i).getType() == NodeInfo::DB){
- jam();
- TnoOfNodes++;
- NodeBitmask::set(readNodes->allNodes, nodePtr.i);
- }//if
- }//for
- readNodes->noOfNodes = TnoOfNodes;
- sendSignal(TBref, GSN_READ_NODESCONF, signal,
- ReadNodesConf::SignalLength, JBB);
-}//Qmgr::execREAD_NODESREQ()
-/*--------------------------------------------------------------------------
- * Signal from an application requesting to be monitored in the cluster.
- * APPL_REGREQ can be entered at any time during the life of the QMGR.
- * It can be entered any number of times.
- * If QMGR is ZRUNNING a CM_APPCHG will be sent to all active nodes.
- *---------------------------------------------------------------------------*/
-void Qmgr::execAPPL_REGREQ(Signal* signal)
-{
NodeRecPtr nodePtr;
- NodeRecPtr myNodePtr;
- RegAppPtr lRegApptr;
- char Tappname[16];
- jamEntry();
- BlockReference Tappref = signal->theData[0];
- Tappname[0] = signal->theData[1] >> 8;
- Tappname[1] = signal->theData[2];
- Tappname[2] = signal->theData[2] >> 8;
- Tappname[3] = signal->theData[3];
- Tappname[4] = signal->theData[3] >> 8;
- Tappname[5] = signal->theData[4];
- Tappname[6] = signal->theData[4] >> 8;
- Tappname[7] = signal->theData[5];
- Tappname[8] = signal->theData[5] >> 8;
- Tappname[9] = signal->theData[6];
- Tappname[10] = signal->theData[6] >> 8;
- Tappname[11] = signal->theData[7];
- Tappname[12] = signal->theData[7] >> 8;
- Tappname[13] = signal->theData[8];
- Tappname[14] = signal->theData[8] >> 8;
- Tappname[signal->theData[1] & 0xFF] = 0;
- UintR Tversion = signal->theData[10];
- Uint16 Tnodeno = refToNode(Tappref);
- if (Tnodeno == 0) {
- jam();
- /* Fix for all not distributed applications. */
- Tnodeno = getOwnNodeId();
- }//if
- if (getOwnNodeId() == Tnodeno) {
- jam();
- /* Local application */
- UintR Tfound = RNIL;
- for (lRegApptr.i = NO_REG_APP-1; (Uint16)~lRegApptr.i; lRegApptr.i--) {
- jam();
- ptrAss(lRegApptr, regApp);
- if (lRegApptr.p->activity == ZREMOVE) {
- Tfound = lRegApptr.i;
- break;
- }//if
- }//for
- if (Tfound != RNIL) {
- jam();
- /* If there was a slot available we */
- /* register the application */
- lRegApptr.i = Tfound;
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- lRegApptr.p->blockref = Tappref;
- strcpy(lRegApptr.p->name, Tappname);
- lRegApptr.p->version = Tversion;
- lRegApptr.p->activity = ZADD;
- myNodePtr.i = getOwnNodeId();
- ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
- /****************************<*/
- /*< APPL_REGCONF <*/
- /****************************<*/
- signal->theData[0] = lRegApptr.i;
- signal->theData[1] = cnoOfNodes;
- signal->theData[2] = cpresident;
- signal->theData[3] = myNodePtr.p->ndynamicId;
- sendSignal(lRegApptr.p->blockref, GSN_APPL_REGCONF, signal, 4, JBB);
- if (myNodePtr.p->phase == ZRUNNING) {
- jam();
- /* Check to see if any further action */
- for (nodePtr.i = 1;
- nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- /* is needed at this time */
- if (nodePtr.p->phase == ZRUNNING) {
- jam();
- sendappchg(signal, lRegApptr.i, nodePtr.i);
- }//if
- }//for
- }//if
- } else {
- jam();
- /****************************<*/
- /*< APPL_REGREF <*/
- /****************************<*/
- signal->theData[0] = ZERRTOOMANY;
- sendSignal(Tappref, GSN_APPL_REGREF, signal, 1, JBB);
- }//if
- } else {
- jam();
- /* TOO MANY REGISTERED APPLICATIONS */
- systemErrorLab(signal);
- }//if
- return;
-}//Qmgr::execAPPL_REGREQ()
-
-/*
-4.4.11 APPL_STARTREG */
-/**--------------------------------------------------------------------------
- * Signal from an application indicating that it is ready to start running
- * distributed. If the application is running alone or if all other
- * applications of the same kind already have registered as STARTING then
- * APPL_STARTCONF will be sent to the application as soon as phase four of
- * STTOR is reached.
- *--------------------------------------------------------------------------*/
-/*******************************/
-/* APPL_STARTREG */
-/*******************************/
-void Qmgr::execAPPL_STARTREG(Signal* signal)
-{
- RegAppPtr lRegApptr;
- NodeRecPtr myNodePtr;
- UintR TnodeId;
- jamEntry();
- lRegApptr.i = signal->theData[0];
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- UintR Tcounter = signal->theData[1];
+ nodePtr.i = getOwnNodeId();
+ ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
- lRegApptr.p->activity = ZSTART;
- /* Application is ready to start. */
+ NdbNodeBitmask tmp = c_definedNodes;
+ tmp.bitANDC(c_clusterNodes);
- /* Calculate how many apps we wait for */
- lRegApptr.p->noofapps = (Tcounter - 1) - lRegApptr.p->noofpending;
- /* send info to all other running nodes in the */
- myNodePtr.i = getOwnNodeId();
- ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
- /* cluster indicating the status change of the */
- if (myNodePtr.p->phase == ZRUNNING) {
- /* application. */
- for (TnodeId = 1; TnodeId < MAX_NDB_NODES; TnodeId++) {
- jam();
- if (lRegApptr.p->m_runNodes.get(TnodeId)){
- jam();
- sendappchg(signal, lRegApptr.i, TnodeId);
- }//if
- }//for
- }//if
- /****************************<*/
- /*< APPL_STARTCONF <*/
- /****************************<*/
- if (lRegApptr.p->noofapps == 0) {
- jam();
- sendSignal(lRegApptr.p->blockref, GSN_APPL_STARTCONF, signal, 1, JBB);
- }//if
- return;
-}//Qmgr::execAPPL_STARTREG()
-
-/*
- 4.4.11 APPL_RUN */
-/*--------------------------------------------------------------------------*/
-/* Signal from an application announcing that it is running. */
-/*--------------------------------------------------------------------------*/
-/*******************************/
-/* APPL_RUN */
-/*******************************/
-void Qmgr::execAPPL_RUN(Signal* signal)
-{
- RegAppPtr lRegApptr;
- NodeRecPtr myNodePtr;
- UintR TnodeId;
- jamEntry();
- lRegApptr.i = signal->theData[0];
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- lRegApptr.p->activity = ZRUN;
- /* Flag the application as running. */
- myNodePtr.i = getOwnNodeId();
- ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
- if (myNodePtr.p->phase == ZRUNNING) {
- /* If we are running send the appl. status */
- for (TnodeId = 1; TnodeId < MAX_NDB_NODES; TnodeId++) {
- jam();
- /* change to all other running nodes. */
- if (lRegApptr.p->m_runNodes.get(TnodeId)){
- jam();
- sendappchg(signal, lRegApptr.i, TnodeId);
- }//if
- }//for
- }//if
- /****************************<*/
- /*< CM_RUN <*/
- /****************************<*/
- /*---------------------------------------------------*/
- /* Inform the CLUSTER CONTROL of NDB started */
- /* so we can connect to API nodes. */
- /*---------------------------------------------------*/
- signal->theData[0] = 1;
- sendSignal(CMVMI_REF, GSN_CM_RUN, signal, 1, JBB);
- cactivateApiCheck = 1;
- /**
- * Start arbitration thread. This could be done as soon as
- * we have all nodes (or a winning majority).
- */
- if (cpresident == getOwnNodeId())
- handleArbitStart(signal);
- return;
-}//Qmgr::execAPPL_RUN()
+ readNodes->noOfNodes = c_definedNodes.count();
+ readNodes->masterNodeId = cpresident;
+ readNodes->ndynamicId = nodePtr.p->ndynamicId;
+ c_definedNodes.copyto(NdbNodeBitmask::Size, readNodes->definedNodes);
+ c_clusterNodes.copyto(NdbNodeBitmask::Size, readNodes->clusterNodes);
+ tmp.copyto(NdbNodeBitmask::Size, readNodes->inactiveNodes);
+ NdbNodeBitmask::clear(readNodes->startingNodes);
+ NdbNodeBitmask::clear(readNodes->startedNodes);
+ sendSignal(TBref, GSN_READ_NODESCONF, signal,
+ ReadNodesConf::SignalLength, JBB);
+}//Qmgr::execREAD_NODESREQ()
void Qmgr::systemErrorBecauseOtherNodeFailed(Signal* signal,
NodeId failedNodeId) {
@@ -3003,234 +2683,6 @@ void Qmgr::systemErrorLab(Signal* signal, const char * message)
return;
}//Qmgr::systemErrorLab()
-/*
-4.4.11 CM_APPCHG */
-/*---------------------------------------------------------------------------*/
-/*Signal between two QMGRs used to announce any changes of state for an appl.*/
-/*---------------------------------------------------------------------------*/
-/*******************************/
-/* CM_APPCHG */
-/*******************************/
-void Qmgr::execCM_APPCHG(Signal* signal)
-{
- RegAppPtr lRegApptr;
- char Tappname[16];
- jamEntry();
- UintR Ttype = signal->theData[0];
- Uint16 Tnodeno = signal->theData[1];
- Tappname[0] = signal->theData[2] >> 8;
- Tappname[1] = signal->theData[3];
- Tappname[2] = signal->theData[3] >> 8;
- Tappname[3] = signal->theData[4];
- Tappname[4] = signal->theData[4] >> 8;
- Tappname[5] = signal->theData[5];
- Tappname[6] = signal->theData[5] >> 8;
- Tappname[7] = signal->theData[6];
- Tappname[8] = signal->theData[6] >> 8;
- Tappname[9] = signal->theData[7];
- Tappname[10] = signal->theData[7] >> 8;
- Tappname[11] = signal->theData[8];
- Tappname[12] = signal->theData[8] >> 8;
- Tappname[13] = signal->theData[9];
- Tappname[14] = signal->theData[9] >> 8;
- Tappname[signal->theData[2] & 0xFF] = 0;
- UintR Tversion = signal->theData[11];
- switch (Ttype) {
- case ZADD:
- jam();
- /* A new application has started on the sending node */
- for (lRegApptr.i = NO_REG_APP-1; (Uint16)~lRegApptr.i; lRegApptr.i--) {
- jam();
- /* We are hosting this application */
- ptrAss(lRegApptr, regApp);
- if (strcmp(lRegApptr.p->name, Tappname) == 0) {
- cmappAdd(signal, lRegApptr.i, Tnodeno, Ttype, Tversion);
- }//if
- }//for
- break;
-
- case ZSTART:
- jam();
- /* A registered application is ready to start on the sending node */
- for (lRegApptr.i = NO_REG_APP-1; (Uint16)~lRegApptr.i; lRegApptr.i--) {
- jam();
- ptrAss(lRegApptr, regApp);
- if (strcmp(lRegApptr.p->name, Tappname) == 0) {
- cmappStart(signal, lRegApptr.i, Tnodeno, Ttype, Tversion);
- }//if
- }//for
- break;
-
- case ZRUN:
- /* A registered application on the sending node has started to run */
- jam();
- for (lRegApptr.i = NO_REG_APP-1; (Uint16)~lRegApptr.i; lRegApptr.i--) {
- jam();
- ptrAss(lRegApptr, regApp);
- if (strcmp(lRegApptr.p->name, Tappname) == 0) {
- arrGuard(Tnodeno, MAX_NDB_NODES);
- lRegApptr.p->m_runNodes.set(Tnodeno);
- applchangerep(signal, lRegApptr.i, Tnodeno, Ttype, Tversion);
- }//if
- }//for
- cacceptRegreq = ZTRUE; /* We can now start accepting new CM_REGREQ */
- /* since the new node is running */
- break;
-
- case ZREMOVE:
- /* A registered application has been deleted on the sending node */
- jam();
- for (lRegApptr.i = NO_REG_APP-1; (Uint16)~lRegApptr.i; lRegApptr.i--) {
- jam();
- ptrAss(lRegApptr, regApp);
- if (strcmp(lRegApptr.p->name, Tappname) == 0) {
- applchangerep(signal, lRegApptr.i, Tnodeno, Ttype, Tversion);
- }//if
- }//for
- break;
-
- default:
- jam();
- /*empty*/;
- break;
- }//switch
- return;
-}//Qmgr::execCM_APPCHG()
-
-/**--------------------------------------------------------------------------
- * INPUT REG_APPPTR
- * TNODENO
- *--------------------------------------------------------------------------*/
-void Qmgr::applchangerep(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion)
-{
- RegAppPtr lRegApptr;
- NodeRecPtr localNodePtr;
- lRegApptr.i = aRegApp;
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- if (lRegApptr.p->blockref != 0) {
- jam();
- localNodePtr.i = aNode;
- ptrCheckGuard(localNodePtr, MAX_NDB_NODES, nodeRec);
- /****************************************/
- /* Send a report of changes on another */
- /* node to the local application */
- /****************************************/
- signal->theData[0] = aType;
- signal->theData[1] = aVersion;
- signal->theData[2] = localNodePtr.i;
- signal->theData[4] = localNodePtr.p->ndynamicId;
- sendSignal(lRegApptr.p->blockref, GSN_APPL_CHANGEREP, signal, 5, JBB);
- }//if
-}//Qmgr::applchangerep()
-
-/*
- 4.10.7 CMAPP_ADD */
-/**--------------------------------------------------------------------------
- * We only map applications of the same version. We have the same application
- * and version locally.
- * INPUT REG_APPPTR
- * TNODENO Sending node
- * TVERSION Version of application
- * OUTPUT REG_APPPTR, TNODENO ( not changed)
- *---------------------------------------------------------------------------*/
-void Qmgr::cmappAdd(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion)
-{
- RegAppPtr lRegApptr;
- lRegApptr.i = aRegApp;
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- if (lRegApptr.p->version == aVersion) {
- jam();
- arrGuard(aNode, MAX_NDB_NODES);
- if (lRegApptr.p->m_runNodes.get(aNode) == false){
- jam();
- /* Check if we already have added it. */
- /*-------------------------------------------------------*/
- /* Since we only add remote applications, if we also are */
- /* hosting them we need to send a reply indicating that */
- /* we also are hosting the application. */
- /*-------------------------------------------------------*/
- sendappchg(signal, lRegApptr.i, aNode);
- lRegApptr.p->m_runNodes.set(aNode);
- /*---------------------------------------*/
- /* Add the remote node to the the local */
- /* nodes memberlist. */
- /* Inform the local application of the */
- /* new application running remotely. */
- /*---------------------------------------*/
- applchangerep(signal, lRegApptr.i, aNode, aType, aVersion);
- }//if
- }//if
-}//Qmgr::cmappAdd()
-
-/*
-4.10.7 CMAPP_START */
-/**--------------------------------------------------------------------------
- * Inform the local application of the change in node state on the remote node
- * INPUT REG_APPPTR
- * OUTPUT -
- *---------------------------------------------------------------------------*/
-void Qmgr::cmappStart(Signal* signal,
- UintR aRegApp,
- Uint16 aNode,
- UintR aType,
- UintR aVersion)
-{
- RegAppPtr lRegApptr;
- lRegApptr.i = aRegApp;
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- if (lRegApptr.p->version == aVersion) {
- applchangerep(signal, lRegApptr.i, aNode, aType, aVersion);
- if (lRegApptr.p->activity == ZSTART) {
- jam();
- //----------------------------------------
- /* If the local application is already */
- /* in START face then we do some checks.*/
- //----------------------------------------
- if (lRegApptr.p->noofapps > 0) {
- jam();
- //----------------------------------------
- /* Check if we need to decrement the no */
- /* of apps. */
- /* This indicates how many startsignals */
- /* from apps remaining before we can */
- /* send a APPL_STARTCONF. */
- //----------------------------------------
- lRegApptr.p->noofapps--;
- }//if
- if (lRegApptr.p->noofapps == 0) {
- jam();
- //----------------------------------------
- /* All applications have registered as */
- /* ready to start. */
- //----------------------------------------
- /****************************<*/
- /*< APPL_STARTCONF <*/
- /****************************<*/
- sendSignal(lRegApptr.p->blockref, GSN_APPL_STARTCONF, signal, 1, JBB);
- }//if
- } else {
- jam();
- /**--------------------------------------------------------------------
- * Add the ready node to the nodes pending counter.
- * This counter is used to see how many remote nodes that are waiting
- * for this node to enter the start face.
- * It is used when the appl. sends a APPL_STARTREG signal.
- *---------------------------------------------------------------------*/
- if (lRegApptr.p->activity == ZADD) {
- jam();
- lRegApptr.p->noofpending++;
- }//if
- }//if
- }//if
-}//Qmgr::cmappStart()
/**---------------------------------------------------------------------------
* A FAILURE HAVE BEEN DISCOVERED ON A NODE. WE NEED TO CLEAR A
@@ -3249,17 +2701,6 @@ void Qmgr::failReport(Signal* signal,
failedNodePtr.i = aFailedNode;
ptrCheckGuard(failedNodePtr, MAX_NDB_NODES, nodeRec);
- if (((cpresidentBusy == ZTRUE) ||
- (cacceptRegreq == ZFALSE)) &&
- (cstartNode == aFailedNode)) {
- jam();
-/*----------------------------------------------------------------------*/
-// A node crashed keeping the president busy and that ensures that there
-// is no acceptance of regreq's which is not acceptable after its crash.
-/*----------------------------------------------------------------------*/
- cpresidentBusy = ZFALSE;
- cacceptRegreq = ZTRUE;
- }//if
if (failedNodePtr.p->phase == ZRUNNING) {
jam();
/* WE ALSO NEED TO ADD HERE SOME CODE THAT GETS OUR NEW NEIGHBOURS. */
@@ -3278,8 +2719,6 @@ void Qmgr::failReport(Signal* signal,
}//if
}//if
failedNodePtr.p->phase = ZPREPARE_FAIL;
- failedNodePtr.p->sendCmAddPrepStatus = Q_NOT_ACTIVE;
- failedNodePtr.p->sendCmAddCommitStatus = Q_NOT_ACTIVE;
failedNodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
failedNodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
failedNodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
@@ -3412,74 +2851,6 @@ Uint16 Qmgr::translateDynamicIdToNodeId(Signal* signal, UintR TdynamicId)
return TtdiNodeId;
}//Qmgr::translateDynamicIdToNodeId()
-
-/*
-4.10.7 GET_DYNAMIC_ID */
-/**--------------------------------------------------------------------------
- * FIND THE CLOSEST HIGHER DYNAMIC ID AMONG THE RUNNING NODES. ADD ONE TO
- * THAT VALUE AND WE HAVE CREATED A NEW, UNIQUE AND HIGHER DYNAMIC VALUE THAN
- * ANYONE ELSE IN THE CLUSTER.THIS WAY WE DON'T HAVE TO KEEP TRACK OF VARIABLE
- * THAT HOLDS THE LAST USED DYNAMIC ID, ESPECIALLY WE DON'T NEED TO INFORM
- * ANY VICE PRESIDENTS ABOUT THAT DYNAMIC VARIABLE.
- * INPUT -
- * RET CDYNAMIC_ID USED AS A TEMPORARY VARIABLE TO PASS THE VALUE TO THE
- * CALLER OF THIS SUBROUTINE
- *---------------------------------------------------------------------------*/
-UintR Qmgr::getDynamicId(Signal* signal)
-{
- NodeRecPtr nodePtr;
- UintR TdynamicId = 0;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRec);
- if (nodePtr.p->phase == ZRUNNING) {
- if (nodePtr.p->ndynamicId > TdynamicId) {
- jam();
- TdynamicId = nodePtr.p->ndynamicId;
- }//if
- }//if
- }//for
- TdynamicId++;
- return TdynamicId;
-}//Qmgr::getDynamicId()
-
-/*
-4.10.7 SENDAPPCHG */
-/*---------------------------------------------------------------------------*/
-/* We only send changes to external nodes. */
-/* INPUT: TNODENO */
-/* REG_APPPTR */
-/*---------------------------------------------------------------------------*/
-void Qmgr::sendappchg(Signal* signal, UintR aRegApp, Uint16 aNode)
-{
- NodeRecPtr localNodePtr;
- RegAppPtr lRegApptr;
- if (aNode != getOwnNodeId()) {
- jam();
- localNodePtr.i = aNode;
- ptrCheckGuard(localNodePtr, MAX_NDB_NODES, nodeRec);
- lRegApptr.i = aRegApp;
- ptrCheckGuard(lRegApptr, NO_REG_APP, regApp);
- /****************************************/
- /* Signal any application changes to */
- /* the receiving node */
- /****************************************/
- signal->theData[0] = lRegApptr.p->activity;
- signal->theData[1] = getOwnNodeId();
- signal->theData[2] = strlen(lRegApptr.p->name)|(lRegApptr.p->name[0] << 8);
- signal->theData[3] = lRegApptr.p->name[1] | (lRegApptr.p->name[2] << 8);
- signal->theData[4] = lRegApptr.p->name[3] | (lRegApptr.p->name[4] << 8);
- signal->theData[5] = lRegApptr.p->name[5] | (lRegApptr.p->name[6] << 8);
- signal->theData[6] = lRegApptr.p->name[7] | (lRegApptr.p->name[8] << 8);
- signal->theData[7] = lRegApptr.p->name[9] | (lRegApptr.p->name[10] << 8);
- signal->theData[8] = lRegApptr.p->name[11] | (lRegApptr.p->name[12] << 8);
- signal->theData[9] = lRegApptr.p->name[13] | (lRegApptr.p->name[14] << 8);
- signal->theData[10] = 0;
- signal->theData[11] = lRegApptr.p->version;
- sendSignal(localNodePtr.p->blockRef, GSN_CM_APPCHG, signal, 12, JBA);
- }//if
-}//Qmgr::sendappchg()
-
/**--------------------------------------------------------------------------
* WHEN RECEIVING PREPARE FAILURE REQUEST WE WILL IMMEDIATELY CLOSE
* COMMUNICATION WITH ALL THOSE NODES.
@@ -4450,14 +3821,10 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
{
switch (signal->theData[0]) {
case 1:
- infoEvent("creadyDistCom = %d, cpresident = %d, cpresidentBusy = %d\n",
- creadyDistCom, cpresident, cpresidentBusy);
- infoEvent("cacceptRegreq = %d, ccm_infoconfCounter = %d\n",
- cacceptRegreq, ccm_infoconfCounter);
- infoEvent("cstartNo = %d, cstartNode = %d, cwaitC..phase1 = %d\n",
- cstartNo, cstartNode, cwaitContinuebPhase1);
- infoEvent("cwaitC..phase2 = %d, cpresidentAlive = %d, cpresidentCand = %d\n"
- ,cwaitContinuebPhase2, cpresidentAlive, cpresidentCandidate);
+ infoEvent("creadyDistCom = %d, cpresident = %d\n",
+ creadyDistCom, cpresident);
+ infoEvent("cpresidentAlive = %d, cpresidentCand = %d\n",
+ cpresidentAlive, cpresidentCandidate);
infoEvent("ctoStatus = %d\n", ctoStatus);
for(Uint32 i = 1; i<MAX_NDB_NODES; i++){
if(getNodeInfo(i).getType() == NodeInfo::DB){
@@ -4469,18 +3836,15 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
case ZINIT:
sprintf(buf, "Node %d: ZINIT(%d)", i, nodePtr.p->phase);
break;
- case ZBLOCKED:
- sprintf(buf, "Node %d: ZBLOCKED(%d)", i, nodePtr.p->phase);
- break;
- case ZWAITING:
- sprintf(buf, "Node %d: ZWAITING(%d)", i, nodePtr.p->phase);
- break;
- case ZWAIT_PRESIDENT:
- sprintf(buf, "Node %d: ZWAIT_PRESIDENT(%d)", i, nodePtr.p->phase);
+ case ZSTARTING:
+ sprintf(buf, "Node %d: ZSTARTING(%d)", i, nodePtr.p->phase);
break;
case ZRUNNING:
sprintf(buf, "Node %d: ZRUNNING(%d)", i, nodePtr.p->phase);
break;
+ case ZPREPARE_FAIL:
+ sprintf(buf, "Node %d: ZPREPARE_FAIL(%d)", i, nodePtr.p->phase);
+ break;
case ZFAIL_CLOSING:
sprintf(buf, "Node %d: ZFAIL_CLOSING(%d)", i, nodePtr.p->phase);
break;
@@ -4490,9 +3854,6 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
case ZAPI_ACTIVE:
sprintf(buf, "Node %d: ZAPI_ACTIVE(%d)", i, nodePtr.p->phase);
break;
- case ZPREPARE_FAIL:
- sprintf(buf, "Node %d: ZPREPARE_FAIL(%d)", i, nodePtr.p->phase);
- break;
default:
sprintf(buf, "Node %d: <UNKNOWN>(%d)", i, nodePtr.p->phase);
break;
@@ -4507,6 +3868,7 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
void Qmgr::execSET_VAR_REQ(Signal* signal)
{
+#if 0
SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0];
ConfigParamId var = setVarReq->variable();
UintR val = setVarReq->value();
@@ -4530,4 +3892,5 @@ void Qmgr::execSET_VAR_REQ(Signal* signal)
default:
sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB);
}// switch
+#endif
}//execSET_VAR_REQ()
diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am
new file mode 100644
index 00000000000..4dacb22af51
--- /dev/null
+++ b/ndb/src/kernel/blocks/suma/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libsuma.a
+
+libsuma_a_SOURCES = Suma.cpp SumaInit.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/suma/Makefile b/ndb/src/kernel/blocks/suma/Makefile_old
index 20014c94670..20014c94670 100644
--- a/ndb/src/kernel/blocks/suma/Makefile
+++ b/ndb/src/kernel/blocks/suma/Makefile_old
diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am
new file mode 100644
index 00000000000..803da815cf0
--- /dev/null
+++ b/ndb/src/kernel/blocks/trix/Makefile.am
@@ -0,0 +1,9 @@
+noinst_LIBRARIES = libtrix.a
+
+libtrix_a_SOURCES = Trix.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/blocks/trix/Makefile b/ndb/src/kernel/blocks/trix/Makefile_old
index 5ac0da11f33..5ac0da11f33 100644
--- a/ndb/src/kernel/blocks/trix/Makefile
+++ b/ndb/src/kernel/blocks/trix/Makefile_old
diff --git a/ndb/src/kernel/blocks/trix/Trix.hpp b/ndb/src/kernel/blocks/trix/Trix.hpp
index 05563559b77..f096e135094 100644
--- a/ndb/src/kernel/blocks/trix/Trix.hpp
+++ b/ndb/src/kernel/blocks/trix/Trix.hpp
@@ -39,6 +39,15 @@ public:
Trix(const class Configuration & conf);
virtual ~Trix();
+public:
+ // Subscription data, when communicating with SUMA
+
+ enum RequestType {
+ TABLE_REORG = 0,
+ INDEX_BUILD = 1
+ };
+ typedef DataBuffer<11> AttrOrderBuffer;
+
private:
// Private attributes
@@ -87,14 +96,6 @@ private:
Uint16 c_noNodesFailed;
Uint16 c_noActiveNodes;
- // Subscription data, when communicating with SUMA
- enum RequestType {
- TABLE_REORG = 0,
- INDEX_BUILD = 1
- };
-
- typedef DataBuffer<11> AttrOrderBuffer;
-
AttrOrderBuffer::DataBufferPool c_theAttrOrderBufferPool;
struct SubscriptionRecord {
diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp
index 56627cba46f..20a9dd8a993 100644
--- a/ndb/src/kernel/error/ErrorReporter.cpp
+++ b/ndb/src/kernel/error/ErrorReporter.cpp
@@ -40,8 +40,8 @@ const char* errorType[] = {
static int WriteMessage(ErrorCategory thrdType, int thrdMessageID,
const char* thrdProblemData,
const char* thrdObjRef,
- Uint32 thrdTheEmulatedJamIndex = 0,
- Uint8 thrdTheEmulatedJam[] = 0);
+ Uint32 thrdTheEmulatedJamIndex,
+ Uint8 thrdTheEmulatedJam[]);
static void dumpJam(FILE* jamStream,
Uint32 thrdTheEmulatedJamIndex,
@@ -157,21 +157,18 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line)
{
char refMessage[100];
-#ifdef USE_EMULATED_JAM
+#ifdef NO_EMULATED_JAM
+ snprintf(refMessage, 100, "file: %s lineNo: %d",
+ file, line);
+#else
const Uint32 blockNumber = theEmulatedJamBlockNumber;
const char *blockName = getBlockName(blockNumber);
snprintf(refMessage, 100, "%s line: %d (block: %s)",
file, line, blockName);
-
+#endif
WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage,
theEmulatedJamIndex, theEmulatedJam);
-#else
- snprintf(refMessage, 100, "file: %s lineNo: %d",
- file, line);
-
- WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage);
-#endif
NdbShutdown(NST_ErrorHandler);
}
@@ -199,12 +196,8 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
// The value for type is not always set correctly in the calling function.
// So, to correct this, we set it set it to the value corresponding to
// the function that is called.
-#ifdef USE_EMULATED_JAM
WriteMessage(type, messageID, problemData,
objRef, theEmulatedJamIndex, theEmulatedJam);
-#else
- WriteMessage(type, messageID, problemData, objRef);
-#endif
if(messageID == ERR_ERROR_INSERT){
NdbShutdown(NST_ErrorInsert);
} else {
@@ -212,9 +205,6 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
}
}
-// This is the function to write the error-message,
-// when the USE_EMULATED_JAM-flag is set
-// during compilation.
int
WriteMessage(ErrorCategory thrdType, int thrdMessageID,
const char* thrdProblemData, const char* thrdObjRef,
@@ -302,9 +292,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID,
// ...and "dump the jam" there.
// ErrorReporter::dumpJam(jamStream);
if(thrdTheEmulatedJam != 0){
-#ifdef USE_EMULATED_JAM
dumpJam(jamStream, thrdTheEmulatedJamIndex, thrdTheEmulatedJam);
-#endif
}
/* Dont print the jobBuffers until a way to copy them,
@@ -325,7 +313,7 @@ void
dumpJam(FILE *jamStream,
Uint32 thrdTheEmulatedJamIndex,
Uint8 thrdTheEmulatedJam[]) {
-#ifdef USE_EMULATED_JAM
+#ifndef NO_EMULATED_JAM
// print header
const int maxaddr = 8;
fprintf(jamStream, "JAM CONTENTS up->down left->right ?=not block entry\n");
@@ -392,5 +380,5 @@ dumpJam(FILE *jamStream,
}
fprintf(jamStream, "\n");
fflush(jamStream);
-#endif // USE_EMULATED_JAM
+#endif // ifndef NO_EMULATED_JAM
}
diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp
index 20340a9602f..b43b30f1873 100644
--- a/ndb/src/kernel/error/ErrorReporter.hpp
+++ b/ndb/src/kernel/error/ErrorReporter.hpp
@@ -37,21 +37,13 @@
ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
#ifdef NDEBUG
-
#define NDB_ASSERT(trueToContinue, message)
-#define THREAD_ASSERT(trueToContinue, message)
-
#else
-
#define NDB_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \
ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
-
-#define THREAD_ASSERT(trueToContinue, message) \
- if ( !(trueToContinue) ) { \
- ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
-
#endif
+
// Description:
// This macro is used to report programming errors.
// Parameters:
diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am
new file mode 100644
index 00000000000..4514d2d105c
--- /dev/null
+++ b/ndb/src/kernel/error/Makefile.am
@@ -0,0 +1,11 @@
+noinst_LIBRARIES = liberror.a
+
+liberror_a_SOURCES = TimeModule.cpp \
+ ErrorReporter.cpp \
+ ErrorMessages.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/error/Makefile b/ndb/src/kernel/error/Makefile_old
index 0fe81f083ce..0fe81f083ce 100644
--- a/ndb/src/kernel/error/Makefile
+++ b/ndb/src/kernel/error/Makefile_old
diff --git a/ndb/src/kernel/ndb-main/Makefile b/ndb/src/kernel/ndb-main/Makefile
deleted file mode 100644
index 29b7ea7e708..00000000000
--- a/ndb/src/kernel/ndb-main/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-include .defs.mk
-
-TYPE := kernel
-
-BIN_TARGET := ndb
-BIN_TARGET_ARCHIVES := mgmapi \
- cmvmi dbacc dbdict dbdih dblqh dbtc \
- dbtup ndbfs ndbcntr qmgr trix backup dbutil suma grep dbtux \
- transporter \
- kernel \
- error \
- trace \
- signaldataprint \
- mgmsrvcommon \
- portlib \
- logger \
- general
-
-# Source files of non-templated classes (.cpp files)
-SOURCES = \
- Main.cpp \
- SimBlockList.cpp
-
-CCFLAGS_LOC = -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/cmvmi) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbacc) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbdict) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbdih) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dblqh) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbtc) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbtup) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/ndbfs) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/missra) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/ndbcntr) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/qmgr) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/trix) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/backup) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbutil) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/suma) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/grep) \
- -I$(call fixpath,$(NDB_TOP)/src/kernel/blocks/dbtux)
-
-include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp
index 706d75509f2..c97ad951cf3 100644
--- a/ndb/src/kernel/vm/Configuration.cpp
+++ b/ndb/src/kernel/vm/Configuration.cpp
@@ -27,6 +27,15 @@
#include <getarg.h>
+#include <mgmapi_configuration.hpp>
+#include <mgmapi_config_parameters_debug.h>
+#include <kernel_config_parameters.h>
+
+#include <kernel_types.h>
+#include <ndb_limits.h>
+#include "pc.hpp"
+#include <LogLevel.hpp>
+
extern "C" {
void ndbSetOwnVersion();
}
@@ -122,10 +131,8 @@ Configuration::init(int argc, const char** argv){
return true;
}
-Configuration::Configuration():
- the_clusterConfigurationData()
+Configuration::Configuration()
{
- m_ownProperties = 0;
_programName = 0;
_connectString = 0;
_fsPath = 0;
@@ -134,8 +141,6 @@ Configuration::Configuration():
}
Configuration::~Configuration(){
- delete m_ownProperties;
-
if(_programName != NULL)
free(_programName);
@@ -143,12 +148,6 @@ Configuration::~Configuration(){
free(_fsPath);
}
-const
-ClusterConfiguration&
-Configuration::clusterConfiguration() const {
- return the_clusterConfigurationData;
-}
-
void
Configuration::setupConfiguration(){
/**
@@ -157,7 +156,7 @@ Configuration::setupConfiguration(){
ConfigRetriever cr;
cr.setConnectString(_connectString);
stopOnError(true);
- Properties * p = cr.getConfig("DB", NDB_VERSION);
+ ndb_mgm_configuration * p = cr.getConfig(NDB_VERSION, NODE_TYPE_DB);
if(p == 0){
const char * s = cr.getErrorString();
if(s == 0)
@@ -171,56 +170,46 @@ Configuration::setupConfiguration(){
"/invalid configuration", s);
}
+ Uint32 nodeId = globalData.ownId = cr.getOwnNodeId();
+
/**
* Configure transporters
*/
{
- IPCConfig * theIPC = new IPCConfig(p);
-
- if(theIPC->init() != 0){
- ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", "");
- }
-
- if(theIPC->configureTransporters(&globalTransporterRegistry) <= 0){
+ int res = IPCConfig::configureTransporters(nodeId,
+ * p,
+ globalTransporterRegistry);
+ if(res <= 0){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"No transporters configured");
}
-
- globalData.ownId = theIPC->ownId();
- delete theIPC;
}
/**
* Setup cluster configuration data
*/
- const Properties * db = 0;
- if (!p->get("Node", globalData.ownId, &db)) {
+ ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
+ if (iter.find(CFG_NODE_ID, globalData.ownId)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", "DB missing");
}
- const char * type;
- if(!(db->get("Type", &type) && strcmp(type, "DB") == 0)){
+
+ unsigned type;
+ if(!(iter.get(CFG_TYPE_OF_SECTION, &type) == 0 && type == NODE_TYPE_DB)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"I'm wrong type of node");
}
- /**
- * Save properties object to use in getOwnProperties()
- */
- m_ownProperties = new Properties(* db);
-
- the_clusterConfigurationData.init(* p, * db);
-
- if(!db->get("MaxNoOfSavedMessages", &_maxErrorLogs)){
+ if(iter.get(CFG_DB_NO_SAVE_MSGS, &_maxErrorLogs)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"MaxNoOfSavedMessages missing");
}
- if(!db->get("LockPagesInMainMemory", &_lockPagesInMainMemory)){
+ if(iter.get(CFG_DB_MEMLOCK, &_lockPagesInMainMemory)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"LockPagesInMainMemory missing");
}
- if(!db->get("TimeBetweenWatchDogCheck", &_timeBetweenWatchDogCheck)){
+ if(iter.get(CFG_DB_WATCHDOG_INTERVAL, &_timeBetweenWatchDogCheck)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"TimeBetweenWatchDogCheck missing");
}
@@ -230,16 +219,16 @@ Configuration::setupConfiguration(){
*/
{
const char* pFileSystemPath = NULL;
- if(!db->get("FileSystemPath", &pFileSystemPath)){
+ if(iter.get(CFG_DB_FILESYSTEM_PATH, &pFileSystemPath)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"FileSystemPath missing");
}
-
+
if(pFileSystemPath == 0 || strlen(pFileSystemPath) == 0){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"Configuration does not contain valid filesystem path");
}
-
+
if(pFileSystemPath[strlen(pFileSystemPath) - 1] == '/')
_fsPath = strdup(pFileSystemPath);
else {
@@ -248,19 +237,17 @@ Configuration::setupConfiguration(){
strcat(_fsPath, "/");
}
}
-
- if(!db->get("StopOnError", &_stopOnError)){
+
+ if(iter.get(CFG_DB_STOP_ON_ERROR, &_stopOnError)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"StopOnError missing");
}
-
- if(!db->get("RestartOnErrorInsert", &m_restartOnErrorInsert)){
+
+ if(iter.get(CFG_DB_STOP_ON_ERROR_INSERT, &m_restartOnErrorInsert)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched",
"RestartOnErrorInsert missing");
}
- delete p;
-
/**
* Create the watch dog thread
*/
@@ -269,7 +256,14 @@ Configuration::setupConfiguration(){
t = globalEmulatorData.theWatchDog ->setCheckInterval(t);
_timeBetweenWatchDogCheck = t;
}
+
+ ConfigValues* cf = ConfigValuesFactory::extractCurrentSection(iter.m_config);
+
+ m_clusterConfig = p;
+ m_clusterConfigIter = ndb_mgm_create_configuration_iterator
+ (p, CFG_SECTION_NODE);
+ calcSizeAlt(cf);
}
bool
@@ -282,12 +276,6 @@ Configuration::timeBetweenWatchDogCheck() const {
return _timeBetweenWatchDogCheck;
}
-const
-ClusterConfiguration::ClusterData&
-Configuration::clusterConfigurationData() const {
- return the_clusterConfigurationData.clusterData();
-}
-
void
Configuration::timeBetweenWatchDogCheck(int value) {
_timeBetweenWatchDogCheck = value;
@@ -313,11 +301,6 @@ Configuration::stopOnError(bool val){
_stopOnError = val;
}
-const Properties *
-Configuration::getOwnProperties() const {
- return m_ownProperties;
-}
-
int
Configuration::getRestartOnErrorInsert() const {
return m_restartOnErrorInsert;
@@ -335,6 +318,350 @@ Configuration::getConnectStringCopy() const {
return 0;
}
+const ndb_mgm_configuration_iterator *
+Configuration::getOwnConfigIterator() const {
+ return m_ownConfigIterator;
+}
+
+ndb_mgm_configuration_iterator *
+Configuration::getClusterConfigIterator() const {
+ return m_clusterConfigIter;
+}
+
+void
+Configuration::calcSizeAlt(ConfigValues * ownConfig){
+ const char * msg = "Invalid configuration fetched";
+ char buf[255];
+
+ unsigned int noOfTables = 0;
+ unsigned int noOfIndexes = 0;
+ unsigned int noOfReplicas = 0;
+ unsigned int noOfDBNodes = 0;
+ unsigned int noOfAPINodes = 0;
+ unsigned int noOfMGMNodes = 0;
+ unsigned int noOfNodes = 0;
+ unsigned int noOfAttributes = 0;
+ unsigned int noOfOperations = 0;
+ unsigned int noOfTransactions = 0;
+ unsigned int noOfIndexPages = 0;
+ unsigned int noOfDataPages = 0;
+ unsigned int noOfScanRecords = 0;
+ m_logLevel = new LogLevel();
+
+ /**
+ * {"NoOfConcurrentCheckpointsDuringRestart", &cd.ispValues[1][5] },
+ * {"NoOfConcurrentCheckpointsAfterRestart", &cd.ispValues[2][4] },
+ * {"NoOfConcurrentProcessesHandleTakeover", &cd.ispValues[1][7] },
+ * {"TimeToWaitAlive", &cd.ispValues[0][0] },
+ */
+ struct AttribStorage { int paramId; Uint32 * storage; };
+ AttribStorage tmp[] = {
+ { CFG_DB_NO_SCANS, &noOfScanRecords },
+ { CFG_DB_NO_TABLES, &noOfTables },
+ { CFG_DB_NO_INDEXES, &noOfIndexes },
+ { CFG_DB_NO_REPLICAS, &noOfReplicas },
+ { CFG_DB_NO_ATTRIBUTES, &noOfAttributes },
+ { CFG_DB_NO_OPS, &noOfOperations },
+ { CFG_DB_NO_TRANSACTIONS, &noOfTransactions }
+#if 0
+ { "NoOfDiskPagesToDiskDuringRestartTUP", &cd.ispValues[3][8] },
+ { "NoOfDiskPagesToDiskAfterRestartTUP", &cd.ispValues[3][9] },
+ { "NoOfDiskPagesToDiskDuringRestartACC", &cd.ispValues[3][10] },
+ { "NoOfDiskPagesToDiskAfterRestartACC", &cd.ispValues[3][11] },
+#endif
+ };
+
+ ndb_mgm_configuration_iterator db(*(ndb_mgm_configuration*)ownConfig, 0);
+
+ const int sz = sizeof(tmp)/sizeof(AttribStorage);
+ for(int i = 0; i<sz; i++){
+ if(ndb_mgm_get_int_parameter(&db, tmp[i].paramId, tmp[i].storage)){
+ snprintf(buf, sizeof(buf), "ConfigParam: %d not found", tmp[i].paramId);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+ }
+
+ Uint64 indexMem = 0, dataMem = 0;
+ ndb_mgm_get_int64_parameter(&db, CFG_DB_DATA_MEM, &dataMem);
+ ndb_mgm_get_int64_parameter(&db, CFG_DB_INDEX_MEM, &indexMem);
+ if(dataMem == 0){
+ snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_DATA_MEM);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+
+ if(indexMem == 0){
+ snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_INDEX_MEM);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+
+ noOfDataPages = (dataMem / 8192);
+ noOfIndexPages = (indexMem / 8192);
+
+ for(unsigned j = 0; j<LogLevel::LOGLEVEL_CATEGORIES; j++){
+ Uint32 tmp;
+ if(!ndb_mgm_get_int_parameter(&db, LogLevel::MIN_LOGLEVEL_ID+j, &tmp)){
+ m_logLevel->setLogLevel((LogLevel::EventCategory)j, tmp);
+ }
+ }
+
+ // tmp
+ ndb_mgm_configuration_iterator * p = m_clusterConfigIter;
+
+ Uint32 nodeNo = noOfNodes = 0;
+ NodeBitmask nodes;
+ for(ndb_mgm_first(p); ndb_mgm_valid(p); ndb_mgm_next(p), nodeNo++){
+
+ Uint32 nodeId;
+ Uint32 nodeType;
+
+ if(ndb_mgm_get_int_parameter(p, CFG_NODE_ID, &nodeId)){
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Id) missing");
+ }
+
+ if(ndb_mgm_get_int_parameter(p, CFG_TYPE_OF_SECTION, &nodeType)){
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Type) missing");
+ }
+
+ if(nodeId > MAX_NODES || nodeId == 0){
+ snprintf(buf, sizeof(buf),
+ "Invalid node id: %d", nodeId);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+
+ if(nodes.get(nodeId)){
+ snprintf(buf, sizeof(buf), "Two node can not have the same node id: %d",
+ nodeId);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+ nodes.set(nodeId);
+
+ switch(nodeType){
+ case NODE_TYPE_DB:
+ noOfDBNodes++; // No of NDB processes
+
+ if(nodeId > MAX_NDB_NODES){
+ snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
+ MAX_NDB_NODES);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+ break;
+ case NODE_TYPE_API:
+ noOfAPINodes++; // No of API processes
+ break;
+ case NODE_TYPE_REP:
+ break;
+ case NODE_TYPE_MGM:
+ noOfMGMNodes++; // No of MGM processes
+ break;
+ case NODE_TYPE_EXT_REP:
+ break;
+ default:
+ snprintf(buf, sizeof(buf), "Unknown node type: %d", nodeType);
+ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
+ }
+ }
+ noOfNodes = nodeNo;
+
+ /**
+ * Do size calculations
+ */
+ ConfigValuesFactory cfg(ownConfig);
+
+ noOfTables++; // Remove impact of system table
+ noOfTables += noOfIndexes; // Indexes are tables too
+ noOfAttributes += 2; // ---"----
+ noOfTables *= 2; // Remove impact of Dict need 2 ids for each table
+
+ if (noOfDBNodes > 15) {
+ noOfDBNodes = 15;
+ }//if
+ Uint32 noOfLocalScanRecords = (noOfDBNodes * noOfScanRecords) + 1;
+ Uint32 noOfTCScanRecords = noOfScanRecords;
+
+ {
+ /**
+ * Acc Size Alt values
+ */
+ // Can keep 65536 pages (= 0.5 GByte)
+ cfg.put(CFG_ACC_DIR_RANGE,
+ 4 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_ACC_DIR_ARRAY,
+ (noOfIndexPages >> 8) +
+ 4 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_ACC_FRAGMENT,
+ 2 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ /*-----------------------------------------------------------------------*/
+ // The extra operation records added are used by the scan and node
+ // recovery process.
+ // Node recovery process will have its operations dedicated to ensure
+ // that they never have a problem with allocation of the operation record.
+ // The remainder are allowed for use by the scan processes.
+ /*-----------------------------------------------------------------------*/
+ cfg.put(CFG_ACC_OP_RECS,
+ noOfReplicas*((16 * noOfOperations) / 10 + 50) +
+ (noOfLocalScanRecords * MAX_PARALLEL_SCANS_PER_FRAG) +
+ NODE_RECOVERY_SCAN_OP_RECORDS);
+
+ cfg.put(CFG_ACC_OVERFLOW_RECS,
+ noOfIndexPages +
+ 2 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_ACC_PAGE8,
+ noOfIndexPages + 32);
+
+ cfg.put(CFG_ACC_ROOT_FRAG,
+ NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_ACC_TABLE, noOfTables);
+
+ cfg.put(CFG_ACC_SCAN, noOfLocalScanRecords);
+ }
+
+ {
+ /**
+ * Dict Size Alt values
+ */
+ cfg.put(CFG_DICT_ATTRIBUTE,
+ noOfAttributes);
+
+ cfg.put(CFG_DICT_CONNECT,
+ noOfOperations + 32);
+
+ cfg.put(CFG_DICT_FRAG_CONNECT,
+ NO_OF_FRAG_PER_NODE * noOfDBNodes * noOfReplicas);
+
+ cfg.put(CFG_DICT_TABLE,
+ noOfTables);
+
+ cfg.put(CFG_DICT_TC_CONNECT,
+ 2* noOfOperations);
+ }
+
+ {
+ /**
+ * Dih Size Alt values
+ */
+ cfg.put(CFG_DIH_API_CONNECT,
+ 2 * noOfTransactions);
+
+ cfg.put(CFG_DIH_CONNECT,
+ noOfOperations + 46);
+
+ cfg.put(CFG_DIH_FRAG_CONNECT,
+ NO_OF_FRAG_PER_NODE * noOfTables * noOfDBNodes);
+
+ int temp;
+ temp = noOfReplicas - 2;
+ if (temp < 0)
+ temp = 1;
+ else
+ temp++;
+ cfg.put(CFG_DIH_MORE_NODES,
+ temp * NO_OF_FRAG_PER_NODE *
+ noOfTables * noOfDBNodes);
+
+ cfg.put(CFG_DIH_REPLICAS,
+ NO_OF_FRAG_PER_NODE * noOfTables *
+ noOfDBNodes * noOfReplicas);
+
+ cfg.put(CFG_DIH_TABLE,
+ noOfTables);
+ }
+
+ {
+ /**
+ * Lqh Size Alt values
+ */
+ cfg.put(CFG_LQH_FRAG,
+ NO_OF_FRAG_PER_NODE * noOfTables * noOfReplicas);
+
+ cfg.put(CFG_LQH_CONNECT,
+ noOfReplicas*((11 * noOfOperations) / 10 + 50));
+
+ cfg.put(CFG_LQH_TABLE,
+ noOfTables);
+
+ cfg.put(CFG_LQH_TC_CONNECT,
+ noOfReplicas*((16 * noOfOperations) / 10 + 50));
+
+ cfg.put(CFG_LQH_REPLICAS,
+ noOfReplicas);
+
+ cfg.put(CFG_LQH_SCAN,
+ noOfLocalScanRecords);
+ }
+
+ {
+ /**
+ * Tc Size Alt values
+ */
+ cfg.put(CFG_TC_API_CONNECT,
+ 3 * noOfTransactions);
+
+ cfg.put(CFG_TC_TC_CONNECT,
+ noOfOperations + 16 + noOfTransactions);
+
+ cfg.put(CFG_TC_TABLE,
+ noOfTables);
+
+ cfg.put(CFG_TC_LOCAL_SCAN,
+ noOfLocalScanRecords);
+
+ cfg.put(CFG_TC_SCAN,
+ noOfTCScanRecords);
+ }
+
+ {
+ /**
+ * Tup Size Alt values
+ */
+ cfg.put(CFG_TUP_FRAG,
+ 2 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_TUP_OP_RECS,
+ noOfReplicas*((16 * noOfOperations) / 10 + 50));
+
+ cfg.put(CFG_TUP_PAGE,
+ noOfDataPages);
+
+ cfg.put(CFG_TUP_PAGE_RANGE,
+ 4 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas);
+
+ cfg.put(CFG_TUP_TABLE,
+ noOfTables);
+
+ cfg.put(CFG_TUP_TABLE_DESC,
+ 4 * NO_OF_FRAG_PER_NODE * noOfAttributes* noOfReplicas +
+ 12 * NO_OF_FRAG_PER_NODE * noOfTables* noOfReplicas );
+
+ cfg.put(CFG_TUP_STORED_PROC,
+ noOfLocalScanRecords);
+ }
+
+ {
+ /**
+ * Tux Size Alt values
+ */
+ cfg.put(CFG_TUX_INDEX,
+ noOfTables);
+
+ cfg.put(CFG_TUX_FRAGMENT,
+ 2 * NO_OF_FRAG_PER_NODE * noOfTables * noOfReplicas);
+
+ cfg.put(CFG_TUX_ATTRIBUTE,
+ noOfIndexes * 4);
+
+ cfg.put(CFG_TUX_SCAN_OP, noOfLocalScanRecords);
+ }
+
+ m_ownConfig = (ndb_mgm_configuration*)cfg.getConfigValues();
+ m_ownConfigIterator = ndb_mgm_create_configuration_iterator
+ (m_ownConfig, 0);
+}
+
void
Configuration::setInitialStart(bool val){
_initialStart = val;
diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp
index 3f96bb454c5..1706ad05867 100644
--- a/ndb/src/kernel/vm/Configuration.hpp
+++ b/ndb/src/kernel/vm/Configuration.hpp
@@ -17,7 +17,8 @@
#ifndef Configuration_H
#define Configuration_H
-#include "ClusterConfiguration.hpp"
+#include <mgmapi.h>
+#include <ndb_types.h>
class Configuration {
public:
@@ -46,35 +47,36 @@ public:
void setRestartOnErrorInsert(int);
// Cluster configuration
- const ClusterConfiguration::ClusterData& clusterConfigurationData() const;
- const ClusterConfiguration& clusterConfiguration() const;
-
const char * programName() const;
const char * fileSystemPath() const;
char * getConnectStringCopy() const;
/**
- * Return Properties for own node
- */
- const Properties * getOwnProperties() const;
-
- /**
*
*/
bool getInitialStart() const;
void setInitialStart(bool val);
bool getDaemonMode() const;
-
+
+ const ndb_mgm_configuration_iterator * getOwnConfigIterator() const;
+
+ class LogLevel * m_logLevel;
private:
+ friend class Cmvmi;
+ friend class Qmgr;
+ ndb_mgm_configuration_iterator * getClusterConfigIterator() const;
+
Uint32 _stopOnError;
Uint32 m_restartOnErrorInsert;
Uint32 _maxErrorLogs;
Uint32 _lockPagesInMainMemory;
Uint32 _timeBetweenWatchDogCheck;
+ ndb_mgm_configuration * m_ownConfig;
+ ndb_mgm_configuration * m_clusterConfig;
- ClusterConfiguration the_clusterConfigurationData;
- const Properties * m_ownProperties;
+ ndb_mgm_configuration_iterator * m_clusterConfigIter;
+ ndb_mgm_configuration_iterator * m_ownConfigIterator;
/**
* arguments to NDB process
@@ -84,6 +86,8 @@ private:
bool _initialStart;
char * _connectString;
bool _daemonMode;
+
+ void calcSizeAlt(class ConfigValues * );
};
inline
diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp
index 0d6d3f55acb..b615e41eb65 100644
--- a/ndb/src/kernel/vm/Emulator.cpp
+++ b/ndb/src/kernel/vm/Emulator.cpp
@@ -43,11 +43,11 @@ extern "C" {
* Declare the global variables
*/
-#ifdef USE_EMULATED_JAM
- Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4];
- Uint32 theEmulatedJamIndex = 0;
- Uint32 theEmulatedJamBlockNumber = 0;
-#endif // USE_EMULATED_JAM
+#ifndef NO_EMULATED_JAM
+Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4];
+Uint32 theEmulatedJamIndex = 0;
+Uint32 theEmulatedJamBlockNumber = 0;
+#endif
GlobalData globalData;
diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp
index ba533eb873d..8c4504b9ba7 100644
--- a/ndb/src/kernel/vm/Emulator.hpp
+++ b/ndb/src/kernel/vm/Emulator.hpp
@@ -36,15 +36,18 @@ extern struct GlobalData globalData;
extern class SignalLoggerManager globalSignalLoggers;
#endif
-#ifdef USE_EMULATED_JAM
-#define EMULATED_JAM_SIZE 1024
-#define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1)
+#ifndef NO_EMULATED_JAM
+ #define EMULATED_JAM_SIZE 1024
+ #define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1)
-extern Uint8 theEmulatedJam[];
-extern Uint32 theEmulatedJamIndex;
-// last block entry, used in dumpJam() if jam contains no block entries
-extern Uint32 theEmulatedJamBlockNumber;
-#endif // USE_EMULATED_JAM
+ extern Uint8 theEmulatedJam[];
+ extern Uint32 theEmulatedJamIndex;
+ // last block entry, used in dumpJam() if jam contains no block entries
+ extern Uint32 theEmulatedJamBlockNumber;
+#else
+ const Uint8 theEmulatedJam[]=0;
+ const Uint32 theEmulatedJamIndex=0;
+#endif
struct EmulatorData {
class Configuration * theConfiguration;
diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp
index e9ca4834562..eca456d26dd 100644
--- a/ndb/src/kernel/vm/FastScheduler.cpp
+++ b/ndb/src/kernel/vm/FastScheduler.cpp
@@ -316,14 +316,14 @@ APZJobBuffer::signal2buffer(Signal* signal,
void
APZJobBuffer::insert(const SignalHeader * const sh,
const Uint32 * const theData, const Uint32 secPtrI[3]){
- Uint32 tOccupancy = theOccupancy;
+ Uint32 tOccupancy = theOccupancy + 1;
Uint32 myWPtr = wPtr;
register BufferEntry& buf = buffer[myWPtr];
if (tOccupancy < bufSize) {
Uint32 cond = (++myWPtr == bufSize) - 1;
wPtr = myWPtr & cond;
- theOccupancy = tOccupancy + 1;
+ theOccupancy = tOccupancy;
buf.header = * sh;
const Uint32 len = buf.header.theLength;
@@ -342,8 +342,9 @@ APZJobBuffer::insert(const SignalHeader * const sh,
}//if
}
APZJobBuffer::APZJobBuffer()
- : rPtr(0), wPtr(0), theOccupancy(0), bufSize(0), buffer(NULL), memRef(NULL)
+ : bufSize(0), buffer(NULL), memRef(NULL)
{
+ clear();
}
APZJobBuffer::~APZJobBuffer()
@@ -354,9 +355,11 @@ APZJobBuffer::~APZJobBuffer()
void
APZJobBuffer::newBuffer(int size)
{
- buffer = new BufferEntry[size];
+ buffer = new BufferEntry[size + 1]; // +1 to support "overrrun"
if(buffer){
+#ifndef NDB_PURIFY
::memset(buffer, 0, (size * sizeof(BufferEntry)));
+#endif
bufSize = size;
} else
bufSize = 0;
@@ -474,10 +477,11 @@ FastScheduler::reportDoJobStatistics(Uint32 tMeanLoopCount) {
signal.theData[0] = EventReport::JobStatistic;
signal.theData[1] = tMeanLoopCount;
+ memset(&signal.header, 0, sizeof(SignalHeader));
signal.header.theLength = 2;
signal.header.theSendersSignalId = 0;
signal.header.theSendersBlockRef = numberToRef(0, 0);
-
+
execute(&signal, JBA, CMVMI, GSN_EVENT_REP);
}
diff --git a/ndb/src/kernel/vm/FastScheduler.hpp b/ndb/src/kernel/vm/FastScheduler.hpp
index 586a7ea27ad..9749dab5d85 100644
--- a/ndb/src/kernel/vm/FastScheduler.hpp
+++ b/ndb/src/kernel/vm/FastScheduler.hpp
@@ -43,7 +43,7 @@ class BufferEntry
{
public:
SignalHeader header;
- Uint32 theDataRegister[28];
+ Uint32 theDataRegister[25];
};
class APZJobBuffer
@@ -68,7 +68,6 @@ public:
void retrieveDump(Signal *signal, Uint32 myRptr);
void clear();
- bool isEmpty() const;
Uint32 getOccupancy() const;
Uint32 getReadPtr() const;
@@ -313,13 +312,13 @@ void
APZJobBuffer::insert(Signal* signal,
BlockNumber bnr, GlobalSignalNumber gsn)
{
- Uint32 tOccupancy = theOccupancy;
+ Uint32 tOccupancy = theOccupancy + 1;
Uint32 myWPtr = wPtr;
if (tOccupancy < bufSize) {
register BufferEntry& buf = buffer[myWPtr];
Uint32 cond = (++myWPtr == bufSize) - 1;
wPtr = myWPtr & cond;
- theOccupancy = tOccupancy + 1;
+ theOccupancy = tOccupancy;
signal2buffer(signal, bnr, gsn, buf);
//---------------------------------------------------------
// Prefetch of buffer[wPtr] is done here. We prefetch for
@@ -343,11 +342,4 @@ APZJobBuffer::insert(Signal* signal, BlockNumber bnr,
signal2buffer(signal, bnr, gsn, buf);
}
-inline
-bool
-APZJobBuffer::isEmpty() const
-{
- return (theOccupancy == 0);
-}
-
#endif
diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am
new file mode 100644
index 00000000000..4e9dbe36c78
--- /dev/null
+++ b/ndb/src/kernel/vm/Makefile.am
@@ -0,0 +1,29 @@
+#SUBDIRS = testCopy testDataBuffer testSimplePropertiesSection
+#ifneq ($(USE_EDITLINE), N)
+#DIRS += testLongSig
+#endif
+
+noinst_LIBRARIES = libkernel.a
+
+libkernel_a_SOURCES = \
+ SimulatedBlock.cpp \
+ FastScheduler.cpp \
+ TimeQueue.cpp \
+ VMSignal.cpp \
+ ThreadConfig.cpp \
+ TransporterCallback.cpp \
+ Emulator.cpp \
+ Configuration.cpp \
+ WatchDog.cpp \
+ SimplePropertiesSection.cpp \
+ SectionReader.cpp \
+ MetaData.cpp \
+ Mutex.cpp SafeCounter.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_kernel.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/kernel/vm/Makefile b/ndb/src/kernel/vm/Makefile_old
index 3f448b77b17..a162f3672ce 100644
--- a/ndb/src/kernel/vm/Makefile
+++ b/ndb/src/kernel/vm/Makefile_old
@@ -13,17 +13,18 @@ SOURCES = \
TransporterCallback.cpp \
Emulator.cpp \
Configuration.cpp \
- ClusterConfiguration.cpp \
WatchDog.cpp \
SimplePropertiesSection.cpp \
SectionReader.cpp \
MetaData.cpp \
Mutex.cpp SafeCounter.cpp
+CFLAGS_Configuration.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+
DIRS := testCopy testDataBuffer testSimplePropertiesSection
+
ifneq ($(USE_EDITLINE), N)
DIRS += testLongSig
endif
-
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/kernel/vm/SignalCounter.hpp b/ndb/src/kernel/vm/SignalCounter.hpp
index d572551ea92..ea770324aa6 100644
--- a/ndb/src/kernel/vm/SignalCounter.hpp
+++ b/ndb/src/kernel/vm/SignalCounter.hpp
@@ -21,6 +21,8 @@
#include <ErrorReporter.hpp>
class SignalCounter {
+ friend struct NodeReceiverGroup;
+
private:
Uint32 m_count;
NdbNodeBitmask m_nodes;
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index e3f087d7d74..a6a8a6242cd 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -60,7 +60,8 @@ SimulatedBlock::SimulatedBlock(BlockNumber blockNumber,
c_fragmentIdCounter = 1;
c_fragSenderRunning = false;
- const Properties * p = conf.getOwnProperties();
+ Properties tmp;
+ const Properties * p = &tmp;
ndbrequire(p != 0);
Uint32 count = 10;
@@ -98,7 +99,9 @@ SimulatedBlock::SimulatedBlock(BlockNumber blockNumber,
for(GlobalSignalNumber i = 0; i<=MAX_GSN; i++)
theExecArray[i] = 0;
+
installSimulatedBlockFunctions();
+ UpgradeStartup::installEXEC(this);
CLEAR_ERROR_INSERT_VALUE;
}
@@ -127,6 +130,7 @@ SimulatedBlock::installSimulatedBlockFunctions(){
a[GSN_UTIL_LOCK_CONF] = &SimulatedBlock::execUTIL_LOCK_CONF;
a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF;
a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF;
+ a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ;
}
void
@@ -182,7 +186,7 @@ SimulatedBlock::sendSignal(BlockReference ref,
Uint32 tSignalId = signal->header.theSignalId;
- if ((length == 0) || (length > 25) || (recBlock == 0)) {
+ if ((length == 0) || (length + noOfSections > 25) || (recBlock == 0)) {
signal_error(gsn, length, recBlock, __FILE__, __LINE__);
return;
}//if
@@ -263,7 +267,7 @@ SimulatedBlock::sendSignal(NodeReceiverGroup rg,
signal->header.theSendersSignalId = tSignalId;
signal->header.theSendersBlockRef = reference();
- if ((length == 0) || (length > 25) || (recBlock == 0)) {
+ if ((length == 0) || (length + noOfSections > 25) || (recBlock == 0)) {
signal_error(gsn, length, recBlock, __FILE__, __LINE__);
return;
}//if
@@ -371,7 +375,7 @@ SimulatedBlock::sendSignal(BlockReference ref,
Uint32 tSignalId = signal->header.theSignalId;
Uint32 tFragInfo = signal->header.m_fragmentInfo;
- if ((length == 0) || (length > 25) || (recBlock == 0)) {
+ if ((length == 0) || (length + noOfSections > 25) || (recBlock == 0)) {
signal_error(gsn, length, recBlock, __FILE__, __LINE__);
return;
}//if
@@ -464,7 +468,7 @@ SimulatedBlock::sendSignal(NodeReceiverGroup rg,
signal->header.theSendersBlockRef = reference();
signal->header.m_noOfSections = noOfSections;
- if ((length == 0) || (length > 25) || (recBlock == 0)) {
+ if ((length == 0) || (length + noOfSections > 25) || (recBlock == 0)) {
signal_error(gsn, length, recBlock, __FILE__, __LINE__);
return;
}//if
@@ -1338,7 +1342,7 @@ SimulatedBlock::sendFirstFragment(FragmentSendInfo & info,
*/
return true;
}
-
+
/**
* Setup info object
*/
@@ -1724,9 +1728,52 @@ void SimulatedBlock::execUTIL_UNLOCK_CONF(Signal* signal){
c_mutexMgr.execUTIL_UNLOCK_CONF(signal);
}
+void
+SimulatedBlock::execREAD_CONFIG_REQ(Signal* signal){
+ const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
+
+ Uint32 ref = req->senderRef;
+ Uint32 senderData = req->senderData;
+
+ ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = senderData;
+ sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
+ ReadConfigConf::SignalLength, JBB);
+}
+
void
SimulatedBlock::ignoreMutexUnlockCallback(Signal* signal,
Uint32 ptrI, Uint32 retVal){
c_mutexMgr.release(ptrI);
}
+void
+UpgradeStartup::installEXEC(SimulatedBlock* block){
+ SimulatedBlock::ExecFunction * a = block->theExecArray;
+ switch(block->number()){
+ case QMGR:
+ a[UpgradeStartup::GSN_CM_APPCHG] = &SimulatedBlock::execUPGRADE;
+ break;
+ case CNTR:
+ a[UpgradeStartup::GSN_CNTR_MASTERREF] = &SimulatedBlock::execUPGRADE;
+ a[UpgradeStartup::GSN_CNTR_MASTERCONF] = &SimulatedBlock::execUPGRADE;
+ break;
+ }
+}
+
+void
+SimulatedBlock::execUPGRADE(Signal* signal){
+ Uint32 gsn = signal->header.theVerId_signalNumber;
+ switch(gsn){
+ case UpgradeStartup::GSN_CM_APPCHG:
+ UpgradeStartup::execCM_APPCHG(* this, signal);
+ break;
+ case UpgradeStartup::GSN_CNTR_MASTERREF:
+ UpgradeStartup::execCNTR_MASTER_REPLY(* this, signal);
+ break;
+ case UpgradeStartup::GSN_CNTR_MASTERCONF:
+ UpgradeStartup::execCNTR_MASTER_REPLY(* this, signal);
+ break;
+ }
+}
diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp
index 42b8a3034f5..491d432625e 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -45,6 +45,16 @@
#include "SafeCounter.hpp"
#include "MetaData.hpp"
+#include <mgmapi.h>
+#include <mgmapi_config_parameters.h>
+#include <mgmapi_config_parameters_debug.h>
+#include <kernel_config_parameters.h>
+#include <Configuration.hpp>
+
+#include <signaldata/ReadConfig.hpp>
+#include <signaldata/UpgradeStartup.hpp>
+
+
/**
* Something for filesystem access
*/
@@ -70,6 +80,7 @@ class SimulatedBlock {
friend class MutexManager;
friend class SafeCounter;
friend class SafeCounterManager;
+ friend struct UpgradeStartup;
public:
friend class BlockComponent;
virtual ~SimulatedBlock();
@@ -378,7 +389,7 @@ private:
void execSIGNAL_DROPPED_REP(Signal* signal);
void execCONTINUE_FRAGMENTED(Signal* signal);
-
+
Uint32 c_fragmentIdCounter;
ArrayPool<FragmentInfo> c_fragmentInfoPool;
DLHashTable<FragmentInfo> c_fragmentInfoHash;
@@ -404,7 +415,9 @@ private:
void execUTIL_UNLOCK_REF(Signal* signal);
void execUTIL_UNLOCK_CONF(Signal* signal);
+ void execREAD_CONFIG_REQ(Signal* signal);
protected:
+ void execUPGRADE(Signal* signal);
// Variable for storing inserted errors, see pc.H
ERROR_INSERT_VARIABLE;
diff --git a/ndb/src/kernel/vm/TransporterCallback.cpp b/ndb/src/kernel/vm/TransporterCallback.cpp
index 3798e4040c8..eb7d138895c 100644
--- a/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -206,6 +206,7 @@ execute(void * callbackObj,
LinearSectionPtr ptr[3]){
const Uint32 secCount = header->m_noOfSections;
+ const Uint32 length = header->theLength;
#ifdef TRACE_DISTRIBUTED
ndbout_c("recv: %s(%d) from (%s, %d)",
@@ -225,6 +226,11 @@ execute(void * callbackObj,
case 1:
ok &= import(secPtr[0], ptr[0].p, ptr[0].sz);
}
+
+ /**
+ * Check that we haven't received a too long signal
+ */
+ ok &= (length + secCount <= 25);
Uint32 secPtrI[3];
if(ok){
@@ -234,6 +240,7 @@ execute(void * callbackObj,
secPtrI[0] = secPtr[0].i;
secPtrI[1] = secPtr[1].i;
secPtrI[2] = secPtr[2].i;
+
globalScheduler.execute(header, prio, theData, secPtrI);
return;
}
diff --git a/ndb/src/kernel/vm/VMSignal.hpp b/ndb/src/kernel/vm/VMSignal.hpp
index 45e731f2079..9111ee7949c 100644
--- a/ndb/src/kernel/vm/VMSignal.hpp
+++ b/ndb/src/kernel/vm/VMSignal.hpp
@@ -34,6 +34,7 @@ struct NodeReceiverGroup {
NodeReceiverGroup();
NodeReceiverGroup(Uint32 blockRef);
NodeReceiverGroup(Uint32 blockNo, const NodeBitmask &);
+ NodeReceiverGroup(Uint32 blockNo, const class SignalCounter &);
NodeReceiverGroup& operator=(BlockReference ref);
@@ -171,6 +172,14 @@ NodeReceiverGroup::NodeReceiverGroup(Uint32 blockNo, const NodeBitmask & nodes){
m_nodes = nodes;
}
+#include "SignalCounter.hpp"
+
+inline
+NodeReceiverGroup::NodeReceiverGroup(Uint32 blockNo, const SignalCounter & nodes){
+ m_block = blockNo;
+ m_nodes = nodes.m_nodes;
+}
+
inline
NodeReceiverGroup&
NodeReceiverGroup::operator=(BlockReference blockRef){
diff --git a/ndb/src/kernel/vm/pc.hpp b/ndb/src/kernel/vm/pc.hpp
index 873a986bc35..bc74adfc8f6 100644
--- a/ndb/src/kernel/vm/pc.hpp
+++ b/ndb/src/kernel/vm/pc.hpp
@@ -22,8 +22,14 @@
#include <NdbOut.hpp>
#include <ndb_limits.h>
-#ifdef USE_EMULATED_JAM
+#ifdef NO_EMULATED_JAM
+#define jam()
+#define jamLine(line)
+#define jamEntry()
+#define jamEntryLine(line)
+
+#else
#ifdef NDB_WIN32
#define jam() { \
@@ -72,11 +78,6 @@
#endif
-#else
-#define jam()
-#define jamLine(line)
-#define jamEntry()
-#define jamEntryLine(line)
#endif
#ifndef NDB_OPT
#define ptrCheck(ptr, limit, rec) if (ptr.i < (limit)) ptr.p = &rec[ptr.i]; else ptr.p = NULL
@@ -116,12 +117,6 @@
#define arrGuard(ind, size)
#endif
-// ------- EVENT STATES OF A NODE -----------------------------
-#define ZADD 0 /* New application added */
-#define ZREMOVE 1 /* An application has been removed */
-#define ZSTART 2 /* An application is ready to start */
-#define ZRUN 3 /* An application has started to run */
-
// -------- ERROR INSERT MACROS -------
#ifdef ERROR_INSERT
#define ERROR_INSERT_VARIABLE UintR cerrorInsert
@@ -190,7 +185,7 @@
*
* NOTE these may only be used within blocks
*/
-#if defined VM_TRACE || defined NDB_DEBUG
+#if defined VM_TRACE
#define ndbassert(check) \
if((check)){ \
} else { \
diff --git a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
index af4e2ca6e24..1d1fb8ebc82 100644
--- a/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
+++ b/ndb/src/kernel/vm/testLongSig/testLongSig.cpp
@@ -39,6 +39,7 @@ print_help(){
ndbout << "11 - Sending of CONTINUEB fragmented signals w/ linear sections"
<< endl;
ndbout << "12 - As but using receiver group" << endl;
+ ndbout << "13 - Send 100 * 1000 25 len signals wo/ sections" << endl;
ndbout << "r - Recive signal from anyone" << endl;
ndbout << "a - Run tests 1 - 12 with variable sizes - 10 loops" << endl;
ndbout << "b - Run tests 1 - 12 with variable sizes - 100 loops" << endl;
@@ -103,7 +104,7 @@ main(void){
data[5] = 70;
data[6] = 123;
data[7] = 10;
- const Uint32 theDataLen = 8;
+ const Uint32 theDataLen = 18;
for(Uint32 i = 0; i<70; i++)
sec0[i] = i;
@@ -198,6 +199,38 @@ main(void){
delete ret1;
count--;
}
+ } else if (data[1] == 13) {
+ const Uint32 count = 3500;
+ const Uint32 loop = 1000;
+
+ signal1.set(ss, 0, CMVMI, GSN_TESTSIG, 25);
+ signal1.header.m_fragmentInfo = 0;
+ signal1.header.m_noOfSections = 0;
+ signal1.theData[1] = 14;
+ signal1.theData[3] = 0; // Print
+ signal1.theData[8] = count;
+ signal1.theData[9] = loop;
+ Uint32 nodeId = ss.getAliveNode();
+ ndbout_c("Sending 25 len signal to node %d", nodeId);
+ ss.sendSignal(nodeId, &signal1);
+
+ Uint32 total;
+ {
+ SimpleSignal * ret1 = ss.waitFor((Uint16)nodeId);
+ ndbout_c("received from node %d",
+ refToNode(ret1->header.theSendersBlockRef));
+ total = ret1->theData[10] - 1;
+ delete ret1;
+ }
+
+ do {
+ ndbout << "Waiting for " << total << " signals... " << flush;
+ SimpleSignal * ret1 = ss.waitFor((Uint16)nodeId);
+ ndbout_c("received from node %d",
+ refToNode(ret1->header.theSendersBlockRef));
+ delete ret1;
+ total --;
+ } while(total > 0);
} else {
print_help();
}
@@ -218,7 +251,6 @@ runTest(SignalSender & ss, Uint32 count, bool verbose){
sec2[i] = i * i;
}
- sig.set(ss, 0, CMVMI, GSN_TESTSIG, 8);
sig.theData[0] = ss.getOwnRef();
sig.theData[1] = 1; // TestType
sig.theData[2] = 128; // FragSize
@@ -236,6 +268,8 @@ runTest(SignalSender & ss, Uint32 count, bool verbose){
sig.ptr[1].sz = randRange(1, 256);
sig.ptr[2].sz = randRange(1, 256);
sig.header.m_noOfSections = secs;
+ const Uint32 len = 5 + (secs > 0 ? 1 : 0) * (25 - 5 - 7);
+ sig.set(ss, 0, CMVMI, GSN_TESTSIG, len);
ndbout << "Loop " << loop << " #secs = " << secs << " sizes = [ ";
unsigned min = 256;
unsigned max = 0;
@@ -248,7 +282,7 @@ runTest(SignalSender & ss, Uint32 count, bool verbose){
sum += sz;
sig.theData[5+i] = sz;
}
- ndbout_c("]");
+ ndbout_c("] len = %d", len);
for(int test = 1; test <= 12; test++){
sig.theData[1] = test;
Uint32 nodeId = ss.getAliveNode();
diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am
new file mode 100644
index 00000000000..e4fa1d449c6
--- /dev/null
+++ b/ndb/src/mgmapi/Makefile.am
@@ -0,0 +1,13 @@
+
+noinst_LTLIBRARIES = libmgmapi.la
+
+libmgmapi_la_SOURCES = mgmapi.cpp mgmapi_configuration.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon
+DEFS_LOC = -DNO_DEBUG_MESSAGES
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/mgmapi/Makefile b/ndb/src/mgmapi/Makefile_old
index 9e7ba4f5ac7..fa734f998e6 100644
--- a/ndb/src/mgmapi/Makefile
+++ b/ndb/src/mgmapi/Makefile_old
@@ -15,7 +15,7 @@ LIB_TARGET := MGM_API
LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib
# Source files of non-templated classes (.C files)
-SOURCES = mgmapi.cpp
+SOURCES = mgmapi.cpp mgmapi_configuration.cpp
CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
-I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon)
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index fcdfe943fb1..bb4b6be8221 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -19,6 +19,7 @@
#include <NdbTCP.h>
#include "mgmapi.h"
#include "mgmapi_debug.h"
+#include "mgmapi_configuration.hpp"
#include <socket_io.h>
#include <NdbOut.hpp>
@@ -26,6 +27,7 @@
#include <Parser.hpp>
#include <OutputStream.hpp>
#include <InputStream.hpp>
+#include <Base64.hpp>
#define MGM_CMD(name, fun, desc) \
@@ -93,15 +95,20 @@ struct ndb_mgm_handle {
#endif
};
-#define SET_ERROR(h, e, s) \
- { \
- char tmp[NDB_MGM_MAX_ERR_DESC_SIZE]; \
- snprintf(tmp, NDB_MGM_MAX_ERR_DESC_SIZE, " (mgmapi.cpp:%d)", __LINE__); \
- strncpy(h->last_error_desc, s, NDB_MGM_MAX_ERR_DESC_SIZE); \
- strncat(h->last_error_desc, tmp, NDB_MGM_MAX_ERR_DESC_SIZE); \
- h->last_error = e; \
- h->last_error_line = __LINE__; \
- }
+#define SET_ERROR(h, e, s) setError(h, e, __LINE__, s)
+
+static
+void
+setError(NdbMgmHandle h, int error, int error_line, const char * msg, ...){
+
+ h->last_error = error; \
+ h->last_error_line = error_line;
+
+ va_list ap;
+ va_start(ap, msg);
+ vsnprintf(h->last_error_desc, sizeof(h->last_error_desc), msg, ap);
+ va_end(ap);
+}
#define CHECK_HANDLE(handle, ret) \
if(handle == 0) { \
@@ -185,9 +192,12 @@ ndb_mgm_get_latest_error(const NdbMgmHandle h)
return h->last_error;
}
-/**
- * Get latest error line associated with a handle
- */
+extern "C"
+const char *
+ndb_mgm_get_latest_error_desc(const NdbMgmHandle h){
+ return h->last_error_desc;
+}
+
extern "C"
int
ndb_mgm_get_latest_error_line(const NdbMgmHandle h)
@@ -207,13 +217,6 @@ ndb_mgm_get_latest_error_msg(const NdbMgmHandle h)
return "Error"; // Unknown Error message
}
-extern "C"
-const char *
-ndb_mgm_get_latest_error_desc(const NdbMgmHandle h)
-{
- return h->last_error_desc;
-}
-
static
int
parse_connect_string(const char * connect_string,
@@ -372,7 +375,8 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv)
// Convert ip address presentation format to numeric format
const int res1 = Ndb_getInAddr(&servaddr.sin_addr, handle->hostname);
if (res1 != 0) {
- SET_ERROR(handle, NDB_MGM_ILLEGAL_IP_ADDRESS, "");
+ DEBUG("Ndb_getInAddr(...) == -1");
+ setError(handle, EINVAL, __LINE__, "Invalid hostname/address");
return -1;
}
@@ -380,7 +384,8 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv)
sizeof(servaddr));
if (res2 == -1) {
NDB_CLOSE_SOCKET(sockfd);
- SET_ERROR(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, "");
+ setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to %s",
+ mgmsrv);
return -1;
}
@@ -389,7 +394,7 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv)
return 0;
}
-
+
/**
* Disconnect from a mgm server
*/
@@ -425,7 +430,7 @@ const int no_of_type_values = (sizeof(type_values) /
sizeof(ndb_mgm_type_atoi));
extern "C"
-enum ndb_mgm_node_type
+ndb_mgm_node_type
ndb_mgm_match_node_type(const char * type)
{
if(type == 0)
@@ -469,7 +474,7 @@ const int no_of_status_values = (sizeof(status_values) /
sizeof(ndb_mgm_status_atoi));
extern "C"
-enum ndb_mgm_node_status
+ndb_mgm_node_status
ndb_mgm_match_node_status(const char * status)
{
if(status == 0)
@@ -514,6 +519,8 @@ status_ackumulate(struct ndb_mgm_node_state * state,
state->node_group = atoi(value);
} else if(strcmp("version", field) == 0){
state->version = atoi(value);
+ } else if(strcmp("connect_count", field) == 0){
+ state->connect_count = atoi(value);
} else {
ndbout_c("Unknown field: %s", field);
}
@@ -1422,10 +1429,103 @@ ndb_mgm_abort_backup(NdbMgmHandle handle, unsigned int backupId,
return 0;
}
+extern "C"
+struct ndb_mgm_configuration *
+ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
+
+ CHECK_HANDLE(handle, 0);
+ CHECK_CONNECTED(handle, 0);
+
+ Properties args;
+ args.put("version", version);
+
+ const ParserRow<ParserDummy> reply[] = {
+ MGM_CMD("get config reply", NULL, ""),
+ MGM_ARG("result", String, Mandatory, "Error message"),
+ MGM_ARG("Content-Length", Int, Optional, "Content length in bytes"),
+ MGM_ARG("Content-Type", String, Optional, "Type (octet-stream)"),
+ MGM_ARG("Content-Transfer-Encoding", String, Optional, "Encoding(base64)"),
+ MGM_END()
+ };
+
+ const Properties *prop;
+ prop = ndb_mgm_call(handle, reply, "get config", &args);
+
+ if(prop == NULL) {
+ SET_ERROR(handle, EIO, "Unable to fetch config");
+ return 0;
+ }
+
+ do {
+ const char * buf;
+ if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){
+ ndbout_c("ERROR Message: %s\n", buf);
+ break;
+ }
+
+ buf = "<Unspecified>";
+ if(!prop->get("Content-Type", &buf) ||
+ strcmp(buf, "ndbconfig/octet-stream") != 0){
+ ndbout_c("Unhandled response type: %s", buf);
+ break;
+ }
+
+ buf = "<Unspecified>";
+ if(!prop->get("Content-Transfer-Encoding", &buf)
+ || strcmp(buf, "base64") != 0){
+ ndbout_c("Unhandled encoding: %s", buf);
+ break;
+ }
+
+ buf = "<Content-Length Unspecified>";
+ Uint32 len = 0;
+ if(!prop->get("Content-Length", &len)){
+ ndbout_c("Invalid response: %s\n", buf);
+ break;
+ }
+
+ len += 1; // Trailing \n
+
+ char* buf64 = new char[len];
+ int read = 0;
+ size_t start = 0;
+ do {
+ if((read = read_socket(handle->socket, handle->read_timeout,
+ &buf64[start], len-start)) == -1){
+ delete[] buf64;
+ buf64 = 0;
+ break;
+ }
+ start += read;
+ } while(start < len);
+ if(buf64 == 0)
+ break;
+
+ UtilBuffer tmp;
+ const int res = base64_decode(buf64, len-1, tmp);
+ delete[] buf64;
+ if(res != 0){
+ ndbout_c("Failed to decode buffer");
+ break;
+ }
+
+ ConfigValuesFactory cvf;
+ const int res2 = cvf.unpack(tmp);
+ if(!res2){
+ ndbout_c("Failed to unpack buffer");
+ break;
+ }
+
+ return (ndb_mgm_configuration*)cvf.m_cfg;
+ } while(0);
+
+ delete prop;
+ return 0;
+}
+
/*****************************************************************************
* Global Replication
- *****************************************************************************/
-
+ ******************************************************************************/
extern "C"
int
ndb_mgm_rep_command(NdbMgmHandle handle, unsigned int request,
diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp
new file mode 100644
index 00000000000..ae7fe2c294c
--- /dev/null
+++ b/ndb/src/mgmapi/mgmapi_configuration.cpp
@@ -0,0 +1,157 @@
+#include <mgmapi.h>
+#include "mgmapi_configuration.hpp"
+#include <new>
+
+ndb_mgm_configuration_iterator::ndb_mgm_configuration_iterator
+(const ndb_mgm_configuration & conf, unsigned type_of_section)
+ : m_config(conf.m_config)
+{
+ m_sectionNo = ~0;
+ m_typeOfSection = type_of_section;
+ first();
+}
+
+ndb_mgm_configuration_iterator::~ndb_mgm_configuration_iterator(){
+ reset();
+}
+
+void
+ndb_mgm_configuration_iterator::reset(){
+ if(m_sectionNo != (Uint32)~0){
+ m_config.closeSection();
+ }
+}
+
+
+int
+ndb_mgm_configuration_iterator::enter(){
+ bool ok = m_config.openSection(m_typeOfSection, m_sectionNo);
+ if(ok){
+ return 0;
+ }
+
+ reset();
+ m_sectionNo = ~0;
+ return -1;
+}
+
+int
+ndb_mgm_configuration_iterator::first(){
+ reset();
+ m_sectionNo = 0;
+ return enter();
+}
+
+int
+ndb_mgm_configuration_iterator::next(){
+ reset();
+ m_sectionNo++;
+ return enter();
+}
+
+int
+ndb_mgm_configuration_iterator::valid() const {
+ return m_sectionNo != (Uint32)~0;
+}
+
+int
+ndb_mgm_configuration_iterator::find(int param, unsigned search){
+ unsigned val = search + 1;
+
+ while(get(param, &val) == 0 && val != search){
+ if(next() != 0)
+ break;
+ }
+
+ if(val == search)
+ return 0;
+
+ return -1;
+}
+
+int
+ndb_mgm_configuration_iterator::get(int param, unsigned * value) const {
+ return m_config.get(param, value) != true;
+
+}
+
+int
+ndb_mgm_configuration_iterator::get(int param,
+ unsigned long long * value) const{
+ return m_config.get(param, value) != true;
+}
+
+int
+ndb_mgm_configuration_iterator::get(int param, const char ** value) const {
+ return m_config.get(param, value) != true;
+}
+
+/**
+ * Published C interface
+ */
+extern "C"
+ndb_mgm_configuration_iterator*
+ndb_mgm_create_configuration_iterator(ndb_mgm_configuration * conf,
+ unsigned type_of_section){
+ ndb_mgm_configuration_iterator* iter = (ndb_mgm_configuration_iterator*)
+ malloc(sizeof(ndb_mgm_configuration_iterator));
+ if(iter == 0)
+ return 0;
+
+ return new(iter) ndb_mgm_configuration_iterator(* conf, type_of_section);
+}
+
+
+extern "C"
+void ndb_mgm_destroy_iterator(ndb_mgm_configuration_iterator* iter){
+ if(iter != 0){
+ iter->~ndb_mgm_configuration_iterator();
+ free(iter);
+ }
+}
+
+extern "C"
+int
+ndb_mgm_first(ndb_mgm_configuration_iterator* iter){
+ return iter->first();
+}
+
+extern "C"
+int
+ndb_mgm_next(ndb_mgm_configuration_iterator* iter){
+ return iter->next();
+}
+
+extern "C"
+int
+ndb_mgm_valid(const ndb_mgm_configuration_iterator* iter){
+ return iter->valid();
+}
+
+extern "C"
+int
+ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter,
+ int param, unsigned * value){
+ return iter->get(param, value);
+}
+
+extern "C"
+int
+ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter,
+ int param, unsigned long long * value){
+ return iter->get(param, value);
+}
+
+extern "C"
+int
+ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator* iter,
+ int param, const char ** value){
+ return iter->get(param, value);
+}
+
+extern "C"
+int
+ndb_mgm_find(ndb_mgm_configuration_iterator* iter,
+ int param, unsigned search){
+ return iter->find(param, search);
+}
diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp
new file mode 100644
index 00000000000..c7feffd3a4e
--- /dev/null
+++ b/ndb/src/mgmapi/mgmapi_configuration.hpp
@@ -0,0 +1,32 @@
+#ifndef MGMAPI_CONFIGURATION_HPP
+#define MGMAPI_CONFIGURATION_HPP
+
+#include <ConfigValues.hpp>
+
+struct ndb_mgm_configuration {
+ ConfigValues m_config;
+};
+
+struct ndb_mgm_configuration_iterator {
+ Uint32 m_sectionNo;
+ Uint32 m_typeOfSection;
+ ConfigValues::ConstIterator m_config;
+
+ ndb_mgm_configuration_iterator(const ndb_mgm_configuration &, unsigned type);
+ ~ndb_mgm_configuration_iterator();
+
+ int first();
+ int next();
+ int valid() const;
+ int find(int param, unsigned value);
+
+ int get(int param, unsigned * value) const ;
+ int get(int param, unsigned long long * value) const ;
+ int get(int param, const char ** value) const ;
+
+ //
+ void reset();
+ int enter();
+};
+
+#endif
diff --git a/ndb/src/mgmapi/test/keso.c b/ndb/src/mgmapi/test/keso.c
index d5086b20b6a..d2675b2ca8a 100644
--- a/ndb/src/mgmapi/test/keso.c
+++ b/ndb/src/mgmapi/test/keso.c
@@ -29,6 +29,7 @@ static int testConnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
static int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply);
static int testStatus(NdbMgmHandle h, struct ndb_mgm_reply* reply);
+static int testGetConfig(NdbMgmHandle h, struct ndb_mgm_reply* reply);
#ifdef VM_TRACE
static int testLogSignals(NdbMgmHandle h, struct ndb_mgm_reply* reply);
static int testStartSignalLog(NdbMgmHandle h, struct ndb_mgm_reply* reply);
@@ -152,6 +153,19 @@ int testDisconnect(NdbMgmHandle h, struct ndb_mgm_reply* reply) {
}
static
+int testGetConfig(NdbMgmHandle h, struct ndb_mgm_reply* reply) {
+ int i = 0;
+ struct ndb_mgm_configuration * config = ndb_mgm_get_configuration(h, 0);
+ if (config != NULL) {
+ free(config);
+ } else {
+ ndbout_c("Unable to get config");
+ return -1;
+ }
+ return 0;
+}
+
+static
int testStatus(NdbMgmHandle h, struct ndb_mgm_reply* reply) {
int i = 0;
struct ndb_mgm_cluster_state* cluster = ndb_mgm_get_status(h);
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index fba5fda32dd..cf9d885847a 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -30,10 +30,6 @@
#include "MgmtErrorReporter.hpp"
#include "CpcClient.hpp"
-#ifdef NDB_SOLARIS // XXX fix me
-static char* strsep(char** x, const char* y) { return 0; }
-#endif
-
/*****************************************************************************
* HELP
@@ -1865,17 +1861,36 @@ CommandInterpreter::executeRep(char* parameters)
* CPC
*****************************************************************************/
+#if 0
+
+#if 0
+//#ifdef NDB_SOLARIS // XXX fix me
+static char* strsep(char** x, const char* y) { return 0; }
+#endif
+
+// Note this code has not been verified
+#if 0
+static char * my_strsep(char **stringp, const char *delim)
+{
+ char *tmp= *stringp;
+ if (tmp == 0)
+ return 0;
+ *stringp = strtok(tmp, delim);
+ return tmp;
+}
+#endif
+
void
CommandInterpreter::executeCpc(char *parameters)
{
char *host_str = NULL, *port_str = NULL, *end;
long port = 1234; /* XXX */
- while((host_str = strsep(&parameters, " \t:")) != NULL &&
+ while((host_str = my_strsep(&parameters, " \t:")) != NULL &&
host_str[0] == '\0');
if(parameters && parameters[0] != '\0') {
- while((port_str = strsep(&parameters, " \t:")) != NULL &&
+ while((port_str = my_strsep(&parameters, " \t:")) != NULL &&
port_str[0] == '\0');
errno = 0;
@@ -1944,6 +1959,7 @@ CommandInterpreter::executeCpc(char *parameters)
<< endl;
return;
}
+#endif
#if 0
static
diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp
index 796a4e4838e..478e03d129a 100644
--- a/ndb/src/mgmclient/CommandInterpreter.hpp
+++ b/ndb/src/mgmclient/CommandInterpreter.hpp
@@ -17,7 +17,7 @@
#ifndef CommandInterpreter_H
#define CommandInterpreter_H
-#define HAVE_GLOBAL_REPLICATION
+//#define HAVE_GLOBAL_REPLICATION
//*****************************************************************************
// Author: Peter Lind
//*****************************************************************************
diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am
new file mode 100644
index 00000000000..f3eaaaa68bd
--- /dev/null
+++ b/ndb/src/mgmclient/Makefile.am
@@ -0,0 +1,21 @@
+
+ndbtools_PROGRAMS = ndb_mgm
+
+ndb_mgm_SOURCES = \
+ main.cpp \
+ CommandInterpreter.cpp \
+ CpcClient.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+
+INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon
+
+LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
+ $(top_builddir)/ndb/src/common/editline/libeditline.a \
+ @TERMCAP_LIB@
+
+ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/mgmclient/Makefile b/ndb/src/mgmclient/Makefile_old
index 9f9a6344ab9..d1b2d60a52a 100644
--- a/ndb/src/mgmclient/Makefile
+++ b/ndb/src/mgmclient/Makefile_old
@@ -4,7 +4,7 @@ TYPE := ndbapi
BIN_TARGET := mgmtclient
BIN_TARGET_LIBS :=
-BIN_TARGET_ARCHIVES := trace logger general mgmapi mgmsrvcommon portlib repapi
+BIN_TARGET_ARCHIVES := trace logger mgmapi general mgmsrvcommon portlib repapi
BIN_TARGET_ARCHIVES += editline
diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp
index 8a7293b8434..004fc463b70 100644
--- a/ndb/src/mgmsrv/CommandInterpreter.cpp
+++ b/ndb/src/mgmsrv/CommandInterpreter.cpp
@@ -27,7 +27,6 @@
#include <signaldata/SetLogLevelOrd.hpp>
#include "ConfigInfo.hpp"
-extern "C"
#include <version.h>
@@ -453,14 +452,15 @@ void CommandInterpreter::executeShow(char* parameters) {
return;
} else if (strcmp(parameters, "PROPERTIES") == 0 ||
strcmp(parameters, "PROP") == 0) {
- _mgmtSrvr.getConfig()->print();
+ ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */
} else if (strcmp(parameters, "CONFIGURATION") == 0 ||
strcmp(parameters, "CONFIG") == 0){
+ ndbout << "_mgmtSrvr.getConfigFile()->print();" << endl; /* XXX */
_mgmtSrvr.getConfig()->printConfigFile();
} else if (strcmp(parameters, "PARAMETERS") == 0 ||
strcmp(parameters, "PARAMS") == 0 ||
strcmp(parameters, "PARAM") == 0) {
- _mgmtSrvr.getConfig()->getConfigInfo()->print();
+ ndbout << "_mgmtSrvr.getConfigInfo()->print();" << endl; /* XXX */
} else {
ndbout << "Invalid argument." << endl;
}
@@ -773,11 +773,11 @@ void CommandInterpreter::executeStatus(int processId,
}
ndb_mgm_node_status status;
- Uint32 startPhase, version, dynamicId, nodeGroup;
+ Uint32 startPhase, version, dynamicId, nodeGroup, connectCount;
bool system;
int result = _mgmtSrvr.status(processId,
&status, &version, &startPhase, &system,
- &dynamicId, &nodeGroup);
+ &dynamicId, &nodeGroup, &connectCount);
if(result != 0){
ndbout << _mgmtSrvr.getErrorText(result) << endl;
return;
diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am
new file mode 100644
index 00000000000..fc493fe10c7
--- /dev/null
+++ b/ndb/src/mgmsrv/Makefile.am
@@ -0,0 +1,30 @@
+
+ndbbin_PROGRAMS = ndb_mgmd
+
+ndb_mgmd_SOURCES = \
+ MgmtSrvr.cpp \
+ MgmtSrvrGeneralSignalHandling.cpp \
+ main.cpp \
+ Services.cpp \
+ convertStrToInt.cpp \
+ NodeLogLevel.cpp \
+ NodeLogLevelList.cpp \
+ SignalQueue.cpp \
+ MgmtSrvrConfig.cpp \
+ CommandInterpreter.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \
+ -I$(top_srcdir)/ndb/src/mgmapi \
+ -I$(top_srcdir)/ndb/src/common/mgmcommon
+
+LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
+ $(top_builddir)/ndb/src/common/editline/libeditline.a \
+ @TERMCAP_LIB@
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+
+ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/mgmsrv/Makefile b/ndb/src/mgmsrv/Makefile_old
index b10bdb64d30..c99875ae8b6 100644
--- a/ndb/src/mgmsrv/Makefile
+++ b/ndb/src/mgmsrv/Makefile_old
@@ -1,10 +1,10 @@
include .defs.mk
-TYPE := ndbapi
+TYPE := ndbapi mgmapiclient
BIN_TARGET := mgmtsrvr
BIN_TARGET_LIBS :=
-BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon
+BIN_TARGET_ARCHIVES := NDB_API mgmsrvcommon mgmapi general
ifneq ($(USE_EDITLINE), N)
BIN_TARGET_ARCHIVES += editline
@@ -31,6 +31,7 @@ SOURCES += CommandInterpreter.cpp
endif
CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \
+ -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \
-I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
-I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon)
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 7c2d94c6b7f..713433cb8e9 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -21,7 +21,6 @@
#include "MgmtErrorReporter.hpp"
#include <NdbOut.hpp>
-#include <AttrType.hpp>
#include <NdbApiSignal.hpp>
#include <kernel_types.h>
#include <RefConvert.hpp>
@@ -29,7 +28,6 @@
#include <GlobalSignalNumbers.h>
#include <signaldata/TestOrd.hpp>
#include <signaldata/TamperOrd.hpp>
-#include <signaldata/SetVarReq.hpp>
#include <signaldata/StartOrd.hpp>
#include <signaldata/ApiVersion.hpp>
#include <signaldata/ResumeReq.hpp>
@@ -49,6 +47,10 @@
#include "NodeLogLevel.hpp"
#include <NdbConfig.h>
+#include <mgmapi.h>
+#include <mgmapi_configuration.hpp>
+#include <mgmapi_config_parameters.h>
+
//#define MGM_SRV_DEBUG
#ifdef MGM_SRV_DEBUG
#define DEBUG(x) do ndbout << x << endl; while(0)
@@ -225,19 +227,33 @@ void
MgmtSrvr::startEventLog()
{
g_EventLogger.setCategory("MgmSrvr");
- const Properties *mgmProps;
- _config->get("Node", _ownNodeId, &mgmProps);
+
+ ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator
+ ((ndb_mgm_configuration*)_config->m_configValues, CFG_SECTION_NODE);
+ if(iter == 0)
+ return ;
+
+ if(ndb_mgm_find(iter, CFG_NODE_ID, _ownNodeId) != 0){
+ ndb_mgm_destroy_iterator(iter);
+ return ;
+ }
+
+ const char * tmp;
BaseString logdest;
char clusterLog[MAXPATHLEN];
-
NdbConfig_ClusterLogFileName(clusterLog, sizeof(clusterLog));
-
- mgmProps->get("LogDestination", logdest);
-
+
+
+ if(ndb_mgm_get_string_parameter(iter, CFG_LOG_DESTINATION, &tmp) == 0){
+ logdest.assign(tmp);
+ }
+ ndb_mgm_destroy_iterator(iter);
+
if(logdest.length()==0) {
- logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6", clusterLog);
+ logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6",
+ clusterLog);
}
-
+
if(!g_EventLogger.addHandler(logdest)) {
ndbout << "ERROR: cannot parse \"" << logdest << "\"" << endl;
exit(1);
@@ -375,8 +391,8 @@ MgmtSrvr::getNodeCount(enum ndb_mgm_node_type type) const
}
int
-MgmtSrvr::getStatPort() const
-{
+MgmtSrvr::getStatPort() const {
+#if 0
const Properties *mgmProps;
if(!getConfig()->get("Node", _ownNodeId, &mgmProps))
return -1;
@@ -386,12 +402,16 @@ MgmtSrvr::getStatPort() const
return -1;
return tmp;
+#else
+ return -1;
+#endif
}
/* Constructor */
MgmtSrvr::MgmtSrvr(NodeId nodeId,
const BaseString &configFilename,
- const BaseString &ndb_config_filename):
+ const BaseString &ndb_config_filename,
+ Config * config):
_blockNumber(1), // Hard coded block number since it makes it easy to send
// signals to other management servers.
_ownReference(0),
@@ -416,8 +436,8 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
m_nextConfigGenerationNumber = 0;
- _config = readConfig();
-
+ _config = (config == 0 ? readConfig() : config);
+
theMgmtWaitForResponseCondPtr = NdbCondition_Create();
m_configMutex = NdbMutex_Create();
@@ -428,31 +448,38 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
for(Uint32 i = 0; i<MAX_NODES; i++)
nodeTypes[i] = (enum ndb_mgm_node_type)-1;
- Properties::Iterator it(_config);
- const char * name;
- for(name = it.first(); name != NULL; name = it.next()){
- if(strncmp(name, "Node_", strlen("Node_")) == 0){
- const Properties * tmp;
+ ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator
+ (config->m_configValues, CFG_SECTION_NODE);
+ for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){
+ unsigned type, id;
+ if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0)
+ continue;
- _config->get(name, &tmp);
-
- Uint32 nodeId;
- BaseString type;
- MGM_REQUIRE(tmp->get("Id", &nodeId));
- MGM_REQUIRE(tmp->get("Type", type));
- MGM_REQUIRE(nodeId < MAX_NODES);
+ if(ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, &id) != 0)
+ continue;
+
+ MGM_REQUIRE(id < MAX_NODES);
- if(type == "MGM")
- nodeTypes[nodeId] = NDB_MGM_NODE_TYPE_MGM;
- if(type == "API")
- nodeTypes[nodeId] = NDB_MGM_NODE_TYPE_API;
- if(type == "DB")
- nodeTypes[nodeId] = NDB_MGM_NODE_TYPE_NDB;
- if(type == "REP")
- nodeTypes[nodeId] = NDB_MGM_NODE_TYPE_API;
+ switch(type){
+ case NODE_TYPE_DB:
+ nodeTypes[id] = NDB_MGM_NODE_TYPE_NDB;
+ break;
+ case NODE_TYPE_API:
+ nodeTypes[id] = NDB_MGM_NODE_TYPE_API;
+ break;
+ case NODE_TYPE_MGM:
+ nodeTypes[id] = NDB_MGM_NODE_TYPE_MGM;
+ break;
+ case NODE_TYPE_REP:
+ nodeTypes[id] = NDB_MGM_NODE_TYPE_REP;
+ break;
+ case NODE_TYPE_EXT_REP:
+ default:
+ break;
}
}
-
+ ndb_mgm_destroy_iterator(iter);
+
m_statisticsListner = NULL;
_nodeLogLevelList = new NodeLogLevelList();
@@ -472,13 +499,6 @@ MgmtSrvr::check_start()
return false;
}
- _props = new Config(* _config);
- if (_props == 0) {
- DEBUG("MgmtSrvr.cpp: Object props is NULL.");
- return false;
- }
- MGM_REQUIRE(_props->put("LocalNodeId", _ownNodeId, true));
-
return true;
}
@@ -489,11 +509,10 @@ MgmtSrvr::start()
if (!check_start())
return false;
}
+ theFacade = TransporterFacade::start_instance
+ (_ownNodeId,
+ (ndb_mgm_configuration*)_config->m_configValues);
- theFacade = TransporterFacade::start_instance(_props, NULL);
- delete _props;
- _props = NULL;
-
if(theFacade == 0) {
DEBUG("MgmtSrvr.cpp: theFacade is NULL.");
return false;
@@ -506,14 +525,14 @@ MgmtSrvr::start()
_blockNumber = theFacade->open(this,
signalReceivedNotification,
nodeStatusNotification);
-
+
if(_blockNumber == -1){
DEBUG("MgmtSrvr.cpp: _blockNumber is -1.");
theFacade->stop_instance();
theFacade = 0;
return false;
}
-
+
_ownReference = numberToRef(_blockNumber, _ownNodeId);
startEventLog();
@@ -558,7 +577,11 @@ MgmtSrvr::~MgmtSrvr()
NdbMutex_Destroy(m_configMutex);
if(m_newConfig != NULL)
- delete m_newConfig;
+ free(m_newConfig);
+
+ if(_config != NULL)
+ delete _config;
+
delete _nodeLogLevelList;
delete _clusterLogLevelList;
@@ -813,9 +836,10 @@ MgmtSrvr::restart(bool nostart, bool initalStart, bool abort,
s = NDB_MGM_NODE_STATUS_NO_CONTACT;
while (s == NDB_MGM_NODE_STATUS_NO_CONTACT && waitTime > 0) {
Uint32 startPhase = 0, version = 0, dynamicId = 0, nodeGroup = 0;
+ Uint32 connectCount = 0;
bool system;
status(nodeId, &s, &version, &startPhase,
- &system, &dynamicId, &nodeGroup);
+ &system, &dynamicId, &nodeGroup, &connectCount);
NdbSleep_MilliSleep(100);
waitTime = (maxTime - NdbTick_CurrentMillisecond());
}
@@ -1298,7 +1322,8 @@ MgmtSrvr::status(int processId,
Uint32 * _phase,
bool * _system,
Uint32 * dynamic,
- Uint32 * nodegroup)
+ Uint32 * nodegroup,
+ Uint32 * connectCount)
{
if (getNodeType(processId) == NDB_MGM_NODE_TYPE_API) {
if(versionNode(processId, false,0,0) ==0)
@@ -1325,7 +1350,8 @@ MgmtSrvr::status(int processId,
* dynamic = node.m_state.dynamicId;
* nodegroup = node.m_state.nodeGroup;
-
+ * connectCount = node.m_info.m_connectCount;
+
switch(node.m_state.startLevel){
case NodeState::SL_CMVMI:
* _status = NDB_MGM_NODE_STATUS_NOT_STARTED;
@@ -1376,11 +1402,11 @@ MgmtSrvr::status(int processId,
* _phase = 0;
return 0;
}
-
+
return -1;
}
-
-
+
+
//****************************************************************************
//****************************************************************************
int
@@ -1950,7 +1976,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal)
BackupEvent event;
event.Event = BackupEvent::BackupStarted;
event.Started.BackupId = conf->backupId;
- event.Started.Nodes = conf->nodes;
+ event.Nodes = conf->nodes;
#ifdef VM_TRACE
ndbout_c("Backup master is %d", refToNode(signal->theSendersBlockRef));
#endif
@@ -2013,7 +2039,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal)
event.Completed.stopGCP = rep->stopGCP;
event.Completed.startGCP = rep->startGCP;
- event.Completed.Nodes = rep->nodes;
+ event.Nodes = rep->nodes;
backupCallback(event);
}
@@ -2170,8 +2196,9 @@ MgmtSrvr::getNextNodeId(NodeId * nodeId, enum ndb_mgm_node_type type) const
while(nodeTypes[tmp] != type && tmp < MAX_NODES)
tmp++;
- if(tmp == MAX_NODES)
+ if(tmp == MAX_NODES){
return false;
+ }
* nodeId = tmp;
return true;
@@ -2530,8 +2557,8 @@ MgmtSrvr::getStuff()
}
NodeId
-MgmtSrvr::getPrimaryNode() const
-{
+MgmtSrvr::getPrimaryNode() const {
+#if 0
Uint32 tmp;
const Properties *prop = NULL;
@@ -2542,4 +2569,7 @@ MgmtSrvr::getPrimaryNode() const
prop->get("PrimaryMGMNode", &tmp);
return tmp;
+#else
+ return 0;
+#endif
}
diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp
index ce8765d6c73..1d394a14857 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -27,6 +27,7 @@
#include <NodeBitmask.hpp>
#include <signaldata/ManagementServer.hpp>
#include "SignalQueue.hpp"
+#include <ndb_version.h>
#include "NodeLogLevelList.hpp"
@@ -151,7 +152,8 @@ public:
/* Constructor */
MgmtSrvr(NodeId nodeId, /* Local nodeid */
const BaseString &config_filename, /* Where to save config */
- const BaseString &ndb_config_filename); /* Ndb.cfg filename */
+ const BaseString &ndb_config_filename, /* Ndb.cfg filename */
+ Config * config);
/**
* Read (initial) config file, create TransporterFacade,
@@ -169,7 +171,8 @@ public:
Uint32 * phase,
bool * systemShutdown,
Uint32 * dynamicId,
- Uint32 * nodeGroup);
+ Uint32 * nodeGroup,
+ Uint32 * connectCount);
// All the functions below may return any of this error codes:
// NO_CONTACT_WITH_PROCESS, PROCESS_NOT_CONFIGURED, WRONG_PROCESS_TYPE,
@@ -307,10 +310,10 @@ public:
BackupAborted = 4
} Event;
+ NdbNodeBitmask Nodes;
union {
struct {
Uint32 BackupId;
- NdbNodeBitmask Nodes;
} Started ;
struct {
Uint32 ErrorCode;
@@ -321,7 +324,6 @@ public:
Uint32 NoOfRecords;
Uint32 NoOfLogBytes;
Uint32 NoOfLogRecords;
- NdbNodeBitmask Nodes;
Uint32 startGCP;
Uint32 stopGCP;
} Completed ;
@@ -522,7 +524,7 @@ private:
int _blockNumber;
NodeId _ownNodeId;
BlockReference _ownReference;
- NdbMutex *m_configMutex;
+ NdbMutex *m_configMutex;
const Config * _config;
Config * m_newConfig;
BaseString m_configFilename;
diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
index f4e53409b30..10316bd2851 100644
--- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp
@@ -275,31 +275,30 @@ MgmtSrvr::readConfig() {
Config *conf = NULL;
if(m_configFilename.length() != 0) {
/* Use config file */
- InitConfigFileParser parser(m_configFilename.c_str());
-
- if(!parser.readConfigFile()) {
+ InitConfigFileParser parser;
+ conf = parser.parseConfig(m_configFilename.c_str());
+
+ if(conf == NULL) {
/* Try to get configuration from other MGM server */
- ConfigRetriever cr;
- cr.setLocalConfigFileName(m_localNdbConfigFilename.c_str());
- conf = new Config(*cr.getConfig("MGM", NDB_VERSION));
- } else {
- conf = new Config(*parser.getConfig());
+ return fetchConfig();
}
-
- if(conf == NULL)
- return NULL;
}
return conf;
}
Config *
MgmtSrvr::fetchConfig() {
- Config *conf = NULL;
ConfigRetriever cr;
cr.setLocalConfigFileName(m_localNdbConfigFilename.c_str());
- conf = new Config(*cr.getConfig("MGM", NDB_VERSION));
+ struct ndb_mgm_configuration * tmp = cr.getConfig(NDB_VERSION,
+ NODE_TYPE_MGM);
+ if(tmp != 0){
+ Config * conf = new Config();
+ conf->m_configValues = tmp;
+ return conf;
+ }
- return conf;
+ return 0;
}
bool
diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp
index 24f41fe64bf..739eef90c52 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -26,6 +26,9 @@
#include <BaseString.hpp>
#include <Base64.hpp>
+#include <ConfigValues.hpp>
+#include <mgmapi_configuration.hpp>
+
#include "Services.hpp"
static const unsigned int MAX_READ_TIMEOUT = 1000 ;
@@ -275,12 +278,60 @@ MgmApiSession::getConfig_old(Parser_t::Context &ctx) {
}
#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */
+inline void require(bool b){ if(!b) abort(); }
+
void
MgmApiSession::getConfig(Parser_t::Context &ctx,
const class Properties &args) {
getConfig_common(ctx, args);
}
+static Properties *
+backward(const char * base, const Properties* reply){
+ Properties * ret = new Properties();
+ Properties::Iterator it(reply);
+ for(const char * name = it.first(); name != 0; name=it.next()){
+ PropertiesType type;
+ reply->getTypeOf(name, &type);
+ switch(type){
+ case PropertiesType_Uint32:{
+ Uint32 val;
+ reply->get(name, &val);
+ ret->put(name, val);
+ }
+ break;
+ case PropertiesType_char:
+ {
+ const char * val;
+ reply->get(name, &val);
+ ret->put(name, val);
+ if(!strcmp(name, "Type") && !strcmp(val, "DB")){
+ ret->put("NoOfDiskBufferPages", (unsigned)0);
+ ret->put("NoOfDiskFiles", (unsigned)0);
+ ret->put("NoOfDiskClusters", (unsigned)0);
+ ret->put("NoOfFreeDiskClusters", (unsigned)0);
+ ret->put("NoOfDiskClustersPerDiskFile", (unsigned)0);
+ ret->put("NoOfConcurrentCheckpointsDuringRestart", (unsigned)1);
+ ret->put("NoOfConcurrentCheckpointsAfterRestart", (unsigned)1);
+ ret->put("NoOfConcurrentProcessesHandleTakeover", (unsigned)1);
+ }
+ }
+ break;
+ case PropertiesType_Properties:
+ {
+ const Properties * recurse;
+ reply->get(name, &recurse);
+ Properties * val = backward(name, recurse);
+ ret->put(name, val);
+ }
+ break;
+ case PropertiesType_Uint64:
+ break;
+ }
+ }
+ return ret;
+}
+
void
MgmApiSession::getConfig_common(Parser_t::Context &,
const class Properties &args,
@@ -290,92 +341,100 @@ MgmApiSession::getConfig_common(Parser_t::Context &,
args.get("version", &version);
args.get("node", &node);
-#if 0
- if(version != 0) {
- m_output->println("get config");
- m_output->println("result: Invalid version number");
- m_output->println("");
- return;
- }
-#endif
-
const Config *conf = m_mgmsrv.getConfig();
if(conf == NULL) {
- m_output->println("get config");
+ m_output->println("get config reply");
m_output->println("result: Could not fetch configuration");
m_output->println("");
return;
}
- bool compatible;
- switch (m_mgmsrv.getNodeType(node)) {
- case NDB_MGM_NODE_TYPE_NDB:
- compatible = ndbCompatible_mgmt_ndb(NDB_VERSION, version);
- break;
- case NDB_MGM_NODE_TYPE_API:
- case NDB_MGM_NODE_TYPE_MGM:
- compatible = ndbCompatible_mgmt_api(NDB_VERSION, version);
- break;
- default:
- m_output->println("get config");
- m_output->println("result: unrecognignized node type");
- m_output->println("");
- return;
- }
-
- if (!compatible){
- m_output->println("get config");
- m_output->println("result: incompatible version mgmt 0x%x and node 0x%x",
- NDB_VERSION, version);
- m_output->println("");
- return;
- }
-
- Properties *reply = new Properties(*conf);
- reply->put("Version", NDB_VERSION); // reply->put("Version", version);
- reply->put("LocalNodeId", node);
+ if(version > 0 && version < makeVersion(3, 5, 0) && compat){
+ Properties *reply = backward("", conf->m_oldConfig);
+ reply->put("Version", version);
+ reply->put("LocalNodeId", node);
-#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT
- if(compat) {
+ backward("", reply);
+ //reply->print();
+
const Uint32 size = reply->getPackedSize();
Uint32 *buffer = new Uint32[size/4+1];
reply->pack(buffer);
delete reply;
-
+
const int uurows = (size + 44)/45;
char * uubuf = new char[uurows * 62+5];
-
+
const int uusz = uuencode_mem(uubuf, (char *)buffer, size);
delete[] buffer;
-
+
m_output->println("GET CONFIG %d %d %d %d %d",
- 0, NDB_VERSION, node, size, uusz);// 0, version, node, size, uusz);
-
+ 0, version, node, size, uusz);
+
m_output->println("begin 664 Ndb_cfg.bin");
-
+
/* XXX Need to write directly to the socket, because the uubuf is not
* NUL-terminated. This could/should probably be done in a nicer way.
*/
write_socket(m_socket, MAX_WRITE_TIMEOUT, uubuf, uusz);
delete[] uubuf;
-
+
m_output->println("end");
m_output->println("");
- } else {
-#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */
-
- UtilBuffer buffer;
- BaseString str;
- reply->pack(buffer);
- delete reply;
- base64_encode(buffer, str);
+ return;
+ }
- m_output->println("config: %s", str.c_str());
- m_output->println("");
-#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT
+ if(compat){
+ m_output->println("GET CONFIG %d %d %d %d %d",1, version, 0, 0, 0);
+ return;
}
-#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */
+
+ if(node != 0){
+ bool compatible;
+ switch (m_mgmsrv.getNodeType(node)) {
+ case NDB_MGM_NODE_TYPE_NDB:
+ compatible = ndbCompatible_mgmt_ndb(NDB_VERSION, version);
+ break;
+ case NDB_MGM_NODE_TYPE_API:
+ case NDB_MGM_NODE_TYPE_MGM:
+ compatible = ndbCompatible_mgmt_api(NDB_VERSION, version);
+ break;
+ default:
+ m_output->println("get config");
+ m_output->println("result: unrecognignized node type");
+ m_output->println("");
+ return;
+ }
+
+ if (!compatible){
+ m_output->println("get config");
+ m_output->println("result: incompatible version mgmt 0x%x and node 0x%x",
+ NDB_VERSION, version);
+ m_output->println("");
+ return;
+ }
+ }
+
+ const ConfigValues * cfg = &conf->m_configValues->m_config;
+ const Uint32 size = cfg->getPackedSize();
+
+ UtilBuffer src;
+ cfg->pack(src);
+
+ BaseString str;
+ int res = base64_encode(src, str);
+
+ m_output->println("get config reply");
+ m_output->println("result: Ok");
+ m_output->println("Content-Length: %d", str.length());
+ m_output->println("Content-Type: ndbconfig/octet-stream");
+ m_output->println("Content-Transfer-Encoding: base64");
+ m_output->println("");
+ m_output->println(str.c_str());
+ m_output->println("");
+
+ return;
}
void
@@ -756,10 +815,14 @@ printNodeStatus(OutputStream *output,
NodeId nodeId = 0;
while(mgmsrv.getNextNodeId(&nodeId, type)) {
enum ndb_mgm_node_status status;
- Uint32 startPhase = 0, version = 0, dynamicId = 0, nodeGroup = 0;
+ Uint32 startPhase = 0,
+ version = 0,
+ dynamicId = 0,
+ nodeGroup = 0,
+ connectCount = 0;
bool system;
mgmsrv.status(nodeId, &status, &version, &startPhase,
- &system, &dynamicId, &nodeGroup);
+ &system, &dynamicId, &nodeGroup, &connectCount);
output->println("node.%d.type: %s",
nodeId,
ndb_mgm_get_node_type_string(type));
@@ -770,6 +833,7 @@ printNodeStatus(OutputStream *output,
output->println("node.%d.startphase: %d", nodeId, startPhase);
output->println("node.%d.dynamic_id: %d", nodeId, dynamicId);
output->println("node.%d.node_group: %d", nodeId, nodeGroup);
+ output->println("node.%d.connect_count: %d", nodeId, connectCount);
}
}
diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp
index 91b443f61a2..d9eb0001c44 100644
--- a/ndb/src/mgmsrv/main.cpp
+++ b/ndb/src/mgmsrv/main.cpp
@@ -34,6 +34,7 @@
#include <NdbHost.h>
#include <ndb_version.h>
#include <ConfigRetriever.hpp>
+#include <mgmapi_config_parameters.h>
#include <getarg.h>
#if defined NDB_OSE || defined NDB_SOFTOSE
@@ -191,7 +192,10 @@ NDB_MAIN(mgmsrv){
glob.mgmObject = new MgmtSrvr(glob.localNodeId,
BaseString(glob.config_filename),
- BaseString(glob.local_config_filename == 0 ? "" : glob.local_config_filename));
+ BaseString(glob.local_config_filename == 0 ? "" : glob.local_config_filename),
+ glob.cluster_config);
+
+ glob.cluster_config = 0;
if(!glob.mgmObject->check_start()){
ndbout_c("Unable to start management server.");
@@ -321,18 +325,21 @@ readGlobalConfig() {
return false;
/* Use config file */
- InitConfigFileParser parser(glob.config_filename);
-
- if(parser.readConfigFile()) {
- glob.cluster_config = new Config(*parser.getConfig());
- } else {
- /* Try to get configuration from other MGM server */
+ InitConfigFileParser parser;
+ glob.cluster_config = parser.parseConfig(glob.config_filename);
+ if(glob.cluster_config == 0){
+ /**
+ * Try to get configuration from other MGM server
+ * Note: Only new format
+ */
+ glob.cluster_config = new Config();
+
ConfigRetriever cr;
cr.setLocalConfigFileName(glob.local_config_filename);
- Properties* mgmconf = cr.getConfig("MGM", NDB_VERSION);
- if (mgmconf == NULL)
+ glob.cluster_config->m_configValues = cr.getConfig(NDB_VERSION,
+ NODE_TYPE_MGM);
+ if (glob.cluster_config->m_configValues == NULL)
return false;
- glob.cluster_config = new Config(*mgmconf);
}
return true;
}
@@ -350,15 +357,23 @@ static bool
setPortNo(){
const Properties *mgmProps;
- if(!glob.cluster_config->get("Node", glob.localNodeId, &mgmProps)){
+ ndb_mgm_configuration_iterator * iter =
+ ndb_mgm_create_configuration_iterator(glob.cluster_config->m_configValues,
+ CFG_SECTION_NODE);
+ if(iter == 0)
+ return false;
+
+ if(ndb_mgm_find(iter, CFG_NODE_ID, glob.localNodeId) != 0){
ndbout << "Could not retrieve configuration for Node "
<< glob.localNodeId << " in config file." << endl
<< "Have you set correct NodeId for this node?" << endl;
+ ndb_mgm_destroy_iterator(iter);
return false;
}
- BaseString type;
- if(!mgmProps->get("Type", type) || strcasecmp(type.c_str(), "MGM") != 0){
+ unsigned type;
+ if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0 ||
+ type != NODE_TYPE_MGM){
ndbout << "Local node id " << glob.localNodeId
<< " is not defined as management server" << endl
<< "Have you set correct NodeId for this node?" << endl;
@@ -369,7 +384,7 @@ setPortNo(){
* Set Port *
************/
Uint32 tmp = 0;
- if (!mgmProps->get("PortNumber", &tmp)){
+ if(ndb_mgm_get_int_parameter(iter, CFG_MGM_PORT, &tmp) != 0){
ndbout << "Could not find PortNumber in the configuration file." << endl;
return false;
}
@@ -378,15 +393,18 @@ setPortNo(){
/*****************
* Set Stat Port *
*****************/
+#if 0
if (!mgmProps->get("PortNumberStats", &tmp)){
ndbout << "Could not find PortNumberStats in the configuration file."
<< endl;
return false;
}
glob.port_stats = tmp;
+#endif
- BaseString host;
- if(!mgmProps->get("ExecuteOnComputer", host)){
+#if 0
+ const char * host;
+ if(ndb_mgm_get_string_parameter(iter, mgmProps->get("ExecuteOnComputer", host)){
ndbout << "Failed to find \"ExecuteOnComputer\" for my node" << endl;
ndbout << "Unable to verify own hostname" << endl;
return false;
@@ -422,8 +440,11 @@ setPortNo(){
return true;
}
- glob.use_specific_ip = false;
glob.interface_name = strdup(hostname);
-
+#endif
+
+ glob.interface_name = 0;
+ glob.use_specific_ip = false;
+
return true;
}
diff --git a/ndb/src/mgmsrv/mkconfig/Makefile b/ndb/src/mgmsrv/mkconfig/Makefile
index d35f68a5648..43574eefbd1 100644
--- a/ndb/src/mgmsrv/mkconfig/Makefile
+++ b/ndb/src/mgmsrv/mkconfig/Makefile
@@ -3,12 +3,11 @@ include .defs.mk
TYPE := ndbapi
BIN_TARGET := mkconfig
-BIN_TARGET_ARCHIVES := logger general trace mgmsrvcommon portlib
+BIN_TARGET_ARCHIVES := logger trace mgmsrvcommon portlib general
SOURCES := mkconfig.cpp
CCFLAGS_LOC += -I.. -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon)
-
-OBJECTS_LOC := ../convertStrToInt.o
+CFLAGS_mkconfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
index 224c82aa8a1..3b2046d7b49 100644
--- a/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
+++ b/ndb/src/mgmsrv/mkconfig/mkconfig.cpp
@@ -16,6 +16,7 @@
#include <ndb_global.h>
#include <ndb_version.h>
+#include <mgmapi_configuration.hpp>
#include <NdbMain.h>
#include <Properties.hpp>
@@ -36,25 +37,20 @@ NDB_COMMAND(mkconfig,
return 0;
}
- InitConfigFileParser parser(argv[1]);
- Config* cp;
+ InitConfigFileParser parser;
+ Config* _cp;
- if (!parser.readConfigFile())
+ if ((_cp = parser.parseConfig(argv[1])) == 0)
return false;
- cp = (Config *) parser.getConfig();
- if (cp == NULL)
- return false;
-
- cp->put("VersionId", (Uint32)NDB_VERSION);
-
+ ConfigValues* cp = &_cp->m_configValues->m_config;
Uint32 sz = cp->getPackedSize();
- Uint32 * buf = new Uint32[sz];
+ UtilBuffer buf;
if(!cp->pack(buf))
return -1;
-
+
FILE * f = fopen(argv[2], "w");
- if(fwrite(buf, 1, sz, f) != sz){
+ if(fwrite(buf.get_data(), 1, buf.length(), f) != sz){
fclose(f);
unlink(argv[2]);
return -1;
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index 1b536b6d741..b26d550fe31 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -21,7 +21,6 @@
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
-#include "AttrType.hpp"
#include "NdbApiSignal.hpp"
#include "API.hpp"
#include <NdbSleep.h>
@@ -33,6 +32,10 @@
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/ApiRegSignalData.hpp>
+#include <mgmapi.h>
+#include <mgmapi_configuration.hpp>
+#include <mgmapi_config_parameters.h>
+
// Just a C wrapper for threadMain
extern "C"
void*
@@ -70,32 +73,49 @@ ClusterMgr::~ClusterMgr(){
}
void
-ClusterMgr::init(const IPCConfig & config){
- NodeId tmp = 0;
- while(config.getNextRemoteNodeId(tmp)) {
+ClusterMgr::init(ndb_mgm_configuration_iterator & iter){
+ for(iter.first(); iter.valid(); iter.next()){
+ Uint32 tmp = 0;
+ if(iter.get(CFG_NODE_ID, &tmp))
+ continue;
+
theNodes[tmp].defined = true;
#if 0
ndbout << "--------------------------------------" << endl;
- config.print();
ndbout << "--------------------------------------" << endl;
ndbout_c("ClusterMgr: Node %d defined as %s", tmp, config.getNodeType(tmp));
#endif
- if(strcmp(config.getNodeType(tmp), "DB") == 0) {
+
+ unsigned type;
+ if(iter.get(CFG_TYPE_OF_SECTION, &type))
+ continue;
+
+ switch(type){
+ case NODE_TYPE_DB:
theNodes[tmp].m_info.m_type = NodeInfo::DB;
- } else if(strcmp(config.getNodeType(tmp), "API") == 0) {
+ break;
+ case NODE_TYPE_API:
theNodes[tmp].m_info.m_type = NodeInfo::API;
- } else if(strcmp(config.getNodeType(tmp), "MGM") == 0) {
+ break;
+ case NODE_TYPE_MGM:
theNodes[tmp].m_info.m_type = NodeInfo::MGM;
- } else if(strcmp(config.getNodeType(tmp), "REP") == 0) {
+ break;
+ case NODE_TYPE_REP:
theNodes[tmp].m_info.m_type = NodeInfo::REP;
- } else if(strcmp(config.getNodeType(tmp), "EXTERNAL REP") == 0) {
+ break;
+ case NODE_TYPE_EXT_REP:
theNodes[tmp].m_info.m_type = NodeInfo::REP;
- theNodes[tmp].hbFrequency = config.getREPHBFrequency(tmp);
- assert(100 <= theNodes[tmp].hbFrequency &&
- theNodes[tmp].hbFrequency < 60 * 60 * 1000);
- } else {
+ {
+ Uint32 hbFreq = 10000;
+ //ndb_mgm_get_int_parameter(iter, CFG_, &hbFreq);
+ theNodes[tmp].hbFrequency = hbFreq;
+ assert(100 <= hbFreq && hbFreq < 60 * 60 * 1000);
+ }
+ break;
+ default:
+ type = type;
#if 0
- ndbout_c("ClusterMgr: Unknown node type: %s", config.getNodeType(tmp));
+ ndbout_c("ClusterMgr: Unknown node type: %d", type);
#endif
}
}
@@ -163,45 +183,43 @@ ClusterMgr::threadMain( ){
const NodeId nodeId = i;
Node & theNode = theNodes[nodeId];
- if (theNode.defined == true) {
-#if 0
- ndbout_c("ClusterMgr: compatible %d", (int)nodeId);
-#endif
+ if (!theNode.defined)
+ continue;
- if (theNode.connected == false){
- theFacade.doConnect(nodeId);
- continue;
+ if (theNode.connected == false){
+ theFacade.doConnect(nodeId);
+ continue;
+ }
+
+ if (!theNode.compatible){
+ continue;
+ }
+
+ theNode.hbCounter += timeSlept;
+ if (theNode.hbCounter >= theNode.hbFrequency){
+ /**
+ * It is now time to send a new Heartbeat
+ */
+ theNode.hbSent++;
+ theNode.hbCounter = 0;
+ /**
+ * If the node is of type REP,
+ * then the receiver of the signal should be API_CLUSTERMGR
+ */
+ if (theNode.m_info.m_type == NodeInfo::REP) {
+ signal.theReceiversBlockNumber = API_CLUSTERMGR;
}
-
-#if 0
- ndbout_c("ClusterMgr: connected %d", (int)nodeId);
+#if 0
+ ndbout_c("ClusterMgr: Sending API_REGREQ to node %d", (int)nodeId);
#endif
-
- theNode.hbCounter += timeSlept;
- if (theNode.hbCounter >= theNode.hbFrequency){
- /**
- * It is now time to send a new Heartbeat
- */
- theNode.hbSent++;
- theNode.hbCounter = 0;
- /**
- * If the node is of type REP,
- * then the receiver of the signal should be API_CLUSTERMGR
- */
- if (theNode.m_info.m_type == NodeInfo::REP) {
- signal.theReceiversBlockNumber = API_CLUSTERMGR;
- }
-#if 0
- ndbout_c("ClusterMgr: Sending API_REGREQ to node %d", (int)nodeId);
-#endif
- theFacade.sendSignalUnCond(&signal, nodeId);
- }//if
-
- if (theNode.hbSent == 4 && theNode.hbFrequency > 0){
- reportNodeFailed(i);
- }//if
- }//if(defined)
- }//for
+ theFacade.sendSignalUnCond(&signal, nodeId);
+ }//if
+
+ if (theNode.hbSent == 4 && theNode.hbFrequency > 0){
+ reportNodeFailed(i);
+ }//if
+ }
+
/**
* End of secure area. Let other threads in
*/
@@ -282,6 +300,10 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
const ApiRegConf * const apiRegConf = (ApiRegConf *)&theData[0];
const NodeId nodeId = refToNode(apiRegConf->qmgrRef);
+#if 0
+ ndbout_c("ClusterMgr: Recd API_REGCONF from node %d", nodeId);
+#endif
+
assert(nodeId > 0 && nodeId < MAX_NODES);
Node & node = theNodes[nodeId];
diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp
index 7b7b947742b..cc3cf66c8aa 100644
--- a/ndb/src/ndbapi/ClusterMgr.hpp
+++ b/ndb/src/ndbapi/ClusterMgr.hpp
@@ -40,7 +40,7 @@ class ClusterMgr {
public:
ClusterMgr(class TransporterFacade &);
~ClusterMgr();
- void init(const IPCConfig & config);
+ void init(struct ndb_mgm_configuration_iterator & config);
void reportConnected(NodeId nodeId);
void reportDisconnected(NodeId nodeId);
@@ -114,7 +114,7 @@ ClusterMgr::getNoOfConnectedNodes() const {
return noOfConnectedNodes;
}
-/******************************************************************************/
+/*****************************************************************************/
/**
* @class ArbitMgr
diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp
index e59793bbc09..098acc9006a 100644
--- a/ndb/src/ndbapi/DictCache.hpp
+++ b/ndb/src/ndbapi/DictCache.hpp
@@ -56,13 +56,14 @@ public:
NdbTableImpl* put(const char * name, NdbTableImpl *);
void drop(NdbTableImpl *);
void release(NdbTableImpl *);
-private:
+public:
enum Status {
OK = 0,
DROPPED = 1,
RETREIVING = 2
};
+private:
struct TableVersion {
Uint32 m_version;
Uint32 m_refCount;
diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am
new file mode 100644
index 00000000000..2ec58ab6e85
--- /dev/null
+++ b/ndb/src/ndbapi/Makefile.am
@@ -0,0 +1,50 @@
+#SUBDIRS = signal-sender
+
+noinst_LTLIBRARIES = libndbapi.la
+
+libndbapi_la_SOURCES = \
+ TransporterFacade.cpp \
+ ClusterMgr.cpp \
+ Ndb.cpp \
+ NdbPoolImpl.cpp \
+ NdbPool.cpp \
+ Ndblist.cpp \
+ Ndbif.cpp \
+ Ndbinit.cpp \
+ Ndberr.cpp \
+ ndberror.c \
+ NdbErrorOut.cpp \
+ NdbConnection.cpp \
+ NdbConnectionScan.cpp \
+ NdbOperation.cpp \
+ NdbOperationSearch.cpp \
+ NdbOperationScan.cpp \
+ NdbOperationInt.cpp \
+ NdbOperationDefine.cpp \
+ NdbOperationExec.cpp \
+ NdbResultSet.cpp \
+ NdbCursorOperation.cpp \
+ NdbScanReceiver.cpp NdbScanOperation.cpp \
+ NdbScanFilter.cpp \
+ NdbIndexOperation.cpp \
+ NdbEventOperation.cpp \
+ NdbEventOperationImpl.cpp \
+ NdbApiSignal.cpp \
+ NdbRecAttr.cpp \
+ NdbUtil.cpp \
+ NdbReceiver.cpp \
+ NdbDictionary.cpp \
+ NdbDictionaryImpl.cpp \
+ DictCache.cpp \
+ NdbBlob.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi
+
+# Ndbapi cannot handle -O3
+NDB_CXXFLAGS_RELEASE_LOC = -O2
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/src/ndbapi/Makefile b/ndb/src/ndbapi/Makefile_old
index f4c82e5d6ba..c2bb0189a7f 100644
--- a/ndb/src/ndbapi/Makefile
+++ b/ndb/src/ndbapi/Makefile_old
@@ -15,13 +15,16 @@ LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) \
transporter \
general \
signaldataprint \
- mgmsrvcommon \
+ mgmapi mgmsrvcommon \
portlib \
logger \
trace
DIRS := signal-sender
+CFLAGS_TransporterFacade.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+CFLAGS_ClusterMgr.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
+
# Source files of non-templated classes (.cpp files)
SOURCES = \
TransporterFacade.cpp \
@@ -55,7 +58,8 @@ SOURCES = \
NdbSchemaOp.cpp \
NdbUtil.cpp \
NdbReceiver.cpp \
- NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp
+ NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp \
+ NdbBlob.cpp
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
index 448a29ca485..fe7260c4693 100644
--- a/ndb/src/ndbapi/Ndb.cpp
+++ b/ndb/src/ndbapi/Ndb.cpp
@@ -26,8 +26,6 @@ Name: Ndb.cpp
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
#include <NdbOperation.hpp>
#include <NdbConnection.hpp>
#include <NdbEventOperation.hpp>
@@ -40,8 +38,6 @@ Name: Ndb.cpp
#include <NdbEnv.h>
#include <BaseString.hpp>
-static bool fullyQualifiedNames = true;
-
/****************************************************************************
void connect();
@@ -155,7 +151,7 @@ Ndb::NDB_connect(Uint32 tNode)
// Set connection pointer as NdbConnection object
//************************************************
tSignal->setData(theMyRef, 2); // Set my block reference
- tNdbCon->Status(Connecting); // Set status to connecting
+ tNdbCon->Status(NdbConnection::Connecting); // Set status to connecting
Uint32 nodeSequence;
{ // send and receive signal
tp->lock_mutex();
@@ -178,7 +174,7 @@ Ndb::NDB_connect(Uint32 tNode)
}//if
}
- if ((tReturnCode == 0) && (tNdbCon->Status() == Connected)) {
+ if ((tReturnCode == 0) && (tNdbCon->Status() == NdbConnection::Connected)) {
//************************************************
// Send and receive was successful
//************************************************
@@ -434,7 +430,7 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
theFirstTransId = tFirstTransId + 1;
}//if
#ifdef VM_TRACE
- if (tConnection->theListState != NotInList) {
+ if (tConnection->theListState != NdbConnection::NotInList) {
printState("startTransactionLocal %x", tConnection);
abort();
}
@@ -476,6 +472,19 @@ Ndb::closeTransaction(NdbConnection* aConnection)
//-----------------------------------------------------
// closeTransaction called on non-existing transaction
//-----------------------------------------------------
+
+ if(aConnection->theError.code == 4008){
+ /**
+ * When a SCAN timed-out, returning the NdbConnection leads
+ * to reuse. And TC crashes when the API tries to reuse it to
+ * something else...
+ */
+#ifdef VM_TRACE
+ printf("Scan timeout:ed NdbConnection-> not returning it-> memory leak\n");
+#endif
+ return;
+ }
+
#ifdef VM_TRACE
printf("Non-existing transaction into closeTransaction\n");
abort();
@@ -589,7 +598,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
tSignal.setData (tAction, 1);
tSignal.setData(tNdbConn->ptr2int(),2);
tSignal.setData(theMyRef,3); // Set return block reference
- tNdbConn->Status(Connecting); // Set status to connecting
+ tNdbConn->Status(NdbConnection::Connecting); // Set status to connecting
TransporterFacade *tp = TransporterFacade::instance();
if (tAction == 3) {
tp->lock_mutex();
@@ -622,7 +631,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
}//if
ret_code = sendRecSignal(tNode, WAIT_NDB_TAMPER, &tSignal, 0);
if (ret_code == 0) {
- if (tNdbConn->Status() != Connected) {
+ if (tNdbConn->Status() != NdbConnection::Connected) {
theRestartGCI = 0;
}//if
releaseNdbCon(tNdbConn);
@@ -637,6 +646,7 @@ Ndb::NdbTamper(TamperType aAction, int aNode)
return 0;
#endif
}
+#if 0
/****************************************************************************
NdbSchemaCon* startSchemaTransaction();
@@ -678,7 +688,7 @@ Ndb::closeSchemaTransaction(NdbSchemaCon* aSchemaCon)
theSchemaConToNdbList = NULL;
return;
}//Ndb::closeSchemaTransaction()
-
+#endif
/*****************************************************************************
void RestartGCI(int aRestartGCI);
@@ -826,7 +836,7 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op)
tOperation->interpretedUpdateTuple();
tOperation->equal("SYSKEY_0", aTableId );
{
-#ifdef NDB_SOLARIS
+#ifdef WORDS_BIGENDIAN
Uint64 cacheSize64 = opValue; // XXX interpreter bug on Uint32
tOperation->incValue("NEXTID", cacheSize64);
#else
@@ -992,7 +1002,7 @@ Ndb::StartTransactionNodeSelectionData::release(){
Uint32
convertEndian(Uint32 Data)
{
-#ifdef _BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
Uint32 t1, t2, t3, t4;
t4 = (Data >> 24) & 255;
t3 = (Data >> 16) & 255;
@@ -1014,18 +1024,14 @@ const char * Ndb::getCatalogName() const
void Ndb::setCatalogName(const char * a_catalog_name)
{
if (a_catalog_name) {
- strncpy(theDataBase, a_catalog_name, NDB_MAX_DATABASE_NAME_SIZE);
- // Prepare prefix for faster operations
- uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1);
- uint schema_len =
- MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1);
- strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1);
- prefixName[db_len] = '/';
- strncpy(prefixName+db_len+1, theDataBaseSchema,
- NDB_MAX_SCHEMA_NAME_SIZE - 1);
- prefixName[db_len+schema_len+1] = '/';
- prefixName[db_len+schema_len+2] = '\0';
- prefixEnd = prefixName + db_len+schema_len + 2;
+ snprintf(theDataBase, sizeof(theDataBase), "%s",
+ a_catalog_name ? a_catalog_name : "");
+
+ int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c",
+ theDataBase, table_name_separator,
+ theDataBaseSchema, table_name_separator);
+ prefixEnd = prefixName + (len < sizeof(prefixName) ? len :
+ sizeof(prefixName) - 1);
}
}
@@ -1037,18 +1043,14 @@ const char * Ndb::getSchemaName() const
void Ndb::setSchemaName(const char * a_schema_name)
{
if (a_schema_name) {
- strncpy(theDataBaseSchema, a_schema_name, NDB_MAX_SCHEMA_NAME_SIZE);
- // Prepare prefix for faster operations
- uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1);
- uint schema_len =
- MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1);
- strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1);
- prefixName[db_len] = '/';
- strncpy(prefixName+db_len+1, theDataBaseSchema,
- NDB_MAX_SCHEMA_NAME_SIZE - 1);
- prefixName[db_len+schema_len+1] = '/';
- prefixName[db_len+schema_len+2] = '\0';
- prefixEnd = prefixName + db_len+schema_len + 2;
+ snprintf(theDataBaseSchema, sizeof(theDataBase), "%s",
+ a_schema_name ? a_schema_name : "");
+
+ int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c",
+ theDataBase, table_name_separator,
+ theDataBaseSchema, table_name_separator);
+ prefixEnd = prefixName + (len < sizeof(prefixName) ? len :
+ sizeof(prefixName) - 1);
}
}
@@ -1086,43 +1088,36 @@ bool Ndb::usingFullyQualifiedNames()
}
const char *
-Ndb::externalizeTableName(const char * internalTableName)
+Ndb::externalizeTableName(const char * internalTableName, bool fullyQualifiedNames)
{
if (fullyQualifiedNames) {
register const char *ptr = internalTableName;
// Skip database name
- while (*ptr && *ptr++ != '/');
+ while (*ptr && *ptr++ != table_name_separator);
// Skip schema name
- while (*ptr && *ptr++ != '/');
-
+ while (*ptr && *ptr++ != table_name_separator);
return ptr;
}
else
return internalTableName;
}
-
const char *
-Ndb::internalizeTableName(const char * externalTableName)
+Ndb::externalizeTableName(const char * internalTableName)
{
- if (fullyQualifiedNames) {
- strncpy(prefixEnd, externalTableName, NDB_MAX_TAB_NAME_SIZE);
- return prefixName;
- }
- else
- return externalTableName;
+ return externalizeTableName(internalTableName, usingFullyQualifiedNames());
}
-
+
const char *
-Ndb::externalizeIndexName(const char * internalIndexName)
+Ndb::externalizeIndexName(const char * internalIndexName, bool fullyQualifiedNames)
{
if (fullyQualifiedNames) {
register const char *ptr = internalIndexName;
// Scan name from the end
while (*ptr++); ptr--; // strend
- while (ptr >= internalIndexName && *ptr != '/')
+ while (ptr >= internalIndexName && *ptr != table_name_separator)
ptr--;
return ptr + 1;
@@ -1130,6 +1125,23 @@ Ndb::externalizeIndexName(const char * internalIndexName)
else
return internalIndexName;
}
+
+const char *
+Ndb::externalizeIndexName(const char * internalIndexName)
+{
+ return externalizeIndexName(internalIndexName, usingFullyQualifiedNames());
+}
+
+const char *
+Ndb::internalizeTableName(const char * externalTableName)
+{
+ if (fullyQualifiedNames) {
+ strncpy(prefixEnd, externalTableName, NDB_MAX_TAB_NAME_SIZE);
+ return prefixName;
+ }
+ else
+ return externalTableName;
+}
const char *
Ndb::internalizeIndexName(const NdbTableImpl * table,
@@ -1140,7 +1152,7 @@ Ndb::internalizeIndexName(const NdbTableImpl * table,
sprintf(tableId, "%d", table->m_tableId);
Uint32 tabIdLen = strlen(tableId);
strncpy(prefixEnd, tableId, tabIdLen);
- prefixEnd[tabIdLen] = '/';
+ prefixEnd[tabIdLen] = table_name_separator;
strncpy(prefixEnd + tabIdLen + 1,
externalIndexName, NDB_MAX_TAB_NAME_SIZE);
return prefixName;
@@ -1156,8 +1168,8 @@ Ndb::getDatabaseFromInternalName(const char * internalName)
strcpy(databaseName, internalName);
register char *ptr = databaseName;
- /* Scan name for the first '/' */
- while (*ptr && *ptr != '/')
+ /* Scan name for the first table_name_separator */
+ while (*ptr && *ptr != table_name_separator)
ptr++;
*ptr = '\0';
BaseString ret = BaseString(databaseName);
@@ -1171,12 +1183,12 @@ Ndb::getSchemaFromInternalName(const char * internalName)
char * schemaName = new char[strlen(internalName)];
register const char *ptr1 = internalName;
- /* Scan name for the second '/' */
- while (*ptr1 && *ptr1 != '/')
+ /* Scan name for the second table_name_separator */
+ while (*ptr1 && *ptr1 != table_name_separator)
ptr1++;
strcpy(schemaName, ptr1 + 1);
register char *ptr = schemaName;
- while (*ptr && *ptr != '/')
+ while (*ptr && *ptr != table_name_separator)
ptr++;
*ptr = '\0';
BaseString ret = BaseString(schemaName);
diff --git a/ndb/src/ndbapi/NdbApiSignal.cpp b/ndb/src/ndbapi/NdbApiSignal.cpp
index a9cd5b1d53a..a44937cd398 100644
--- a/ndb/src/ndbapi/NdbApiSignal.cpp
+++ b/ndb/src/ndbapi/NdbApiSignal.cpp
@@ -29,7 +29,6 @@ Adjust: 971114 UABMNST First version.
******************************************************************************/
#include "API.hpp"
#include "NdbApiSignal.hpp"
-#include <AttrType.hpp>
/**
* The following include includes
diff --git a/ndb/src/ndbapi/NdbApiSignal.hpp b/ndb/src/ndbapi/NdbApiSignal.hpp
index 76cefe0e882..9d5bc0847be 100644
--- a/ndb/src/ndbapi/NdbApiSignal.hpp
+++ b/ndb/src/ndbapi/NdbApiSignal.hpp
@@ -31,7 +31,6 @@
#define NdbApiSignal_H
#include <kernel_types.h>
-#include "AttrType.hpp"
#include "TransporterFacade.hpp"
#include <TransporterDefinitions.hpp>
#include "Ndb.hpp"
diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp
new file mode 100644
index 00000000000..8e067f770e8
--- /dev/null
+++ b/ndb/src/ndbapi/NdbBlob.cpp
@@ -0,0 +1,1349 @@
+/* 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.hpp"
+#include "NdbDictionaryImpl.hpp"
+#include "NdbConnection.hpp"
+#include "NdbOperation.hpp"
+#include "NdbIndexOperation.hpp"
+#include "NdbRecAttr.hpp"
+#include "NdbBlob.hpp"
+
+#ifdef NDB_BLOB_DEBUG
+#define DBG(x) \
+ do { \
+ static const char* p = getenv("NDB_BLOB_DEBUG"); \
+ if (p == 0 || *p == 0 || *p == '0') break; \
+ const char* cname = theColumn == NULL ? "BLOB" : theColumn->m_name.c_str(); \
+ ndbout << cname << " " << __LINE__ << " " << x << " " << *this << endl; \
+ } while (0)
+#define EXE() assert(theNdbCon->executeNoBlobs(NoCommit) == 0)
+#else
+#define DBG(x)
+#endif
+
+static char*
+ndb_blob_debug(const Uint32* data, unsigned size)
+{
+ static char buf[128 + 1]; // MT irrelevant
+ buf[0] = 0;
+ for (unsigned i = 0; i < size && i < 128 / 4; i++) {
+ sprintf(buf + strlen(buf), "%*s%08x", i != 0, "", data[i]);
+ }
+ return buf;
+}
+
+/*
+ * Reading index table directly (as a table) is faster but there are
+ * bugs or limitations. Keep the code but make possible to choose.
+ */
+static const bool g_ndb_blob_ok_to_read_index_table = false;
+
+// state (inline)
+
+inline void
+NdbBlob::setState(State newState)
+{
+ DBG("setState " << newState);
+ theState = newState;
+}
+
+// define blob table
+
+int
+NdbBlob::getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName)
+{
+ NdbTableImpl* t = anNdb->theDictionary->m_impl.getTable(tableName);
+ if (t == NULL)
+ return -1;
+ NdbColumnImpl* c = t->getColumn(columnName);
+ if (c == NULL)
+ return -1;
+ getBlobTableName(btname, t, c);
+ return 0;
+}
+
+void
+NdbBlob::getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c)
+{
+ assert(t != 0 && c != 0 && c->getBlobType());
+ memset(btname, 0, BlobTableNameSize);
+ sprintf(btname, "NDB$BLOB_%d_%d_%d", (int)t->m_tableId, (int)t->m_version, (int)c->m_attrId);
+}
+
+void
+NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c)
+{
+ char btname[BlobTableNameSize];
+ getBlobTableName(btname, t, c);
+ bt.setName(btname);
+ bt.setLogging(t->getLogging());
+ bt.setFragmentType(t->getFragmentType());
+ { NdbDictionary::Column bc("DIST");
+ bc.setType(NdbDictionary::Column::Unsigned);
+ bc.setPrimaryKey(true);
+ bc.setDistributionKey(true);
+ bt.addColumn(bc);
+ }
+ { NdbDictionary::Column bc("PART");
+ bc.setType(NdbDictionary::Column::Unsigned);
+ bc.setPrimaryKey(true);
+ bt.addColumn(bc);
+ }
+ { NdbDictionary::Column bc("PK");
+ bc.setType(NdbDictionary::Column::Unsigned);
+ assert(t->m_sizeOfKeysInWords != 0);
+ bc.setLength(t->m_sizeOfKeysInWords);
+ bc.setPrimaryKey(true);
+ bt.addColumn(bc);
+ }
+ { NdbDictionary::Column bc("DATA");
+ switch (c->m_type) {
+ case NdbDictionary::Column::Blob:
+ bc.setType(NdbDictionary::Column::Binary);
+ break;
+ case NdbDictionary::Column::Clob:
+ bc.setType(NdbDictionary::Column::Char);
+ break;
+ default:
+ assert(false);
+ break;
+ }
+ bc.setLength(c->getPartSize());
+ bt.addColumn(bc);
+ }
+}
+
+// initialization
+
+NdbBlob::NdbBlob()
+{
+ init();
+}
+
+void
+NdbBlob::init()
+{
+ theState = Idle;
+ theBlobTableName[0] = 0;
+ theNdb = NULL;
+ theNdbCon = NULL;
+ theNdbOp = NULL;
+ theTable = NULL;
+ theAccessTable = NULL;
+ theColumn = NULL;
+ theFillChar = 0;
+ theInlineSize = 0;
+ thePartSize = 0;
+ theStripeSize = 0;
+ theGetFlag = false;
+ theGetBuf = NULL;
+ theSetFlag = false;
+ theSetBuf = NULL;
+ theGetSetBytes = 0;
+ theHead = NULL;
+ theInlineData = NULL;
+ theHeadInlineRecAttr = NULL;
+ theHeadInlineUpdateFlag = false;
+ theNewPartFlag = false;
+ theNullFlag = -1;
+ theLength = 0;
+ thePos = 0;
+ theNext = NULL;
+}
+
+void
+NdbBlob::release()
+{
+ setState(Idle);
+}
+
+// buffers
+
+NdbBlob::Buf::Buf() :
+ data(NULL),
+ size(0),
+ maxsize(0)
+{
+}
+
+NdbBlob::Buf::~Buf()
+{
+ delete [] data;
+}
+
+void
+NdbBlob::Buf::alloc(unsigned n)
+{
+ size = n;
+ if (maxsize < n) {
+ delete [] data;
+ // align to Uint64
+ if (n % 8 != 0)
+ n += 8 - n % 8;
+ data = new char [n];
+ maxsize = n;
+ }
+#ifdef VM_TRACE
+ memset(data, 'X', maxsize);
+#endif
+}
+
+// classify operations (inline)
+
+inline bool
+NdbBlob::isTableOp()
+{
+ return theTable == theAccessTable;
+}
+
+inline bool
+NdbBlob::isIndexOp()
+{
+ return theTable != theAccessTable;
+}
+
+inline bool
+NdbBlob::isKeyOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::InsertRequest ||
+ theNdbOp->theOperationType == NdbOperation::UpdateRequest ||
+ theNdbOp->theOperationType == NdbOperation::ReadRequest ||
+ theNdbOp->theOperationType == NdbOperation::ReadExclusive ||
+ theNdbOp->theOperationType == NdbOperation::DeleteRequest;
+}
+
+inline bool
+NdbBlob::isReadOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::ReadRequest ||
+ theNdbOp->theOperationType == NdbOperation::ReadExclusive;
+}
+
+inline bool
+NdbBlob::isInsertOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::InsertRequest;
+}
+
+inline bool
+NdbBlob::isUpdateOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::UpdateRequest;
+}
+
+inline bool
+NdbBlob::isDeleteOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::DeleteRequest;
+}
+
+inline bool
+NdbBlob::isScanOp()
+{
+ return
+ theNdbOp->theOperationType == NdbOperation::OpenScanRequest ||
+ theNdbOp->theOperationType == NdbOperation::OpenRangeScanRequest;
+}
+
+// computations (inline)
+
+inline Uint32
+NdbBlob::getPartNumber(Uint64 pos)
+{
+ assert(pos >= theInlineSize);
+ return (pos - theInlineSize) / thePartSize;
+}
+
+inline Uint32
+NdbBlob::getPartCount()
+{
+ if (theLength <= theInlineSize)
+ return 0;
+ return 1 + getPartNumber(theLength - 1);
+}
+
+inline Uint32
+NdbBlob::getDistKey(Uint32 part)
+{
+ assert(theStripeSize != 0);
+ return (part / theStripeSize) % theStripeSize;
+}
+
+// getters and setters
+
+int
+NdbBlob::getTableKeyValue(NdbOperation* anOp)
+{
+ Uint32* data = (Uint32*)theKeyBuf.data;
+ unsigned pos = 0;
+ DBG("getTableKeyValue");
+ for (unsigned i = 0; i < theTable->m_columns.size(); i++) {
+ NdbColumnImpl* c = theTable->m_columns[i];
+ assert(c != NULL);
+ if (c->m_pk) {
+ unsigned len = c->m_attrSize * c->m_arraySize;
+ if (anOp->getValue(c, (char*)&data[pos]) == NULL) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ // odd bytes receive no data and must be zeroed
+ while (len % 4 != 0) {
+ char* p = (char*)&data[pos] + len++;
+ *p = 0;
+ }
+ pos += len / 4;
+ }
+ }
+ assert(pos == theKeyBuf.size / 4);
+ return 0;
+}
+
+int
+NdbBlob::setTableKeyValue(NdbOperation* anOp)
+{
+ const Uint32* data = (const Uint32*)theKeyBuf.data;
+ unsigned pos = 0;
+ const unsigned size = theTable->m_columns.size();
+ DBG("setTableKeyValue key=" << ndb_blob_debug(data, size));
+ for (unsigned i = 0; i < size; i++) {
+ NdbColumnImpl* c = theTable->m_columns[i];
+ assert(c != NULL);
+ if (c->m_pk) {
+ unsigned len = c->m_attrSize * c->m_arraySize;
+ if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ pos += (len + 3) / 4;
+ }
+ }
+ assert(pos == theKeyBuf.size / 4);
+ return 0;
+}
+
+int
+NdbBlob::setAccessKeyValue(NdbOperation* anOp)
+{
+ const Uint32* data = (const Uint32*)theAccessKeyBuf.data;
+ unsigned pos = 0;
+ const unsigned size = theAccessTable->m_columns.size();
+ DBG("setAccessKeyValue key=" << ndb_blob_debug(data, size));
+ for (unsigned i = 0; i < size; i++) {
+ NdbColumnImpl* c = theAccessTable->m_columns[i];
+ assert(c != NULL);
+ if (c->m_pk) {
+ unsigned len = c->m_attrSize * c->m_arraySize;
+ if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ pos += (len + 3) / 4;
+ }
+ }
+ assert(pos == theAccessKeyBuf.size / 4);
+ return 0;
+}
+
+int
+NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part)
+{
+ Uint32* data = (Uint32*)theKeyBuf.data;
+ unsigned size = theTable->m_sizeOfKeysInWords;
+ DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size));
+ if (anOp->equal((Uint32)0, getDistKey(part)) == -1 ||
+ anOp->equal((Uint32)1, part) == -1 ||
+ anOp->equal((Uint32)2, theKeyBuf.data) == -1) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ return 0;
+}
+
+int
+NdbBlob::getHeadInlineValue(NdbOperation* anOp)
+{
+ DBG("getHeadInlineValue");
+ theHeadInlineRecAttr = anOp->getValue(theColumn, theHeadInlineBuf.data);
+ if (theHeadInlineRecAttr == NULL) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ return 0;
+}
+
+void
+NdbBlob::getHeadFromRecAttr()
+{
+ assert(theHeadInlineRecAttr != NULL);
+ theNullFlag = theHeadInlineRecAttr->isNULL();
+ assert(theNullFlag != -1);
+ theLength = ! theNullFlag ? theHead->length : 0;
+ DBG("getHeadFromRecAttr out");
+}
+
+int
+NdbBlob::setHeadInlineValue(NdbOperation* anOp)
+{
+ DBG("setHeadInlineValue");
+ theHead->length = theLength;
+ if (theLength < theInlineSize)
+ memset(theInlineData + theLength, 0, theInlineSize - theLength);
+ assert(theNullFlag != -1);
+ const char* aValue = theNullFlag ? 0 : theHeadInlineBuf.data;
+ if (anOp->setValue(theColumn, aValue, theHeadInlineBuf.size) == -1) {
+ setErrorCode(anOp);
+ return -1;
+ }
+ theHeadInlineUpdateFlag = false;
+ return 0;
+}
+
+// getValue/setValue
+
+int
+NdbBlob::getValue(void* data, Uint32 bytes)
+{
+ DBG("getValue data=" << hex << data << " bytes=" << dec << bytes);
+ if (theGetFlag || theState != Prepared) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ if (! isReadOp() && ! isScanOp()) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ if (data == NULL && bytes != 0) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ theGetFlag = true;
+ theGetBuf = static_cast<char*>(data);
+ theGetSetBytes = bytes;
+ return 0;
+}
+
+int
+NdbBlob::setValue(const void* data, Uint32 bytes)
+{
+ DBG("setValue data=" << hex << data << " bytes=" << dec << bytes);
+ if (theSetFlag || theState != Prepared) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ if (! isInsertOp() && ! isUpdateOp()) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ if (data == NULL && bytes != 0) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ theSetFlag = true;
+ theSetBuf = static_cast<const char*>(data);
+ theGetSetBytes = bytes;
+ if (isInsertOp()) {
+ // write inline part now
+ if (theSetBuf != 0) {
+ unsigned n = theGetSetBytes;
+ if (n > theInlineSize)
+ n = theInlineSize;
+ if (writeDataPrivate(0, theSetBuf, n) == -1)
+ return -1;
+ } else {
+ theNullFlag = true;
+ theLength = 0;
+ }
+ if (setHeadInlineValue(theNdbOp) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+// misc operations
+
+int
+NdbBlob::getNull(bool& isNull)
+{
+ if (theState == Prepared && theSetFlag) {
+ isNull = (theSetBuf == NULL);
+ return 0;
+ }
+ if (theNullFlag == -1) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ isNull = theNullFlag;
+ return 0;
+}
+
+int
+NdbBlob::setNull()
+{
+ DBG("setNull");
+ if (theNullFlag == -1) {
+ if (theState == Prepared) {
+ return setValue(0, 0);
+ }
+ setErrorCode(ErrState);
+ return -1;
+ }
+ if (theNullFlag)
+ return 0;
+ if (deleteParts(0, getPartCount()) == -1)
+ return -1;
+ theNullFlag = true;
+ theLength = 0;
+ theHeadInlineUpdateFlag = true;
+ return 0;
+}
+
+int
+NdbBlob::getLength(Uint64& len)
+{
+ if (theState == Prepared && theSetFlag) {
+ len = theGetSetBytes;
+ return 0;
+ }
+ if (theNullFlag == -1) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ len = theLength;
+ return 0;
+}
+
+int
+NdbBlob::truncate(Uint64 length)
+{
+ DBG("truncate kength=" << length);
+ if (theNullFlag == -1) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ if (theLength > length) {
+ if (length >= theInlineSize) {
+ Uint32 part1 = getPartNumber(length);
+ Uint32 part2 = getPartNumber(theLength - 1);
+ assert(part2 >= part1);
+ if (deleteParts(part1, part2 - part1) == -1)
+ return -1;
+ } else {
+ if (deleteParts(0, getPartCount()) == -1)
+ return -1;
+ }
+ theLength = length;
+ theHeadInlineUpdateFlag = true;
+ }
+ return 0;
+}
+
+int
+NdbBlob::getPos(Uint64& pos)
+{
+ if (theNullFlag == -1) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ pos = thePos;
+ return 0;
+}
+
+int
+NdbBlob::setPos(Uint64 pos)
+{
+ if (theNullFlag == -1) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ if (pos > theLength) {
+ setErrorCode(ErrSeek);
+ return -1;
+ }
+ thePos = pos;
+ return 0;
+}
+
+// read/write
+
+int
+NdbBlob::readData(void* data, Uint32& bytes)
+{
+ if (readData(thePos, data, bytes) == -1)
+ return -1;
+ thePos += bytes;
+ assert(thePos <= theLength);
+ return 0;
+}
+
+int
+NdbBlob::readData(Uint64 pos, void* data, Uint32& bytes)
+{
+ if (theState != Active) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ char* buf = static_cast<char*>(data);
+ return readDataPrivate(pos, buf, bytes);
+}
+
+int
+NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes)
+{
+ DBG("readData pos=" << pos << " bytes=" << bytes);
+ if (pos > theLength) {
+ setErrorCode(ErrSeek);
+ return -1;
+ }
+ if (bytes > theLength - pos)
+ bytes = theLength - pos;
+ Uint32 len = bytes;
+ if (len > 0) {
+ // inline part
+ if (pos < theInlineSize) {
+ Uint32 n = theInlineSize - pos;
+ if (n > len)
+ n = len;
+ memcpy(buf, theInlineData + pos, n);
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ if (len > 0) {
+ assert(pos >= theInlineSize);
+ Uint32 off = (pos - theInlineSize) % thePartSize;
+ // partial first block
+ if (off != 0) {
+ DBG("partial first block pos=" << pos << " len=" << len);
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ if (readParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ Uint32 n = thePartSize - off;
+ if (n > len)
+ n = len;
+ memcpy(buf, thePartBuf.data + off, n);
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ if (len > 0) {
+ assert((pos - theInlineSize) % thePartSize == 0);
+ // complete blocks in the middle
+ if (len >= thePartSize) {
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ Uint32 count = len / thePartSize;
+ if (readParts(buf, part, count) == -1)
+ return -1;
+ Uint32 n = thePartSize * count;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ if (len > 0) {
+ // partial last block
+ DBG("partial last block pos=" << pos << " len=" << len);
+ assert((pos - theInlineSize) % thePartSize == 0 && len < thePartSize);
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ if (readParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ memcpy(buf, thePartBuf.data, len);
+ Uint32 n = len;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ assert(len == 0);
+ return 0;
+}
+
+int
+NdbBlob::writeData(const void* data, Uint32 bytes)
+{
+ if (writeData(thePos, data, bytes) == -1)
+ return -1;
+ thePos += bytes;
+ assert(thePos <= theLength);
+ return 0;
+}
+
+int
+NdbBlob::writeData(Uint64 pos, const void* data, Uint32 bytes)
+{
+ if (theState != Active) {
+ setErrorCode(ErrState);
+ return -1;
+ }
+ const char* buf = static_cast<const char*>(data);
+ return writeDataPrivate(pos, buf, bytes);
+}
+
+int
+NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes)
+{
+ DBG("writeData pos=" << pos << " bytes=" << bytes);
+ if (pos > theLength) {
+ setErrorCode(ErrSeek);
+ return -1;
+ }
+ Uint32 len = bytes;
+ // any write makes blob not NULL
+ if (theNullFlag) {
+ theNullFlag = false;
+ theHeadInlineUpdateFlag = true;
+ }
+ if (len > 0) {
+ // inline part
+ if (pos < theInlineSize) {
+ Uint32 n = theInlineSize - pos;
+ if (n > len)
+ n = len;
+ memcpy(theInlineData + pos, buf, n);
+ theHeadInlineUpdateFlag = true;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ if (len > 0) {
+ assert(pos >= theInlineSize);
+ Uint32 off = (pos - theInlineSize) % thePartSize;
+ // partial first block
+ if (off != 0) {
+ DBG("partial first block pos=" << pos << " len=" << len);
+ if (theNewPartFlag) {
+ // must flush insert to guarantee read
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ theNewPartFlag = false;
+ }
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ if (readParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ Uint32 n = thePartSize - off;
+ if (n > len) {
+ memset(thePartBuf.data + off + len, theFillChar, n - len);
+ n = len;
+ }
+ memcpy(thePartBuf.data + off, buf, n);
+ if (updateParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ if (len > 0) {
+ assert((pos - theInlineSize) % thePartSize == 0);
+ // complete blocks in the middle
+ if (len >= thePartSize) {
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ Uint32 count = len / thePartSize;
+ for (unsigned i = 0; i < count; i++) {
+ if (part + i < getPartCount()) {
+ if (updateParts(buf, part + i, 1) == -1)
+ return -1;
+ } else {
+ if (insertParts(buf, part + i, 1) == -1)
+ return -1;
+ }
+ Uint32 n = thePartSize;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ }
+ }
+ if (len > 0) {
+ // partial last block
+ DBG("partial last block pos=" << pos << " len=" << len);
+ assert((pos - theInlineSize) % thePartSize == 0 && len < thePartSize);
+ Uint32 part = (pos - theInlineSize) / thePartSize;
+ if (theLength > pos + len) {
+ if (theNewPartFlag) {
+ // must flush insert to guarantee read
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ theNewPartFlag = false;
+ }
+ if (readParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode(theNdbOp);
+ return -1;
+ }
+ memcpy(thePartBuf.data, buf, len);
+ if (updateParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ } else {
+ memcpy(thePartBuf.data, buf, len);
+ memset(thePartBuf.data + len, theFillChar, thePartSize - len);
+ if (part < getPartCount()) {
+ if (updateParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ } else {
+ if (insertParts(thePartBuf.data, part, 1) == -1)
+ return -1;
+ }
+ }
+ Uint32 n = len;
+ pos += n;
+ buf += n;
+ len -= n;
+ }
+ assert(len == 0);
+ if (theLength < pos) {
+ theLength = pos;
+ theHeadInlineUpdateFlag = true;
+ }
+ DBG("writeData out");
+ return 0;
+}
+
+int
+NdbBlob::readParts(char* buf, Uint32 part, Uint32 count)
+{
+ DBG("readParts part=" << part << " count=" << count);
+ Uint32 n = 0;
+ while (n < count) {
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName);
+ if (tOp == NULL ||
+ tOp->readTuple() == -1 ||
+ setPartKeyValue(tOp, part + n) == -1 ||
+ tOp->getValue((Uint32)3, buf) == NULL) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ buf += thePartSize;
+ n++;
+ }
+ return 0;
+}
+
+int
+NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count)
+{
+ DBG("insertParts part=" << part << " count=" << count);
+ Uint32 n = 0;
+ while (n < count) {
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName);
+ if (tOp == NULL ||
+ tOp->insertTuple() == -1 ||
+ setPartKeyValue(tOp, part + n) == -1 ||
+ tOp->setValue((Uint32)3, buf) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ buf += thePartSize;
+ n++;
+ theNewPartFlag = true;
+ }
+ return 0;
+}
+
+int
+NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count)
+{
+ DBG("updateParts part=" << part << " count=" << count);
+ Uint32 n = 0;
+ while (n < count) {
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName);
+ if (tOp == NULL ||
+ tOp->updateTuple() == -1 ||
+ setPartKeyValue(tOp, part + n) == -1 ||
+ tOp->setValue((Uint32)3, buf) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ buf += thePartSize;
+ n++;
+ theNewPartFlag = true;
+ }
+ return 0;
+}
+
+int
+NdbBlob::deleteParts(Uint32 part, Uint32 count)
+{
+ DBG("deleteParts part=" << part << " count=" << count);
+ Uint32 n = 0;
+ while (n < count) {
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName);
+ if (tOp == NULL ||
+ tOp->deleteTuple() == -1 ||
+ setPartKeyValue(tOp, part + n) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ n++;
+ }
+ return 0;
+}
+
+// blob handle maintenance
+
+/*
+ * Prepare blob handle linked to an operation. Checks blob table.
+ * Allocates buffers. For key operation fetches key data from signal
+ * data. For read operation adds read of head+inline.
+ */
+int
+NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn)
+{
+ assert(theState == Idle);
+ // ndb api stuff
+ theNdb = anOp->theNdb;
+ theNdbCon = aCon; // for scan, this is the real transaction (m_transConnection)
+ theNdbOp = anOp;
+ theTable = anOp->m_currentTable;
+ theAccessTable = anOp->m_accessTable;
+ theColumn = aColumn;
+ DBG("atPrepare");
+ NdbDictionary::Column::Type partType = NdbDictionary::Column::Undefined;
+ switch (theColumn->getType()) {
+ case NdbDictionary::Column::Blob:
+ partType = NdbDictionary::Column::Binary;
+ theFillChar = 0x0;
+ break;
+ case NdbDictionary::Column::Clob:
+ partType = NdbDictionary::Column::Char;
+ theFillChar = 0x20;
+ break;
+ default:
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ // sizes
+ theInlineSize = theColumn->getInlineSize();
+ thePartSize = theColumn->getPartSize();
+ theStripeSize = theColumn->getStripeSize();
+ // blob table sanity check
+ assert((NDB_BLOB_HEAD_SIZE << 2) == sizeof(Head));
+ assert(theColumn->m_attrSize * theColumn->m_arraySize == sizeof(Head) + theInlineSize);
+ getBlobTableName(theBlobTableName, theTable, theColumn);
+ const NdbDictionary::Table* bt;
+ const NdbDictionary::Column* bc;
+ if (theInlineSize >= (1 << 16) ||
+ thePartSize == 0 ||
+ thePartSize >= (1 << 16) ||
+ theStripeSize == 0 ||
+ (bt = theNdb->theDictionary->getTable(theBlobTableName)) == NULL ||
+ (bc = bt->getColumn("DATA")) == NULL ||
+ bc->getType() != partType ||
+ bc->getLength() != (int)thePartSize) {
+ setErrorCode(ErrTable);
+ return -1;
+ }
+ // buffers
+ theKeyBuf.alloc(theTable->m_sizeOfKeysInWords << 2);
+ theAccessKeyBuf.alloc(theAccessTable->m_sizeOfKeysInWords << 2);
+ theHeadInlineBuf.alloc(sizeof(Head) + theInlineSize);
+ thePartBuf.alloc(thePartSize);
+ theHead = (Head*)theHeadInlineBuf.data;
+ theInlineData = theHeadInlineBuf.data + sizeof(Head);
+ // handle different operation types
+ bool supportedOp = false;
+ if (isKeyOp()) {
+ if (isTableOp()) {
+ // get table key
+ Uint32* data = (Uint32*)theKeyBuf.data;
+ unsigned size = theTable->m_sizeOfKeysInWords;
+ if (theNdbOp->getKeyFromTCREQ(data, size) == -1) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ }
+ if (isIndexOp()) {
+ // get index key
+ Uint32* data = (Uint32*)theAccessKeyBuf.data;
+ unsigned size = theAccessTable->m_sizeOfKeysInWords;
+ if (theNdbOp->getKeyFromTCREQ(data, size) == -1) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ }
+ if (isReadOp()) {
+ // add read of head+inline in this op
+ if (getHeadInlineValue(theNdbOp) == -1)
+ return -1;
+ }
+ if (isInsertOp()) {
+ // becomes NULL unless set before execute
+ theNullFlag = true;
+ theLength = 0;
+ }
+ supportedOp = true;
+ }
+ if (isScanOp()) {
+ // add read of head+inline in this op
+ if (getHeadInlineValue(theNdbOp) == -1)
+ return -1;
+ supportedOp = true;
+ }
+ if (! supportedOp) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ setState(Prepared);
+ DBG("atPrepare out");
+ return 0;
+}
+
+/*
+ * Before execute of prepared operation. May add new operations before
+ * this one. May ask that this operation and all before it (a "batch")
+ * is executed immediately in no-commit mode.
+ */
+int
+NdbBlob::preExecute(ExecType anExecType, bool& batch)
+{
+ DBG("preExecute");
+ if (theState == Invalid)
+ return -1;
+ assert(theState == Prepared);
+ // handle different operation types
+ assert(isKeyOp());
+ if (isReadOp()) {
+ if (theGetFlag && theGetSetBytes > theInlineSize) {
+ // need blob head before proceeding
+ batch = true;
+ }
+ }
+ if (isInsertOp()) {
+ if (theSetFlag && theGetSetBytes > theInlineSize) {
+ // add ops to write rest of a setValue
+ assert(theSetBuf != 0);
+ Uint64 pos = theInlineSize;
+ const char* buf = theSetBuf + theInlineSize;
+ Uint32 bytes = theGetSetBytes - theInlineSize;
+ if (writeDataPrivate(pos, buf, bytes) == -1)
+ return -1;
+ if (anExecType == Commit && theHeadInlineUpdateFlag) {
+ // add an operation to update head+inline
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theTable);
+ if (tOp == NULL ||
+ tOp->updateTuple() == -1 ||
+ setTableKeyValue(tOp) == -1 ||
+ setHeadInlineValue(tOp) == -1) {
+ setErrorCode(ErrAbort);
+ return -1;
+ }
+ }
+ }
+ }
+ if (isTableOp()) {
+ if (isUpdateOp() || isDeleteOp()) {
+ // add operation before this one to read head+inline
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theTable, theNdbOp);
+ if (tOp == NULL ||
+ tOp->readTuple() == -1 ||
+ setTableKeyValue(tOp) == -1 ||
+ getHeadInlineValue(tOp) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ // execute immediately
+ batch = true;
+ }
+ }
+ if (isIndexOp()) {
+ // add op before this one to read table key
+ NdbBlob* tFirstBlob = theNdbOp->theBlobList;
+ if (this == tFirstBlob) {
+ // first blob does it for all
+ if (g_ndb_blob_ok_to_read_index_table) {
+ Uint32 pkAttrId = theAccessTable->getNoOfColumns() - 1;
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theAccessTable, theNdbOp);
+ if (tOp == NULL ||
+ tOp->readTuple() == -1 ||
+ setAccessKeyValue(tOp) == -1 ||
+ tOp->getValue(pkAttrId, theKeyBuf.data) == NULL) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ } else {
+ NdbOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp);
+ if (tOp == NULL ||
+ tOp->readTuple() == -1 ||
+ setAccessKeyValue(tOp) == -1 ||
+ getTableKeyValue(tOp) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ }
+ }
+ if (isUpdateOp() || isDeleteOp()) {
+ // add op before this one to read head+inline via index
+ NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp);
+ if (tOp == NULL ||
+ tOp->readTuple() == -1 ||
+ setAccessKeyValue(tOp) == -1 ||
+ getHeadInlineValue(tOp) == -1) {
+ setErrorCode(tOp);
+ return -1;
+ }
+ // execute immediately
+ batch = true;
+ }
+ }
+ DBG("preExecute out batch=" << batch);
+ return 0;
+}
+
+/*
+ * After execute, for any operation. If already Active, this routine
+ * has been done previously. Operations which requested a no-commit
+ * batch can add new operations after this one. They are added before
+ * any remaining prepared operations.
+ */
+int
+NdbBlob::postExecute(ExecType anExecType)
+{
+ DBG("postExecute type=" << anExecType);
+ if (theState == Invalid)
+ return -1;
+ if (theState == Active)
+ return 0;
+ assert(theState == Prepared);
+ assert(isKeyOp());
+ if (isIndexOp()) {
+ NdbBlob* tFirstBlob = theNdbOp->theBlobList;
+ if (this != tFirstBlob) {
+ // copy key from first blob
+ assert(theKeyBuf.size == tFirstBlob->theKeyBuf.size);
+ memcpy(theKeyBuf.data, tFirstBlob->theKeyBuf.data, tFirstBlob->theKeyBuf.size);
+ }
+ }
+ if (isReadOp()) {
+ getHeadFromRecAttr();
+ if (theGetFlag && theGetSetBytes > 0) {
+ // copy inline bytes to user buffer
+ assert(theGetBuf != NULL);
+ unsigned n = theGetSetBytes;
+ if (n > theInlineSize)
+ n = theInlineSize;
+ memcpy(theGetBuf, theInlineData, n);
+ }
+ if (theGetFlag && theGetSetBytes > theInlineSize) {
+ // add ops to read rest of a getValue
+ assert(anExecType == NoCommit);
+ assert(theGetBuf != 0);
+ Uint64 pos = theInlineSize;
+ char* buf = theGetBuf + theInlineSize;
+ Uint32 bytes = theGetSetBytes - theInlineSize;
+ if (readDataPrivate(pos, buf, bytes) == -1)
+ return -1;
+ }
+ }
+ if (isUpdateOp()) {
+ assert(anExecType == NoCommit);
+ getHeadFromRecAttr();
+ if (theSetFlag) {
+ // setValue overwrites everything
+ if (theSetBuf != 0) {
+ if (truncate(0) == -1)
+ return -1;
+ if (writeDataPrivate(0, theSetBuf, theGetSetBytes) == -1)
+ return -1;
+ } else {
+ if (setNull() == -1)
+ return -1;
+ }
+ }
+ }
+ if (isDeleteOp()) {
+ assert(anExecType == NoCommit);
+ getHeadFromRecAttr();
+ if (deleteParts(0, getPartCount()) == -1)
+ return -1;
+ }
+ theNewPartFlag = false;
+ setState(anExecType == NoCommit ? Active : Closed);
+ DBG("postExecute out");
+ return 0;
+}
+
+/*
+ * Before commit of completed operation. For write add operation to
+ * update head+inline.
+ */
+int
+NdbBlob::preCommit()
+{
+ DBG("preCommit");
+ if (theState == Invalid)
+ return -1;
+ assert(theState == Active);
+ assert(isKeyOp());
+ if (isInsertOp() || isUpdateOp()) {
+ if (theHeadInlineUpdateFlag) {
+ // add an operation to update head+inline
+ NdbOperation* tOp = theNdbCon->getNdbOperation(theTable);
+ if (tOp == NULL ||
+ tOp->updateTuple() == -1 ||
+ setTableKeyValue(tOp) == -1 ||
+ setHeadInlineValue(tOp) == -1) {
+ setErrorCode(ErrAbort);
+ return -1;
+ }
+ }
+ }
+ DBG("preCommit out");
+ return 0;
+}
+
+/*
+ * After next scan result. Handle like read op above.
+ */
+int
+NdbBlob::atNextResult()
+{
+ DBG("atNextResult");
+ if (theState == Invalid)
+ return -1;
+ assert(isScanOp());
+ getHeadFromRecAttr();
+ // reset position
+ thePos = 0;
+ // get primary key
+ { Uint32* data = (Uint32*)theKeyBuf.data;
+ unsigned size = theTable->m_sizeOfKeysInWords;
+ if (theNdbOp->getKeyFromKEYINFO20(data, size) == -1) {
+ setErrorCode(ErrUsage);
+ return -1;
+ }
+ }
+ if (! theNullFlag) {
+ if (theGetFlag && theGetSetBytes > 0) {
+ // copy inline bytes to user buffer
+ assert(theGetBuf != NULL);
+ unsigned n = theGetSetBytes;
+ if (n > theLength)
+ n = theLength;
+ if (n > theInlineSize)
+ n = theInlineSize;
+ memcpy(theGetBuf, theInlineData, n);
+ }
+ if (theGetFlag && theGetSetBytes > theInlineSize && theLength > theInlineSize) {
+ // add ops to read rest of a getValue
+ assert(theGetBuf != 0);
+ Uint64 pos = theInlineSize;
+ char* buf = theGetBuf + theInlineSize;
+ Uint32 bytes = theGetSetBytes - theInlineSize;
+ if (readDataPrivate(pos, buf, bytes) == -1)
+ return -1;
+ // must also execute them
+ DBG("force execute");
+ if (theNdbCon->executeNoBlobs(NoCommit) == -1) {
+ setErrorCode((NdbOperation*)0);
+ return -1;
+ }
+ }
+ }
+ setState(Active);
+ DBG("atNextResult out");
+ return 0;
+}
+
+
+// misc
+
+const NdbDictionary::Column*
+NdbBlob::getColumn()
+{
+ return theColumn;
+}
+
+// errors
+
+void
+NdbBlob::setErrorCode(int anErrorCode, bool invalidFlag)
+{
+ DBG("setErrorCode code=" << anErrorCode);
+ theError.code = anErrorCode;
+ if (invalidFlag)
+ setState(Invalid);
+}
+
+void
+NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag)
+{
+ int code = 0;
+ if (anOp != NULL && (code = anOp->theError.code) != 0)
+ ;
+ else if ((code = theNdbCon->theError.code) != 0)
+ ;
+ else if ((code = theNdb->theError.code) != 0)
+ ;
+ else
+ code = ErrUnknown;
+ setErrorCode(code, invalidFlag);
+}
+
+void
+NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag)
+{
+ int code = 0;
+ if (theNdbCon != NULL && (code = theNdbCon->theError.code) != 0)
+ ;
+ else if ((code = theNdb->theError.code) != 0)
+ ;
+ else
+ code = ErrUnknown;
+ setErrorCode(code, invalidFlag);
+}
+
+#ifdef VM_TRACE
+NdbOut&
+operator<<(NdbOut& out, const NdbBlob& blob)
+{
+ ndbout << dec << "s=" << blob.theState;
+ ndbout << dec << " n=" << blob.theNullFlag;;
+ ndbout << dec << " l=" << blob.theLength;
+ ndbout << dec << " p=" << blob.thePos;
+ ndbout << dec << " u=" << blob.theHeadInlineUpdateFlag;
+ return out;
+}
+#endif
diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp
index 4ec098c3c60..ad415b8acbf 100644
--- a/ndb/src/ndbapi/NdbConnection.cpp
+++ b/ndb/src/ndbapi/NdbConnection.cpp
@@ -35,6 +35,7 @@ Adjust: 971022 UABMNST First version.
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
#include "API.hpp"
+#include "NdbBlob.hpp"
#include <ndb_limits.h>
#include <signaldata/TcKeyConf.hpp>
@@ -89,7 +90,8 @@ NdbConnection::NdbConnection( Ndb* aNdb ) :
theCurrentScanRec(NULL),
thePreviousScanRec(NULL),
theScanningOp(NULL),
- theBuddyConPtr(0xFFFFFFFF)
+ theBuddyConPtr(0xFFFFFFFF),
+ theBlobFlag(false)
{
theListState = NotInList;
theError.code = 0;
@@ -152,6 +154,8 @@ NdbConnection::init()
m_theLastCursorOperation = NULL;
m_firstExecutedCursorOp = 0;
theBuddyConPtr = 0xFFFFFFFF;
+ //
+ theBlobFlag = false;
}//NdbConnection::init()
/*****************************************************************************
@@ -251,6 +255,86 @@ NdbConnection::execute(ExecType aTypeOfExec,
AbortOption abortOption,
int forceSend)
{
+ if (! theBlobFlag)
+ return executeNoBlobs(aTypeOfExec, abortOption, forceSend);
+
+ // execute prepared ops in batches, as requested by blobs
+
+ ExecType tExecType;
+ NdbOperation* tPrepOp;
+
+ do {
+ tExecType = aTypeOfExec;
+ tPrepOp = theFirstOpInList;
+ while (tPrepOp != NULL) {
+ bool batch = false;
+ NdbBlob* tBlob = tPrepOp->theBlobList;
+ while (tBlob != NULL) {
+ if (tBlob->preExecute(tExecType, batch) == -1)
+ return -1;
+ tBlob = tBlob->theNext;
+ }
+ if (batch) {
+ // blob asked to execute all up to here now
+ tExecType = NoCommit;
+ break;
+ }
+ tPrepOp = tPrepOp->next();
+ }
+ // save rest of prepared ops if batch
+ NdbOperation* tRestOp;
+ NdbOperation* tLastOp;
+ if (tPrepOp != NULL) {
+ tRestOp = tPrepOp->next();
+ tPrepOp->next(NULL);
+ tLastOp = theLastOpInList;
+ theLastOpInList = tPrepOp;
+ }
+ if (tExecType == Commit) {
+ NdbOperation* tOp = theCompletedFirstOp;
+ while (tOp != NULL) {
+ NdbBlob* tBlob = tOp->theBlobList;
+ while (tBlob != NULL) {
+ if (tBlob->preCommit() == -1)
+ return -1;
+ tBlob = tBlob->theNext;
+ }
+ tOp = tOp->next();
+ }
+ }
+ if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
+ return -1;
+ {
+ NdbOperation* tOp = theCompletedFirstOp;
+ while (tOp != NULL) {
+ NdbBlob* tBlob = tOp->theBlobList;
+ while (tBlob != NULL) {
+ // may add new operations if batch
+ if (tBlob->postExecute(tExecType) == -1)
+ return -1;
+ tBlob = tBlob->theNext;
+ }
+ tOp = tOp->next();
+ }
+ }
+ // add saved prepared ops if batch
+ if (tPrepOp != NULL && tRestOp != NULL) {
+ if (theFirstOpInList == NULL)
+ theFirstOpInList = tRestOp;
+ else
+ theLastOpInList->next(tRestOp);
+ theLastOpInList = tLastOp;
+ }
+ } while (theFirstOpInList != NULL || tExecType != aTypeOfExec);
+
+ return 0;
+}
+
+int
+NdbConnection::executeNoBlobs(ExecType aTypeOfExec,
+ AbortOption abortOption,
+ int forceSend)
+{
//------------------------------------------------------------------------
// We will start by preparing all operations in the transaction defined
// since last execute or since beginning. If this works ok we will continue
@@ -330,7 +414,6 @@ NdbConnection::executeAsynchPrepare( ExecType aTypeOfExec,
* Reset error.code on execute
*/
theError.code = 0;
-
NdbCursorOperation* tcOp = m_theFirstCursorOperation;
if (tcOp != 0){
// Execute any cursor operations
@@ -885,7 +968,7 @@ Remark: Get an operation from NdbOperation object idlelist and
object, synchronous.
*****************************************************************************/
NdbOperation*
-NdbConnection::getNdbOperation(NdbTableImpl * tab)
+NdbConnection::getNdbOperation(NdbTableImpl * tab, NdbOperation* aNextOp)
{
NdbOperation* tOp;
@@ -897,14 +980,28 @@ NdbConnection::getNdbOperation(NdbTableImpl * tab)
tOp = theNdb->getOperation();
if (tOp == NULL)
goto getNdbOp_error1;
- if (theLastOpInList != NULL) {
- theLastOpInList->next(tOp);
- theLastOpInList = tOp;
+ if (aNextOp == NULL) {
+ if (theLastOpInList != NULL) {
+ theLastOpInList->next(tOp);
+ theLastOpInList = tOp;
+ } else {
+ theLastOpInList = tOp;
+ theFirstOpInList = tOp;
+ }//if
+ tOp->next(NULL);
} else {
- theLastOpInList = tOp;
- theFirstOpInList = tOp;
- }//if
- tOp->next(NULL);
+ // add before the given op
+ if (theFirstOpInList == aNextOp) {
+ theFirstOpInList = tOp;
+ } else {
+ NdbOperation* aLoopOp = theFirstOpInList;
+ while (aLoopOp != NULL && aLoopOp->next() != aNextOp)
+ aLoopOp = aLoopOp->next();
+ assert(aLoopOp != NULL);
+ aLoopOp->next(tOp);
+ }
+ tOp->next(aNextOp);
+ }
if (tOp->init(tab, this) != -1) {
return tOp;
} else {
@@ -1068,21 +1165,36 @@ Remark: Get an operation from NdbIndexOperation object idlelist and get
*****************************************************************************/
NdbIndexOperation*
NdbConnection::getNdbIndexOperation(NdbIndexImpl * anIndex,
- NdbTableImpl * aTable)
+ NdbTableImpl * aTable,
+ NdbOperation* aNextOp)
{
NdbIndexOperation* tOp;
tOp = theNdb->getIndexOperation();
if (tOp == NULL)
goto getNdbOp_error1;
- if (theLastOpInList != NULL) {
- theLastOpInList->next(tOp);
- theLastOpInList = tOp;
+ if (aNextOp == NULL) {
+ if (theLastOpInList != NULL) {
+ theLastOpInList->next(tOp);
+ theLastOpInList = tOp;
+ } else {
+ theLastOpInList = tOp;
+ theFirstOpInList = tOp;
+ }//if
+ tOp->next(NULL);
} else {
- theLastOpInList = tOp;
- theFirstOpInList = tOp;
- }//if
- tOp->next(NULL);
+ // add before the given op
+ if (theFirstOpInList == aNextOp) {
+ theFirstOpInList = tOp;
+ } else {
+ NdbOperation* aLoopOp = theFirstOpInList;
+ while (aLoopOp != NULL && aLoopOp->next() != aNextOp)
+ aLoopOp = aLoopOp->next();
+ assert(aLoopOp != NULL);
+ aLoopOp->next(tOp);
+ }
+ tOp->next(aNextOp);
+ }
if (tOp->indxInit(anIndex, aTable, this)!= -1) {
return tOp;
} else {
@@ -1706,7 +1818,7 @@ NdbConnection::getTransactionId()
return theTransactionId;
}//NdbConnection::getTransactionId()
-CommitStatusType
+NdbConnection::CommitStatusType
NdbConnection::commitStatus()
{
return theCommitStatus;
diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp
index b068ea6460f..413ad0745db 100644
--- a/ndb/src/ndbapi/NdbDictionary.cpp
+++ b/ndb/src/ndbapi/NdbDictionary.cpp
@@ -103,6 +103,11 @@ NdbDictionary::Column::getLength() const{
return m_impl.m_length;
}
+int
+NdbDictionary::Column::getSize() const{
+ return m_impl.m_attrSize;
+}
+
void
NdbDictionary::Column::setNullable(bool val){
m_impl.m_nullable = val;
@@ -234,7 +239,7 @@ NdbDictionary::Table::~Table(){
}
NdbDictionary::Table&
-NdbDictionary::Table::operator=(const NdbDictionary::Table::Table& table)
+NdbDictionary::Table::operator=(const NdbDictionary::Table& table)
{
m_impl.assign(table.m_impl);
@@ -268,6 +273,9 @@ NdbDictionary::Table::addColumn(const Column & c){
if(c.getPrimaryKey()){
m_impl.m_noOfKeys++;
}
+ if (col->getBlobType()) {
+ m_impl.m_noOfBlobs++;
+ }
m_impl.buildColumnHash();
}
@@ -797,3 +805,74 @@ const struct NdbError &
NdbDictionary::Dictionary::getNdbError() const {
return m_impl.getNdbError();
}
+
+NdbOut& operator <<(NdbOut& ndbout, const NdbDictionary::Column::Type type)
+{
+ switch(type){
+ case NdbDictionary::Column::Bigunsigned:
+ ndbout << "Bigunsigned";
+ break;
+ case NdbDictionary::Column::Unsigned:
+ ndbout << "Unsigned";
+ break;
+ case NdbDictionary::Column::Smallunsigned:
+ ndbout << "Smallunsigned";
+ break;
+ case NdbDictionary::Column::Tinyunsigned:
+ ndbout << "Tinyunsigned";
+ break;
+ case NdbDictionary::Column::Bigint:
+ ndbout << "Bigint";
+ break;
+ case NdbDictionary::Column::Int:
+ ndbout << "Int";
+ break;
+ case NdbDictionary::Column::Smallint:
+ ndbout << "Smallint";
+ break;
+ case NdbDictionary::Column::Tinyint:
+ ndbout << "Tinyint";
+ break;
+ case NdbDictionary::Column::Char:
+ ndbout << "Char";
+ break;
+ case NdbDictionary::Column::Varchar:
+ ndbout << "Varchar";
+ break;
+ case NdbDictionary::Column::Float:
+ ndbout << "Float";
+ break;
+ case NdbDictionary::Column::Double:
+ ndbout << "Double";
+ break;
+ case NdbDictionary::Column::Mediumint:
+ ndbout << "Mediumint";
+ break;
+ case NdbDictionary::Column::Mediumunsigned:
+ ndbout << "Mediumunsigend";
+ break;
+ case NdbDictionary::Column::Binary:
+ ndbout << "Binary";
+ break;
+ case NdbDictionary::Column::Varbinary:
+ ndbout << "Varbinary";
+ break;
+ case NdbDictionary::Column::Decimal:
+ ndbout << "Decimal";
+ break;
+ case NdbDictionary::Column::Timespec:
+ ndbout << "Timespec";
+ break;
+ case NdbDictionary::Column::Blob:
+ ndbout << "Blob";
+ break;
+ case NdbDictionary::Column::Undefined:
+ ndbout << "Undefined";
+ break;
+ default:
+ ndbout << "Unknown type=" << (Uint32)type;
+ break;
+ }
+
+ return ndbout;
+}
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 02e3ee23f9c..9589639a332 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -17,7 +17,6 @@
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
#include <NdbOut.hpp>
-#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
#include <signaldata/GetTabInfo.hpp>
@@ -35,6 +34,7 @@
#include <AttributeList.hpp>
#include <NdbEventOperation.hpp>
#include "NdbEventOperationImpl.hpp"
+#include "NdbBlob.hpp"
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
@@ -56,8 +56,8 @@ NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f)
init();
}
-NdbColumnImpl::NdbColumnImpl&
-NdbColumnImpl::operator=(const NdbColumnImpl::NdbColumnImpl& col)
+NdbColumnImpl&
+NdbColumnImpl::operator=(const NdbColumnImpl& col)
{
m_attrId = col.m_attrId;
m_name = col.m_name;
@@ -179,7 +179,14 @@ NdbColumnImpl::equal(const NdbColumnImpl& col) const
case NdbDictionary::Column::Double:
case NdbDictionary::Column::Datetime:
case NdbDictionary::Column::Timespec:
+ break;
case NdbDictionary::Column::Blob:
+ case NdbDictionary::Column::Clob:
+ if (m_precision != col.m_precision ||
+ m_scale != col.m_scale ||
+ m_length != col.m_length) {
+ return false;
+ }
break;
}
if (m_autoIncrement != col.m_autoIncrement){
@@ -224,6 +231,8 @@ NdbTableImpl::NdbTableImpl()
: NdbDictionary::Table(* this), m_facade(this)
{
m_noOfKeys = 0;
+ m_sizeOfKeysInWords = 0;
+ m_noOfBlobs = 0;
m_index = 0;
init();
}
@@ -258,6 +267,8 @@ NdbTableImpl::init(){
m_indexType = NdbDictionary::Index::Undefined;
m_noOfKeys = 0;
+ m_sizeOfKeysInWords = 0;
+ m_noOfBlobs = 0;
}
bool
@@ -337,6 +348,8 @@ NdbTableImpl::assign(const NdbTableImpl& org)
m_index = org.m_index;
m_noOfKeys = org.m_noOfKeys;
+ m_sizeOfKeysInWords = org.m_sizeOfKeysInWords;
+ m_noOfBlobs = org.m_noOfBlobs;
m_version = org.m_version;
m_status = org.m_status;
@@ -622,7 +635,7 @@ NdbDictionaryImpl::getIndexTable(NdbIndexImpl * index,
const char * internalName =
m_ndb.internalizeIndexName(table, index->getName());
- return getTable(Ndb::externalizeTableName(internalName));
+ return getTable(m_ndb.externalizeTableName(internalName));
}
bool
@@ -863,7 +876,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal,
* get tab info
*/
NdbTableImpl *
-NdbDictInterface::getTable(int tableId)
+NdbDictInterface::getTable(int tableId, bool fullyQualifiedNames)
{
NdbApiSignal tSignal(m_reference);
GetTabInfoReq * const req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend());
@@ -877,11 +890,11 @@ NdbDictInterface::getTable(int tableId)
tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ;
tSignal.theLength = GetTabInfoReq::SignalLength;
- return getTable(&tSignal, 0, 0);
+ return getTable(&tSignal, 0, 0, fullyQualifiedNames);
}
NdbTableImpl *
-NdbDictInterface::getTable(const char * name)
+NdbDictInterface::getTable(const char * name, bool fullyQualifiedNames)
{
NdbApiSignal tSignal(m_reference);
GetTabInfoReq * const req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend());
@@ -905,13 +918,13 @@ NdbDictInterface::getTable(const char * name)
ptr[0].p = (Uint32*)name;
ptr[0].sz = strLen;
- return getTable(&tSignal, ptr, 1);
+ return getTable(&tSignal, ptr, 1, fullyQualifiedNames);
}
NdbTableImpl *
NdbDictInterface::getTable(class NdbApiSignal * signal,
LinearSectionPtr ptr[3],
- Uint32 noOfSections)
+ Uint32 noOfSections, bool fullyQualifiedNames)
{
//GetTabInfoReq * const req = CAST_PTR(GetTabInfoReq, signal->getDataPtrSend());
int r = dictSignal(signal,ptr,noOfSections,
@@ -925,7 +938,7 @@ NdbDictInterface::getTable(class NdbApiSignal * signal,
NdbTableImpl * rt = 0;
m_error.code = parseTableInfo(&rt,
(Uint32*)m_buffer.get_data(),
- m_buffer.length() / 4);
+ m_buffer.length() / 4, fullyQualifiedNames);
rt->buildColumnHash();
return rt;
}
@@ -1077,12 +1090,15 @@ columnTypeMapping[] = {
{ DictTabInfo::ExtVarbinary, NdbDictionary::Column::Varbinary },
{ DictTabInfo::ExtDatetime, NdbDictionary::Column::Datetime },
{ DictTabInfo::ExtTimespec, NdbDictionary::Column::Timespec },
+ { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob },
+ { DictTabInfo::ExtClob, NdbDictionary::Column::Clob },
{ -1, -1 }
};
int
NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
- const Uint32 * data, Uint32 len)
+ const Uint32 * data, Uint32 len,
+ bool fullyQualifiedNames)
{
SimplePropertiesLinearReader it(data, len);
DictTabInfo::Table tableDesc; tableDesc.init();
@@ -1096,7 +1112,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
return 703;
}
const char * internalName = tableDesc.TableName;
- const char * externalName = Ndb::externalizeTableName(internalName);
+ const char * externalName = Ndb::externalizeTableName(internalName, fullyQualifiedNames);
NdbTableImpl * impl = new NdbTableImpl();
impl->m_tableId = tableDesc.TableId;
@@ -1125,12 +1141,13 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
if(impl->m_indexType == NdbDictionary::Index::Undefined){
} else {
const char * externalPrimary =
- Ndb::externalizeTableName(tableDesc.PrimaryTable);
+ Ndb::externalizeTableName(tableDesc.PrimaryTable, fullyQualifiedNames);
impl->m_primaryTable.assign(externalPrimary);
}
Uint32 keyInfoPos = 0;
Uint32 keyCount = 0;
+ Uint32 blobCount;
for(Uint32 i = 0; i < tableDesc.NoOfAttributes; i++) {
DictTabInfo::Attribute attrDesc; attrDesc.init();
@@ -1187,6 +1204,8 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
} else {
col->m_keyInfoPos = 0;
}
+ if (col->getBlobType())
+ blobCount++;
NdbColumnImpl * null = 0;
impl->m_columns.fill(attrDesc.AttributeId, null);
@@ -1199,6 +1218,8 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
it.next();
}
impl->m_noOfKeys = keyCount;
+ impl->m_sizeOfKeysInWords = keyInfoPos;
+ impl->m_noOfBlobs = blobCount;
* ret = impl;
return 0;
}
@@ -1206,6 +1227,43 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
/*****************************************************************
* Create table and alter table
*/
+int
+NdbDictionaryImpl::createTable(NdbTableImpl &t)
+{
+ if (m_receiver.createTable(m_ndb, t) != 0)
+ return -1;
+ if (t.m_noOfBlobs == 0)
+ return 0;
+ // update table def from DICT
+ NdbTableImpl * tp = getTable(t.m_externalName.c_str());
+ if (tp == NULL) {
+ m_error.code = 709;
+ return -1;
+ }
+ if (createBlobTables(* tp) != 0) {
+ int save_code = m_error.code;
+ (void)dropTable(t);
+ m_error.code = save_code;
+ return -1;
+ }
+ return 0;
+}
+
+int
+NdbDictionaryImpl::createBlobTables(NdbTableImpl &t)
+{
+ for (unsigned i = 0; i < t.m_columns.size(); i++) {
+ NdbColumnImpl & c = *t.m_columns[i];
+ if (! c.getBlobType())
+ continue;
+ NdbTableImpl bt;
+ NdbBlob::getBlobTable(bt, &t, &c);
+ if (createTable(bt) != 0)
+ return -1;
+ }
+ return 0;
+}
+
int
NdbDictInterface::createTable(Ndb & ndb,
NdbTableImpl & impl)
@@ -1257,7 +1315,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
NdbTableImpl & impl,
bool alter)
{
- if((unsigned)impl.getNoOfPrimaryKeys() > MAXNROFTUPLEKEY){
+ if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){
m_error.code = 4317;
return -1;
}
@@ -1540,6 +1598,12 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
if (dropIndex(element.name, name) == -1)
return -1;
}
+
+ if (impl.m_noOfBlobs != 0) {
+ if (dropBlobTables(impl) != 0)
+ return -1;
+ }
+
int ret = m_receiver.dropTable(impl);
if(ret == 0){
const char * internalTableName = impl.m_internalName.c_str();
@@ -1555,6 +1619,23 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
}
int
+NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
+{
+ for (unsigned i = 0; i < t.m_columns.size(); i++) {
+ NdbColumnImpl & c = *t.m_columns[i];
+ if (! c.getBlobType())
+ continue;
+ char btname[NdbBlob::BlobTableNameSize];
+ NdbBlob::getBlobTableName(btname, &t, &c);
+ if (dropTable(btname) != 0) {
+ if (m_error.code != 709)
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
NdbDictInterface::dropTable(const NdbTableImpl & impl)
{
NdbApiSignal tSignal(m_reference);
@@ -1867,7 +1948,7 @@ int
NdbDictionaryImpl::dropIndex(NdbIndexImpl & impl, const char * tableName)
{
const char * indexName = impl.getName();
- if (tableName || Ndb::usingFullyQualifiedNames()) {
+ if (tableName || m_ndb.usingFullyQualifiedNames()) {
NdbTableImpl * timpl = impl.m_table;
if (timpl == 0) {
@@ -2572,14 +2653,13 @@ NdbDictionaryImpl::listObjects(List& list, NdbDictionary::Object::Type type)
req.requestData = 0;
req.setTableType(getKernelConstant(type, objectTypeMapping, 0));
req.setListNames(true);
- return m_receiver.listObjects(list, req.requestData);
+ return m_receiver.listObjects(list, req.requestData, m_ndb.usingFullyQualifiedNames());
}
int
NdbDictionaryImpl::listIndexes(List& list, const char * tableName)
{
- ListTablesReq
- req;
+ ListTablesReq req;
NdbTableImpl* impl = getTable(tableName);
if (impl == 0)
return -1;
@@ -2587,12 +2667,12 @@ NdbDictionaryImpl::listIndexes(List& list, const char * tableName)
req.setTableId(impl->m_tableId);
req.setListNames(true);
req.setListIndexes(true);
- return m_receiver.listObjects(list, req.requestData);
+ return m_receiver.listObjects(list, req.requestData, m_ndb.usingFullyQualifiedNames());
}
int
NdbDictInterface::listObjects(NdbDictionary::Dictionary::List& list,
- Uint32 requestData)
+ Uint32 requestData, bool fullyQualifiedNames)
{
NdbApiSignal tSignal(m_reference);
ListTablesReq* const req = CAST_PTR(ListTablesReq, tSignal.getDataPtrSend());
@@ -2657,7 +2737,7 @@ NdbDictInterface::listObjects(NdbDictionary::Dictionary::List& list,
memcpy(indexName, &data[pos], n << 2);
databaseName = Ndb::getDatabaseFromInternalName(indexName);
schemaName = Ndb::getSchemaFromInternalName(indexName);
- objectName = BaseString(Ndb::externalizeIndexName(indexName));
+ objectName = BaseString(Ndb::externalizeIndexName(indexName, fullyQualifiedNames));
delete [] indexName;
} else if ((element.type == NdbDictionary::Object::SystemTable) ||
(element.type == NdbDictionary::Object::UserTable)) {
@@ -2665,7 +2745,7 @@ NdbDictInterface::listObjects(NdbDictionary::Dictionary::List& list,
memcpy(tableName, &data[pos], n << 2);
databaseName = Ndb::getDatabaseFromInternalName(tableName);
schemaName = Ndb::getSchemaFromInternalName(tableName);
- objectName = BaseString(Ndb::externalizeTableName(tableName));
+ objectName = BaseString(Ndb::externalizeTableName(tableName, fullyQualifiedNames));
delete [] tableName;
}
else {
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 3263a636a79..bf59838c198 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -81,6 +81,7 @@ public:
Uint32 m_keyInfoPos;
Uint32 m_extType; // used by restore (kernel type in versin v2x)
bool getInterpretableType() const ;
+ bool getBlobType() const;
/**
* Equality/assign
@@ -141,6 +142,8 @@ public:
* Aggregates
*/
Uint32 m_noOfKeys;
+ unsigned short m_sizeOfKeysInWords;
+ unsigned short m_noOfBlobs;
/**
* Equality/assign
@@ -283,17 +286,18 @@ public:
int stopSubscribeEvent(class Ndb & ndb, NdbEventImpl &);
int stopSubscribeEvent(NdbApiSignal* signal, LinearSectionPtr ptr[3]);
- int listObjects(NdbDictionary::Dictionary::List& list, Uint32 requestData);
+ int listObjects(NdbDictionary::Dictionary::List& list, Uint32 requestData, bool fullyQualifiedNames);
int listObjects(NdbApiSignal* signal);
- NdbTableImpl * getTable(int tableId);
- NdbTableImpl * getTable(const char * name);
+ NdbTableImpl * getTable(int tableId, bool fullyQualifiedNames);
+ NdbTableImpl * getTable(const char * name, bool fullyQualifiedNames);
NdbTableImpl * getTable(class NdbApiSignal * signal,
LinearSectionPtr ptr[3],
- Uint32 noOfSections);
+ Uint32 noOfSections, bool fullyQualifiedNames);
static int parseTableInfo(NdbTableImpl ** dst,
- const Uint32 * data, Uint32 len);
+ const Uint32 * data, Uint32 len,
+ bool fullyQualifiedNames);
NdbError & m_error;
private:
@@ -352,13 +356,12 @@ public:
bool setTransporter(class Ndb * ndb, class TransporterFacade * tf);
bool setTransporter(class TransporterFacade * tf);
- int createTable(NdbTableImpl &t)
- {
- return m_receiver.createTable(m_ndb, t);
- }
+ int createTable(NdbTableImpl &t);
+ int createBlobTables(NdbTableImpl &);
int alterTable(NdbTableImpl &t);
int dropTable(const char * name);
int dropTable(NdbTableImpl &);
+ int dropBlobTables(NdbTableImpl &);
int invalidateObject(NdbTableImpl &);
int removeCachedObject(NdbTableImpl &);
@@ -432,6 +435,13 @@ NdbColumnImpl::getInterpretableType() const {
}
inline
+bool
+NdbColumnImpl::getBlobType() const {
+ return (m_type == NdbDictionary::Column::Blob ||
+ m_type == NdbDictionary::Column::Clob);
+}
+
+inline
NdbTableImpl &
NdbTableImpl::getImpl(NdbDictionary::Table & t){
return t.m_impl;
@@ -601,7 +611,7 @@ NdbDictionaryImpl::getTableImpl(const char * internalTableName)
m_globalHash->unlock();
if (ret == 0){
- ret = m_receiver.getTable(internalTableName);
+ ret = m_receiver.getTable(internalTableName, m_ndb.usingFullyQualifiedNames());
m_globalHash->lock();
m_globalHash->put(internalTableName, ret);
@@ -624,7 +634,7 @@ NdbIndexImpl *
NdbDictionaryImpl::getIndex(const char * indexName,
const char * tableName)
{
- if (tableName || Ndb::usingFullyQualifiedNames()) {
+ if (tableName || m_ndb.usingFullyQualifiedNames()) {
const char * internalIndexName = 0;
if (tableName) {
NdbTableImpl * t = getTable(tableName);
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index acc726e28c5..b73a58d97c4 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -21,7 +21,6 @@
#include "NdbDictionaryImpl.hpp"
#include "API.hpp"
#include <NdbOut.hpp>
-#include <AttrType.hpp>
#include "NdbApiSignal.hpp"
#include "TransporterFacade.hpp"
#include <signaldata/CreateEvnt.hpp>
@@ -489,52 +488,7 @@ NdbEventOperationImpl::getEventType()
}
}
-void
-NdbEventOperationImpl::printRecAttr(NdbRecAttr *p)
-{
- int size = p->attrSize();
- int aSize = p->arraySize();
-
- switch(p->attrType()){
- case UnSigned:
- switch(size) {
- case 8: ndbout << p->u_64_value(); break;
- case 4: ndbout << p->u_32_value(); break;
- case 2: ndbout << p->u_short_value(); break;
- case 1: ndbout << (unsigned) p->u_char_value(); break;
- default: ndbout << "Unknown size" << endl;
- }
- break;
-
- case Signed:
- switch(size) {
- case 8: ndbout << p->int64_value(); break;
- case 4: ndbout << p->int32_value(); break;
- case 2: ndbout << p->short_value(); break;
- case 1: ndbout << (int) p->char_value(); break;
- default: ndbout << "Unknown size" << endl;
- }
- break;
-
- case String:
- {
- char* buf = new char[aSize+1];
- memcpy(buf, p->aRef(), aSize);
- buf[aSize] = 0;
- ndbout << buf;
- delete [] buf;
- }
- break;
-
- case Float:
- ndbout << p->float_value();
- break;
-
- default:
- ndbout << "Unknown";
- break;
- }
-}
+
void
NdbEventOperationImpl::print()
@@ -545,8 +499,7 @@ NdbEventOperationImpl::print()
NdbRecAttr *p = theFirstRecAttrs[i];
ndbout << " %u " << i;
while (p) {
- ndbout << " : " << p->attrId() << " = ";
- printRecAttr(p);
+ ndbout << " : " << p->attrId() << " = " << *p;
p = p->next();
}
ndbout << "\n";
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/ndb/src/ndbapi/NdbEventOperationImpl.hpp
index b7dee084a9f..f67c998e639 100644
--- a/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+++ b/ndb/src/ndbapi/NdbEventOperationImpl.hpp
@@ -60,7 +60,6 @@ public:
void print();
void printAll();
- void printRecAttr(NdbRecAttr *);
Ndb *m_ndb;
NdbEventImpl *m_eventImpl;
diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp
index ee5491d72a8..631c09e2e6d 100644
--- a/ndb/src/ndbapi/NdbIndexOperation.cpp
+++ b/ndb/src/ndbapi/NdbIndexOperation.cpp
@@ -87,7 +87,7 @@ NdbIndexOperation::indxInit(NdbIndexImpl * anIndex,
m_accessTable = anIndex->m_table;
m_theIndexLen = 0;
m_theNoOfIndexDefined = 0;
- for (Uint32 i=0; i<MAXNROFTUPLEKEY; i++)
+ for (Uint32 i=0; i<NDB_MAX_ATTRIBUTES_IN_INDEX; i++)
for (int j=0; j<3; j++)
m_theIndexDefined[i][j] = false;
@@ -221,7 +221,7 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
goto equal_error2;
}//if
}//if
- } while (i < MAXNROFTUPLEKEY);
+ } while (i < NDB_MAX_ATTRIBUTES_IN_INDEX);
goto equal_error2;
} else {
goto equal_error1;
@@ -372,6 +372,17 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
} else if ((tOpType == ReadRequest) || (tOpType == DeleteRequest) ||
(tOpType == ReadExclusive)) {
theStatus = GetValue;
+ // create blob handles automatically
+ if (tOpType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) {
+ for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) {
+ NdbColumnImpl* c = m_currentTable->m_columns[i];
+ assert(c != 0);
+ if (c->getBlobType()) {
+ if (getBlobHandle(theNdbCon, c) == NULL)
+ return -1;
+ }
+ }
+ }
return 0;
} else if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) {
theStatus = SetValue;
@@ -695,7 +706,7 @@ NdbIndexOperation::receiveTCINDXREF( NdbApiSignal* aSignal)
theStatus = Finished;
- theNdbCon->theReturnStatus = ReturnFailure;
+ theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
//--------------------------------------------------------------------------//
// If the transaction this operation belongs to consists only of simple reads
// we set the error code on the transaction object.
diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp
index ccbfa767542..e6031a58c5f 100644
--- a/ndb/src/ndbapi/NdbOperation.cpp
+++ b/ndb/src/ndbapi/NdbOperation.cpp
@@ -31,7 +31,8 @@
#include "NdbApiSignal.hpp"
#include "NdbRecAttr.hpp"
#include "NdbUtil.hpp"
-
+#include "NdbBlob.hpp"
+#include "ndbapi_limits.h"
#include <signaldata/TcKeyReq.hpp>
#include "NdbDictionaryImpl.hpp"
@@ -103,7 +104,8 @@ NdbOperation::NdbOperation(Ndb* aNdb) :
theFirstSCAN_TABINFO_Recv(NULL),
theLastSCAN_TABINFO_Recv(NULL),
theSCAN_TABCONF_Recv(NULL),
- theBoundATTRINFO(NULL)
+ theBoundATTRINFO(NULL),
+ theBlobList(NULL)
{
theReceiver.init(NdbReceiver::NDB_OPERATION, this);
theError.code = 0;
@@ -163,7 +165,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){
m_currentTable = m_accessTable = tab;
theNdbCon = myConnection;
- for (Uint32 i=0; i<MAXNROFTUPLEKEY; i++)
+ for (Uint32 i=0; i<NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; i++)
for (int j=0; j<3; j++)
theTupleKeyDefined[i][j] = false;
@@ -197,6 +199,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){
theTotalNrOfKeyWordInSignal = 8;
theMagicNumber = 0xABCDEF01;
theBoundATTRINFO = NULL;
+ theBlobList = NULL;
tSignal = theNdb->getSignal();
if (tSignal == NULL)
@@ -236,6 +239,8 @@ NdbOperation::release()
NdbCall* tSaveCall;
NdbSubroutine* tSubroutine;
NdbSubroutine* tSaveSubroutine;
+ NdbBlob* tBlob;
+ NdbBlob* tSaveBlob;
if (theTCREQ != NULL)
{
@@ -308,6 +313,14 @@ NdbOperation::release()
}
theBoundATTRINFO = NULL;
}
+ tBlob = theBlobList;
+ while (tBlob != NULL)
+ {
+ tSaveBlob = tBlob;
+ tBlob = tBlob->theNext;
+ theNdb->releaseNdbBlob(tSaveBlob);
+ }
+ theBlobList = NULL;
releaseScan();
}
@@ -356,6 +369,18 @@ NdbOperation::setValue( Uint32 anAttrId,
return setValue(m_currentTable->getColumn(anAttrId), aValuePassed, len);
}
+NdbBlob*
+NdbOperation::getBlobHandle(const char* anAttrName)
+{
+ return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName));
+}
+
+NdbBlob*
+NdbOperation::getBlobHandle(Uint32 anAttrId)
+{
+ return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId));
+}
+
int
NdbOperation::incValue(const char* anAttrName, Uint32 aValue)
{
@@ -428,4 +453,8 @@ NdbOperation::setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len
return setBound(m_accessTable->getColumn(anAttrId), type, aValue, len);
}
-
+const char*
+NdbOperation::getTableName() const
+{
+ return m_currentTable->m_externalName.c_str();
+}
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index 18f8b79d12e..69a6602fe65 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -31,10 +31,10 @@
#include "NdbConnection.hpp"
#include "Ndb.hpp"
#include "NdbRecAttr.hpp"
-#include "AttrType.hpp"
#include "NdbUtil.hpp"
#include "NdbOut.hpp"
#include "NdbImpl.hpp"
+#include "NdbBlob.hpp"
#include <Interpreter.hpp>
@@ -529,9 +529,9 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
tAttrId = tAttrInfo->m_attrId;
const char *aValue = aValuePassed;
Uint32 ahValue;
- AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
if (aValue == NULL) {
if (tAttrInfo->m_nullable) {
+ AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
ah.setNULL();
insertATTRINFO(ahValue);
// Insert Attribute Id with the value
@@ -565,7 +565,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
}//if
const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word
const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word
- ah.setDataSize(totalSizeInWords);
+ AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId,
+ totalSizeInWords);
insertATTRINFO( ahValue );
/***********************************************************************
@@ -604,6 +605,33 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
return 0;
}//NdbOperation::setValue()
+NdbBlob*
+NdbOperation::getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* tAttrInfo)
+{
+ NdbBlob* tBlob = theBlobList;
+ NdbBlob* tLastBlob = NULL;
+ while (tBlob != NULL) {
+ if (tBlob->theColumn == tAttrInfo)
+ return tBlob;
+ tLastBlob = tBlob;
+ tBlob = tBlob->theNext;
+ }
+ tBlob = theNdb->getNdbBlob();
+ if (tBlob == NULL)
+ return NULL;
+ if (tBlob->atPrepare(aCon, this, tAttrInfo) == -1) {
+ theNdb->releaseNdbBlob(tBlob);
+ return NULL;
+ }
+ if (tLastBlob == NULL)
+ theBlobList = tBlob;
+ else
+ tLastBlob->theNext = tBlob;
+ tBlob->theNext = NULL;
+ theNdbCon->theBlobFlag = true;
+ return tBlob;
+}
+
/*
* Define bound on index column in range scan.
*/
diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp
index b2a6f99880c..d00c527550d 100644
--- a/ndb/src/ndbapi/NdbOperationExec.cpp
+++ b/ndb/src/ndbapi/NdbOperationExec.cpp
@@ -757,7 +757,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal)
theStatus = Finished;
- theNdbCon->theReturnStatus = ReturnFailure;
+ theNdbCon->theReturnStatus = NdbConnection::ReturnFailure;
//-------------------------------------------------------------------------//
// If the transaction this operation belongs to consists only of simple reads
// we set the error code on the transaction object.
diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp
index be23a1c274c..e61fc5b05d7 100644
--- a/ndb/src/ndbapi/NdbOperationInt.cpp
+++ b/ndb/src/ndbapi/NdbOperationInt.cpp
@@ -31,7 +31,6 @@ Adjust: 991029 UABRONM First version.
#include "NdbConnection.hpp"
#include "Ndb.hpp"
#include "NdbRecAttr.hpp"
-#include "AttrType.hpp"
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
@@ -69,7 +68,7 @@ NdbOperation::incCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -121,7 +120,7 @@ NdbOperation::write_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -169,7 +168,7 @@ NdbOperation::read_attrCheck(const NdbColumnImpl* tNdbColumnImpl)
}
return tNdbColumnImpl->m_attrId;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -209,7 +208,7 @@ NdbOperation::initial_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -235,7 +234,7 @@ NdbOperation::labelCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
@@ -255,7 +254,7 @@ NdbOperation::intermediate_interpreterCheck()
}
return 0;
} else {
- if (theNdbCon->theCommitStatus == Started)
+ if (theNdbCon->theCommitStatus == NdbConnection::Started)
setErrorCodeAbort(4200);
}
return -1;
diff --git a/ndb/src/ndbapi/NdbOperationScan.cpp b/ndb/src/ndbapi/NdbOperationScan.cpp
index df4f2421ec0..299e6f2adea 100644
--- a/ndb/src/ndbapi/NdbOperationScan.cpp
+++ b/ndb/src/ndbapi/NdbOperationScan.cpp
@@ -31,7 +31,7 @@ NdbOperation::openScanRead(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -48,7 +48,7 @@ NdbOperation::openScanExclusive(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -65,7 +65,7 @@ NdbOperation::openScanReadHoldLock(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -82,7 +82,7 @@ NdbOperation::openScanReadCommitted(Uint32 aParallelism)
{
aParallelism = checkParallelism(aParallelism);
- if ((theNdbCon->theCommitStatus != Started) &&
+ if ((theNdbCon->theCommitStatus != NdbConnection::Started) &&
(theStatus != Init) &&
(aParallelism == 0)) {
setErrorCode(4200);
@@ -569,8 +569,35 @@ NdbOperation::takeOverScanOp(OperationType opType, NdbConnection* updateTrans)
}
}
+ // create blob handles automatically
+ if (opType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) {
+ for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) {
+ NdbColumnImpl* c = m_currentTable->m_columns[i];
+ assert(c != 0);
+ if (c->getBlobType()) {
+ if (newOp->getBlobHandle(updateTrans, c) == NULL)
+ return NULL;
+ }
+ }
+ }
+
return newOp;
}
-
-
+int
+NdbOperation::getKeyFromKEYINFO20(Uint32* data, unsigned size)
+{
+ const NdbScanReceiver* tScanRec = theNdbCon->thePreviousScanRec;
+ NdbApiSignal* tSignal = tScanRec->theFirstKEYINFO20_Recv;
+ unsigned pos = 0;
+ unsigned n = 0;
+ while (pos < size) {
+ if (n == 20) {
+ tSignal = tSignal->next();
+ n = 0;
+ }
+ const unsigned h = KeyInfo20::HeaderLength;
+ data[pos++] = tSignal->getDataPtrSend()[h + n++];
+ }
+ return 0;
+}
diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp
index e1d5e823077..19cb133dbf7 100644
--- a/ndb/src/ndbapi/NdbOperationSearch.cpp
+++ b/ndb/src/ndbapi/NdbOperationSearch.cpp
@@ -35,7 +35,6 @@ Adjust: 971022 UABMNST First version.
#include <Ndb.hpp>
#include "NdbImpl.hpp"
#include <NdbOut.hpp>
-#include "AttrType.hpp"
#include <AttributeHeader.hpp>
#include <signaldata/TcKeyReq.hpp>
@@ -102,7 +101,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
goto equal_error2;
}//if
}//if
- } while (i < MAXNROFTUPLEKEY);
+ } while (i < NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY);
goto equal_error2;
} else {
goto equal_error1;
@@ -252,6 +251,17 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
} else if ((tOpType == ReadRequest) || (tOpType == DeleteRequest) ||
(tOpType == ReadExclusive)) {
theStatus = GetValue;
+ // create blob handles automatically
+ if (tOpType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) {
+ for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) {
+ NdbColumnImpl* c = m_currentTable->m_columns[i];
+ assert(c != 0);
+ if (c->getBlobType()) {
+ if (getBlobHandle(theNdbCon, c) == NULL)
+ return -1;
+ }
+ }
+ }
return 0;
} else if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) {
theStatus = SetValue;
@@ -498,3 +508,24 @@ LastWordLabel:
return 0;
}
+
+int
+NdbOperation::getKeyFromTCREQ(Uint32* data, unsigned size)
+{
+ assert(m_accessTable != 0 && m_accessTable->m_sizeOfKeysInWords != 0);
+ assert(m_accessTable->m_sizeOfKeysInWords == size);
+ unsigned pos = 0;
+ while (pos < 8 && pos < size) {
+ data[pos++] = theKEYINFOptr[pos];
+ }
+ NdbApiSignal* tSignal = theFirstKEYINFO;
+ unsigned n = 0;
+ while (pos < size) {
+ if (n == 20) {
+ tSignal = tSignal->next();
+ n = 0;
+ }
+ data[pos++] = tSignal->getDataPtrSend()[3 + n++];
+ }
+ return 0;
+}
diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp
index 0f7baeac4f5..0ed2ff4e796 100644
--- a/ndb/src/ndbapi/NdbRecAttr.cpp
+++ b/ndb/src/ndbapi/NdbRecAttr.cpp
@@ -27,17 +27,14 @@ Documentation:
Adjust: 971206 UABRONM First version
************************************************************************************************/
#include <ndb_global.h>
-#include "NdbRecAttr.hpp"
+#include <NdbOut.hpp>
+#include <NdbRecAttr.hpp>
#include "NdbDictionaryImpl.hpp"
+#include <NdbTCP.h>
-NdbRecAttr::NdbRecAttr() :
- theStorageX(NULL),
- theValue(NULL),
- theRef(NULL),
- theNext(NULL),
- theAttrId(0xFFFF),
- theNULLind(-1)
-{
+NdbRecAttr::NdbRecAttr()
+{
+ init();
}
NdbRecAttr::~NdbRecAttr()
@@ -46,6 +43,11 @@ NdbRecAttr::~NdbRecAttr()
}
int
+NdbRecAttr::setup(const class NdbDictionary::Column* col, char* aValue)
+{
+ return setup(&(col->m_impl), aValue);
+}
+int
NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue)
{
Uint32 tAttrSize = anAttrInfo->m_attrSize;
@@ -53,6 +55,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue)
Uint32 tAttrByteSize = tAttrSize * tArraySize;
m_column = anAttrInfo;
+
theAttrId = anAttrInfo->m_attrId;
theAttrSize = tAttrSize;
theArraySize = tArraySize;
@@ -124,3 +127,79 @@ NdbRecAttr::clone() const {
memcpy(ret->theRef, theRef, n);
return ret;
}
+
+NdbOut& operator<<(NdbOut& ndbout, const NdbRecAttr &r)
+{
+ if (r.isNULL())
+ {
+ ndbout << "[NULL]";
+ return ndbout;
+ }
+
+ if (r.arraySize() > 1)
+ ndbout << "[";
+
+ for (Uint32 j = 0; j < r.arraySize(); j++)
+ {
+ if (j > 0)
+ ndbout << " ";
+
+ switch(r.getType())
+ {
+ case NdbDictionary::Column::Bigunsigned:
+ ndbout << r.u_64_value();
+ break;
+ case NdbDictionary::Column::Unsigned:
+ ndbout << r.u_32_value();
+ break;
+ case NdbDictionary::Column::Smallunsigned:
+ ndbout << r.u_short_value();
+ break;
+ case NdbDictionary::Column::Tinyunsigned:
+ ndbout << (unsigned) r.u_char_value();
+ break;
+ case NdbDictionary::Column::Bigint:
+ ndbout << r.int64_value();
+ break;
+ case NdbDictionary::Column::Int:
+ ndbout << r.int32_value();
+ break;
+ case NdbDictionary::Column::Smallint:
+ ndbout << r.short_value();
+ break;
+ case NdbDictionary::Column::Tinyint:
+ ndbout << (int) r.char_value();
+ break;
+ case NdbDictionary::Column::Char:
+ ndbout.print("%.*s", r.arraySize(), r.aRef());
+ j = r.arraySize();
+ break;
+ case NdbDictionary::Column::Varchar:
+ {
+ short len = ntohs(r.u_short_value());
+ ndbout.print("%.*s", len, r.aRef()+2);
+ }
+ j = r.arraySize();
+ break;
+ case NdbDictionary::Column::Float:
+ ndbout << r.float_value();
+ break;
+ case NdbDictionary::Column::Double:
+ ndbout << r.double_value();
+ break;
+ default: /* no print functions for the rest, just print type */
+ ndbout << r.getType();
+ j = r.arraySize();
+ if (j > 1)
+ ndbout << " %u times" << j;
+ break;
+ }
+ }
+
+ if (r.arraySize() > 1)
+ {
+ ndbout << "]";
+ }
+
+ return ndbout;
+}
diff --git a/ndb/src/ndbapi/NdbResultSet.cpp b/ndb/src/ndbapi/NdbResultSet.cpp
index 8397d5eef91..65ed43f60d8 100644
--- a/ndb/src/ndbapi/NdbResultSet.cpp
+++ b/ndb/src/ndbapi/NdbResultSet.cpp
@@ -61,7 +61,8 @@ NdbResultSet::updateTuple(){
}
NdbScanOperation * op = (NdbScanOperation*)(m_operation);
- return op->takeOverScanOp(UpdateRequest, op->m_transConnection);
+ return op->takeOverScanOp(NdbOperation::UpdateRequest,
+ op->m_transConnection);
}
NdbOperation*
@@ -71,7 +72,8 @@ NdbResultSet::updateTuple(NdbConnection* takeOverTrans){
return 0;
}
- return m_operation->takeOverScanOp(UpdateRequest, takeOverTrans);
+ return m_operation->takeOverScanOp(NdbOperation::UpdateRequest,
+ takeOverTrans);
}
int
@@ -82,7 +84,8 @@ NdbResultSet::deleteTuple(){
}
NdbScanOperation * op = (NdbScanOperation*)(m_operation);
- void * res = op->takeOverScanOp(DeleteRequest, op->m_transConnection);
+ void * res = op->takeOverScanOp(NdbOperation::DeleteRequest,
+ op->m_transConnection);
if(res == 0)
return -1;
return 0;
@@ -95,7 +98,8 @@ NdbResultSet::deleteTuple(NdbConnection * takeOverTrans){
return 0;
}
- void * res = m_operation->takeOverScanOp(DeleteRequest, takeOverTrans);
+ void * res = m_operation->takeOverScanOp(NdbOperation::DeleteRequest,
+ takeOverTrans);
if(res == 0)
return -1;
return 0;
diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp
index 4db0f30f56c..cc090ac0364 100644
--- a/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -34,6 +34,7 @@
#include "NdbApiSignal.hpp"
#include <NdbOut.hpp>
#include "NdbDictionaryImpl.hpp"
+#include "NdbBlob.hpp"
NdbScanOperation::NdbScanOperation(Ndb* aNdb) :
NdbCursorOperation(aNdb),
@@ -86,8 +87,10 @@ NdbScanOperation::init(NdbTableImpl* tab, NdbConnection* myConnection)
m_transConnection = myConnection;
//NdbConnection* aScanConnection = theNdb->startTransaction(myConnection);
NdbConnection* aScanConnection = theNdb->hupp(myConnection);
- if (!aScanConnection)
+ if (!aScanConnection){
+ setErrorCodeAbort(theNdb->getNdbError().code);
return -1;
+ }
aScanConnection->theFirstOpInList = this;
aScanConnection->theLastOpInList = this;
NdbCursorOperation::cursInit();
@@ -106,11 +109,11 @@ NdbResultSet* NdbScanOperation::readTuples(Uint32 parallell,
break;
case NdbCursorOperation::LM_Exclusive:
parallell = (parallell == 0 ? 1 : parallell);
- res = openScan(parallell, true, /*irrelevant*/true, /*irrelevant*/false);
+ res = openScan(parallell, true, true, false);
break;
case NdbCursorOperation::LM_Dirty:
parallell = (parallell == 0 ? 240 : parallell);
- res = openScan(parallell, true, /*irrelevant*/true, /*irrelevant*/false);
+ res = openScan(parallell, false, false, true);
break;
default:
res = -1;
@@ -292,6 +295,18 @@ int NdbScanOperation::setValue(Uint32 anAttrId, double aValue)
return 0;
}
+NdbBlob*
+NdbScanOperation::getBlobHandle(const char* anAttrName)
+{
+ return NdbOperation::getBlobHandle(m_transConnection, m_currentTable->getColumn(anAttrName));
+}
+
+NdbBlob*
+NdbScanOperation::getBlobHandle(Uint32 anAttrId)
+{
+ return NdbOperation::getBlobHandle(m_transConnection, m_currentTable->getColumn(anAttrId));
+}
+
// Private methods
int NdbScanOperation::executeCursor(int ProcessorId)
@@ -342,6 +357,15 @@ int NdbScanOperation::nextResult(bool fetchAllowed)
const NdbError err = theNdbCon->getNdbError();
m_transConnection->setOperationErrorCode(err.code);
}
+ if (result == 0) {
+ // handle blobs
+ NdbBlob* tBlob = theBlobList;
+ while (tBlob != NULL) {
+ if (tBlob->atNextResult() == -1)
+ return -1;
+ tBlob = tBlob->theNext;
+ }
+ }
return result;
}
diff --git a/ndb/src/ndbapi/NdbUtil.hpp b/ndb/src/ndbapi/NdbUtil.hpp
index 6a82af85987..80fc15ddd8c 100644
--- a/ndb/src/ndbapi/NdbUtil.hpp
+++ b/ndb/src/ndbapi/NdbUtil.hpp
@@ -30,7 +30,6 @@ Comment:
#define NdbUtil_H
#include <ndb_global.h>
-#include "AttrType.hpp"
class NdbApiSignal;
class NdbOperation;
diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp
index faa2f00cfce..a8b968da03f 100644
--- a/ndb/src/ndbapi/Ndberr.cpp
+++ b/ndb/src/ndbapi/Ndberr.cpp
@@ -18,9 +18,9 @@
#include <NdbError.hpp>
#include "NdbImpl.hpp"
#include "NdbDictionaryImpl.hpp"
-#include <NdbSchemaCon.hpp>
#include <NdbOperation.hpp>
#include <NdbConnection.hpp>
+#include <NdbBlob.hpp>
static void
@@ -67,9 +67,9 @@ NdbOperation::getNdbError() const {
return theError;
}
-const
-NdbError &
-NdbSchemaCon::getNdbError() const {
+const
+NdbError &
+NdbBlob::getNdbError() const {
update(theError);
return theError;
}
diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp
index 696dfe68e40..a05eb4c54c3 100644
--- a/ndb/src/ndbapi/Ndbif.cpp
+++ b/ndb/src/ndbapi/Ndbif.cpp
@@ -16,10 +16,9 @@
#include "NdbApiSignal.hpp"
-#include "AttrType.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbIndexOperation.hpp"
#include "NdbScanReceiver.hpp"
@@ -42,13 +41,12 @@
/******************************************************************************
- * int init( int aNrOfCon, int aNrOfOp );
+ * int init( int aMaxNoOfTransactions );
*
* Return Value: Return 0 : init was successful.
* Return -1: In all other case.
- * Parameters: aNrOfCon : Number of connections offered to the application.
- * aNrOfOp : Number of operations offered to the application.
- * Remark: Create pointers and idle list Synchronous.
+ * Parameters: aMaxNoOfTransactions : Max number of simultaneous transations
+ * Remark: Create pointers and idle list Synchronous.
****************************************************************************/
int
Ndb::init(int aMaxNoOfTransactions)
@@ -90,7 +88,7 @@ Ndb::init(int aMaxNoOfTransactions)
theMyRef = numberToRef(theNdbBlockNumber, theNode);
for (i = 1; i < MAX_NDB_NODES; i++){
- if (theFacade->getIsNodeDefined(i)){
+ if (theFacade->getIsDbNode(i)){
theDBnodes[theNoOfDBnodes] = i;
theNoOfDBnodes++;
}
@@ -254,8 +252,9 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
for (int i = tNoSentTransactions - 1; i >= 0; i--) {
NdbConnection* localCon = theSentTransactionsArray[i];
if (localCon->getConnectedNodeId() == aNodeId ) {
- const SendStatusType sendStatus = localCon->theSendStatus;
- if (sendStatus == sendTC_OP || sendStatus == sendTC_COMMIT) {
+ const NdbConnection::SendStatusType sendStatus = localCon->theSendStatus;
+ if (sendStatus == NdbConnection::sendTC_OP ||
+ sendStatus == NdbConnection::sendTC_COMMIT) {
/*
A transaction was interrupted in the prepare phase by a node
failure. Since the transaction was not found in the phase
@@ -263,13 +262,13 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
we report a normal node failure abort.
*/
localCon->setOperationErrorCodeAbort(4010);
- localCon->theCompletionStatus = CompletedFailure;
- } else if (sendStatus == sendTC_ROLLBACK) {
+ localCon->theCompletionStatus = NdbConnection::CompletedFailure;
+ } else if (sendStatus == NdbConnection::sendTC_ROLLBACK) {
/*
We aimed for abort and abort we got even if it was by a node
failure. We will thus report it as a success.
*/
- localCon->theCompletionStatus = CompletedSuccess;
+ localCon->theCompletionStatus = NdbConnection::CompletedSuccess;
} else {
#ifdef VM_TRACE
printState("abortTransactionsAfterNodeFailure %x", this);
@@ -281,7 +280,7 @@ Ndb::abortTransactionsAfterNodeFailure(Uint16 aNodeId)
intact since the node was failing and they were aborted. Thus we
set commit state to Aborted and set state to release on close.
*/
- localCon->theCommitStatus = Aborted;
+ localCon->theCommitStatus = NdbConnection::Aborted;
localCon->theReleaseOnClose = true;
completedTransaction(localCon);
}//if
@@ -328,7 +327,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_OP)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
tReturnCode = tCon->receiveTCKEYCONF(keyConf, aSignal->getLength());
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -356,7 +355,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveREAD_CONF(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -381,7 +380,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTRANSID_AI(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -398,7 +397,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTRANSID_AI(tDataPtr,
aSignal->getLength());
if (tReturnCode != -1) {
@@ -442,8 +441,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == sendTC_OP) ||
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTCKEY_FAILCONF(failConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -469,8 +468,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if ((tCon->theSendStatus == sendTC_OP) ||
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCKEY_FAILREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -490,7 +489,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tOp->checkMagicNumber() == 0) {
tCon = tOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tOp->receiveTCKEYREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -512,7 +511,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITCONF(commitConf);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -537,7 +536,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_COMMIT)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_COMMIT)) {
tReturnCode = tCon->receiveTC_COMMITREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -553,7 +552,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKCONF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -568,7 +567,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_ROLLBACK)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_ROLLBACK)) {
tReturnCode = tCon->receiveTCROLLBACKREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -789,7 +788,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
const BlockReference aTCRef = aSignal->theSendersBlockRef;
tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) &&
- (tCon->theSendStatus == sendTC_OP)) {
+ (tCon->theSendStatus == NdbConnection::sendTC_OP)) {
tReturnCode = tCon->receiveTCINDXCONF(indxConf, aSignal->getLength());
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -812,7 +811,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tIndexOp->checkMagicNumber() == 0) {
tCon = tIndexOp->theNdbCon;
if (tCon != NULL) {
- if (tCon->theSendStatus == sendTC_OP) {
+ if (tCon->theSendStatus == NdbConnection::sendTC_OP) {
tReturnCode = tIndexOp->receiveTCINDXREF(aSignal);
if (tReturnCode != -1) {
completedTransaction(tCon);
@@ -866,7 +865,8 @@ Ndb::completedTransaction(NdbConnection* aCon)
Uint32 tTransArrayIndex = aCon->theTransArrayIndex;
Uint32 tNoSentTransactions = theNoOfSentTransactions;
Uint32 tNoCompletedTransactions = theNoOfCompletedTransactions;
- if ((tNoSentTransactions > 0) && (aCon->theListState == InSendList) &&
+ if ((tNoSentTransactions > 0) &&
+ (aCon->theListState == NdbConnection::InSendList) &&
(tTransArrayIndex < tNoSentTransactions)) {
NdbConnection* tMoveCon = theSentTransactionsArray[tNoSentTransactions - 1];
@@ -880,7 +880,7 @@ Ndb::completedTransaction(NdbConnection* aCon)
theNoOfCompletedTransactions = tNoCompletedTransactions + 1;
theNoOfSentTransactions = tNoSentTransactions - 1;
- aCon->theListState = InCompletedList;
+ aCon->theListState = NdbConnection::InCompletedList;
aCon->handleExecuteCompletion();
if ((theMinNoOfEventsToWakeUp != 0) &&
(theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) {
@@ -915,7 +915,7 @@ Ndb::reportCallback(NdbConnection** aCopyArray, Uint32 aNoOfCompletedTrans)
NdbAsynchCallback aCallback = aCopyArray[i]->theCallbackFunction;
int tResult = 0;
if (aCallback != NULL) {
- if (aCopyArray[i]->theReturnStatus == ReturnFailure) {
+ if (aCopyArray[i]->theReturnStatus == NdbConnection::ReturnFailure) {
tResult = -1;
}//if
(*aCallback)(tResult, aCopyArray[i], anyObject);
@@ -939,13 +939,13 @@ Ndb::pollCompleted(NdbConnection** aCopyArray)
if (tNoCompletedTransactions > 0) {
for (i = 0; i < tNoCompletedTransactions; i++) {
aCopyArray[i] = theCompletedTransactionsArray[i];
- if (aCopyArray[i]->theListState != InCompletedList) {
+ if (aCopyArray[i]->theListState != NdbConnection::InCompletedList) {
ndbout << "pollCompleted error ";
ndbout << aCopyArray[i]->theListState << endl;
abort();
}//if
theCompletedTransactionsArray[i] = NULL;
- aCopyArray[i]->theListState = NotInList;
+ aCopyArray[i]->theListState = NdbConnection::NotInList;
}//for
}//if
theNoOfCompletedTransactions = 0;
@@ -967,8 +967,8 @@ Ndb::check_send_timeout()
a_con->printState();
#endif
a_con->setOperationErrorCodeAbort(4012);
- a_con->theCommitStatus = Aborted;
- a_con->theCompletionStatus = CompletedFailure;
+ a_con->theCommitStatus = NdbConnection::Aborted;
+ a_con->theCompletionStatus = NdbConnection::CompletedFailure;
a_con->handleExecuteCompletion();
remove_sent_list(i);
insert_completed_list(a_con);
@@ -997,7 +997,7 @@ Ndb::insert_completed_list(NdbConnection* a_con)
Uint32 no_of_comp = theNoOfCompletedTransactions;
theCompletedTransactionsArray[no_of_comp] = a_con;
theNoOfCompletedTransactions = no_of_comp + 1;
- a_con->theListState = InCompletedList;
+ a_con->theListState = NdbConnection::InCompletedList;
a_con->theTransArrayIndex = no_of_comp;
return no_of_comp;
}
@@ -1008,7 +1008,7 @@ Ndb::insert_sent_list(NdbConnection* a_con)
Uint32 no_of_sent = theNoOfSentTransactions;
theSentTransactionsArray[no_of_sent] = a_con;
theNoOfSentTransactions = no_of_sent + 1;
- a_con->theListState = InSendList;
+ a_con->theListState = NdbConnection::InSendList;
a_con->theTransArrayIndex = no_of_sent;
return no_of_sent;
}
@@ -1046,10 +1046,10 @@ Ndb::sendPrepTrans(int forceSend)
if ((tp->getNodeSequence(node_id) == a_con->theNodeSequence) &&
tp->get_node_alive(node_id) ||
(tp->get_node_stopping(node_id) &&
- ((a_con->theSendStatus == sendABORT) ||
- (a_con->theSendStatus == sendABORTfail) ||
- (a_con->theSendStatus == sendCOMMITstate) ||
- (a_con->theSendStatus == sendCompleted)))) {
+ ((a_con->theSendStatus == NdbConnection::sendABORT) ||
+ (a_con->theSendStatus == NdbConnection::sendABORTfail) ||
+ (a_con->theSendStatus == NdbConnection::sendCOMMITstate) ||
+ (a_con->theSendStatus == NdbConnection::sendCompleted)))) {
/*
We will send if
1) Node is alive and sequences are correct OR
@@ -1081,13 +1081,13 @@ Ndb::sendPrepTrans(int forceSend)
again and will thus set the state to Aborted to avoid a more or
less eternal loop of tries.
*/
- if (a_con->theSendStatus == sendOperations) {
+ if (a_con->theSendStatus == NdbConnection::sendOperations) {
a_con->setOperationErrorCodeAbort(4021);
- a_con->theCommitStatus = NeedAbort;
+ a_con->theCommitStatus = NdbConnection::NeedAbort;
TRACE_DEBUG("Send buffer full and sendOperations");
} else {
a_con->setOperationErrorCodeAbort(4026);
- a_con->theCommitStatus = Aborted;
+ a_con->theCommitStatus = NdbConnection::Aborted;
TRACE_DEBUG("Send buffer full, set state to Aborted");
}//if
}//if
@@ -1104,7 +1104,7 @@ Ndb::sendPrepTrans(int forceSend)
*/
TRACE_DEBUG("Abort a transaction when stopping a node");
a_con->setOperationErrorCodeAbort(4023);
- a_con->theCommitStatus = NeedAbort;
+ a_con->theCommitStatus = NdbConnection::NeedAbort;
} else {
/*
The node is hard dead and we cannot continue. We will also release
@@ -1114,10 +1114,10 @@ Ndb::sendPrepTrans(int forceSend)
a_con->setOperationErrorCodeAbort(4025);
a_con->theReleaseOnClose = true;
a_con->theTransactionIsStarted = false;
- a_con->theCommitStatus = Aborted;
+ a_con->theCommitStatus = NdbConnection::Aborted;
}//if
}//if
- a_con->theCompletionStatus = CompletedFailure;
+ a_con->theCompletionStatus = NdbConnection::CompletedFailure;
a_con->handleExecuteCompletion();
insert_completed_list(a_con);
}//for
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index be7acc48d7a..f451ba885d4 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -15,10 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <ndb_global.h>
+
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbConnection.hpp"
#include "NdbRecAttr.hpp"
@@ -54,7 +56,7 @@ Ndb(const char* aDataBase);
Parameters: aDataBase : Name of the database.
Remark: Connect to the database.
***************************************************************************/
-Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
+Ndb::Ndb( const char* aDataBase , const char* aSchema) :
theNdbObjectIdMap(0),
thePreparedTransactionsArray(NULL),
theSentTransactionsArray(NULL),
@@ -72,8 +74,8 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theOpIdleList(NULL),
theScanOpIdleList(NULL),
theIndexOpIdleList(NULL),
- theSchemaConIdleList(NULL),
- theSchemaConToNdbList(NULL),
+// theSchemaConIdleList(NULL),
+// theSchemaConToNdbList(NULL),
theTransactionList(NULL),
theConnectionArray(NULL),
theRecAttrIdleList(NULL),
@@ -83,6 +85,7 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theSubroutineList(NULL),
theCallList(NULL),
theScanList(NULL),
+ theNdbBlobIdleList(NULL),
theNoOfDBnodes(0),
theDBnodes(NULL),
the_release_ind(NULL),
@@ -92,6 +95,8 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theNdbBlockNumber(-1),
theInitState(NotConstructed)
{
+ fullyQualifiedNames = true;
+
cgetSignals =0;
cfreeSignals = 0;
cnewSignals = 0;
@@ -116,28 +121,22 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theLastTupleId[i] = 0;
}//for
- if (aDataBase)
- strncpy(theDataBase, aDataBase, NDB_MAX_DATABASE_NAME_SIZE);
- else
- memset(theDataBase, 0, sizeof(theDataBase));
- strncpy(theDataBaseSchema, aDataBaseSchema, NDB_MAX_SCHEMA_NAME_SIZE);
- // Prepare prefix for faster operations
- uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1);
- uint schema_len =
- MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1);
- strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1);
- prefixName[db_len] = '/';
- strncpy(prefixName+db_len+1, theDataBaseSchema,
- NDB_MAX_SCHEMA_NAME_SIZE - 1);
- prefixName[db_len+schema_len+1] = '/';
- prefixName[db_len+schema_len+2] = '\0';
- prefixEnd = prefixName + db_len+schema_len + 2;
+ snprintf(theDataBase, sizeof(theDataBase), "%s",
+ aDataBase ? aDataBase : "");
+ snprintf(theDataBaseSchema, sizeof(theDataBaseSchema), "%s",
+ aSchema ? aSchema : "");
+
+ int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c",
+ theDataBase, table_name_separator,
+ theDataBaseSchema, table_name_separator);
+ prefixEnd = prefixName + (len < sizeof(prefixName) ? len :
+ sizeof(prefixName) - 1);
NdbMutex_Lock(&createNdbMutex);
TransporterFacade * m_facade = 0;
if(theNoOfNdbObjects == 0){
- if ((m_facade = TransporterFacade::start_instance(0,ndbConnectString)) == 0)
+ if ((m_facade = TransporterFacade::start_instance(ndbConnectString)) == 0)
theInitState = InitConfigError;
} else {
m_facade = TransporterFacade::instance();
@@ -207,8 +206,8 @@ Ndb::~Ndb()
NdbMutex_Unlock(&createNdbMutex);
- if (theSchemaConToNdbList != NULL)
- closeSchemaTransaction(theSchemaConToNdbList);
+// if (theSchemaConToNdbList != NULL)
+// closeSchemaTransaction(theSchemaConToNdbList);
while ( theConIdleList != NULL )
freeNdbCon();
while ( theSignalIdleList != NULL )
@@ -231,6 +230,8 @@ Ndb::~Ndb()
freeNdbCall();
while (theScanList != NULL)
freeNdbScanRec();
+ while (theNdbBlobIdleList != NULL)
+ freeNdbBlob();
releaseTransactionArrays();
startTransactionNodeSelectionData.release();
diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp
index 3839cc3291b..e557fdc0a5f 100644
--- a/ndb/src/ndbapi/Ndblist.cpp
+++ b/ndb/src/ndbapi/Ndblist.cpp
@@ -16,8 +16,8 @@
#include <NdbOut.hpp>
#include "Ndb.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
+//#include "NdbSchemaOp.hpp"
+//#include "NdbSchemaCon.hpp"
#include "NdbOperation.hpp"
#include "NdbScanOperation.hpp"
#include "NdbIndexOperation.hpp"
@@ -27,6 +27,7 @@
#include "NdbScanReceiver.hpp"
#include "NdbUtil.hpp"
#include "API.hpp"
+#include "NdbBlob.hpp"
void
Ndb::checkFailedNode()
@@ -104,7 +105,7 @@ Ndb::createConIdleList(int aNrOfCon)
tNdbCon->next(theConIdleList);
theConIdleList = tNdbCon;
}
- tNdbCon->Status(NotConnected);
+ tNdbCon->Status(NdbConnection::NotConnected);
}
theNoOfAllocatedTransactions = aNrOfCon;
return aNrOfCon;
@@ -435,6 +436,19 @@ Ndb::getSignal()
return tSignal;
}
+NdbBlob*
+Ndb::getNdbBlob()
+{
+ NdbBlob* tBlob = theNdbBlobIdleList;
+ if (tBlob != NULL) {
+ theNdbBlobIdleList = tBlob->theNext;
+ tBlob->init();
+ } else {
+ tBlob = new NdbBlob;
+ }
+ return tBlob;
+}
+
/***************************************************************************
void releaseNdbBranch(NdbBranch* aNdbBranch);
@@ -601,6 +615,14 @@ Ndb::releaseSignalsInList(NdbApiSignal** pList){
}
}
+void
+Ndb::releaseNdbBlob(NdbBlob* aBlob)
+{
+ aBlob->release();
+ aBlob->theNext = theNdbBlobIdleList;
+ theNdbBlobIdleList = aBlob;
+}
+
/***************************************************************************
void freeOperation();
@@ -745,6 +767,14 @@ Ndb::freeSignal()
cfreeSignals++;
}
+void
+Ndb::freeNdbBlob()
+{
+ NdbBlob* tBlob = theNdbBlobIdleList;
+ theNdbBlobIdleList = tBlob->theNext;
+ delete tBlob;
+}
+
/****************************************************************************
int releaseConnectToNdb(NdbConnection* aConnectConnection);
@@ -770,7 +800,7 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con)
tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1);
tSignal.setData(theMyRef, 2);
tSignal.setData(a_con->ptr2int(), 3);
- a_con->Status(DisConnecting);
+ a_con->Status(NdbConnection::DisConnecting);
a_con->theMagicNumber = 0x37412619;
int ret_code = sendRecSignal(node_id,
WAIT_TC_RELEASE,
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index f4a3ae3e87d..e725144a8f8 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -16,7 +16,6 @@
#include <ndb_global.h>
#include <ndb_limits.h>
-#include <AttrType.hpp>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
#include <IPCConfig.hpp>
@@ -29,6 +28,8 @@
#include "API.hpp"
#include <ConfigRetriever.hpp>
+#include <mgmapi_config_parameters.h>
+#include <mgmapi_configuration.hpp>
#include <NdbConfig.h>
#include <ndb_version.h>
#include <SignalLoggerManager.hpp>
@@ -332,39 +333,40 @@ atexit_stop_instance(){
* Which is protected by a mutex
*/
TransporterFacade*
-TransporterFacade::start_instance(Properties* props, const char *connectString)
-{
- bool ownProps = false;
- if (props == NULL) {
- // TransporterFacade used from API get config from mgmt srvr
- ConfigRetriever configRetriever;
- configRetriever.setConnectString(connectString);
- props = configRetriever.getConfig("API", NDB_VERSION);
- if (props == 0) {
- ndbout << "Configuration error: ";
- const char* erString = configRetriever.getErrorString();
- if (erString == 0) {
- erString = "No error specified!";
- }
- ndbout << erString << endl;
- return NULL;
+TransporterFacade::start_instance(const char * connectString){
+
+ // TransporterFacade used from API get config from mgmt srvr
+ ConfigRetriever configRetriever;
+ configRetriever.setConnectString(connectString);
+ ndb_mgm_configuration * props = configRetriever.getConfig(NDB_VERSION,
+ NODE_TYPE_API);
+ if (props == 0) {
+ ndbout << "Configuration error: ";
+ const char* erString = configRetriever.getErrorString();
+ if (erString == 0) {
+ erString = "No error specified!";
}
- props->put("LocalNodeId", configRetriever.getOwnNodeId());
- props->put("LocalNodeType", "API");
-
- ownProps = true;
+ ndbout << erString << endl;
+ return 0;
}
- TransporterFacade* tf = new TransporterFacade();
+ const int nodeId = configRetriever.getOwnNodeId();
- if (! tf->init(props)) {
+ TransporterFacade * tf = start_instance(nodeId, props);
+
+ free(props);
+ return tf;
+}
+
+TransporterFacade*
+TransporterFacade::start_instance(int nodeId,
+ const ndb_mgm_configuration* props)
+{
+ TransporterFacade* tf = new TransporterFacade();
+ if (! tf->init(nodeId, props)) {
delete tf;
return NULL;
}
- if (ownProps) {
- delete props;
- }
-
/**
* Install atexit handler
*/
@@ -499,61 +501,65 @@ TransporterFacade::TransporterFacade() :
}
bool
-TransporterFacade::init(Properties* props)
+TransporterFacade::init(Uint32 nodeId, const ndb_mgm_configuration* props)
{
- IPCConfig config(props);
-
- if (config.init() != 0) {
- TRP_DEBUG( "IPCConfig object config failed to init()" );
- return false;
- }
- theOwnId = config.ownId();
-
+ theOwnId = nodeId;
theTransporterRegistry = new TransporterRegistry(this);
- if(config.configureTransporters(theTransporterRegistry) <= 0) {
+
+ const int res = IPCConfig::configureTransporters(nodeId,
+ * props,
+ * theTransporterRegistry);
+ if(res <= 0){
TRP_DEBUG( "configureTransporters returned 0 or less" );
return false;
}
+ ndb_mgm_configuration_iterator iter(* props, CFG_SECTION_NODE);
+ iter.first();
theClusterMgr = new ClusterMgr(* this);
- theClusterMgr->init(config);
-
- theReceiveThread = NdbThread_Create(runReceiveResponse_C,
- (void**)this,
- 32768,
- "ndb_receive",
- NDB_THREAD_PRIO_LOW);
-
- theSendThread = NdbThread_Create(runSendRequest_C,
- (void**)this,
- 32768,
- "ndb_send",
- NDB_THREAD_PRIO_LOW);
-
- theClusterMgr->startThread();
+ theClusterMgr->init(iter);
/**
* Unless there is a "Name", the initiated transporter is within
* an NDB Cluster. (If "Name" is defined, then the transporter
* is used to connect to a different system, i.e. NDB Cluster.)
*/
+#if 0
if (!props->contains("Name")) {
- const Properties* p = 0;
- if(!props->get("Node", ownId(), &p)) {
+#endif
+ iter.first();
+ if(iter.find(CFG_NODE_ID, nodeId)){
TRP_DEBUG( "Node info missing from config." );
return false;
}
Uint32 rank = 0;
- if (p->get("ArbitrationRank", &rank) && rank > 0) {
+ if(!iter.get(CFG_NODE_ARBIT_RANK, &rank) && rank>0){
theArbitMgr = new ArbitMgr(* this);
theArbitMgr->setRank(rank);
Uint32 delay = 0;
- p->get("ArbitrationDelay", &delay);
+ iter.get(CFG_NODE_ARBIT_DELAY, &delay);
theArbitMgr->setDelay(delay);
}
+
+#if 0
}
+#endif
+
+ theReceiveThread = NdbThread_Create(runReceiveResponse_C,
+ (void**)this,
+ 32768,
+ "ndb_receive",
+ NDB_THREAD_PRIO_LOW);
+
+ theSendThread = NdbThread_Create(runSendRequest_C,
+ (void**)this,
+ 32768,
+ "ndb_send",
+ NDB_THREAD_PRIO_LOW);
+ theClusterMgr->startThread();
+
#ifdef API_TRACE
signalLogger.logOn(true, 0, SignalLoggerManager::LogInOut);
#endif
diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp
index d9d2dbbcf0f..4b76cbe864a 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -17,7 +17,6 @@
#ifndef TransporterFacade_H
#define TransporterFacade_H
-#include <AttrType.hpp>
#include <kernel_types.h>
#include <ndb_limits.h>
#include <NdbThread.h>
@@ -28,8 +27,8 @@
class ClusterMgr;
class ArbitMgr;
-class Properties;
class IPCConfig;
+struct ndb_mgm_configuration;
class Ndb;
class NdbApiSignal;
@@ -43,15 +42,20 @@ extern "C" {
void atexit_stop_instance();
}
+/**
+ * Max number of Ndb objects in different threads.
+ * (Ndb objects should not be shared by different threads.)
+ */
class TransporterFacade
{
public:
TransporterFacade();
virtual ~TransporterFacade();
- bool init(Properties* props);
+ bool init(Uint32, const ndb_mgm_configuration *);
static TransporterFacade* instance();
- static TransporterFacade* start_instance(Properties* ipcConfig, const char *connectString);
+ static TransporterFacade* start_instance(int, const ndb_mgm_configuration*);
+ static TransporterFacade* start_instance(const char *connectString);
static void stop_instance();
/**
@@ -76,7 +80,7 @@ public:
// Is node available for running transactions
bool get_node_alive(NodeId nodeId) const;
bool get_node_stopping(NodeId nodeId) const;
- bool getIsNodeDefined(NodeId nodeId) const;
+ bool getIsDbNode(NodeId nodeId) const;
bool getIsNodeSendable(NodeId nodeId) const;
Uint32 getNodeGrp(NodeId nodeId) const;
Uint32 getNodeSequence(NodeId nodeId) const;
@@ -156,6 +160,8 @@ private:
/**
* Block number handling
*/
+ static const unsigned MAX_NO_THREADS = 4711;
+
struct ThreadData {
static const Uint32 ACTIVE = (1 << 16) | 1;
static const Uint32 INACTIVE = (1 << 16);
@@ -250,8 +256,10 @@ TransporterFacade::check_send_size(Uint32 node_id, Uint32 send_size)
inline
bool
-TransporterFacade::getIsNodeDefined(NodeId n) const {
- return theClusterMgr->getNodeInfo(n).defined;
+TransporterFacade::getIsDbNode(NodeId n) const {
+ return
+ theClusterMgr->getNodeInfo(n).defined &&
+ theClusterMgr->getNodeInfo(n).m_info.m_type == NodeInfo::DB;
}
inline
diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
index ea7cf4de426..760322d669d 100644
--- a/ndb/src/ndbapi/ndberror.c
+++ b/ndb/src/ndbapi/ndberror.c
@@ -418,8 +418,14 @@ ErrorBundle ErrorCodes[] = {
{ 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"}
-
+ { 4262, UD, "NdbScanFilter: Condition is out of bounds"},
+ { 4263, IE, "Invalid blob attributes or invalid blob parts table" },
+ { 4264, AE, "Invalid usage of blob attribute" },
+ { 4265, AE, "Method is not valid in current blob state" },
+ { 4266, AE, "Invalid blob seek position" },
+ { 4267, IE, "Corrupted blob value" },
+ { 4268, IE, "Error in blob head update forced rollback of transaction" },
+ { 4268, IE, "Unknown blob error" }
};
static
diff --git a/ndb/src/ndbapi/signal-sender/SignalSender.cpp b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
index e642848dcee..680d0c23b4a 100644
--- a/ndb/src/ndbapi/signal-sender/SignalSender.cpp
+++ b/ndb/src/ndbapi/signal-sender/SignalSender.cpp
@@ -71,7 +71,7 @@ SimpleSignal::print(FILE * out){
SignalSender::SignalSender(const char * connectString){
m_cond = NdbCondition_Create();
- theFacade = TransporterFacade::start_instance(0,connectString);
+ theFacade = TransporterFacade::start_instance(connectString);
m_blockNo = theFacade->open(this, execSignal, execNodeStatus);
assert(m_blockNo > 0);
}
diff --git a/ndb/src/client/Makefile b/ndb/src/old_files/client/Makefile
index 1751a98bdfe..1751a98bdfe 100644
--- a/ndb/src/client/Makefile
+++ b/ndb/src/old_files/client/Makefile
diff --git a/ndb/src/client/odbc/Extra.mk b/ndb/src/old_files/client/odbc/Extra.mk
index 762fb0bedd0..762fb0bedd0 100644
--- a/ndb/src/client/odbc/Extra.mk
+++ b/ndb/src/old_files/client/odbc/Extra.mk
diff --git a/ndb/src/client/odbc/Makefile b/ndb/src/old_files/client/odbc/Makefile
index 2da683e7d86..2da683e7d86 100644
--- a/ndb/src/client/odbc/Makefile
+++ b/ndb/src/old_files/client/odbc/Makefile
diff --git a/ndb/src/client/odbc/NdbOdbc.cpp b/ndb/src/old_files/client/odbc/NdbOdbc.cpp
index 67c6b5e0004..67c6b5e0004 100755
--- a/ndb/src/client/odbc/NdbOdbc.cpp
+++ b/ndb/src/old_files/client/odbc/NdbOdbc.cpp
diff --git a/ndb/src/client/odbc/NdbOdbc.def b/ndb/src/old_files/client/odbc/NdbOdbc.def
index 85619b91915..85619b91915 100755
--- a/ndb/src/client/odbc/NdbOdbc.def
+++ b/ndb/src/old_files/client/odbc/NdbOdbc.def
diff --git a/ndb/src/client/odbc/codegen/CodeGen.cpp b/ndb/src/old_files/client/odbc/codegen/CodeGen.cpp
index 6be78b62bd9..6be78b62bd9 100644
--- a/ndb/src/client/odbc/codegen/CodeGen.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/CodeGen.cpp
diff --git a/ndb/src/client/odbc/codegen/CodeGen.hpp b/ndb/src/old_files/client/odbc/codegen/CodeGen.hpp
index ae61dab0c2a..ae61dab0c2a 100644
--- a/ndb/src/client/odbc/codegen/CodeGen.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/CodeGen.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_base.cpp b/ndb/src/old_files/client/odbc/codegen/Code_base.cpp
index dc02e071156..dc02e071156 100644
--- a/ndb/src/client/odbc/codegen/Code_base.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_base.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_base.hpp b/ndb/src/old_files/client/odbc/codegen/Code_base.hpp
index c67c0ca7adb..c67c0ca7adb 100644
--- a/ndb/src/client/odbc/codegen/Code_base.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_base.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_column.cpp
index c4c0480a5e7..c4c0480a5e7 100644
--- a/ndb/src/client/odbc/codegen/Code_column.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_column.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_column.hpp
index af0dcea690d..af0dcea690d 100644
--- a/ndb/src/client/odbc/codegen/Code_column.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_column.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_comp_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp
index 7782ed1ea2a..7782ed1ea2a 100644
--- a/ndb/src/client/odbc/codegen/Code_comp_op.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_comp_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp
index 0585ab1dabf..0585ab1dabf 100644
--- a/ndb/src/client/odbc/codegen/Code_comp_op.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp
index 84f319338a4..84f319338a4 100644
--- a/ndb/src/client/odbc/codegen/Code_create_index.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp
index ebd757e1118..ebd757e1118 100644
--- a/ndb/src/client/odbc/codegen/Code_create_index.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp
index 5b90b658ed7..5b90b658ed7 100644
--- a/ndb/src/client/odbc/codegen/Code_create_row.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp
index f03455ff28e..f03455ff28e 100644
--- a/ndb/src/client/odbc/codegen/Code_create_row.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp
index 14e4abbd7fe..14e4abbd7fe 100644
--- a/ndb/src/client/odbc/codegen/Code_create_table.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_create_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp
index cbb2189d8ce..cbb2189d8ce 100644
--- a/ndb/src/client/odbc/codegen/Code_create_table.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_data_type.cpp b/ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp
index 1ff0fcebcbe..1ff0fcebcbe 100644
--- a/ndb/src/client/odbc/codegen/Code_data_type.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_data_type.hpp b/ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp
index 735dc05014f..735dc05014f 100644
--- a/ndb/src/client/odbc/codegen/Code_data_type.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp
index 2ba4291a0e8..2ba4291a0e8 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp
index 1ceca62d55d..1ceca62d55d 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp
index ee037e54c1f..ee037e54c1f 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_column.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp
index 7d089d37440..7d089d37440 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_column.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_constr.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp
index 78c23e38d97..78c23e38d97 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_constr.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_constr.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp
index ea7808b37cb..ea7808b37cb 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_constr.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp
index 87589ebbaa0..87589ebbaa0 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_row.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_ddl_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp
index ac3eded1b2e..ac3eded1b2e 100644
--- a/ndb/src/client/odbc/codegen/Code_ddl_row.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete.cpp
index 35b3daa1aca..35b3daa1aca 100644
--- a/ndb/src/client/odbc/codegen/Code_delete.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete.hpp
index c7fa245497b..c7fa245497b 100644
--- a/ndb/src/client/odbc/codegen/Code_delete.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp
index 8f2c3be2848..8f2c3be2848 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_index.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp
index 1aaaa18abcb..1aaaa18abcb 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_index.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp
index 4a6dec64654..4a6dec64654 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp
index 4138baefa4c..4138baefa4c 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_lookup.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp
index fed7244a026..fed7244a026 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_scan.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_delete_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp
index eb013a8257e..eb013a8257e 100644
--- a/ndb/src/client/odbc/codegen/Code_delete_scan.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml.cpp
index 44fd4478646..44fd4478646 100644
--- a/ndb/src/client/odbc/codegen/Code_dml.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml.hpp
index 0618f583984..0618f583984 100644
--- a/ndb/src/client/odbc/codegen/Code_dml.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp
index 808e2ac8c4b..808e2ac8c4b 100644
--- a/ndb/src/client/odbc/codegen/Code_dml_column.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp
index 0fb33944a3a..0fb33944a3a 100644
--- a/ndb/src/client/odbc/codegen/Code_dml_column.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp
index ceb63a9f7b9..ceb63a9f7b9 100644
--- a/ndb/src/client/odbc/codegen/Code_dml_row.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_dml_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp
index 6c7e46ba9af..6c7e46ba9af 100644
--- a/ndb/src/client/odbc/codegen/Code_dml_row.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_drop_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp
index b6bae88e270..b6bae88e270 100644
--- a/ndb/src/client/odbc/codegen/Code_drop_index.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_drop_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp
index 99891c9a52f..99891c9a52f 100644
--- a/ndb/src/client/odbc/codegen/Code_drop_index.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_drop_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp
index f20bf9fdae0..f20bf9fdae0 100644
--- a/ndb/src/client/odbc/codegen/Code_drop_table.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_drop_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp
index 849a472ed94..849a472ed94 100644
--- a/ndb/src/client/odbc/codegen/Code_drop_table.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr.cpp
index 4afa75986a0..4afa75986a0 100644
--- a/ndb/src/client/odbc/codegen/Code_expr.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr.hpp
index b6f07471b4d..b6f07471b4d 100644
--- a/ndb/src/client/odbc/codegen/Code_expr.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp
index 17a9a502d4c..17a9a502d4c 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_column.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp
index 2ce7c441e45..2ce7c441e45 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_column.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_const.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp
index 564d307a4f8..564d307a4f8 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_const.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_const.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp
index 2e26c637a23..2e26c637a23 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_const.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_conv.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp
index bc89482fedc..bc89482fedc 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_conv.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_conv.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp
index 3294960c7b3..3294960c7b3 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_conv.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_func.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp
index 96b461a72d9..96b461a72d9 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_func.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_func.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp
index 856d7529875..856d7529875 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_func.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp
index 7e8314c1741..7e8314c1741 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_op.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp
index f9686cad151..f9686cad151 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_op.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_param.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp
index 93892cae5e6..93892cae5e6 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_param.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_param.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp
index 783e5c087b4..783e5c087b4 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_param.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp
index da1751d41d1..da1751d41d1 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_row.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_expr_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp
index 94527931dba..94527931dba 100644
--- a/ndb/src/client/odbc/codegen/Code_expr_row.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_idx_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp
index 584ffef3e01..584ffef3e01 100644
--- a/ndb/src/client/odbc/codegen/Code_idx_column.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_idx_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp
index 209ed705b48..209ed705b48 100644
--- a/ndb/src/client/odbc/codegen/Code_idx_column.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_insert.cpp b/ndb/src/old_files/client/odbc/codegen/Code_insert.cpp
index c442186c181..c442186c181 100644
--- a/ndb/src/client/odbc/codegen/Code_insert.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_insert.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_insert.hpp b/ndb/src/old_files/client/odbc/codegen/Code_insert.hpp
index 748b092e33a..748b092e33a 100644
--- a/ndb/src/client/odbc/codegen/Code_insert.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_insert.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_pred.cpp b/ndb/src/old_files/client/odbc/codegen/Code_pred.cpp
index fe7cac7606e..fe7cac7606e 100644
--- a/ndb/src/client/odbc/codegen/Code_pred.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_pred.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_pred.hpp b/ndb/src/old_files/client/odbc/codegen/Code_pred.hpp
index a77c1161fa1..a77c1161fa1 100644
--- a/ndb/src/client/odbc/codegen/Code_pred.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_pred.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_pred_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp
index 29736e45818..29736e45818 100644
--- a/ndb/src/client/odbc/codegen/Code_pred_op.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_pred_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp
index 9130bc3cb81..9130bc3cb81 100644
--- a/ndb/src/client/odbc/codegen/Code_pred_op.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query.cpp
index 9e983942601..9e983942601 100644
--- a/ndb/src/client/odbc/codegen/Code_query.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query.hpp
index 97f98f859ff..97f98f859ff 100644
--- a/ndb/src/client/odbc/codegen/Code_query.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_count.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp
index f52c41df802..f52c41df802 100644
--- a/ndb/src/client/odbc/codegen/Code_query_count.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_count.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp
index a094eba4519..a094eba4519 100644
--- a/ndb/src/client/odbc/codegen/Code_query_count.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_distinct.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp
index 4cbfbfe812d..4cbfbfe812d 100644
--- a/ndb/src/client/odbc/codegen/Code_query_distinct.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_distinct.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp
index 62c46bda901..62c46bda901 100644
--- a/ndb/src/client/odbc/codegen/Code_query_distinct.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_filter.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp
index 934a24d182d..934a24d182d 100644
--- a/ndb/src/client/odbc/codegen/Code_query_filter.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_filter.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp
index 60cbf0f86a7..60cbf0f86a7 100644
--- a/ndb/src/client/odbc/codegen/Code_query_filter.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_group.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp
index c3019efaa85..c3019efaa85 100644
--- a/ndb/src/client/odbc/codegen/Code_query_group.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_group.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp
index e79022c5284..e79022c5284 100644
--- a/ndb/src/client/odbc/codegen/Code_query_group.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp
index ee19d6123cc..ee19d6123cc 100644
--- a/ndb/src/client/odbc/codegen/Code_query_index.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp
index 87affd50580..87affd50580 100644
--- a/ndb/src/client/odbc/codegen/Code_query_index.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_join.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp
index 89aafe13610..89aafe13610 100644
--- a/ndb/src/client/odbc/codegen/Code_query_join.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_join.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp
index f6ac9205329..f6ac9205329 100644
--- a/ndb/src/client/odbc/codegen/Code_query_join.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp
index bad4199190b..bad4199190b 100644
--- a/ndb/src/client/odbc/codegen/Code_query_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp
index e66623d4030..e66623d4030 100644
--- a/ndb/src/client/odbc/codegen/Code_query_lookup.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_project.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp
index 54043ce3d5d..54043ce3d5d 100644
--- a/ndb/src/client/odbc/codegen/Code_query_project.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_project.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp
index 545685ab9df..545685ab9df 100644
--- a/ndb/src/client/odbc/codegen/Code_query_project.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_range.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp
index 5d29c5af315..5d29c5af315 100644
--- a/ndb/src/client/odbc/codegen/Code_query_range.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_range.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp
index 4438189522c..4438189522c 100644
--- a/ndb/src/client/odbc/codegen/Code_query_range.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_repeat.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp
index 8b295a97916..8b295a97916 100644
--- a/ndb/src/client/odbc/codegen/Code_query_repeat.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_repeat.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp
index 90d6ef55104..90d6ef55104 100644
--- a/ndb/src/client/odbc/codegen/Code_query_repeat.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp
index 1c0f58980e5..1c0f58980e5 100644
--- a/ndb/src/client/odbc/codegen/Code_query_scan.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp
index d6d1630ddf8..d6d1630ddf8 100644
--- a/ndb/src/client/odbc/codegen/Code_query_scan.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_sort.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp
index 4ea6db8c4e2..4ea6db8c4e2 100644
--- a/ndb/src/client/odbc/codegen/Code_query_sort.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_sort.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp
index d1aa03d9aef..d1aa03d9aef 100644
--- a/ndb/src/client/odbc/codegen/Code_query_sort.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_sys.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp
index affe3dc1264..affe3dc1264 100644
--- a/ndb/src/client/odbc/codegen/Code_query_sys.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_query_sys.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp
index 8eb069d0413..8eb069d0413 100644
--- a/ndb/src/client/odbc/codegen/Code_query_sys.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_root.cpp b/ndb/src/old_files/client/odbc/codegen/Code_root.cpp
index 4f45bdffdaf..4f45bdffdaf 100644
--- a/ndb/src/client/odbc/codegen/Code_root.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_root.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_root.hpp b/ndb/src/old_files/client/odbc/codegen/Code_root.hpp
index 4f0f96725e3..4f0f96725e3 100644
--- a/ndb/src/client/odbc/codegen/Code_root.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_root.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_select.cpp b/ndb/src/old_files/client/odbc/codegen/Code_select.cpp
index 611b491968d..611b491968d 100644
--- a/ndb/src/client/odbc/codegen/Code_select.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_select.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_select.hpp b/ndb/src/old_files/client/odbc/codegen/Code_select.hpp
index eaa9b801f29..eaa9b801f29 100644
--- a/ndb/src/client/odbc/codegen/Code_select.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_select.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_set_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp
index dd13ba0c3f7..dd13ba0c3f7 100644
--- a/ndb/src/client/odbc/codegen/Code_set_row.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_set_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp
index 10d62826ac7..10d62826ac7 100644
--- a/ndb/src/client/odbc/codegen/Code_set_row.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_stmt.cpp b/ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp
index d790f667b84..d790f667b84 100644
--- a/ndb/src/client/odbc/codegen/Code_stmt.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_stmt.hpp b/ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp
index 20b7fb965fb..20b7fb965fb 100644
--- a/ndb/src/client/odbc/codegen/Code_stmt.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_table.cpp
index ee3c2a2ed07..ee3c2a2ed07 100644
--- a/ndb/src/client/odbc/codegen/Code_table.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_table.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_table.hpp
index 8a95b8fa26c..8a95b8fa26c 100644
--- a/ndb/src/client/odbc/codegen/Code_table.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_table.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_table_list.cpp b/ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp
index ea9f4fdc26e..ea9f4fdc26e 100644
--- a/ndb/src/client/odbc/codegen/Code_table_list.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_table_list.hpp b/ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp
index 47989166cac..47989166cac 100644
--- a/ndb/src/client/odbc/codegen/Code_table_list.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_update.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update.cpp
index 0b33cd628b4..0b33cd628b4 100644
--- a/ndb/src/client/odbc/codegen/Code_update.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_update.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update.hpp
index 380b651518b..380b651518b 100644
--- a/ndb/src/client/odbc/codegen/Code_update.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp
index 6f74db0d913..6f74db0d913 100644
--- a/ndb/src/client/odbc/codegen/Code_update_index.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp
index bbad822650a..bbad822650a 100644
--- a/ndb/src/client/odbc/codegen/Code_update_index.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp
index 7525fb72692..7525fb72692 100644
--- a/ndb/src/client/odbc/codegen/Code_update_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp
index fc4341880dd..fc4341880dd 100644
--- a/ndb/src/client/odbc/codegen/Code_update_lookup.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp
index 9fac1728469..9fac1728469 100644
--- a/ndb/src/client/odbc/codegen/Code_update_scan.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp
diff --git a/ndb/src/client/odbc/codegen/Code_update_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp
index d742883e561..d742883e561 100644
--- a/ndb/src/client/odbc/codegen/Code_update_scan.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp
diff --git a/ndb/src/client/odbc/codegen/Makefile b/ndb/src/old_files/client/odbc/codegen/Makefile
index 49e5439556d..49e5439556d 100644
--- a/ndb/src/client/odbc/codegen/Makefile
+++ b/ndb/src/old_files/client/odbc/codegen/Makefile
diff --git a/ndb/src/client/odbc/codegen/SimpleGram.ypp b/ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp
index d49344849d2..07d8017e5ed 100644
--- a/ndb/src/client/odbc/codegen/SimpleGram.ypp
+++ b/ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp
@@ -88,6 +88,7 @@ struct PhysAttr { int storage; int logging; };
struct PhysAttr* m_phys_attr;
NdbDictionary::Object::FragmentType m_storage_attr;
bool m_logging_attr;
+ SqlType::Type m_sql_type;
}
/* keywords */
@@ -100,6 +101,7 @@ struct PhysAttr { int storage; int logging; };
T_BLOB
T_BY
T_CHAR
+ T_CLOB
T_CONSTRAINT
T_CREATE
T_DATETIME
@@ -128,6 +130,7 @@ struct PhysAttr { int storage; int logging; };
T_LIMIT
T_LOGGING
T_LONGBLOB
+ T_LONGCLOB
T_MEDIUM
T_NOLOGGING
T_NOT
@@ -248,6 +251,7 @@ struct PhysAttr { int storage; int logging; };
%type <m_phys_attr> phys_attr2
%type <m_storage_attr> storage_attr
%type <m_logging_attr> logging_attr
+%type <m_sql_type> blob_type
%%
@@ -606,10 +610,10 @@ data_type:
$$ = dataType;
}
|
- blob_keyword
+ blob_type
{
Plan_root* root = simpleParser.root();
- SqlType sqlType(SqlType::Blob, true);
+ SqlType sqlType($1, true);
Plan_data_type* dataType = new Plan_data_type(root, sqlType);
root->saveNode(dataType);
$$ = dataType;
@@ -620,10 +624,26 @@ dummy_binary:
|
T_BINARY
;
-blob_keyword:
+blob_type:
T_BLOB
+ {
+ $$ = SqlType::Blob;
+ }
|
T_LONGBLOB
+ {
+ $$ = SqlType::Blob;
+ }
+ |
+ T_CLOB
+ {
+ $$ = SqlType::Clob;
+ }
+ |
+ T_LONGCLOB
+ {
+ $$ = SqlType::Clob;
+ }
;
create_column_rest:
/* empty */
diff --git a/ndb/src/client/odbc/codegen/SimpleParser.cpp b/ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp
index 62162172bc8..a2418f49e37 100644
--- a/ndb/src/client/odbc/codegen/SimpleParser.cpp
+++ b/ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp
@@ -14,6 +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 <common/common.hpp>
#include <NdbMutex.h>
#include <common/StmtArea.hpp>
#include <FlexLexer.h>
diff --git a/ndb/src/client/odbc/codegen/SimpleParser.hpp b/ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp
index abadae8f905..abadae8f905 100644
--- a/ndb/src/client/odbc/codegen/SimpleParser.hpp
+++ b/ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp
diff --git a/ndb/src/client/odbc/codegen/SimpleScan.lpp b/ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp
index bd930c08cfa..29aa876f669 100644
--- a/ndb/src/client/odbc/codegen/SimpleScan.lpp
+++ b/ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp
@@ -149,6 +149,7 @@ static const SqlKeyword sqlKeyword[] = {
{ "BLOB", T_BLOB, StateType },
{ "BY", T_BY, -1 },
{ "CHAR", T_CHAR, StateType },
+ { "CLOB", T_CLOB, StateType },
{ "CONSTRAINT", T_CONSTRAINT, -1 },
{ "CREATE", T_CREATE, -1 },
{ "DATETIME", T_DATETIME, StateType },
@@ -177,6 +178,7 @@ static const SqlKeyword sqlKeyword[] = {
{ "LIMIT", T_LIMIT, -1 },
{ "LOGGING", T_LOGGING, StatePhys },
{ "LONGBLOB", T_LONGBLOB, StateType },
+ { "LONGCLOB", T_LONGCLOB, StateType },
{ "MEDIUM", T_MEDIUM, StatePhys },
{ "NOLOGGING", T_NOLOGGING, StatePhys },
{ "NOT", T_NOT, -1 },
diff --git a/ndb/src/client/odbc/common/AttrArea.cpp b/ndb/src/old_files/client/odbc/common/AttrArea.cpp
index ff9e085a7f6..ff9e085a7f6 100644
--- a/ndb/src/client/odbc/common/AttrArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/AttrArea.cpp
diff --git a/ndb/src/client/odbc/common/AttrArea.hpp b/ndb/src/old_files/client/odbc/common/AttrArea.hpp
index 050cce719bf..050cce719bf 100644
--- a/ndb/src/client/odbc/common/AttrArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/AttrArea.hpp
diff --git a/ndb/src/client/odbc/common/CodeTree.cpp b/ndb/src/old_files/client/odbc/common/CodeTree.cpp
index ebe4840c5f6..ebe4840c5f6 100644
--- a/ndb/src/client/odbc/common/CodeTree.cpp
+++ b/ndb/src/old_files/client/odbc/common/CodeTree.cpp
diff --git a/ndb/src/client/odbc/common/CodeTree.hpp b/ndb/src/old_files/client/odbc/common/CodeTree.hpp
index 1b0ae3199af..1b0ae3199af 100644
--- a/ndb/src/client/odbc/common/CodeTree.hpp
+++ b/ndb/src/old_files/client/odbc/common/CodeTree.hpp
diff --git a/ndb/src/client/odbc/common/ConnArea.cpp b/ndb/src/old_files/client/odbc/common/ConnArea.cpp
index d4d3be52a3c..d4d3be52a3c 100644
--- a/ndb/src/client/odbc/common/ConnArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/ConnArea.cpp
diff --git a/ndb/src/client/odbc/common/ConnArea.hpp b/ndb/src/old_files/client/odbc/common/ConnArea.hpp
index 36367a39bae..36367a39bae 100644
--- a/ndb/src/client/odbc/common/ConnArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/ConnArea.hpp
diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/old_files/client/odbc/common/Ctx.cpp
index 44689657788..d6faa5cba77 100644
--- a/ndb/src/client/odbc/common/Ctx.cpp
+++ b/ndb/src/old_files/client/odbc/common/Ctx.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 <ndb_global.h>
#include <NdbApi.hpp>
#include <common/common.hpp>
#include "DiagArea.hpp"
diff --git a/ndb/src/client/odbc/common/Ctx.hpp b/ndb/src/old_files/client/odbc/common/Ctx.hpp
index d25d45ff0c7..d25d45ff0c7 100644
--- a/ndb/src/client/odbc/common/Ctx.hpp
+++ b/ndb/src/old_files/client/odbc/common/Ctx.hpp
diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/old_files/client/odbc/common/DataField.cpp
index dfd4137ffd9..11aae7d893b 100644
--- a/ndb/src/client/odbc/common/DataField.cpp
+++ b/ndb/src/old_files/client/odbc/common/DataField.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 <ndb_global.h>
#include "DataField.hpp"
#ifndef INT_MAX
diff --git a/ndb/src/client/odbc/common/DataField.hpp b/ndb/src/old_files/client/odbc/common/DataField.hpp
index 65138df25f1..65138df25f1 100644
--- a/ndb/src/client/odbc/common/DataField.hpp
+++ b/ndb/src/old_files/client/odbc/common/DataField.hpp
diff --git a/ndb/src/client/odbc/common/DataRow.cpp b/ndb/src/old_files/client/odbc/common/DataRow.cpp
index 509f2673e0d..509f2673e0d 100644
--- a/ndb/src/client/odbc/common/DataRow.cpp
+++ b/ndb/src/old_files/client/odbc/common/DataRow.cpp
diff --git a/ndb/src/client/odbc/common/DataRow.hpp b/ndb/src/old_files/client/odbc/common/DataRow.hpp
index 4a5a1e905b9..4a5a1e905b9 100644
--- a/ndb/src/client/odbc/common/DataRow.hpp
+++ b/ndb/src/old_files/client/odbc/common/DataRow.hpp
diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/old_files/client/odbc/common/DataType.cpp
index 9c9629f1d24..96f6a6e0877 100644
--- a/ndb/src/client/odbc/common/DataType.cpp
+++ b/ndb/src/old_files/client/odbc/common/DataType.cpp
@@ -78,6 +78,9 @@ SqlType::setType(Ctx& ctx, Type type, bool nullable)
case Blob:
setType(ctx, Varbinary, FAKE_BLOB_SIZE, nullable); // XXX BLOB hack
return;
+ case Clob:
+ setType(ctx, Varchar, FAKE_BLOB_SIZE, nullable); // XXX BLOB hack
+ return;
case Null:
case Unbound:
break;
@@ -193,6 +196,9 @@ SqlType::setType(Ctx& ctx, const NdbDictionary::Column* ndbColumn)
case NdbDictionary::Column::Blob:
setType(ctx, Blob, nullable);
return;
+ case NdbDictionary::Column::Clob:
+ setType(ctx, Clob, nullable);
+ return;
default:
break;
}
diff --git a/ndb/src/client/odbc/common/DataType.hpp b/ndb/src/old_files/client/odbc/common/DataType.hpp
index ac2ca337e22..e03e445cf05 100644
--- a/ndb/src/client/odbc/common/DataType.hpp
+++ b/ndb/src/old_files/client/odbc/common/DataType.hpp
@@ -74,6 +74,7 @@ public:
Date = SQL_DATE,
Datetime = SQL_TYPE_TIMESTAMP,
Blob = SQL_BLOB,
+ Clob = SQL_CLOB,
Null = NullDataType, // not an ODBC SQL type
Unbound = UnboundDataType // special for placeholders
};
diff --git a/ndb/src/client/odbc/common/DescArea.cpp b/ndb/src/old_files/client/odbc/common/DescArea.cpp
index bad9f23d3ef..bad9f23d3ef 100644
--- a/ndb/src/client/odbc/common/DescArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/DescArea.cpp
diff --git a/ndb/src/client/odbc/common/DescArea.hpp b/ndb/src/old_files/client/odbc/common/DescArea.hpp
index e9f552d758d..e9f552d758d 100644
--- a/ndb/src/client/odbc/common/DescArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/DescArea.hpp
diff --git a/ndb/src/client/odbc/common/DiagArea.cpp b/ndb/src/old_files/client/odbc/common/DiagArea.cpp
index 06e8da89495..06e8da89495 100644
--- a/ndb/src/client/odbc/common/DiagArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/DiagArea.cpp
diff --git a/ndb/src/client/odbc/common/DiagArea.hpp b/ndb/src/old_files/client/odbc/common/DiagArea.hpp
index 79c03de6623..79c03de6623 100644
--- a/ndb/src/client/odbc/common/DiagArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/DiagArea.hpp
diff --git a/ndb/src/client/odbc/common/Makefile b/ndb/src/old_files/client/odbc/common/Makefile
index 7ee29738d86..7ee29738d86 100644
--- a/ndb/src/client/odbc/common/Makefile
+++ b/ndb/src/old_files/client/odbc/common/Makefile
diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/old_files/client/odbc/common/OdbcData.cpp
index 2e1bd768aec..32400e07c7a 100644
--- a/ndb/src/client/odbc/common/OdbcData.cpp
+++ b/ndb/src/old_files/client/odbc/common/OdbcData.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 <ndb_global.h>
#include "OdbcData.hpp"
OdbcData::OdbcData() :
diff --git a/ndb/src/client/odbc/common/OdbcData.hpp b/ndb/src/old_files/client/odbc/common/OdbcData.hpp
index c1884507cfe..c1884507cfe 100644
--- a/ndb/src/client/odbc/common/OdbcData.hpp
+++ b/ndb/src/old_files/client/odbc/common/OdbcData.hpp
diff --git a/ndb/src/client/odbc/common/ResultArea.cpp b/ndb/src/old_files/client/odbc/common/ResultArea.cpp
index 79d7fb0ccc4..79d7fb0ccc4 100644
--- a/ndb/src/client/odbc/common/ResultArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/ResultArea.cpp
diff --git a/ndb/src/client/odbc/common/ResultArea.hpp b/ndb/src/old_files/client/odbc/common/ResultArea.hpp
index d4890c44d99..d4890c44d99 100644
--- a/ndb/src/client/odbc/common/ResultArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/ResultArea.hpp
diff --git a/ndb/src/client/odbc/common/Sqlstate.cpp b/ndb/src/old_files/client/odbc/common/Sqlstate.cpp
index 2d625a7c159..2d625a7c159 100644
--- a/ndb/src/client/odbc/common/Sqlstate.cpp
+++ b/ndb/src/old_files/client/odbc/common/Sqlstate.cpp
diff --git a/ndb/src/client/odbc/common/Sqlstate.hpp b/ndb/src/old_files/client/odbc/common/Sqlstate.hpp
index 3b4665dc6ca..3b4665dc6ca 100644
--- a/ndb/src/client/odbc/common/Sqlstate.hpp
+++ b/ndb/src/old_files/client/odbc/common/Sqlstate.hpp
diff --git a/ndb/src/client/odbc/common/StmtArea.cpp b/ndb/src/old_files/client/odbc/common/StmtArea.cpp
index 5ce2d47d31a..5ce2d47d31a 100644
--- a/ndb/src/client/odbc/common/StmtArea.cpp
+++ b/ndb/src/old_files/client/odbc/common/StmtArea.cpp
diff --git a/ndb/src/client/odbc/common/StmtArea.hpp b/ndb/src/old_files/client/odbc/common/StmtArea.hpp
index a88c6d36e6d..a88c6d36e6d 100644
--- a/ndb/src/client/odbc/common/StmtArea.hpp
+++ b/ndb/src/old_files/client/odbc/common/StmtArea.hpp
diff --git a/ndb/src/client/odbc/common/StmtInfo.cpp b/ndb/src/old_files/client/odbc/common/StmtInfo.cpp
index 3467fb5023e..3467fb5023e 100644
--- a/ndb/src/client/odbc/common/StmtInfo.cpp
+++ b/ndb/src/old_files/client/odbc/common/StmtInfo.cpp
diff --git a/ndb/src/client/odbc/common/StmtInfo.hpp b/ndb/src/old_files/client/odbc/common/StmtInfo.hpp
index 9cd489be6da..9cd489be6da 100644
--- a/ndb/src/client/odbc/common/StmtInfo.hpp
+++ b/ndb/src/old_files/client/odbc/common/StmtInfo.hpp
diff --git a/ndb/src/client/odbc/common/common.cpp b/ndb/src/old_files/client/odbc/common/common.cpp
index 73d14c82efe..73d14c82efe 100644
--- a/ndb/src/client/odbc/common/common.cpp
+++ b/ndb/src/old_files/client/odbc/common/common.cpp
diff --git a/ndb/src/client/odbc/common/common.hpp b/ndb/src/old_files/client/odbc/common/common.hpp
index e90950df9c5..d2f243b6437 100644
--- a/ndb/src/client/odbc/common/common.hpp
+++ b/ndb/src/old_files/client/odbc/common/common.hpp
@@ -17,9 +17,13 @@
#ifndef ODBC_COMMON_common_hpp
#define ODBC_COMMON_common_hpp
+#define stpcpy stpcpy
+#include <ndb_global.h>
+#undef swap
+
// misc defs
-#ifdef NDB_GCC
+#ifdef NDB_GCC // only for odbc
#define PRINTFLIKE(i,j) __attribute__ ((format (printf, i, j)))
#else
#define PRINTFLIKE(i,j)
diff --git a/ndb/src/client/odbc/dictionary/DictCatalog.cpp b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp
index 433347c9a70..433347c9a70 100644
--- a/ndb/src/client/odbc/dictionary/DictCatalog.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictCatalog.hpp b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp
index 5452990a51b..5452990a51b 100644
--- a/ndb/src/client/odbc/dictionary/DictCatalog.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp
diff --git a/ndb/src/client/odbc/dictionary/DictColumn.cpp b/ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp
index fa0128f1ddb..fa0128f1ddb 100644
--- a/ndb/src/client/odbc/dictionary/DictColumn.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictColumn.hpp b/ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp
index 945fb86367b..945fb86367b 100644
--- a/ndb/src/client/odbc/dictionary/DictColumn.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp
diff --git a/ndb/src/client/odbc/dictionary/DictIndex.cpp b/ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp
index 95d93318902..95d93318902 100644
--- a/ndb/src/client/odbc/dictionary/DictIndex.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictIndex.hpp b/ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp
index 7ba46daaae3..7ba46daaae3 100644
--- a/ndb/src/client/odbc/dictionary/DictIndex.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp
diff --git a/ndb/src/client/odbc/dictionary/DictSchema.cpp b/ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp
index 91939cb2f26..91939cb2f26 100644
--- a/ndb/src/client/odbc/dictionary/DictSchema.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictSchema.hpp b/ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp
index 099352edbb9..099352edbb9 100644
--- a/ndb/src/client/odbc/dictionary/DictSchema.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp
diff --git a/ndb/src/client/odbc/dictionary/DictSys.cpp b/ndb/src/old_files/client/odbc/dictionary/DictSys.cpp
index 1ceef66ee57..1ceef66ee57 100644
--- a/ndb/src/client/odbc/dictionary/DictSys.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictSys.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictSys.hpp b/ndb/src/old_files/client/odbc/dictionary/DictSys.hpp
index e6fa661fd59..e6fa661fd59 100644
--- a/ndb/src/client/odbc/dictionary/DictSys.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictSys.hpp
diff --git a/ndb/src/client/odbc/dictionary/DictTable.cpp b/ndb/src/old_files/client/odbc/dictionary/DictTable.cpp
index 4db7d3b3aec..4db7d3b3aec 100644
--- a/ndb/src/client/odbc/dictionary/DictTable.cpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictTable.cpp
diff --git a/ndb/src/client/odbc/dictionary/DictTable.hpp b/ndb/src/old_files/client/odbc/dictionary/DictTable.hpp
index 5cecfff9562..5cecfff9562 100644
--- a/ndb/src/client/odbc/dictionary/DictTable.hpp
+++ b/ndb/src/old_files/client/odbc/dictionary/DictTable.hpp
diff --git a/ndb/src/client/odbc/dictionary/Makefile b/ndb/src/old_files/client/odbc/dictionary/Makefile
index cdfd3b6ea0c..cdfd3b6ea0c 100644
--- a/ndb/src/client/odbc/dictionary/Makefile
+++ b/ndb/src/old_files/client/odbc/dictionary/Makefile
diff --git a/ndb/src/client/odbc/docs/class.fig b/ndb/src/old_files/client/odbc/docs/class.fig
index 38c24c1fba4..38c24c1fba4 100644
--- a/ndb/src/client/odbc/docs/class.fig
+++ b/ndb/src/old_files/client/odbc/docs/class.fig
diff --git a/ndb/src/client/odbc/docs/descfield.pl b/ndb/src/old_files/client/odbc/docs/descfield.pl
index 80fef22f303..80fef22f303 100644
--- a/ndb/src/client/odbc/docs/descfield.pl
+++ b/ndb/src/old_files/client/odbc/docs/descfield.pl
diff --git a/ndb/src/client/odbc/docs/diag.txt b/ndb/src/old_files/client/odbc/docs/diag.txt
index a9a0e0f42d0..a9a0e0f42d0 100644
--- a/ndb/src/client/odbc/docs/diag.txt
+++ b/ndb/src/old_files/client/odbc/docs/diag.txt
diff --git a/ndb/src/client/odbc/docs/getinfo.pl b/ndb/src/old_files/client/odbc/docs/getinfo.pl
index 34e26b47bab..34e26b47bab 100644
--- a/ndb/src/client/odbc/docs/getinfo.pl
+++ b/ndb/src/old_files/client/odbc/docs/getinfo.pl
diff --git a/ndb/src/client/odbc/docs/gettypeinfo.pl b/ndb/src/old_files/client/odbc/docs/gettypeinfo.pl
index 0a999fd7249..0a999fd7249 100644
--- a/ndb/src/client/odbc/docs/gettypeinfo.pl
+++ b/ndb/src/old_files/client/odbc/docs/gettypeinfo.pl
diff --git a/ndb/src/client/odbc/docs/handleattr.pl b/ndb/src/old_files/client/odbc/docs/handleattr.pl
index 892d34b105b..892d34b105b 100644
--- a/ndb/src/client/odbc/docs/handleattr.pl
+++ b/ndb/src/old_files/client/odbc/docs/handleattr.pl
diff --git a/ndb/src/client/odbc/docs/main.hpp b/ndb/src/old_files/client/odbc/docs/main.hpp
index ebb5b1f235a..ebb5b1f235a 100644
--- a/ndb/src/client/odbc/docs/main.hpp
+++ b/ndb/src/old_files/client/odbc/docs/main.hpp
diff --git a/ndb/src/client/odbc/docs/ndbodbc.html b/ndb/src/old_files/client/odbc/docs/ndbodbc.html
index 6be624dfa1b..6be624dfa1b 100644
--- a/ndb/src/client/odbc/docs/ndbodbc.html
+++ b/ndb/src/old_files/client/odbc/docs/ndbodbc.html
diff --git a/ndb/src/client/odbc/docs/select.fig b/ndb/src/old_files/client/odbc/docs/select.fig
index 4f51a2085b4..4f51a2085b4 100644
--- a/ndb/src/client/odbc/docs/select.fig
+++ b/ndb/src/old_files/client/odbc/docs/select.fig
diff --git a/ndb/src/client/odbc/docs/systables.pl b/ndb/src/old_files/client/odbc/docs/systables.pl
index 728d966a7a4..728d966a7a4 100644
--- a/ndb/src/client/odbc/docs/systables.pl
+++ b/ndb/src/old_files/client/odbc/docs/systables.pl
diff --git a/ndb/src/client/odbc/docs/type.txt b/ndb/src/old_files/client/odbc/docs/type.txt
index d7b391afc55..d7b391afc55 100644
--- a/ndb/src/client/odbc/docs/type.txt
+++ b/ndb/src/old_files/client/odbc/docs/type.txt
diff --git a/ndb/src/client/odbc/driver/Func.data b/ndb/src/old_files/client/odbc/driver/Func.data
index c32671e1135..c32671e1135 100644
--- a/ndb/src/client/odbc/driver/Func.data
+++ b/ndb/src/old_files/client/odbc/driver/Func.data
diff --git a/ndb/src/client/odbc/driver/Func.pl b/ndb/src/old_files/client/odbc/driver/Func.pl
index 1064a6a6c6e..1064a6a6c6e 100644
--- a/ndb/src/client/odbc/driver/Func.pl
+++ b/ndb/src/old_files/client/odbc/driver/Func.pl
diff --git a/ndb/src/client/odbc/driver/Makefile b/ndb/src/old_files/client/odbc/driver/Makefile
index 62f82371da4..62f82371da4 100644
--- a/ndb/src/client/odbc/driver/Makefile
+++ b/ndb/src/old_files/client/odbc/driver/Makefile
diff --git a/ndb/src/client/odbc/driver/SQLAllocConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp
index a7ffd8c89d1..a7ffd8c89d1 100644
--- a/ndb/src/client/odbc/driver/SQLAllocConnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLAllocEnv.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp
index a62dae61008..a62dae61008 100644
--- a/ndb/src/client/odbc/driver/SQLAllocEnv.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp
diff --git a/ndb/src/client/odbc/driver/SQLAllocHandle.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp
index 9daf6ead946..9daf6ead946 100644
--- a/ndb/src/client/odbc/driver/SQLAllocHandle.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp
diff --git a/ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp
index 61290e37b7b..61290e37b7b 100644
--- a/ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp
diff --git a/ndb/src/client/odbc/driver/SQLAllocStmt.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp
index bf3f149f5de..bf3f149f5de 100644
--- a/ndb/src/client/odbc/driver/SQLAllocStmt.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp
diff --git a/ndb/src/client/odbc/driver/SQLBindCol.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp
index 5562334e8cc..5562334e8cc 100644
--- a/ndb/src/client/odbc/driver/SQLBindCol.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp
diff --git a/ndb/src/client/odbc/driver/SQLBindParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp
index 2fcc17b872f..2fcc17b872f 100644
--- a/ndb/src/client/odbc/driver/SQLBindParam.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp
diff --git a/ndb/src/client/odbc/driver/SQLBindParameter.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp
index e4ca5bbc731..e4ca5bbc731 100644
--- a/ndb/src/client/odbc/driver/SQLBindParameter.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp
diff --git a/ndb/src/client/odbc/driver/SQLBrowseConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp
index 7e629e199e5..7e629e199e5 100644
--- a/ndb/src/client/odbc/driver/SQLBrowseConnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLBulkOperations.cpp b/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp
index 7d256d66e3f..7d256d66e3f 100644
--- a/ndb/src/client/odbc/driver/SQLBulkOperations.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp
diff --git a/ndb/src/client/odbc/driver/SQLCancel.cpp b/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp
index ac4e43c6e89..ac4e43c6e89 100644
--- a/ndb/src/client/odbc/driver/SQLCancel.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp
diff --git a/ndb/src/client/odbc/driver/SQLCloseCursor.cpp b/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp
index 26d88c91e3b..26d88c91e3b 100644
--- a/ndb/src/client/odbc/driver/SQLCloseCursor.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp
diff --git a/ndb/src/client/odbc/driver/SQLColAttribute.cpp b/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp
index 0e7e5446932..0e7e5446932 100644
--- a/ndb/src/client/odbc/driver/SQLColAttribute.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp
diff --git a/ndb/src/client/odbc/driver/SQLColAttributes.cpp b/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp
index 05a4c1d4d37..05a4c1d4d37 100644
--- a/ndb/src/client/odbc/driver/SQLColAttributes.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp
diff --git a/ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp b/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp
index cfbc9c2bc57..cfbc9c2bc57 100644
--- a/ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp
diff --git a/ndb/src/client/odbc/driver/SQLColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp
index 4e0b646ee7d..4e0b646ee7d 100644
--- a/ndb/src/client/odbc/driver/SQLColumns.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp
diff --git a/ndb/src/client/odbc/driver/SQLConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp
index d8f30ed47e7..d8f30ed47e7 100644
--- a/ndb/src/client/odbc/driver/SQLConnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLCopyDesc.cpp b/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp
index b4d4b2e4122..b4d4b2e4122 100644
--- a/ndb/src/client/odbc/driver/SQLCopyDesc.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDataSources.cpp b/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp
index 6115e7175f9..6115e7175f9 100644
--- a/ndb/src/client/odbc/driver/SQLDataSources.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDescribeCol.cpp b/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp
index f15ce8962f1..f15ce8962f1 100644
--- a/ndb/src/client/odbc/driver/SQLDescribeCol.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDescribeParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp
index beff41396fe..beff41396fe 100644
--- a/ndb/src/client/odbc/driver/SQLDescribeParam.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDisconnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp
index 75db5604da8..75db5604da8 100644
--- a/ndb/src/client/odbc/driver/SQLDisconnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDriverConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp
index 340babd8523..340babd8523 100644
--- a/ndb/src/client/odbc/driver/SQLDriverConnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLDrivers.cpp b/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp
index 9c52f900992..9c52f900992 100644
--- a/ndb/src/client/odbc/driver/SQLDrivers.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp
diff --git a/ndb/src/client/odbc/driver/SQLEndTran.cpp b/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp
index 20b0b2203f5..20b0b2203f5 100644
--- a/ndb/src/client/odbc/driver/SQLEndTran.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp
diff --git a/ndb/src/client/odbc/driver/SQLError.cpp b/ndb/src/old_files/client/odbc/driver/SQLError.cpp
index af78c931d37..af78c931d37 100644
--- a/ndb/src/client/odbc/driver/SQLError.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLError.cpp
diff --git a/ndb/src/client/odbc/driver/SQLExecDirect.cpp b/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp
index 0ad99d29cd9..0ad99d29cd9 100644
--- a/ndb/src/client/odbc/driver/SQLExecDirect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLExecute.cpp b/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp
index 9c30d418f09..9c30d418f09 100644
--- a/ndb/src/client/odbc/driver/SQLExecute.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp
diff --git a/ndb/src/client/odbc/driver/SQLExtendedFetch.cpp b/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp
index e0dd078b5d0..e0dd078b5d0 100644
--- a/ndb/src/client/odbc/driver/SQLExtendedFetch.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFetch.cpp b/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp
index addba7b998c..addba7b998c 100644
--- a/ndb/src/client/odbc/driver/SQLFetch.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFetchScroll.cpp b/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp
index cfbfc813fca..cfbfc813fca 100644
--- a/ndb/src/client/odbc/driver/SQLFetchScroll.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp
diff --git a/ndb/src/client/odbc/driver/SQLForeignKeys.cpp b/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp
index 886ac6bdaa5..886ac6bdaa5 100644
--- a/ndb/src/client/odbc/driver/SQLForeignKeys.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFreeConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp
index 9ac84710cce..9ac84710cce 100644
--- a/ndb/src/client/odbc/driver/SQLFreeConnect.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFreeEnv.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp
index 7e35056feb5..7e35056feb5 100644
--- a/ndb/src/client/odbc/driver/SQLFreeEnv.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFreeHandle.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp
index 284463cbb07..284463cbb07 100644
--- a/ndb/src/client/odbc/driver/SQLFreeHandle.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp
diff --git a/ndb/src/client/odbc/driver/SQLFreeStmt.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp
index 7af6623a37a..7af6623a37a 100644
--- a/ndb/src/client/odbc/driver/SQLFreeStmt.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp
index 66c1f3827e1..66c1f3827e1 100644
--- a/ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetConnectOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp
index 514bedb12b9..514bedb12b9 100644
--- a/ndb/src/client/odbc/driver/SQLGetConnectOption.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetCursorName.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp
index d54bdf42005..d54bdf42005 100644
--- a/ndb/src/client/odbc/driver/SQLGetCursorName.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetData.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp
index 3b6987c515d..3b6987c515d 100644
--- a/ndb/src/client/odbc/driver/SQLGetData.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetDescField.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp
index 6cc390a58ed..6cc390a58ed 100644
--- a/ndb/src/client/odbc/driver/SQLGetDescField.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetDescRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp
index c7e9631b075..c7e9631b075 100644
--- a/ndb/src/client/odbc/driver/SQLGetDescRec.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetDiagField.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp
index 3eb34f7ebf6..3eb34f7ebf6 100644
--- a/ndb/src/client/odbc/driver/SQLGetDiagField.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetDiagRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp
index 448c5206d76..448c5206d76 100644
--- a/ndb/src/client/odbc/driver/SQLGetDiagRec.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp
index c93870326e4..c93870326e4 100644
--- a/ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetFunctions.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp
index 68416fab1a6..68416fab1a6 100644
--- a/ndb/src/client/odbc/driver/SQLGetFunctions.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetInfo.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp
index 8f0a0d67cfa..8f0a0d67cfa 100644
--- a/ndb/src/client/odbc/driver/SQLGetInfo.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp
index 990ab68808a..990ab68808a 100644
--- a/ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetStmtOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp
index 0b5758b1212..0b5758b1212 100644
--- a/ndb/src/client/odbc/driver/SQLGetStmtOption.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp
diff --git a/ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp
index e6a016cc400..e6a016cc400 100644
--- a/ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp
diff --git a/ndb/src/client/odbc/driver/SQLMoreResults.cpp b/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp
index d23d653a319..d23d653a319 100644
--- a/ndb/src/client/odbc/driver/SQLMoreResults.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp
diff --git a/ndb/src/client/odbc/driver/SQLNativeSql.cpp b/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp
index fb8a9bbf3d9..fb8a9bbf3d9 100644
--- a/ndb/src/client/odbc/driver/SQLNativeSql.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp
diff --git a/ndb/src/client/odbc/driver/SQLNumParams.cpp b/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp
index 7b1a6a07aec..7b1a6a07aec 100644
--- a/ndb/src/client/odbc/driver/SQLNumParams.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp
diff --git a/ndb/src/client/odbc/driver/SQLNumResultCols.cpp b/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp
index 2e70897a9a2..2e70897a9a2 100644
--- a/ndb/src/client/odbc/driver/SQLNumResultCols.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp
diff --git a/ndb/src/client/odbc/driver/SQLParamData.cpp b/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp
index 4eb38a010f4..4eb38a010f4 100644
--- a/ndb/src/client/odbc/driver/SQLParamData.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp
diff --git a/ndb/src/client/odbc/driver/SQLParamOptions.cpp b/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp
index 59b7dcf7fa9..59b7dcf7fa9 100644
--- a/ndb/src/client/odbc/driver/SQLParamOptions.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp
diff --git a/ndb/src/client/odbc/driver/SQLPrepare.cpp b/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp
index b1205fa6e3a..b1205fa6e3a 100644
--- a/ndb/src/client/odbc/driver/SQLPrepare.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp
diff --git a/ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp b/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp
index 2d562ae3e19..2d562ae3e19 100644
--- a/ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp
diff --git a/ndb/src/client/odbc/driver/SQLProcedureColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp
index 2e42e428b87..2e42e428b87 100644
--- a/ndb/src/client/odbc/driver/SQLProcedureColumns.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp
diff --git a/ndb/src/client/odbc/driver/SQLProcedures.cpp b/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp
index 1f3a9f89073..1f3a9f89073 100644
--- a/ndb/src/client/odbc/driver/SQLProcedures.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp
diff --git a/ndb/src/client/odbc/driver/SQLPutData.cpp b/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp
index a4715a836d2..a4715a836d2 100644
--- a/ndb/src/client/odbc/driver/SQLPutData.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp
diff --git a/ndb/src/client/odbc/driver/SQLRowCount.cpp b/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp
index d03f954386a..d03f954386a 100644
--- a/ndb/src/client/odbc/driver/SQLRowCount.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp
index 05bfce5e9cd..05bfce5e9cd 100644
--- a/ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetConnectOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp
index a4794316971..a4794316971 100644
--- a/ndb/src/client/odbc/driver/SQLSetConnectOption.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetCursorName.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp
index 291ad817d42..291ad817d42 100644
--- a/ndb/src/client/odbc/driver/SQLSetCursorName.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetDescField.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp
index 19d34c2f46d..19d34c2f46d 100644
--- a/ndb/src/client/odbc/driver/SQLSetDescField.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetDescRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp
index 80a00514a51..80a00514a51 100644
--- a/ndb/src/client/odbc/driver/SQLSetDescRec.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp
index 86364eac5e8..86364eac5e8 100644
--- a/ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp
index 03bde1076d8..03bde1076d8 100644
--- a/ndb/src/client/odbc/driver/SQLSetParam.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetPos.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp
index 653030f90bc..653030f90bc 100644
--- a/ndb/src/client/odbc/driver/SQLSetPos.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp
index a5e89d8568b..a5e89d8568b 100644
--- a/ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp
index 9ed6a83b563..9ed6a83b563 100644
--- a/ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSetStmtOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp
index b403fc8408c..b403fc8408c 100644
--- a/ndb/src/client/odbc/driver/SQLSetStmtOption.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp
diff --git a/ndb/src/client/odbc/driver/SQLSpecialColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp
index 5dd92c86053..5dd92c86053 100644
--- a/ndb/src/client/odbc/driver/SQLSpecialColumns.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp
diff --git a/ndb/src/client/odbc/driver/SQLStatistics.cpp b/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp
index 941fb6249a5..941fb6249a5 100644
--- a/ndb/src/client/odbc/driver/SQLStatistics.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp
diff --git a/ndb/src/client/odbc/driver/SQLTablePrivileges.cpp b/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp
index 23c6ad9fc4b..23c6ad9fc4b 100644
--- a/ndb/src/client/odbc/driver/SQLTablePrivileges.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp
diff --git a/ndb/src/client/odbc/driver/SQLTables.cpp b/ndb/src/old_files/client/odbc/driver/SQLTables.cpp
index b2496bfba87..b2496bfba87 100644
--- a/ndb/src/client/odbc/driver/SQLTables.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLTables.cpp
diff --git a/ndb/src/client/odbc/driver/SQLTransact.cpp b/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp
index da8b46b1596..da8b46b1596 100644
--- a/ndb/src/client/odbc/driver/SQLTransact.cpp
+++ b/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp
diff --git a/ndb/src/client/odbc/driver/driver.cpp b/ndb/src/old_files/client/odbc/driver/driver.cpp
index dabfd5f855b..f992fa70878 100644
--- a/ndb/src/client/odbc/driver/driver.cpp
+++ b/ndb/src/old_files/client/odbc/driver/driver.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 <NdbMutex.h>
#include "driver.hpp"
+#include <NdbMutex.h>
#undef NDB_ODBC_SIG_DFL
#ifdef NDB_ODBC_SIG_DFL
diff --git a/ndb/src/client/odbc/driver/driver.hpp b/ndb/src/old_files/client/odbc/driver/driver.hpp
index 96d2e052c0d..96d2e052c0d 100644
--- a/ndb/src/client/odbc/driver/driver.hpp
+++ b/ndb/src/old_files/client/odbc/driver/driver.hpp
diff --git a/ndb/src/client/odbc/executor/Exec_comp_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp
index 40d3950a592..40d3950a592 100644
--- a/ndb/src/client/odbc/executor/Exec_comp_op.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_create_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp
index 3966c6d5db2..3966c6d5db2 100644
--- a/ndb/src/client/odbc/executor/Exec_create_index.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_create_table.cpp b/ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp
index d6274119371..d6274119371 100644
--- a/ndb/src/client/odbc/executor/Exec_create_table.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_delete_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp
index 10814654a58..10814654a58 100644
--- a/ndb/src/client/odbc/executor/Exec_delete_index.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_delete_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp
index d0795286122..d0795286122 100644
--- a/ndb/src/client/odbc/executor/Exec_delete_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_delete_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp
index a0b3b8314b8..a0b3b8314b8 100644
--- a/ndb/src/client/odbc/executor/Exec_delete_scan.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_drop_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp
index 6bf451f6911..6bf451f6911 100644
--- a/ndb/src/client/odbc/executor/Exec_drop_index.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_drop_table.cpp b/ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp
index 40d1d42fc61..40d1d42fc61 100644
--- a/ndb/src/client/odbc/executor/Exec_drop_table.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_expr_conv.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp
index 636bfda7d59..636bfda7d59 100644
--- a/ndb/src/client/odbc/executor/Exec_expr_conv.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_expr_func.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp
index 093d15c6e2b..093d15c6e2b 100644
--- a/ndb/src/client/odbc/executor/Exec_expr_func.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_expr_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp
index fc8b6df9f5b..fc8b6df9f5b 100644
--- a/ndb/src/client/odbc/executor/Exec_expr_op.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_insert.cpp b/ndb/src/old_files/client/odbc/executor/Exec_insert.cpp
index c2612c6aaab..c2612c6aaab 100644
--- a/ndb/src/client/odbc/executor/Exec_insert.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_insert.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_pred_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp
index 7caa4656473..7caa4656473 100644
--- a/ndb/src/client/odbc/executor/Exec_pred_op.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_query_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp
index 919743beac2..919743beac2 100644
--- a/ndb/src/client/odbc/executor/Exec_query_index.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_query_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp
index 599e1a36461..599e1a36461 100644
--- a/ndb/src/client/odbc/executor/Exec_query_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_query_range.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp
index 0bc878d760d..0bc878d760d 100644
--- a/ndb/src/client/odbc/executor/Exec_query_range.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_query_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp
index 213dfdd616d..213dfdd616d 100644
--- a/ndb/src/client/odbc/executor/Exec_query_scan.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_query_sys.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp
index acdc120e609..acdc120e609 100644
--- a/ndb/src/client/odbc/executor/Exec_query_sys.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_update_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp
index 35b6159d8ca..35b6159d8ca 100644
--- a/ndb/src/client/odbc/executor/Exec_update_index.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_update_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp
index 2c801372de3..2c801372de3 100644
--- a/ndb/src/client/odbc/executor/Exec_update_lookup.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp
diff --git a/ndb/src/client/odbc/executor/Exec_update_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp
index a36fdd27142..a36fdd27142 100644
--- a/ndb/src/client/odbc/executor/Exec_update_scan.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp
diff --git a/ndb/src/client/odbc/executor/Executor.cpp b/ndb/src/old_files/client/odbc/executor/Executor.cpp
index adabb28a4a5..adabb28a4a5 100644
--- a/ndb/src/client/odbc/executor/Executor.cpp
+++ b/ndb/src/old_files/client/odbc/executor/Executor.cpp
diff --git a/ndb/src/client/odbc/executor/Executor.hpp b/ndb/src/old_files/client/odbc/executor/Executor.hpp
index 5edb9d509ac..5edb9d509ac 100644
--- a/ndb/src/client/odbc/executor/Executor.hpp
+++ b/ndb/src/old_files/client/odbc/executor/Executor.hpp
diff --git a/ndb/src/client/odbc/executor/Makefile b/ndb/src/old_files/client/odbc/executor/Makefile
index d86781e212c..d86781e212c 100644
--- a/ndb/src/client/odbc/executor/Makefile
+++ b/ndb/src/old_files/client/odbc/executor/Makefile
diff --git a/ndb/src/client/odbc/handles/AttrDbc.cpp b/ndb/src/old_files/client/odbc/handles/AttrDbc.cpp
index 4768a8995a2..4768a8995a2 100644
--- a/ndb/src/client/odbc/handles/AttrDbc.cpp
+++ b/ndb/src/old_files/client/odbc/handles/AttrDbc.cpp
diff --git a/ndb/src/client/odbc/handles/AttrEnv.cpp b/ndb/src/old_files/client/odbc/handles/AttrEnv.cpp
index 3d57fddeb57..3d57fddeb57 100644
--- a/ndb/src/client/odbc/handles/AttrEnv.cpp
+++ b/ndb/src/old_files/client/odbc/handles/AttrEnv.cpp
diff --git a/ndb/src/client/odbc/handles/AttrRoot.cpp b/ndb/src/old_files/client/odbc/handles/AttrRoot.cpp
index d1b264835b6..d1b264835b6 100644
--- a/ndb/src/client/odbc/handles/AttrRoot.cpp
+++ b/ndb/src/old_files/client/odbc/handles/AttrRoot.cpp
diff --git a/ndb/src/client/odbc/handles/AttrStmt.cpp b/ndb/src/old_files/client/odbc/handles/AttrStmt.cpp
index ce9a9c03fd1..ce9a9c03fd1 100644
--- a/ndb/src/client/odbc/handles/AttrStmt.cpp
+++ b/ndb/src/old_files/client/odbc/handles/AttrStmt.cpp
diff --git a/ndb/src/client/odbc/handles/DescSpec.cpp b/ndb/src/old_files/client/odbc/handles/DescSpec.cpp
index 83905cf9822..83905cf9822 100644
--- a/ndb/src/client/odbc/handles/DescSpec.cpp
+++ b/ndb/src/old_files/client/odbc/handles/DescSpec.cpp
diff --git a/ndb/src/client/odbc/handles/FuncTab.cpp b/ndb/src/old_files/client/odbc/handles/FuncTab.cpp
index 6bd744d7a7f..6bd744d7a7f 100644
--- a/ndb/src/client/odbc/handles/FuncTab.cpp
+++ b/ndb/src/old_files/client/odbc/handles/FuncTab.cpp
diff --git a/ndb/src/client/odbc/handles/HandleBase.cpp b/ndb/src/old_files/client/odbc/handles/HandleBase.cpp
index 27379cdc3f8..27379cdc3f8 100644
--- a/ndb/src/client/odbc/handles/HandleBase.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleBase.cpp
diff --git a/ndb/src/client/odbc/handles/HandleBase.hpp b/ndb/src/old_files/client/odbc/handles/HandleBase.hpp
index fc35c2b559b..fc35c2b559b 100644
--- a/ndb/src/client/odbc/handles/HandleBase.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleBase.hpp
diff --git a/ndb/src/client/odbc/handles/HandleDbc.cpp b/ndb/src/old_files/client/odbc/handles/HandleDbc.cpp
index 2d5ded2cc21..2d5ded2cc21 100644
--- a/ndb/src/client/odbc/handles/HandleDbc.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleDbc.cpp
diff --git a/ndb/src/client/odbc/handles/HandleDbc.hpp b/ndb/src/old_files/client/odbc/handles/HandleDbc.hpp
index 130df08d02c..130df08d02c 100644
--- a/ndb/src/client/odbc/handles/HandleDbc.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleDbc.hpp
diff --git a/ndb/src/client/odbc/handles/HandleDesc.cpp b/ndb/src/old_files/client/odbc/handles/HandleDesc.cpp
index 4cff1bb8892..4cff1bb8892 100644
--- a/ndb/src/client/odbc/handles/HandleDesc.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleDesc.cpp
diff --git a/ndb/src/client/odbc/handles/HandleDesc.hpp b/ndb/src/old_files/client/odbc/handles/HandleDesc.hpp
index 9419697f134..9419697f134 100644
--- a/ndb/src/client/odbc/handles/HandleDesc.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleDesc.hpp
diff --git a/ndb/src/client/odbc/handles/HandleEnv.cpp b/ndb/src/old_files/client/odbc/handles/HandleEnv.cpp
index bc9d8b420a6..bc9d8b420a6 100644
--- a/ndb/src/client/odbc/handles/HandleEnv.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleEnv.cpp
diff --git a/ndb/src/client/odbc/handles/HandleEnv.hpp b/ndb/src/old_files/client/odbc/handles/HandleEnv.hpp
index 2b13b0256bc..2b13b0256bc 100644
--- a/ndb/src/client/odbc/handles/HandleEnv.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleEnv.hpp
diff --git a/ndb/src/client/odbc/handles/HandleRoot.cpp b/ndb/src/old_files/client/odbc/handles/HandleRoot.cpp
index d901cb5cb7f..13560d55028 100644
--- a/ndb/src/client/odbc/handles/HandleRoot.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleRoot.cpp
@@ -14,6 +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 <common/common.hpp>
#include <NdbMutex.h>
#include <common/DiagArea.hpp>
#include "HandleRoot.hpp"
diff --git a/ndb/src/client/odbc/handles/HandleRoot.hpp b/ndb/src/old_files/client/odbc/handles/HandleRoot.hpp
index 08a22b3e400..08a22b3e400 100644
--- a/ndb/src/client/odbc/handles/HandleRoot.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleRoot.hpp
diff --git a/ndb/src/client/odbc/handles/HandleStmt.cpp b/ndb/src/old_files/client/odbc/handles/HandleStmt.cpp
index d33d33dbd5b..d33d33dbd5b 100644
--- a/ndb/src/client/odbc/handles/HandleStmt.cpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleStmt.cpp
diff --git a/ndb/src/client/odbc/handles/HandleStmt.hpp b/ndb/src/old_files/client/odbc/handles/HandleStmt.hpp
index 0bee138bfc6..0bee138bfc6 100644
--- a/ndb/src/client/odbc/handles/HandleStmt.hpp
+++ b/ndb/src/old_files/client/odbc/handles/HandleStmt.hpp
diff --git a/ndb/src/client/odbc/handles/InfoTab.cpp b/ndb/src/old_files/client/odbc/handles/InfoTab.cpp
index 1a93c4da264..1a93c4da264 100644
--- a/ndb/src/client/odbc/handles/InfoTab.cpp
+++ b/ndb/src/old_files/client/odbc/handles/InfoTab.cpp
diff --git a/ndb/src/client/odbc/handles/Makefile b/ndb/src/old_files/client/odbc/handles/Makefile
index d37e7d286ba..d37e7d286ba 100644
--- a/ndb/src/client/odbc/handles/Makefile
+++ b/ndb/src/old_files/client/odbc/handles/Makefile
diff --git a/ndb/src/client/odbc/handles/PoolNdb.cpp b/ndb/src/old_files/client/odbc/handles/PoolNdb.cpp
index c487ca2b976..45d3c67ec77 100644
--- a/ndb/src/client/odbc/handles/PoolNdb.cpp
+++ b/ndb/src/old_files/client/odbc/handles/PoolNdb.cpp
@@ -14,6 +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 <common/common.hpp>
#include <NdbMutex.h>
#include <NdbApi.hpp>
#include "PoolNdb.hpp"
diff --git a/ndb/src/client/odbc/handles/PoolNdb.hpp b/ndb/src/old_files/client/odbc/handles/PoolNdb.hpp
index bea7e72a59f..35eac055c30 100644
--- a/ndb/src/client/odbc/handles/PoolNdb.hpp
+++ b/ndb/src/old_files/client/odbc/handles/PoolNdb.hpp
@@ -17,8 +17,8 @@
#ifndef ODBC_HANDLES_PoolNdb_hpp
#define ODBC_HANDLES_PoolNdb_hpp
-#include <list>
#include <common/common.hpp>
+#include <list>
class Ndb;
diff --git a/ndb/src/client/odbc/handles/handles.hpp b/ndb/src/old_files/client/odbc/handles/handles.hpp
index a9f0fcae888..a9f0fcae888 100644
--- a/ndb/src/client/odbc/handles/handles.hpp
+++ b/ndb/src/old_files/client/odbc/handles/handles.hpp
diff --git a/ndb/src/ndbbaseclient/Makefile b/ndb/src/old_files/ndbbaseclient/Makefile
index f4c49a95ffa..f4c49a95ffa 100644
--- a/ndb/src/ndbbaseclient/Makefile
+++ b/ndb/src/old_files/ndbbaseclient/Makefile
diff --git a/ndb/src/ndbbaseclient/ndbbaseclient_dummy.cpp b/ndb/src/old_files/ndbbaseclient/ndbbaseclient_dummy.cpp
index e69de29bb2d..e69de29bb2d 100644
--- a/ndb/src/ndbbaseclient/ndbbaseclient_dummy.cpp
+++ b/ndb/src/old_files/ndbbaseclient/ndbbaseclient_dummy.cpp
diff --git a/ndb/src/ndbclient/Makefile b/ndb/src/old_files/ndbclient/Makefile
index 2c597eccfa1..2c597eccfa1 100644
--- a/ndb/src/ndbclient/Makefile
+++ b/ndb/src/old_files/ndbclient/Makefile
diff --git a/ndb/src/ndbclient/ndbclient_dummy.cpp b/ndb/src/old_files/ndbclient/ndbclient_dummy.cpp
index e69de29bb2d..e69de29bb2d 100644
--- a/ndb/src/ndbclient/ndbclient_dummy.cpp
+++ b/ndb/src/old_files/ndbclient/ndbclient_dummy.cpp
diff --git a/ndb/src/newtonapi/Makefile b/ndb/src/old_files/newtonapi/Makefile
index bed179046a5..bed179046a5 100644
--- a/ndb/src/newtonapi/Makefile
+++ b/ndb/src/old_files/newtonapi/Makefile
diff --git a/ndb/src/newtonapi/dba_binding.cpp b/ndb/src/old_files/newtonapi/dba_binding.cpp
index 63e48110b1d..63e48110b1d 100644
--- a/ndb/src/newtonapi/dba_binding.cpp
+++ b/ndb/src/old_files/newtonapi/dba_binding.cpp
diff --git a/ndb/src/newtonapi/dba_bulkread.cpp b/ndb/src/old_files/newtonapi/dba_bulkread.cpp
index 1f75037046b..1f75037046b 100644
--- a/ndb/src/newtonapi/dba_bulkread.cpp
+++ b/ndb/src/old_files/newtonapi/dba_bulkread.cpp
diff --git a/ndb/src/newtonapi/dba_config.cpp b/ndb/src/old_files/newtonapi/dba_config.cpp
index d84386a9438..d84386a9438 100644
--- a/ndb/src/newtonapi/dba_config.cpp
+++ b/ndb/src/old_files/newtonapi/dba_config.cpp
diff --git a/ndb/src/newtonapi/dba_dac.cpp b/ndb/src/old_files/newtonapi/dba_dac.cpp
index fcb4e676e46..fcb4e676e46 100644
--- a/ndb/src/newtonapi/dba_dac.cpp
+++ b/ndb/src/old_files/newtonapi/dba_dac.cpp
diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/old_files/newtonapi/dba_error.cpp
index f05446522b0..f05446522b0 100644
--- a/ndb/src/newtonapi/dba_error.cpp
+++ b/ndb/src/old_files/newtonapi/dba_error.cpp
diff --git a/ndb/src/newtonapi/dba_init.cpp b/ndb/src/old_files/newtonapi/dba_init.cpp
index aa5fef1171c..aa5fef1171c 100644
--- a/ndb/src/newtonapi/dba_init.cpp
+++ b/ndb/src/old_files/newtonapi/dba_init.cpp
diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/old_files/newtonapi/dba_internal.hpp
index 84ae7ba222b..84ae7ba222b 100644
--- a/ndb/src/newtonapi/dba_internal.hpp
+++ b/ndb/src/old_files/newtonapi/dba_internal.hpp
diff --git a/ndb/src/newtonapi/dba_process.cpp b/ndb/src/old_files/newtonapi/dba_process.cpp
index ddb6e62f180..ddb6e62f180 100644
--- a/ndb/src/newtonapi/dba_process.cpp
+++ b/ndb/src/old_files/newtonapi/dba_process.cpp
diff --git a/ndb/src/newtonapi/dba_process.hpp b/ndb/src/old_files/newtonapi/dba_process.hpp
index ef24fbd9142..ef24fbd9142 100644
--- a/ndb/src/newtonapi/dba_process.hpp
+++ b/ndb/src/old_files/newtonapi/dba_process.hpp
diff --git a/ndb/src/newtonapi/dba_schema.cpp b/ndb/src/old_files/newtonapi/dba_schema.cpp
index 9fa99cb5d43..1bf21f1fe80 100644
--- a/ndb/src/newtonapi/dba_schema.cpp
+++ b/ndb/src/old_files/newtonapi/dba_schema.cpp
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "dba_internal.hpp"
+#include "NdbSchemaCon.hpp"
static bool getNdbAttr(DBA_DataTypes_t,
Size_t,
@@ -31,7 +32,7 @@ DBA_CreateTable(const char* TableName,
if(DBA_TableExists(TableName))
return DBA_NO_ERROR;
- NdbSchemaCon * schemaCon = DBA__TheNdb->startSchemaTransaction();
+ NdbSchemaCon * schemaCon = NdbSchemaCon::startSchemaTrans(DBA__TheNdb);
if(schemaCon == 0){
DBA__SetLatestError(DBA_NDB_ERROR, 0,
"Internal NDB error: No schema transaction");
@@ -39,8 +40,8 @@ DBA_CreateTable(const char* TableName,
}
NdbSchemaOp * schemaOp = schemaCon->getNdbSchemaOp();
- if(schemaOp == 0){
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
+ if(schemaOp == 0){
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
DBA__SetLatestError(DBA_NDB_ERROR, 0,
"Internal NDB error: No schema op");
return DBA_NDB_ERROR;
@@ -56,7 +57,7 @@ DBA_CreateTable(const char* TableName,
80,
1,
false) == -1){
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
DBA__SetLatestError(DBA_NDB_ERROR, 0,
"Internal NDB error: Create table failed");
return DBA_NDB_ERROR;
@@ -71,7 +72,7 @@ DBA_CreateTable(const char* TableName,
&attrSize,
&arraySize,
&attrType)){
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
DBA__SetLatestError(DBA_APPLICATION_ERROR, 0,
"Invalid datatype/size combination");
return DBA_APPLICATION_ERROR;
@@ -82,7 +83,7 @@ DBA_CreateTable(const char* TableName,
attrSize,
arraySize,
attrType) == -1){
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
DBA__SetLatestError(DBA_NDB_ERROR, 0,
"Internal NDB error: Create attribute failed");
return DBA_NDB_ERROR;
@@ -90,14 +91,14 @@ DBA_CreateTable(const char* TableName,
}
if(schemaCon->execute() == -1){
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
DBA__SetLatestError(DBA_NDB_ERROR, 0,
"Internal NDB error: Execute schema failed");
return DBA_NDB_ERROR;
}
- DBA__TheNdb->closeSchemaTransaction(schemaCon);
-
+ NdbSchemaCon::closeSchemaTrans(schemaCon);
+
return DBA_NO_ERROR;
}
diff --git a/ndb/src/rep/ExtSender.cpp b/ndb/src/old_files/rep/ExtSender.cpp
index cf31001a85f..cf31001a85f 100644
--- a/ndb/src/rep/ExtSender.cpp
+++ b/ndb/src/old_files/rep/ExtSender.cpp
diff --git a/ndb/src/rep/ExtSender.hpp b/ndb/src/old_files/rep/ExtSender.hpp
index 0bdabd68f37..0bdabd68f37 100644
--- a/ndb/src/rep/ExtSender.hpp
+++ b/ndb/src/old_files/rep/ExtSender.hpp
diff --git a/ndb/src/rep/Makefile b/ndb/src/old_files/rep/Makefile
index 9688a68ec74..9688a68ec74 100644
--- a/ndb/src/rep/Makefile
+++ b/ndb/src/old_files/rep/Makefile
diff --git a/ndb/src/rep/NodeConnectInfo.hpp b/ndb/src/old_files/rep/NodeConnectInfo.hpp
index 403f92a5999..403f92a5999 100644
--- a/ndb/src/rep/NodeConnectInfo.hpp
+++ b/ndb/src/old_files/rep/NodeConnectInfo.hpp
diff --git a/ndb/src/rep/README b/ndb/src/old_files/rep/README
index 7be5e230eb3..7be5e230eb3 100644
--- a/ndb/src/rep/README
+++ b/ndb/src/old_files/rep/README
diff --git a/ndb/src/rep/RepApiInterpreter.cpp b/ndb/src/old_files/rep/RepApiInterpreter.cpp
index 6e6f150713a..6e6f150713a 100644
--- a/ndb/src/rep/RepApiInterpreter.cpp
+++ b/ndb/src/old_files/rep/RepApiInterpreter.cpp
diff --git a/ndb/src/rep/RepApiInterpreter.hpp b/ndb/src/old_files/rep/RepApiInterpreter.hpp
index 78f190156b3..78f190156b3 100644
--- a/ndb/src/rep/RepApiInterpreter.hpp
+++ b/ndb/src/old_files/rep/RepApiInterpreter.hpp
diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/old_files/rep/RepApiService.cpp
index d07f7a59375..d07f7a59375 100644
--- a/ndb/src/rep/RepApiService.cpp
+++ b/ndb/src/old_files/rep/RepApiService.cpp
diff --git a/ndb/src/rep/RepApiService.hpp b/ndb/src/old_files/rep/RepApiService.hpp
index e1137e53258..e1137e53258 100644
--- a/ndb/src/rep/RepApiService.hpp
+++ b/ndb/src/old_files/rep/RepApiService.hpp
diff --git a/ndb/src/rep/RepCommandInterpreter.cpp b/ndb/src/old_files/rep/RepCommandInterpreter.cpp
index a0daf9529ab..a0daf9529ab 100644
--- a/ndb/src/rep/RepCommandInterpreter.cpp
+++ b/ndb/src/old_files/rep/RepCommandInterpreter.cpp
diff --git a/ndb/src/rep/RepCommandInterpreter.hpp b/ndb/src/old_files/rep/RepCommandInterpreter.hpp
index 398a7c0318c..398a7c0318c 100644
--- a/ndb/src/rep/RepCommandInterpreter.hpp
+++ b/ndb/src/old_files/rep/RepCommandInterpreter.hpp
diff --git a/ndb/src/rep/RepComponents.cpp b/ndb/src/old_files/rep/RepComponents.cpp
index 04b2e0e5fa5..04b2e0e5fa5 100644
--- a/ndb/src/rep/RepComponents.cpp
+++ b/ndb/src/old_files/rep/RepComponents.cpp
diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/old_files/rep/RepComponents.hpp
index ff0f29e2128..ff0f29e2128 100644
--- a/ndb/src/rep/RepComponents.hpp
+++ b/ndb/src/old_files/rep/RepComponents.hpp
diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/old_files/rep/RepMain.cpp
index d9f057be9a1..d9f057be9a1 100644
--- a/ndb/src/rep/RepMain.cpp
+++ b/ndb/src/old_files/rep/RepMain.cpp
diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/old_files/rep/Requestor.cpp
index 3c93a6394a4..3c93a6394a4 100644
--- a/ndb/src/rep/Requestor.cpp
+++ b/ndb/src/old_files/rep/Requestor.cpp
diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/old_files/rep/Requestor.hpp
index 735d2094bde..735d2094bde 100644
--- a/ndb/src/rep/Requestor.hpp
+++ b/ndb/src/old_files/rep/Requestor.hpp
diff --git a/ndb/src/rep/RequestorSubscriptions.cpp b/ndb/src/old_files/rep/RequestorSubscriptions.cpp
index 75b41fae037..75b41fae037 100644
--- a/ndb/src/rep/RequestorSubscriptions.cpp
+++ b/ndb/src/old_files/rep/RequestorSubscriptions.cpp
diff --git a/ndb/src/rep/SignalQueue.cpp b/ndb/src/old_files/rep/SignalQueue.cpp
index 9b356a14b7d..9b356a14b7d 100644
--- a/ndb/src/rep/SignalQueue.cpp
+++ b/ndb/src/old_files/rep/SignalQueue.cpp
diff --git a/ndb/src/rep/SignalQueue.hpp b/ndb/src/old_files/rep/SignalQueue.hpp
index 5ebc78a3a37..697bca85893 100644
--- a/ndb/src/rep/SignalQueue.hpp
+++ b/ndb/src/old_files/rep/SignalQueue.hpp
@@ -53,7 +53,7 @@ public:
template<class T> bool waitFor(Vector<T> &t,
T *&handler,
NdbApiSignal *&signal,
- Uint32 timeout = DEFAULT_TIMEOUT);
+ Uint32 timeout);
/**
* size()
diff --git a/ndb/src/rep/TODO b/ndb/src/old_files/rep/TODO
index a2462fae6cd..a2462fae6cd 100644
--- a/ndb/src/rep/TODO
+++ b/ndb/src/old_files/rep/TODO
diff --git a/ndb/src/rep/adapters/AppNDB.cpp b/ndb/src/old_files/rep/adapters/AppNDB.cpp
index abb146d921f..05f6d52807f 100644
--- a/ndb/src/rep/adapters/AppNDB.cpp
+++ b/ndb/src/old_files/rep/adapters/AppNDB.cpp
@@ -50,9 +50,10 @@ void
AppNDB::init(const char* connectString) {
// NdbThread_SetConcurrencyLevel(1+ 2);
- Ndb::useFullyQualifiedNames(false);
-
m_ndb = new Ndb("");
+
+ m_ndb->useFullyQualifiedNames(false);
+
m_ndb->setConnectString(connectString);
/**
* @todo Set proper max no of transactions?? needed?? Default 12??
@@ -539,7 +540,8 @@ AppNDB::prepareMetaRecord(MetaRecord* mr) {
NdbTableImpl * tmp = 0;
NdbDictionary::Table * table =0;
Uint32 * data =(Uint32*)( ((char*)mr + sizeof(Uint32)*6));
- int res = NdbDictInterface::parseTableInfo(&tmp, data, mr->dataLen);
+ int res = NdbDictInterface::parseTableInfo(&tmp, data, mr->dataLen,
+ m_ndb->usingFullyQualifiedNames());
if(res == 0) {
table = tmp;
return table;
diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/old_files/rep/adapters/AppNDB.hpp
index 9563a1e41ab..9563a1e41ab 100644
--- a/ndb/src/rep/adapters/AppNDB.hpp
+++ b/ndb/src/old_files/rep/adapters/AppNDB.hpp
diff --git a/ndb/src/rep/adapters/ExtAPI.cpp b/ndb/src/old_files/rep/adapters/ExtAPI.cpp
index 0dcd1e85465..0dcd1e85465 100644
--- a/ndb/src/rep/adapters/ExtAPI.cpp
+++ b/ndb/src/old_files/rep/adapters/ExtAPI.cpp
diff --git a/ndb/src/rep/adapters/ExtAPI.hpp b/ndb/src/old_files/rep/adapters/ExtAPI.hpp
index f10b6c7d682..f10b6c7d682 100644
--- a/ndb/src/rep/adapters/ExtAPI.hpp
+++ b/ndb/src/old_files/rep/adapters/ExtAPI.hpp
diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/old_files/rep/adapters/ExtNDB.cpp
index eb541cdced9..6642b750b57 100644
--- a/ndb/src/rep/adapters/ExtNDB.cpp
+++ b/ndb/src/old_files/rep/adapters/ExtNDB.cpp
@@ -72,22 +72,26 @@ ExtNDB::init(const char * connectString)
"ExtNDB_Service",
NDB_THREAD_PRIO_LOW);
- ConfigRetriever configRetriever;
- configRetriever.setConnectString(connectString);
+#if 0
+ /**
+ * I don't see that this does anything
+ *
+ * Jonas 13/2-04
+ */
+ ConfigRetriever cr; cr.setConnectString(connectString);
- Properties* config = configRetriever.getConfig("REP", REP_VERSION_ID);
+ ndb_mgm_configuration * config = cr.getConfig(NDB_VERSION, NODE_TYPE_REP);
if (config == 0) {
ndbout << "ExtNDB: Configuration error: ";
- const char* erString = configRetriever.getErrorString();
+ const char* erString = cr.getErrorString();
if (erString == 0) {
erString = "No error specified!";
}
ndbout << erString << endl;
return false;
}
- m_ownNodeId = configRetriever.getOwnNodeId();
- config->put("LocalNodeId", m_ownNodeId);
- config->put("LocalNodeType", "REP");
+ NdbAutoPtr autoPtr(config);
+ m_ownNodeId = r.getOwnNodeId();
/**
* Check which GREPs to connect to (in configuration)
@@ -117,6 +121,7 @@ ExtNDB::init(const char * connectString)
}
}
}
+#endif
m_transporterFacade = TransporterFacade::instance();
@@ -142,7 +147,7 @@ ExtNDB::init(const char * connectString)
m_ownBlockNo);
for (Uint32 i=1; i<MAX_NDB_NODES; i++) {
- if (m_transporterFacade->getIsNodeDefined(i) &&
+ if (m_transporterFacade->getIsDbNode(i) &&
m_transporterFacade->getIsNodeSendable(i))
{
Uint32 nodeGrp = m_transporterFacade->getNodeGrp(i);
@@ -186,8 +191,8 @@ public:
};
};
-void *
-ExtNDB::signalExecThread_C(void *r)
+extern "C"
+void *signalExecThread_C(void *r)
{
ExtNDB *grepps = (ExtNDB*)r;
@@ -198,6 +203,7 @@ ExtNDB::signalExecThread_C(void *r)
return 0;
}
+
void
ExtNDB::signalExecThreadRun()
{
@@ -233,10 +239,12 @@ ExtNDB::signalExecThreadRun()
sl.push_back(SigMatch(GSN_GREP_SUB_START_REF, &ExtNDB::sendSignalRep));
sl.push_back(SigMatch(GSN_GREP_SUB_CREATE_REF, &ExtNDB::sendSignalRep));
+
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
- if(m_signalRecvQueue.waitFor(sl, handler, signal)) {
+
+ if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT)) {
#if 0
RLOG(("Removed signal from queue (GSN: %d, QSize: %d)",
signal->readSignalNumber(), m_signalRecvQueue.size()));
diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/old_files/rep/adapters/ExtNDB.hpp
index bcbf51393aa..228c980fd06 100644
--- a/ndb/src/rep/adapters/ExtNDB.hpp
+++ b/ndb/src/old_files/rep/adapters/ExtNDB.hpp
@@ -34,6 +34,10 @@
#include <rep/storage/GCIContainerPS.hpp>
#include "ExtAPI.hpp"
+extern "C" {
+static void * signalExecThread_C(void *);
+}
+
/**
* @class ExtNDB
* @brief Class responsible for connection to primary system GREP
@@ -58,15 +62,15 @@ public:
void signalErrorHandler(NdbApiSignal * s, Uint32 nodeId);
private:
+ friend void * signalExecThread_C(void *);
+ void signalExecThreadRun();
+
static void execSignal(void* signalSender, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
static void execNodeStatus(void* signalSender, NodeId,
bool alive, bool nfCompleted);
- void signalExecThreadRun();
- static void * signalExecThread_C(void *);
-
void sendSignalRep(NdbApiSignal *);
void sendDisconnectRep(Uint32 nodeId);
diff --git a/ndb/src/rep/adapters/Makefile b/ndb/src/old_files/rep/adapters/Makefile
index bdd711510c3..bdd711510c3 100644
--- a/ndb/src/rep/adapters/Makefile
+++ b/ndb/src/old_files/rep/adapters/Makefile
diff --git a/ndb/src/rep/adapters/TableInfoPs.hpp b/ndb/src/old_files/rep/adapters/TableInfoPs.hpp
index 3fa25979255..3fa25979255 100644
--- a/ndb/src/rep/adapters/TableInfoPs.hpp
+++ b/ndb/src/old_files/rep/adapters/TableInfoPs.hpp
diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/old_files/rep/dbug_hack.cpp
index 74e5f080777..74e5f080777 100644
--- a/ndb/src/rep/dbug_hack.cpp
+++ b/ndb/src/old_files/rep/dbug_hack.cpp
diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/old_files/rep/rep_version.hpp
index 3830f9c351c..3830f9c351c 100644
--- a/ndb/src/rep/rep_version.hpp
+++ b/ndb/src/old_files/rep/rep_version.hpp
diff --git a/ndb/src/rep/repapi/Makefile b/ndb/src/old_files/rep/repapi/Makefile
index fdd153f1060..fdd153f1060 100644
--- a/ndb/src/rep/repapi/Makefile
+++ b/ndb/src/old_files/rep/repapi/Makefile
diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/old_files/rep/repapi/repapi.cpp
index d34ab098c9c..d34ab098c9c 100644
--- a/ndb/src/rep/repapi/repapi.cpp
+++ b/ndb/src/old_files/rep/repapi/repapi.cpp
diff --git a/ndb/src/rep/repapi/repapi.h b/ndb/src/old_files/rep/repapi/repapi.h
index 170e493cd86..170e493cd86 100644
--- a/ndb/src/rep/repapi/repapi.h
+++ b/ndb/src/old_files/rep/repapi/repapi.h
diff --git a/ndb/src/rep/state/Channel.cpp b/ndb/src/old_files/rep/state/Channel.cpp
index 1d573bad2f5..a7f7b90d3fe 100644
--- a/ndb/src/rep/state/Channel.cpp
+++ b/ndb/src/old_files/rep/state/Channel.cpp
@@ -273,7 +273,7 @@ Channel::addTable(const char * tableName)
if(strlen(tableName)>MAX_TAB_NAME_SIZE)
return GrepError::REP_NOT_PROPER_TABLE;
/**
- * No of separators are the number of '/' found in tableName
+ * No of separators are the number of table_name_separator found in tableName
* since a table is defined as <db>/<schema>/tablename.
* if noOfSeparators is not equal to 2, then it is not a valid
* table name.
@@ -282,7 +282,7 @@ Channel::addTable(const char * tableName)
if(strlen(tableName) < 5)
return GrepError::REP_NOT_PROPER_TABLE;
for(Uint32 i =0; i < strlen(tableName); i++)
- if(tableName[i]=='/')
+ if(tableName[i]==table_name_separator)
noOfSeps++;
if(noOfSeps!=2)
return GrepError::REP_NOT_PROPER_TABLE;
@@ -301,7 +301,7 @@ Channel::removeTable(const char * tableName)
if(strlen(tableName)>MAX_TAB_NAME_SIZE)
return GrepError::REP_NOT_PROPER_TABLE;
/**
- * No of separators are the number of '/' found in tableName
+ * No of separators are the number of table_name_separator found in tableName
* since a table is defined as <db>/<schema>/tablename.
* If noOfSeparators is not equal to 2,
* then it is not a valid table name.
@@ -310,7 +310,7 @@ Channel::removeTable(const char * tableName)
if(strlen(tableName) < 5)
return GrepError::REP_NOT_PROPER_TABLE;
for(Uint32 i =0; i < strlen(tableName); i++)
- if(tableName[i]=='/')
+ if(tableName[i]==table_name_separator)
noOfSeps++;
if(noOfSeps!=2)
return GrepError::REP_NOT_PROPER_TABLE;
diff --git a/ndb/src/rep/state/Channel.hpp b/ndb/src/old_files/rep/state/Channel.hpp
index cdf4eecca63..cdf4eecca63 100644
--- a/ndb/src/rep/state/Channel.hpp
+++ b/ndb/src/old_files/rep/state/Channel.hpp
diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/old_files/rep/state/Interval.cpp
index 8266f19c58d..8266f19c58d 100644
--- a/ndb/src/rep/state/Interval.cpp
+++ b/ndb/src/old_files/rep/state/Interval.cpp
diff --git a/ndb/src/rep/state/Interval.hpp b/ndb/src/old_files/rep/state/Interval.hpp
index 935adaf26b1..935adaf26b1 100644
--- a/ndb/src/rep/state/Interval.hpp
+++ b/ndb/src/old_files/rep/state/Interval.hpp
diff --git a/ndb/src/rep/state/Makefile b/ndb/src/old_files/rep/state/Makefile
index 3eed69a97dd..3eed69a97dd 100644
--- a/ndb/src/rep/state/Makefile
+++ b/ndb/src/old_files/rep/state/Makefile
diff --git a/ndb/src/rep/state/RepState.cpp b/ndb/src/old_files/rep/state/RepState.cpp
index d8a50961a3c..d8a50961a3c 100644
--- a/ndb/src/rep/state/RepState.cpp
+++ b/ndb/src/old_files/rep/state/RepState.cpp
diff --git a/ndb/src/rep/state/RepState.hpp b/ndb/src/old_files/rep/state/RepState.hpp
index e88151d5609..06bbca19f7e 100644
--- a/ndb/src/rep/state/RepState.hpp
+++ b/ndb/src/old_files/rep/state/RepState.hpp
@@ -22,6 +22,7 @@
#include <rep/repapi/repapi.h>
#include <rep/ExtSender.hpp>
#include <rep/adapters/AppNDB.hpp>
+#include <Properties.hpp>
#include "Channel.hpp"
#include "Interval.hpp"
diff --git a/ndb/src/rep/state/RepStateEvent.cpp b/ndb/src/old_files/rep/state/RepStateEvent.cpp
index 9be304c8bfa..9be304c8bfa 100644
--- a/ndb/src/rep/state/RepStateEvent.cpp
+++ b/ndb/src/old_files/rep/state/RepStateEvent.cpp
diff --git a/ndb/src/rep/state/RepStateRequests.cpp b/ndb/src/old_files/rep/state/RepStateRequests.cpp
index 02677e141f6..02677e141f6 100644
--- a/ndb/src/rep/state/RepStateRequests.cpp
+++ b/ndb/src/old_files/rep/state/RepStateRequests.cpp
diff --git a/ndb/src/rep/state/testInterval/Makefile b/ndb/src/old_files/rep/state/testInterval/Makefile
index fbb0b48c280..fbb0b48c280 100644
--- a/ndb/src/rep/state/testInterval/Makefile
+++ b/ndb/src/old_files/rep/state/testInterval/Makefile
diff --git a/ndb/src/rep/state/testInterval/testInterval.cpp b/ndb/src/old_files/rep/state/testInterval/testInterval.cpp
index 463e4adffb7..463e4adffb7 100644
--- a/ndb/src/rep/state/testInterval/testInterval.cpp
+++ b/ndb/src/old_files/rep/state/testInterval/testInterval.cpp
diff --git a/ndb/src/rep/state/testRepState/Makefile b/ndb/src/old_files/rep/state/testRepState/Makefile
index 33c6076eff3..33c6076eff3 100644
--- a/ndb/src/rep/state/testRepState/Makefile
+++ b/ndb/src/old_files/rep/state/testRepState/Makefile
diff --git a/ndb/src/rep/state/testRepState/testRequestor.cpp b/ndb/src/old_files/rep/state/testRepState/testRequestor.cpp
index 8989f7098b8..8989f7098b8 100644
--- a/ndb/src/rep/state/testRepState/testRequestor.cpp
+++ b/ndb/src/old_files/rep/state/testRepState/testRequestor.cpp
diff --git a/ndb/src/rep/state/testRepState/testRequestor.hpp b/ndb/src/old_files/rep/state/testRepState/testRequestor.hpp
index 726b289114d..726b289114d 100644
--- a/ndb/src/rep/state/testRepState/testRequestor.hpp
+++ b/ndb/src/old_files/rep/state/testRepState/testRequestor.hpp
diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/old_files/rep/storage/GCIBuffer.cpp
index 013600b30a5..013600b30a5 100644
--- a/ndb/src/rep/storage/GCIBuffer.cpp
+++ b/ndb/src/old_files/rep/storage/GCIBuffer.cpp
diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/old_files/rep/storage/GCIBuffer.hpp
index 8a8473d1d49..8a8473d1d49 100644
--- a/ndb/src/rep/storage/GCIBuffer.hpp
+++ b/ndb/src/old_files/rep/storage/GCIBuffer.hpp
diff --git a/ndb/src/rep/storage/GCIContainer.cpp b/ndb/src/old_files/rep/storage/GCIContainer.cpp
index c161db0769b..c161db0769b 100644
--- a/ndb/src/rep/storage/GCIContainer.cpp
+++ b/ndb/src/old_files/rep/storage/GCIContainer.cpp
diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/old_files/rep/storage/GCIContainer.hpp
index 48cbc66bfbd..48cbc66bfbd 100644
--- a/ndb/src/rep/storage/GCIContainer.hpp
+++ b/ndb/src/old_files/rep/storage/GCIContainer.hpp
diff --git a/ndb/src/rep/storage/GCIContainerPS.cpp b/ndb/src/old_files/rep/storage/GCIContainerPS.cpp
index 5adb53f965c..5adb53f965c 100644
--- a/ndb/src/rep/storage/GCIContainerPS.cpp
+++ b/ndb/src/old_files/rep/storage/GCIContainerPS.cpp
diff --git a/ndb/src/rep/storage/GCIContainerPS.hpp b/ndb/src/old_files/rep/storage/GCIContainerPS.hpp
index 7f5aaac4840..7f5aaac4840 100644
--- a/ndb/src/rep/storage/GCIContainerPS.hpp
+++ b/ndb/src/old_files/rep/storage/GCIContainerPS.hpp
diff --git a/ndb/src/rep/storage/GCIPage.cpp b/ndb/src/old_files/rep/storage/GCIPage.cpp
index 05ecde2fee1..05ecde2fee1 100644
--- a/ndb/src/rep/storage/GCIPage.cpp
+++ b/ndb/src/old_files/rep/storage/GCIPage.cpp
diff --git a/ndb/src/rep/storage/GCIPage.hpp b/ndb/src/old_files/rep/storage/GCIPage.hpp
index 50c5ab0cfba..50c5ab0cfba 100644
--- a/ndb/src/rep/storage/GCIPage.hpp
+++ b/ndb/src/old_files/rep/storage/GCIPage.hpp
diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/old_files/rep/storage/LogRecord.hpp
index a0bf3d52372..a0bf3d52372 100644
--- a/ndb/src/rep/storage/LogRecord.hpp
+++ b/ndb/src/old_files/rep/storage/LogRecord.hpp
diff --git a/ndb/src/rep/storage/Makefile b/ndb/src/old_files/rep/storage/Makefile
index 89b3af455e8..89b3af455e8 100644
--- a/ndb/src/rep/storage/Makefile
+++ b/ndb/src/old_files/rep/storage/Makefile
diff --git a/ndb/src/rep/storage/NodeConnectInfo.hpp b/ndb/src/old_files/rep/storage/NodeConnectInfo.hpp
index 403f92a5999..403f92a5999 100644
--- a/ndb/src/rep/storage/NodeConnectInfo.hpp
+++ b/ndb/src/old_files/rep/storage/NodeConnectInfo.hpp
diff --git a/ndb/src/rep/storage/NodeGroup.cpp b/ndb/src/old_files/rep/storage/NodeGroup.cpp
index 33451efb104..33451efb104 100644
--- a/ndb/src/rep/storage/NodeGroup.cpp
+++ b/ndb/src/old_files/rep/storage/NodeGroup.cpp
diff --git a/ndb/src/rep/storage/NodeGroup.hpp b/ndb/src/old_files/rep/storage/NodeGroup.hpp
index 1f515e02a23..1f515e02a23 100644
--- a/ndb/src/rep/storage/NodeGroup.hpp
+++ b/ndb/src/old_files/rep/storage/NodeGroup.hpp
diff --git a/ndb/src/rep/storage/NodeGroupInfo.cpp b/ndb/src/old_files/rep/storage/NodeGroupInfo.cpp
index 8c250268997..8c250268997 100644
--- a/ndb/src/rep/storage/NodeGroupInfo.cpp
+++ b/ndb/src/old_files/rep/storage/NodeGroupInfo.cpp
diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/old_files/rep/storage/NodeGroupInfo.hpp
index 3d0499d4425..3d0499d4425 100644
--- a/ndb/src/rep/storage/NodeGroupInfo.hpp
+++ b/ndb/src/old_files/rep/storage/NodeGroupInfo.hpp
diff --git a/ndb/src/rep/transfer/Makefile b/ndb/src/old_files/rep/transfer/Makefile
index 0d8851e287a..0d8851e287a 100644
--- a/ndb/src/rep/transfer/Makefile
+++ b/ndb/src/old_files/rep/transfer/Makefile
diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/old_files/rep/transfer/TransPS.cpp
index 1f65e95850d..11fb0203cbc 100644
--- a/ndb/src/rep/transfer/TransPS.cpp
+++ b/ndb/src/old_files/rep/transfer/TransPS.cpp
@@ -47,6 +47,8 @@ TransPS::~TransPS()
void
TransPS::init(TransporterFacade * tf, const char * connectString)
{
+ abort();
+#ifdef NOT_FUNCTIONAL
m_signalExecThread = NdbThread_Create(signalExecThread_C,
(void **)this,
32768,
@@ -128,6 +130,7 @@ TransPS::init(TransporterFacade * tf, const char * connectString)
m_repSender->setNodeId(extRepNodeId);
m_repSender->setOwnRef(m_ownRef);
m_repSender->setTransporterFacade(tf);
+#endif
}
/*****************************************************************************
@@ -153,8 +156,9 @@ public:
};
};
+extern "C"
void *
-TransPS::signalExecThread_C(void *r)
+signalExecThread_C(void *r)
{
TransPS *repps = (TransPS*)r;
@@ -196,7 +200,7 @@ TransPS::signalExecThreadRun()
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
- if(m_signalRecvQueue.waitFor(sl, handler, signal)) {
+ if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT)) {
#if 0
ndbout_c("TransPS: Removed signal from queue (GSN: %d, QSize: %d)",
signal->readSignalNumber(), m_signalRecvQueue.size());
diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/old_files/rep/transfer/TransPS.hpp
index b47f1acfca2..0464b9e47c0 100644
--- a/ndb/src/rep/transfer/TransPS.hpp
+++ b/ndb/src/old_files/rep/transfer/TransPS.hpp
@@ -35,6 +35,10 @@
#include <rep/rep_version.hpp>
+extern "C" {
+static void * signalExecThread_C(void *);
+}
+
/**
* @class TransPS
* @brief Responsible for REP-REP interface in Primary System role
@@ -62,8 +66,10 @@ private:
/**
* SignalQueue executor thread
*/
+
+ friend void * signalExecThread_C(void *);
+
void signalExecThreadRun();
- static void * signalExecThread_C(void *);
static void execSignal(void* signalSender, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/old_files/rep/transfer/TransSS.cpp
index 83f4b570330..376c6375bc4 100644
--- a/ndb/src/rep/transfer/TransSS.cpp
+++ b/ndb/src/old_files/rep/transfer/TransSS.cpp
@@ -52,6 +52,8 @@ TransSS::~TransSS()
void
TransSS::init(const char * connectString)
{
+ abort();
+#ifdef NOT_FUNCTIONAL
m_signalExecThread = NdbThread_Create(signalExecThread_C,
(void **)this,
32768,
@@ -139,6 +141,7 @@ TransSS::init(const char * connectString)
m_repSender->setNodeId(extRepNodeId);
m_repSender->setOwnRef(m_ownRef);
m_repSender->setTransporterFacade(m_transporterFacade);
+#endif
}
/*****************************************************************************
@@ -165,8 +168,9 @@ public:
};
};
+extern "C"
void *
-TransSS::signalExecThread_C(void *r)
+signalExecThread_C(void *r)
{
TransSS *transss = (TransSS*)r;
@@ -243,7 +247,7 @@ TransSS::signalExecThreadRun()
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
- if(m_signalRecvQueue.waitFor(sl, handler, signal))
+ if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT))
{
#if 0
ndbout_c("TransSS: Removed signal from queue (GSN: %d, QSize: %d)",
diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/old_files/rep/transfer/TransSS.hpp
index 6f2089e46ac..3340038c8d1 100644
--- a/ndb/src/rep/transfer/TransSS.hpp
+++ b/ndb/src/old_files/rep/transfer/TransSS.hpp
@@ -34,6 +34,10 @@
#include <rep/state/RepState.hpp>
+extern "C" {
+static void * signalExecThread_C(void *);
+}
+
/**
* @class TransSS
* @brief Responsible for REP-REP interface in Standby System role
@@ -57,8 +61,8 @@ private:
/***************************************************************************
* Private Methods
***************************************************************************/
+ friend void * signalExecThread_C(void *);
void signalExecThreadRun(); ///< SignalQueue executor thread
- static void * signalExecThread_C(void *);
static void execSignal(void* executorObj, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
diff --git a/ndb/src/rep/transfer/TransSSSubscriptions.cpp b/ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp
index 582ba8040a6..582ba8040a6 100644
--- a/ndb/src/rep/transfer/TransSSSubscriptions.cpp
+++ b/ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp
diff --git a/ndb/test/Makefile b/ndb/test/Makefile
deleted file mode 100644
index 19472917560..00000000000
--- a/ndb/test/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-include .defs.mk
-
-DIRS := src tools ndbapi run-test
-
-EXTRA_DIRS = newtonapi
-
-ifeq ($(NDB_ARCH), x86_64)
-EXTRA_DIRS =
-endif
-
-DIRS += $(EXTRA_DIRS)
-
-ifneq ($(NDB_ODBC),N)
-DIRS += odbc
-endif
-
-include $(NDB_TOP)/Epilogue.mk
-
-_bins_ndbapi : _libs_src
diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am
new file mode 100644
index 00000000000..2e0f30df9d4
--- /dev/null
+++ b/ndb/test/Makefile.am
@@ -0,0 +1,6 @@
+SUBDIRS = src tools ndbapi run-test
+
+EXTRA_DIST = include
+
+dist-hook:
+ -rm -rf `find $(distdir) -type d -name SCCS`
diff --git a/ndb/test/include/NDBT_Table.hpp b/ndb/test/include/NDBT_Table.hpp
index 950c1f15ff7..eee76773106 100644
--- a/ndb/test/include/NDBT_Table.hpp
+++ b/ndb/test/include/NDBT_Table.hpp
@@ -25,66 +25,6 @@
class NDBT_Attribute : public NdbDictionary::Column {
friend class NdbOut& operator <<(class NdbOut&, const NDBT_Attribute &);
public:
- NDBT_Attribute(const char* anAttrName,
- AttrType type,
- int sz = 4,
- KeyType key = NoKey,
- bool nullable = false,
- StorageAttributeType indexOnly = NormalStorageAttribute,
- StorageMode _sm = MMBased) :
- NdbDictionary::Column(anAttrName)
- {
- assert(anAttrName != 0);
-
- setNullable(nullable);
- setIndexOnlyStorage(indexOnly == IndexStorageAttribute);
- setPrimaryKey(key != NoKey);
- setTupleKey(key == TupleId);
- setLength(1);
- switch(type){
- case ::Signed:
- if(sz == 8)
- setType(NdbDictionary::Column::Bigint);
- else if (sz == 4)
- setType(NdbDictionary::Column::Int);
- else {
- setType(NdbDictionary::Column::Int);
- setLength(sz);
- }
- break;
-
- case ::UnSigned:
- if(sz == 8)
- setType(NdbDictionary::Column::Bigunsigned);
- else if (sz == 4)
- setType(NdbDictionary::Column::Unsigned);
- else {
- setType(NdbDictionary::Column::Unsigned);
- setLength(sz);
- }
- break;
-
- case ::Float:
- if(sz == 8)
- setType(NdbDictionary::Column::Double);
- else if (sz == 4)
- setType(NdbDictionary::Column::Float);
- else{
- setType(NdbDictionary::Column::Float);
- setLength(sz);
- }
- break;
-
- case ::String:
- setType(NdbDictionary::Column::Char);
- setLength(sz);
- break;
-
- case ::NoAttrTypeDef:
- break;
- }
- }
-
NDBT_Attribute(const char* _name,
Column::Type _type,
int _length = 1,
@@ -132,4 +72,13 @@ NDBT_Table::discoverTableFromDb(Ndb* ndb, const char * name){
return ndb->getDictionary()->getTable(name);
}
+
+/**
+ * Print meta information about index
+ * (information on how it is strored, what the attributes look like etc.)
+ */
+class NdbOut& operator <<(class NdbOut&, const NdbDictionary::Index &);
+
+
+
#endif
diff --git a/ndb/test/include/NdbConfig.hpp b/ndb/test/include/NdbConfig.hpp
index f13872f4d64..19439fafbb2 100644
--- a/ndb/test/include/NdbConfig.hpp
+++ b/ndb/test/include/NdbConfig.hpp
@@ -17,29 +17,22 @@
#ifndef NDBT_CONFIG_HPP
#define NDBT_CONFIG_HPP
+#include <ndb_types.h>
#include <mgmapi.h>
#include <Vector.hpp>
#include <NdbRestarter.hpp>
-#include <Properties.hpp>
+#include <mgmapi_config_parameters.h>
-class NdbConfig : public NdbRestarter{
+class NdbConfig : public NdbRestarter {
public:
NdbConfig(int own_id, const char* addr = 0)
: NdbRestarter(addr),
ownNodeId(own_id) {};
- bool getProperty(unsigned int node_id, const char* type,
- const char * name, Uint32 * value) const;
- bool getProperty(unsigned int node_id, const char* type,
- const char * name, const char ** value) const;
-
- bool getHostName(unsigned int node_id,
- const char ** hostname) const;
-protected:
- bool getPropsForNode(unsigned int node_id,
- const char* type,
- const Properties ** props) const;
+ bool getProperty(unsigned nodeid, unsigned type, unsigned key, Uint32 * val);
+ bool getHostName(unsigned int node_id, const char ** hostname);
+ //protected:
int ownNodeId;
};
diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp
index cfd5409bb69..b4c29a87eff 100644
--- a/ndb/test/include/NdbRestarter.hpp
+++ b/ndb/test/include/NdbRestarter.hpp
@@ -89,7 +89,9 @@ protected:
const char* host;
int port;
NdbMgmHandle handle;
-
+ ndb_mgm_configuration * m_config;
+protected:
+ ndb_mgm_configuration * getConfig();
};
#endif
diff --git a/ndb/include/ndbapi/NdbSchemaCon.hpp b/ndb/test/include/NdbSchemaCon.hpp
index 9d6b49df8f9..313daf0094b 100644
--- a/ndb/include/ndbapi/NdbSchemaCon.hpp
+++ b/ndb/test/include/NdbSchemaCon.hpp
@@ -16,15 +16,16 @@
#ifndef NdbSchemaCon_H
#define NdbSchemaCon_H
+
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
#include <ndb_types.h>
-#include "AttrType.hpp"
#include "NdbError.hpp"
+#include <NdbSchemaOp.hpp>
class NdbSchemaOp;
-class NdbApiSignal;
class Ndb;
+class NdbApiSignal;
/**
* @class NdbSchemaCon
@@ -44,6 +45,7 @@ class Ndb;
* into the database.
*
* @note Currently only one table can be added per transaction.
+ * @note Depricated, use NdbDictionary
*/
class NdbSchemaCon
{
@@ -51,6 +53,18 @@ friend class Ndb;
friend class NdbSchemaOp;
public:
+
+ static
+ NdbSchemaCon* startSchemaTrans(Ndb* pNdb){
+ return new NdbSchemaCon(pNdb);
+ }
+
+ static
+ void closeSchemaTrans(NdbSchemaCon* pSchCon){
+ delete pSchCon;
+ }
+
+
/**
* Execute a schema transaction.
*
@@ -75,6 +89,7 @@ public:
const NdbError & getNdbError() const;
private:
+
/******************************************************************************
* These are the create and delete methods of this class.
*****************************************************************************/
@@ -85,8 +100,6 @@ private:
/******************************************************************************
* These are the private methods of this class.
*****************************************************************************/
- void init(); // Initialise connection object for new
- // transaction.
void release(); // Release all schemaop in schemaCon
@@ -105,7 +118,6 @@ private:
int receiveDROP_INDX_REF(NdbApiSignal*);
-
/*****************************************************************************
* These are the private variables of this class.
*****************************************************************************/
@@ -126,6 +138,9 @@ NdbSchemaCon::checkMagicNumber()
return -1;
return 0;
}//NdbSchemaCon::checkMagicNumber()
+
+
+
#endif
#endif
diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp
index c3a3827a6b4..43f76c8c253 100644
--- a/ndb/include/ndbapi/NdbSchemaOp.hpp
+++ b/ndb/test/include/NdbSchemaOp.hpp
@@ -16,14 +16,126 @@
#ifndef NdbSchemaOp_H
#define NdbSchemaOp_H
+
+#include <NdbDictionary.hpp>
+
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
-#include "NdbDictionary.hpp"
-#include "AttrType.hpp"
-#include "NdbSchemaCon.hpp"
+ /**
+ * Type of attribute
+ *
+ * NOTE! AttrType is deprecated, use NdbDictionary::Column::Type instead!
+ */
+ enum AttrType {
+ Signed, ///< Attributes of this type can be read with:
+ ///< NdbRecAttr::int64_value,
+ ///< NdbRecAttr::int32_value,
+ ///< NdbRecAttr::short_value,
+ ///< NdbRecAttr::char_value
+ UnSigned, ///< Attributes of this type can be read with:
+ ///< NdbRecAttr::u_64_value,
+ ///< NdbRecAttr::u_32_value,
+ ///< NdbRecAttr::u_short_value,
+ ///< NdbRecAttr::u_char_value
+ Float, ///< Attributes of this type can be read with:
+ ///< NdbRecAttr::float_value and
+ ///< NdbRecAttr::double_value
+ String, ///< Attributes of this type can be read with:
+ ///< NdbRecAttr::aRef,
+ ///< NdbRecAttr::getAttributeObject
+ NoAttrTypeDef ///< Used for debugging only
+ };
+
+
+ /**
+ * @deprecated
+ */
+ enum NullAttributeType {
+ NoNullTypeDefined = -1,
+ NotNullAttribute,
+ NullAttribute,
+ AttributeDefined
+ };
+ /**
+ * Indicates whether the attribute is part of a primary key or not
+ */
+ enum KeyType {
+ Undefined = -1, ///< Used for debugging only
+ NoKey, ///< Attribute is not part of primary key
+ ///< or tuple identity
+ TupleKey, ///< Attribute is part of primary key
+ TupleId ///< Attribute is part of tuple identity
+ ///< (This type of attribute is created
+ ///< internally, and should not be
+ ///< manually created.)
+ };
+ /**
+ * Indicate whether the attribute should be stored on disk or not
+ */
+ enum StorageMode {
+ MMBased = 0, ///< Main memory
+ DiskBased = 1, ///< Disk (Not yet supported.)
+ NoStorageTypeDef ///< Used for debugging only
+ };
+
+ /**
+ * Where attribute is stored.
+ *
+ * This is used to indicate whether a primary key
+ * should only be stored in the index storage and not in the data storage
+ * or if it should be stored in both places.
+ * The first alternative makes the attribute take less space,
+ * but makes it impossible to scan using attribute.
+ *
+ * @note Use NormalStorageAttribute for most cases.
+ * (IndexStorageAttribute should only be used on primary key
+ * attributes and only if you do not want to scan using the attribute.)
+ */
+ enum StorageAttributeType {
+ NoStorageAttributeTypeDefined = -1, ///< <i>Missing explanation</i>
+ IndexStorageAttribute, ///< Attribute is only stored in
+ ///< index storage (ACC)
+ NormalStorageAttribute ///< Attribute values are stored
+ ///< both in the index (ACC) and
+ ///< in the data storage (TUP)
+ };
+
+
+ /**
+ * Type of fragmentation used for a table
+ */
+ enum FragmentType {
+ Default = 0, ///< (All is default!)
+ Single = 1, ///< Only one fragment
+ All = 2, ///< Default value. One fragment per node group
+ DistributionGroup = 3, ///< Distribution Group used for fragmentation.
+ ///< One fragment per node group
+ DistributionKey = 4, ///< Distribution Key used for fragmentation.
+ ///< One fragment per node group.
+ AllLarge = 5, ///< Sixten fragments per node group.
+ DGroupLarge = 6, ///< Distribution Group used for fragmentation.
+ ///< Sixten fragments per node group
+ DKeyLarge = 7 ///< Distribution Key used for fragmentation.
+ ///< Sixten fragments per node group
+ };
+
+ /**
+ * Type of table or index.
+ */
+ enum TableType {
+ UndefTableType = 0,
+ SystemTable = 1, ///< Internal.Table cannot be updated by user
+ UserTable = 2, ///< Normal application table
+ UniqueHashIndex = 3, ///< Unique un-ordered hash index
+ HashIndex = 4, ///< Non-unique un-ordered hash index
+ UniqueOrderedIndex = 5, ///< Unique ordered index
+ OrderedIndex = 6 ///< Non-unique ordered index
+ };
+
-class NdbApiSignal;
+class NdbSchemaCon;
class Ndb;
+
/**
* @class NdbSchemaOp
@@ -41,8 +153,10 @@ class NdbSchemaOp
{
friend class Ndb;
friend class NdbSchemaCon;
-
+
public:
+
+
/**
* Create a new table in the database.
*
@@ -184,7 +298,6 @@ public:
int aMemoryType = 1,
bool aStoredTable = true);
-#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* This is the old function declaration, don't use.
*
@@ -211,7 +324,6 @@ public:
aMemoryType,
(aStoredTable == 1 ? true : false));
}
-#endif
/**
* Add a new attribute to a database table.
@@ -367,7 +479,6 @@ public:
bool aAutoIncrement = false,
const char* aDefaultValue = 0);
-#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* @deprecated do not use!
*/
@@ -394,19 +505,8 @@ public:
aDistributionGroup,
aDistributionGroupNoOfBits);
}
-#endif
-
- /**
- * Get the last error which occurred during the transaction.
- *
- * If an error occured (NdbSchemaCon::execute returned -1 or
- * NdbSchemaCon::getNdbSchemaOp returned NULL), then this method
- * retrieves the error object containing information about
- * the error.
- *
- * @return Error object containing information about last error.
- */
- const NdbError & getNdbError() const;
+
+ const NdbError & getNdbError() const;
protected:
@@ -440,17 +540,48 @@ protected:
Ndb* theNdb; // Point back to the Ndb object.
NdbSchemaCon* theSchemaCon; // Point back to the connection object.
+
class NdbDictionary::Table * m_currentTable;
};
-inline
-const NdbError &
-NdbSchemaOp::getNdbError() const
-{
- return theSchemaCon->getNdbError();
-}
+/**
+ * Get old attribute type from new type
+ *
+ * NOTE! attrType is deprecated, use getType instead!
+ *
+ * @return Type of attribute: { Signed, UnSigned, Float,a String }
+ */
+inline
+AttrType
+convertColumnTypeToAttrType(NdbDictionary::Column::Type _type)
+{
+
+ switch(_type){
+ case NdbDictionary::Column::Bigint:
+ case NdbDictionary::Column::Int:
+ return Signed;
+ case NdbDictionary::Column::Bigunsigned:
+ case NdbDictionary::Column::Unsigned:
+ return UnSigned;
+ case NdbDictionary::Column::Float:
+ case NdbDictionary::Column::Decimal:
+ case NdbDictionary::Column::Double:
+ return Float;
+ case NdbDictionary::Column::Char:
+ case NdbDictionary::Column::Varchar:
+ case NdbDictionary::Column::Binary:
+ case NdbDictionary::Column::Varbinary:
+ return String;
+ case NdbDictionary::Column::Datetime:
+ case NdbDictionary::Column::Timespec:
+ case NdbDictionary::Column::Undefined:
+ default:
+ return NoAttrTypeDef;
+ }
+}
#endif
+
#endif
diff --git a/ndb/test/ndbapi/telco/InsertRecs.cpp b/ndb/test/ndbapi/InsertRecs.cpp
index f42786d666d..f42786d666d 100644
--- a/ndb/test/ndbapi/telco/InsertRecs.cpp
+++ b/ndb/test/ndbapi/InsertRecs.cpp
diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am
new file mode 100644
index 00000000000..52058c306fb
--- /dev/null
+++ b/ndb/test/ndbapi/Makefile.am
@@ -0,0 +1,81 @@
+
+SUBDIRS = bank
+
+ndbtest_PROGRAMS = \
+flexBench \
+drop_all_tabs \
+create_all_tabs \
+create_tab \
+flexAsynch \
+flexBench \
+flexHammer \
+flexScan \
+flexTT \
+testBackup \
+testBasic \
+testBasicAsynch \
+testBlobs \
+testDataBuffers \
+testDict \
+testIndex \
+testMgm \
+testNdbApi \
+testNodeRestart \
+testOIBasic \
+testOperations \
+testRestartGci \
+testScan \
+testScanInterpreter \
+testSystemRestart \
+testTimeout \
+testTransactions \
+test_event
+
+#flexTimedAsynch
+#testBlobs
+#flex_bench_mysql
+
+create_all_tabs_SOURCES = create_all_tabs.cpp
+create_tab_SOURCES = create_tab.cpp
+drop_all_tabs_SOURCES = drop_all_tabs.cpp
+flexAsynch_SOURCES = flexAsynch.cpp
+flexBench_SOURCES = flexBench.cpp
+flexHammer_SOURCES = flexHammer.cpp
+flexScan_SOURCES = flexScan.cpp
+flexTT_SOURCES = flexTT.cpp
+#flexTimedAsynch_SOURCES = flexTimedAsynch.cpp
+#flex_bench_mysql_SOURCES = flex_bench_mysql.cpp
+testBackup_SOURCES = testBackup.cpp
+testBasic_SOURCES = testBasic.cpp
+testBasicAsynch_SOURCES = testBasicAsynch.cpp
+testBlobs_SOURCES = testBlobs.cpp
+testDataBuffers_SOURCES = testDataBuffers.cpp
+testDict_SOURCES = testDict.cpp
+testIndex_SOURCES = testIndex.cpp
+testMgm_SOURCES = testMgm.cpp
+testNdbApi_SOURCES = testNdbApi.cpp
+testNodeRestart_SOURCES = testNodeRestart.cpp
+testOIBasic_SOURCES = testOIBasic.cpp
+testOperations_SOURCES = testOperations.cpp
+testRestartGci_SOURCES = testRestartGci.cpp
+testScan_SOURCES = testScan.cpp
+testScanInterpreter_SOURCES = testScanInterpreter.cpp
+testSystemRestart_SOURCES = testSystemRestart.cpp
+testTimeout_SOURCES = testTimeout.cpp
+testTransactions_SOURCES = testTransactions.cpp
+test_event_SOURCES = test_event.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
+
+##testDict_INCLUDES = $(INCLUDES) -I$(top_srcdir)/ndb/include/kernel
+##testIndex_INCLUDES = $(INCLUDES) -I$(top_srcdir)/ndb/include/kernel
+##testSystemRestart_INCLUDES = $(INCLUDES) -I$(top_srcdir)/ndb/include/kernel
+##testTransactions_INCLUDES = $(INCLUDES) -I$(top_srcdir)/ndb/include/kernel
+testBackup_LDADD = $(LDADD) bank/libbank.a
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
+
diff --git a/ndb/test/ndbapi/Makefile b/ndb/test/ndbapi/Makefile_old
index 91f0c84c18e..34761e1eb9c 100644
--- a/ndb/test/ndbapi/Makefile
+++ b/ndb/test/ndbapi/Makefile_old
@@ -37,7 +37,8 @@ BIN_DIRS = \
indexTest \
test_event \
indexTest2 \
- testGrep
+ testGrep \
+ testBlobs
ifeq ($(NDB_OS), SOLARIS)
ifeq ($(NDB_COMPILER), FORTE6)
diff --git a/ndb/test/ndbapi/testScanInterpreter/ScanFilter.hpp b/ndb/test/ndbapi/ScanFilter.hpp
index 09786756798..09786756798 100644
--- a/ndb/test/ndbapi/testScanInterpreter/ScanFilter.hpp
+++ b/ndb/test/ndbapi/ScanFilter.hpp
diff --git a/ndb/test/ndbapi/testScan/ScanFunctions.hpp b/ndb/test/ndbapi/ScanFunctions.hpp
index 36d01909861..36d01909861 100644
--- a/ndb/test/ndbapi/testScan/ScanFunctions.hpp
+++ b/ndb/test/ndbapi/ScanFunctions.hpp
diff --git a/ndb/test/ndbapi/testScanInterpreter/ScanInterpretTest.hpp b/ndb/test/ndbapi/ScanInterpretTest.hpp
index 3862de34111..3862de34111 100644
--- a/ndb/test/ndbapi/testScanInterpreter/ScanInterpretTest.hpp
+++ b/ndb/test/ndbapi/ScanInterpretTest.hpp
diff --git a/ndb/test/ndbapi/acid2/TraceNdbApi.cpp b/ndb/test/ndbapi/TraceNdbApi.cpp
index bd43b15f2e6..bd43b15f2e6 100644
--- a/ndb/test/ndbapi/acid2/TraceNdbApi.cpp
+++ b/ndb/test/ndbapi/TraceNdbApi.cpp
diff --git a/ndb/test/ndbapi/acid2/VerifyNdbApi.cpp b/ndb/test/ndbapi/VerifyNdbApi.cpp
index 79645827e2c..79645827e2c 100644
--- a/ndb/test/ndbapi/acid2/VerifyNdbApi.cpp
+++ b/ndb/test/ndbapi/VerifyNdbApi.cpp
diff --git a/ndb/test/ndbapi/acid/acid.cpp b/ndb/test/ndbapi/acid.cpp
index 49961531a1c..157b3c7b3ef 100644
--- a/ndb/test/ndbapi/acid/acid.cpp
+++ b/ndb/test/ndbapi/acid.cpp
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbApi.hpp>
+#include <NdbSchemaCon.hpp>
#include <NdbMutex.h>
#include <NdbOut.hpp>
#include <NdbSleep.h>
@@ -230,7 +231,6 @@ extern "C" void* NdbThreadFuncInsert(void* pArg)
VerifyMethodInt(pNdbOperationW, setValue(c_szWarehouseSum, nWarehouseSum));
int iExec = pNdbConnection->execute(Commit);
int iError = pNdbConnection->getNdbError().code;
- CommitStatusType cs = pNdbConnection->commitStatus();
if(iExec<0 && iError!=0 && iError!=266 && iError!=630) {
ReportMethodInt(iExec, pNdbConnection, "pNdbConnection", "execute(Commit)", __FILE__, __LINE__);
@@ -285,7 +285,6 @@ extern "C" void* NdbThreadFuncUpdate(void* pArg)
VerifyMethodInt(pNdbOperationW, setValue(c_szWarehouseSum, nWarehouseSum));
int iExec = pNdbConnection->execute(Commit);
int iError = pNdbConnection->getNdbError().code;
- CommitStatusType cs = pNdbConnection->commitStatus();
if(iExec<0 && iError!=0 && iError!=266 && iError!=626) {
ReportMethodInt(iExec, pNdbConnection, "pNdbConnection", "execute(Commit)", __FILE__, __LINE__);
@@ -333,7 +332,6 @@ extern "C" void* NdbThreadFuncDelete(void* pArg)
}
int iExec = pNdbConnection->execute(Commit);
int iError = pNdbConnection->getNdbError().code;
- CommitStatusType cs = pNdbConnection->commitStatus();
if(iExec<0 && iError!=0 && iError!=266 && iError!=626) {
ReportMethodInt(iExec, pNdbConnection, "pNdbConnection", "execute(Commit)", __FILE__, __LINE__);
@@ -389,7 +387,7 @@ extern "C" void* NdbThreadFuncRead(void* pArg)
}
int iExec = pNdbConnection->execute(Commit);
int iError = pNdbConnection->getNdbError().code;
- CommitStatusType cs = pNdbConnection->commitStatus();
+
if(iExec<0 && iError!=0 && iError!=266 && iError!=626) {
ReportMethodInt(iExec, pNdbConnection, "pNdbConnection", "execute(Commit)", __FILE__, __LINE__);
}
@@ -465,8 +463,7 @@ NDB_COMMAND(acid, "acid", "acid", "acid", 65535)
VerifyMethodInt(pNdb, init());
VerifyMethodInt(pNdb, waitUntilReady());
- NdbSchemaCon* pNdbSchemaCon = NULL ;
- VerifyMethodPtr(pNdbSchemaCon, pNdb, startSchemaTransaction());
+ NdbSchemaCon* pNdbSchemaCon= NdbSchemaCon::startSchemaTrans(pNdb);
if(!pNdbSchemaCon){
ndbout <<"startSchemaTransaction failed, exiting now" << endl ;
delete pNdb ;
@@ -497,9 +494,9 @@ NDB_COMMAND(acid, "acid", "acid", "acid", 65535)
VerifyMethodInt(pNdbSchemaOp, createAttribute(c_szWarehouseSum, NoKey, 32, 1, UnSigned, MMBased, false));
VerifyMethodInt(pNdbSchemaOp, createAttribute(c_szWarehouseCount, NoKey, 32, 1, UnSigned, MMBased, false));
VerifyMethodInt(pNdbSchemaCon, execute());
- VerifyMethodVoid(pNdb, closeSchemaTransaction(pNdbSchemaCon));
+ NdbSchemaCon::closeSchemaTrans(pNdbSchemaCon);
- VerifyMethodPtr(pNdbSchemaCon, pNdb, startSchemaTransaction());
+ pNdbSchemaCon= NdbSchemaCon::startSchemaTrans(pNdb);
VerifyMethodPtr(pNdbSchemaOp, pNdbSchemaCon, getNdbSchemaOp());
#if defined NDB_OSE || defined NDB_SOFTOSE
VerifyMethodInt(pNdbSchemaOp, createTable(
@@ -526,7 +523,7 @@ NDB_COMMAND(acid, "acid", "acid", "acid", 65535)
VerifyMethodInt(pNdbSchemaOp, createAttribute(c_szDistrictSum, NoKey, 32, 1, UnSigned, MMBased, false));
VerifyMethodInt(pNdbSchemaOp, createAttribute(c_szDistrictCount, NoKey, 32, 1, UnSigned, MMBased, false));
VerifyMethodInt(pNdbSchemaCon, execute());
- VerifyMethodVoid(pNdb, closeSchemaTransaction(pNdbSchemaCon));
+ NdbSchemaCon::closeSchemaTrans(pNdbSchemaCon);
g_pNdbMutex = NdbMutex_Create();
NdbMutex_Lock(g_pNdbMutex);
diff --git a/ndb/test/ndbapi/acid2/acid2.cpp b/ndb/test/ndbapi/acid2.cpp
index 434a0450daa..434a0450daa 100644
--- a/ndb/test/ndbapi/acid2/acid2.cpp
+++ b/ndb/test/ndbapi/acid2.cpp
diff --git a/ndb/test/ndbapi/telco/adoInsertRecs.cpp b/ndb/test/ndbapi/adoInsertRecs.cpp
index 0bc67ef641b..0bc67ef641b 100644
--- a/ndb/test/ndbapi/telco/adoInsertRecs.cpp
+++ b/ndb/test/ndbapi/adoInsertRecs.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp b/ndb/test/ndbapi/asyncGenerator.cpp
index 84a93414712..84a93414712 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/asyncGenerator.cpp
+++ b/ndb/test/ndbapi/asyncGenerator.cpp
diff --git a/ndb/test/ndbapi/bank/src/Bank.cpp b/ndb/test/ndbapi/bank/Bank.cpp
index 11ebf087fd4..14883205693 100644
--- a/ndb/test/ndbapi/bank/src/Bank.cpp
+++ b/ndb/test/ndbapi/bank/Bank.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 "../Bank.hpp"
+#include "Bank.hpp"
#include <time.h>
#include <NdbSleep.h>
#include <UtilTransactions.hpp>
diff --git a/ndb/test/ndbapi/bank/src/BankLoad.cpp b/ndb/test/ndbapi/bank/BankLoad.cpp
index 985a49d5f64..76261b664a6 100644
--- a/ndb/test/ndbapi/bank/src/BankLoad.cpp
+++ b/ndb/test/ndbapi/bank/BankLoad.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 "../Bank.hpp"
+#include "Bank.hpp"
#include <UtilTransactions.hpp>
/**
diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am
new file mode 100644
index 00000000000..886d664aefb
--- /dev/null
+++ b/ndb/test/ndbapi/bank/Makefile.am
@@ -0,0 +1,22 @@
+
+ndbtest_PROGRAMS = testBank bankSumAccounts bankValidateAllGLs bankMakeGL bankTransactionMaker bankCreator bankTimer
+
+noinst_LIBRARIES = libbank.a
+
+libbank_a_SOURCES = Bank.cpp BankLoad.cpp Bank.hpp
+
+testBank_SOURCES = testBank.cpp
+bankSumAccounts_SOURCES = bankSumAccounts.cpp
+bankValidateAllGLs_SOURCES = bankValidateAllGLs.cpp
+bankMakeGL_SOURCES = bankMakeGL.cpp
+bankTransactionMaker_SOURCES = bankTransactionMaker.cpp
+bankCreator_SOURCES = bankCreator.cpp
+bankTimer_SOURCES = bankTimer.cpp
+
+LDADD_LOC = $(noinst_LIBRARIES)
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/test/ndbapi/bank/Makefile b/ndb/test/ndbapi/bank/Makefile_old
index f710f9e6612..f710f9e6612 100644
--- a/ndb/test/ndbapi/bank/Makefile
+++ b/ndb/test/ndbapi/bank/Makefile_old
diff --git a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp b/ndb/test/ndbapi/bank/bankCreator.cpp
index d84818baf24..5331ec6ba69 100644
--- a/ndb/test/ndbapi/bank/bankCreator/bankCreator.cpp
+++ b/ndb/test/ndbapi/bank/bankCreator.cpp
@@ -23,7 +23,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp b/ndb/test/ndbapi/bank/bankMakeGL.cpp
index 55e9081a598..54bc559fbf9 100644
--- a/ndb/test/ndbapi/bank/bankMakeGL/bankMakeGL.cpp
+++ b/ndb/test/ndbapi/bank/bankMakeGL.cpp
@@ -23,7 +23,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp b/ndb/test/ndbapi/bank/bankSumAccounts.cpp
index ab3e862e8d2..c0a903f9034 100644
--- a/ndb/test/ndbapi/bank/bankSumAccounts/bankSumAccounts.cpp
+++ b/ndb/test/ndbapi/bank/bankSumAccounts.cpp
@@ -23,7 +23,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp b/ndb/test/ndbapi/bank/bankTimer.cpp
index ba8de9e4af1..ba3165fccb4 100644
--- a/ndb/test/ndbapi/bank/bankTimer/bankTimer.cpp
+++ b/ndb/test/ndbapi/bank/bankTimer.cpp
@@ -24,7 +24,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp
index 0c7d5d72473..fe9b53e0c8d 100644
--- a/ndb/test/ndbapi/bank/bankTransactionMaker/bankTransactionMaker.cpp
+++ b/ndb/test/ndbapi/bank/bankTransactionMaker.cpp
@@ -24,7 +24,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp
index 13136755de8..f9d974bb5f7 100644
--- a/ndb/test/ndbapi/bank/bankValidateAllGLs/bankValidateAllGLs.cpp
+++ b/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp
@@ -24,7 +24,7 @@
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <getarg.h>
-#include "../Bank.hpp"
+#include "Bank.hpp"
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/bank/bankCreator/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankCreator/Makefile
index d40103a8347..d40103a8347 100644
--- a/ndb/test/ndbapi/bank/bankCreator/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankCreator/Makefile
diff --git a/ndb/test/ndbapi/bank/bankMakeGL/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankMakeGL/Makefile
index 16a092e885c..16a092e885c 100644
--- a/ndb/test/ndbapi/bank/bankMakeGL/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankMakeGL/Makefile
diff --git a/ndb/test/ndbapi/bank/bankSumAccounts/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankSumAccounts/Makefile
index 34f1cc21bc6..34f1cc21bc6 100644
--- a/ndb/test/ndbapi/bank/bankSumAccounts/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankSumAccounts/Makefile
diff --git a/ndb/test/ndbapi/bank/bankTimer/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankTimer/Makefile
index a2fcf703723..a2fcf703723 100644
--- a/ndb/test/ndbapi/bank/bankTimer/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankTimer/Makefile
diff --git a/ndb/test/ndbapi/bank/bankTransactionMaker/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankTransactionMaker/Makefile
index 2e482898476..2e482898476 100644
--- a/ndb/test/ndbapi/bank/bankTransactionMaker/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankTransactionMaker/Makefile
diff --git a/ndb/test/ndbapi/bank/bankValidateAllGLs/Makefile b/ndb/test/ndbapi/bank/old_dirs/bankValidateAllGLs/Makefile
index 660b73fb830..660b73fb830 100644
--- a/ndb/test/ndbapi/bank/bankValidateAllGLs/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/bankValidateAllGLs/Makefile
diff --git a/ndb/test/ndbapi/bank/src/Makefile b/ndb/test/ndbapi/bank/old_dirs/src/Makefile
index e0ab8e0e536..e0ab8e0e536 100644
--- a/ndb/test/ndbapi/bank/src/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/src/Makefile
diff --git a/ndb/test/ndbapi/bank/testBank/Makefile b/ndb/test/ndbapi/bank/old_dirs/testBank/Makefile
index 382aaadad7c..382aaadad7c 100644
--- a/ndb/test/ndbapi/bank/testBank/Makefile
+++ b/ndb/test/ndbapi/bank/old_dirs/testBank/Makefile
diff --git a/ndb/test/ndbapi/bank/testBank/testBank.cpp b/ndb/test/ndbapi/bank/testBank.cpp
index 094ecaa499c..77ac1172d7c 100644
--- a/ndb/test/ndbapi/bank/testBank/testBank.cpp
+++ b/ndb/test/ndbapi/bank/testBank.cpp
@@ -29,7 +29,7 @@
continue; }
-#include "../Bank.hpp"
+#include "Bank.hpp"
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
diff --git a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp
index ce0aee35e8f..ce0aee35e8f 100644
--- a/ndb/test/ndbapi/ronja/benchronja/benchronja.cpp
+++ b/ndb/test/ndbapi/benchronja.cpp
diff --git a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp b/ndb/test/ndbapi/bulk_copy.cpp
index 18881cae216..18881cae216 100644
--- a/ndb/test/ndbapi/bulk_copy/bulk_copy.cpp
+++ b/ndb/test/ndbapi/bulk_copy.cpp
diff --git a/ndb/test/ndbapi/vw_test/cdrserver.cpp b/ndb/test/ndbapi/cdrserver.cpp
index 8354d28f53f..8354d28f53f 100644
--- a/ndb/test/ndbapi/vw_test/cdrserver.cpp
+++ b/ndb/test/ndbapi/cdrserver.cpp
diff --git a/ndb/test/ndbapi/cello-sessionDb/celloDb.cpp b/ndb/test/ndbapi/celloDb.cpp
index ec61e783585..ec61e783585 100644
--- a/ndb/test/ndbapi/cello-sessionDb/celloDb.cpp
+++ b/ndb/test/ndbapi/celloDb.cpp
diff --git a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp b/ndb/test/ndbapi/create_all_tabs.cpp
index 55d04888144..55d04888144 100644
--- a/ndb/test/ndbapi/create_all_tabs/create_all_tabs.cpp
+++ b/ndb/test/ndbapi/create_all_tabs.cpp
diff --git a/ndb/test/ndbapi/create_tab/create_tab.cpp b/ndb/test/ndbapi/create_tab.cpp
index 8bb1e7a9572..8bb1e7a9572 100644
--- a/ndb/test/ndbapi/create_tab/create_tab.cpp
+++ b/ndb/test/ndbapi/create_tab.cpp
diff --git a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp b/ndb/test/ndbapi/drop_all_tabs.cpp
index 59c57396acd..59c57396acd 100644
--- a/ndb/test/ndbapi/drop_all_tabs/drop_all_tabs.cpp
+++ b/ndb/test/ndbapi/drop_all_tabs.cpp
diff --git a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp
index 0822f3ee999..396ac06c87a 100644
--- a/ndb/test/ndbapi/flexAsynch/flexAsynch.cpp
+++ b/ndb/test/ndbapi/flexAsynch.cpp
@@ -15,7 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
#include "NdbApi.hpp"
+#include <NdbSchemaCon.hpp>
#include <NdbMain.h>
#include <md5_hash.hpp>
@@ -738,7 +740,7 @@ createTables(Ndb* pMyNdb){
if (theTableCreateFlag == 0) {
for(int i=0; i < 1 ;i++) {
ndbout << "Creating " << tableName[i] << "..." << endl;
- MySchemaTransaction = pMyNdb->startSchemaTransaction();
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pMyNdb);
if(MySchemaTransaction == NULL &&
(!error_handler(MySchemaTransaction->getNdbError())))
@@ -748,7 +750,8 @@ createTables(Ndb* pMyNdb){
if(MySchemaOp == NULL &&
(!error_handler(MySchemaTransaction->getNdbError())))
return -1;
-
+
+
check = MySchemaOp->createTable( tableName[i]
,8 // Table Size
,TupleKey // Key Type
@@ -793,7 +796,7 @@ createTables(Ndb* pMyNdb){
(!error_handler(MySchemaTransaction->getNdbError())))
return -1;
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
}
}
diff --git a/ndb/test/ndbapi/flexBench/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp
index 809d11086bf..809d11086bf 100644
--- a/ndb/test/ndbapi/flexBench/flexBench.cpp
+++ b/ndb/test/ndbapi/flexBench.cpp
diff --git a/ndb/test/ndbapi/flexHammer/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp
index 057efb31e74..c1c47923de9 100644
--- a/ndb/test/ndbapi/flexHammer/flexHammer.cpp
+++ b/ndb/test/ndbapi/flexHammer.cpp
@@ -58,6 +58,7 @@ Revision history:
#include <NdbTick.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
+#include <NdbSchemaCon.hpp>
ErrorData * flexHammerErrorData;
@@ -754,7 +755,7 @@ createTables(Ndb* pMyNdb)
} // if
ndbout << endl;
- MySchemaTransaction = pMyNdb->startSchemaTransaction();
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pMyNdb);
if (MySchemaTransaction == NULL) {
return(-1);
} // if
@@ -762,7 +763,7 @@ createTables(Ndb* pMyNdb)
MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if (MySchemaOp == NULL) {
// Clean up opened schema transaction
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return(-1);
} // if
@@ -787,7 +788,7 @@ createTables(Ndb* pMyNdb)
#endif
if (check == -1) {
// Clean up opened schema transaction
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return(-1);
} // if
@@ -798,7 +799,7 @@ createTables(Ndb* pMyNdb)
NotNullAttribute );
if (check == -1) {
// Clean up opened schema transaction
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return(-1);
} // if
@@ -810,7 +811,7 @@ createTables(Ndb* pMyNdb)
NotNullAttribute );
if (check == -1) {
// Clean up opened schema transaction
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return(-1);
} // if
} // for
@@ -819,11 +820,11 @@ createTables(Ndb* pMyNdb)
check = MySchemaTransaction->execute();
if (check == -1) {
// Clean up opened schema transaction
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return(-1);
} // if
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
} // for
} // if
diff --git a/ndb/test/ndbapi/flexScan/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp
index 19fb6dc5ab0..5b5b4dde730 100644
--- a/ndb/test/ndbapi/flexScan/flexScan.cpp
+++ b/ndb/test/ndbapi/flexScan.cpp
@@ -62,6 +62,7 @@
#include <NdbMain.h>
#include <NdbTest.hpp>
#include <NDBT_Error.hpp>
+#include <NdbSchemaCon.hpp>
#define PKSIZE 1
#define FOREVER 1
@@ -151,7 +152,6 @@ static void UpdateArray(int *attrValue)
int attrCount = 0;
int opCount = 0;
int sizeCount = 0;
- int Index = 0;
int* pValue = attrValue;
for (tableCount = 0; tableCount < tNoOfTables; tableCount++) {
@@ -179,7 +179,6 @@ static void Compare(int* attrValue, int* readValue)
int attrCount = 0;
int OpCount = 0;
int first = 0;
- int sizeCount = 0;
for (tableCount = 0; tableCount < tNoOfTables; tableCount++) {
for (attrCount = 0; attrCount < tNoOfAttributes-1; attrCount++) {
@@ -592,19 +591,14 @@ flexScanThread(void* ThreadData)
ThreadNdb* pThreadData = (ThreadNdb*)ThreadData;
unsigned int thread_no = pThreadData->ThreadNo;
unsigned int thread_base = (thread_no * 2000000) + (tNodeId * 26000);
- int NrOfScannedRecords = 0;
int tThreadResult = 0;
Ndb* MyNdb = NULL;
- NdbConnection *MyTransaction = NULL;
- NdbOperation* MyOperation[MAXTABLES];
int check = 0;
StartType tType = stLast;
int* pkValue = NULL;
int* attrValue = NULL;
int* readValue = NULL;
int AllocSize = 0;
- NdbRecAttr* tTmp = NULL;
- OperationType opType;
AllocSize = tNoOfTables * (tNoOfAttributes-1) * tNoOfOperations *
tAttributeSize * sizeof(int);
@@ -770,15 +764,15 @@ static int createTables(Ndb* pMyNdb)
do {
i++;
ndbout << endl << "Creating " << tableName[i - 1] << "..." << endl;
-
- MySchemaTransaction = pMyNdb->startSchemaTransaction();
+
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pMyNdb);
if( MySchemaTransaction == NULL ) {
return (-1);
} // if
MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( MySchemaOp == NULL ) {
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return (-1);
} // if
@@ -800,14 +794,14 @@ static int createTables(Ndb* pMyNdb)
,40); // Nr of Pages
#endif
if (check == -1) {
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return -1;
} // if
check = MySchemaOp->createAttribute( (char*)attrName[0], TupleKey, 32, PKSIZE,
UnSigned, MMBased, NotNullAttribute );
if (check == -1) {
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return -1;
} // if
@@ -815,7 +809,7 @@ static int createTables(Ndb* pMyNdb)
check = MySchemaOp->createAttribute( (char*)attrName[j], NoKey, 32, tAttributeSize,
UnSigned, MMBased, NotNullAttribute );
if (check == -1) {
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return -1;
} // if
} // for
@@ -825,7 +819,7 @@ static int createTables(Ndb* pMyNdb)
ndbout << "Probably, " << tableName[i - 1] << " already exist" << endl;
} // if
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
} while (tNoOfTables > i);
}
@@ -1058,7 +1052,6 @@ static int insertRows(Ndb* pNdb, // NDB object
int attrCount = 0;
NdbConnection* MyTransaction = NULL;
NdbOperation* MyOperations[MAXTABLES] = {NULL};
- int Index = 0;
int opCount = 0;
for (opCount = 0; opCount < tNoOfOperations; opCount++) {
@@ -1099,7 +1092,7 @@ static int insertRows(Ndb* pNdb, // NDB object
} // if
for (attrCount = 0; attrCount < tNoOfAttributes - 1; attrCount++) {
- Index = tableCount * (tNoOfAttributes - 1) * tNoOfOperations * tAttributeSize +
+ int Index = tableCount * (tNoOfAttributes - 1) * tNoOfOperations * tAttributeSize +
attrCount * tNoOfOperations * tAttributeSize + opCount * tAttributeSize;
check = MyOperations[tableCount]->
setValue((char*)attrName[attrCount + 1],
diff --git a/ndb/test/ndbapi/flexTT/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp
index c45cbd95762..a82875de5c2 100644
--- a/ndb/test/ndbapi/flexTT/flexTT.cpp
+++ b/ndb/test/ndbapi/flexTT.cpp
@@ -18,6 +18,7 @@
#include <ndb_global.h>
#include <NdbApi.hpp>
+#include <NdbSchemaCon.hpp>
#include <NdbMain.h>
#include <md5_hash.hpp>
@@ -662,7 +663,7 @@ createTables(Ndb* pMyNdb){
if (theTableCreateFlag == 0) {
ndbout << "Creating Table: vpn_users " << "..." << endl;
- MySchemaTransaction = pMyNdb->startSchemaTransaction();
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pMyNdb);
if(MySchemaTransaction == NULL &&
(!error_handler(MySchemaTransaction->getNdbError())))
@@ -748,7 +749,7 @@ createTables(Ndb* pMyNdb){
(!error_handler(MySchemaTransaction->getNdbError())))
return -1;
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
}//if
return 0;
diff --git a/ndb/test/ndbapi/flexTimedAsynch/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp
index 761be53fdd3..761be53fdd3 100644
--- a/ndb/test/ndbapi/flexTimedAsynch/flexTimedAsynch.cpp
+++ b/ndb/test/ndbapi/flexTimedAsynch.cpp
diff --git a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql.cpp
index 7cc883ab3e6..7cc883ab3e6 100644
--- a/ndb/test/ndbapi/flex_bench_mysql/flex_bench_mysql.cpp
+++ b/ndb/test/ndbapi/flex_bench_mysql.cpp
diff --git a/ndb/test/ndbapi/indexTest/index.cpp b/ndb/test/ndbapi/index.cpp
index 508186de529..508186de529 100644
--- a/ndb/test/ndbapi/indexTest/index.cpp
+++ b/ndb/test/ndbapi/index.cpp
diff --git a/ndb/test/ndbapi/indexTest2/index2.cpp b/ndb/test/ndbapi/index2.cpp
index e49113d2f1b..e49113d2f1b 100644
--- a/ndb/test/ndbapi/indexTest2/index2.cpp
+++ b/ndb/test/ndbapi/index2.cpp
diff --git a/ndb/test/ndbapi/ronja/initronja/initronja.cpp b/ndb/test/ndbapi/initronja.cpp
index f3f4d9628e2..b3215104822 100644
--- a/ndb/test/ndbapi/ronja/initronja/initronja.cpp
+++ b/ndb/test/ndbapi/initronja.cpp
@@ -21,6 +21,7 @@
* *************************************************** */
#include "NdbApi.hpp"
+#include "NdbSchemaCon.hpp"
#include <NdbOut.hpp>
#include <NdbMain.h>
#include <NdbTest.hpp>
@@ -90,7 +91,7 @@ NDB_COMMAND(initronja, "initronja", "initronja", "initronja", 65535){
ndbout << endl << "Creating the table SHORT_REC" << "..." << endl;
- MySchemaTransaction = pNdb->startSchemaTransaction();
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if(!MySchemaTransaction) goto error_handler;
MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if(!MySchemaOp) goto error_handler;
@@ -148,11 +149,11 @@ NDB_COMMAND(initronja, "initronja", "initronja", "initronja", 65535){
ndbout << "SHORT_REC created " << endl;
}// if
- pNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
ndbout << endl << "Creating the table LONG_REC..." << endl;
- MySchemaTransaction = pNdb->startSchemaTransaction();
+ MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if(!MySchemaTransaction) goto error_handler;
MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
@@ -212,7 +213,7 @@ NDB_COMMAND(initronja, "initronja", "initronja", "initronja", 65535){
ndbout << "LONG_REC created" << endl;
}// if
- pNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
check = InsertRecords(pNdb, tNoOfRecords);
@@ -234,7 +235,7 @@ NDB_COMMAND(initronja, "initronja", "initronja", "initronja", 65535){
error_handler:
ndbout << "SchemaTransaction returned error:" ;
ndbout << MySchemaTransaction->getNdbError() << endl;
- pNdb->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
delete pNdb ;
NDBT_ProgramExit(NDBT_FAILED) ;
exit(-1);
diff --git a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp b/ndb/test/ndbapi/interpreterInTup.cpp
index a2352edf707..47960cd5d12 100644
--- a/ndb/test/ndbapi/interpreterInTup/interpreterInTup.cpp
+++ b/ndb/test/ndbapi/interpreterInTup.cpp
@@ -58,6 +58,7 @@
#include <NdbThread.h>
#include <NdbMutex.h>
#include <NdbApi.hpp>
+#include <NdbSchemaCon.hpp>
#include <NDBT.hpp>
#define MAXATTR 3
@@ -93,8 +94,8 @@ TTYPE t_addReg(int, NdbOperation*);
TTYPE t_subReg(int, NdbOperation*);
TTYPE t_subroutineWithBranchLabel(int, NdbOperation*);
-char tableName[MAXTABLES][MAXSTRLEN+1] = {0};
-char attrName[MAXATTR][MAXSTRLEN+1] = {0};
+char tableName[MAXSTRLEN+1];
+char attrName[MAXATTR][MAXSTRLEN+1];
int attrValue[NUMBEROFRECORDS] = {0};
int pkValue[NUMBEROFRECORDS] = {0};
const int tAttributeSize = 1 ;
@@ -105,11 +106,9 @@ int bTestPassed = 0;
int main(int argc, const char** argv) {
- int tTableId = 0;
int operationType = 0;
- int tupTest = 0 ;
- int scanTest = 0 ;
- bool loop = 0 ;
+ int tupTest = 0;
+ int scanTest = 0;
Ndb* pNdb = new Ndb("TEST_DB");
pNdb->init();
@@ -140,7 +139,7 @@ int main(int argc, const char** argv) {
setAttrNames() ;
setTableNames() ;
- const void * p = NDBT_Table::discoverTableFromDb(pNdb, tableName[0]);
+ const void * p = NDBT_Table::discoverTableFromDb(pNdb, tableName);
if (p != 0){
create_table(pNdb);
}
@@ -252,18 +251,17 @@ void create_table(Ndb* pMyNdb) {
***************************************************************/
int check = -1 ;
- NdbSchemaCon *MySchemaTransaction = NULL ;
NdbSchemaOp *MySchemaOp = NULL ;
- ndbout << endl << "Creating " << tableName[0] << " ... " << endl;
+ ndbout << endl << "Creating " << tableName << " ... " << endl;
- MySchemaTransaction = pMyNdb->startSchemaTransaction();
+ NdbSchemaCon* MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pMyNdb);
if(!MySchemaTransaction) error_handler(MySchemaTransaction->getNdbError(), NO_FAIL);
MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( !MySchemaOp ) error_handler(MySchemaTransaction->getNdbError(), NO_FAIL);
// Create table
- check = MySchemaOp->createTable( tableName[0],
+ check = MySchemaOp->createTable( tableName,
8, // Table size
TupleKey, // Key Type
40 // Nr of Pages
@@ -305,7 +303,8 @@ void create_table(Ndb* pMyNdb) {
ndbout << tableName[0] << " created" << endl;
}
- pMyNdb->closeSchemaTransaction(MySchemaTransaction);
+
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return;
@@ -333,7 +332,7 @@ void write_rows (Ndb* pMyNdb) {
error_handler(pMyNdb->getNdbError(), NO_FAIL);
}//if
- MyOperation = MyTransaction->getNdbOperation(tableName[0]);
+ MyOperation = MyTransaction->getNdbOperation(tableName);
if (!MyOperation) {
error_handler(pMyNdb->getNdbError(), NO_FAIL);
}//if
@@ -366,9 +365,6 @@ void verify_deleted(Ndb* pMyNdb) {
int check = -1 ;
int loop_count_ops = nRecords;
- NdbRecAttr* tTmp;
- int readValue[MAXATTR];
- NdbConnection* pMyTransaction = NULL ;
NdbOperation* pMyOperation = NULL ;
ndbout << "Verifying deleted records..."<< flush;
@@ -378,7 +374,7 @@ void verify_deleted(Ndb* pMyNdb) {
NdbConnection* pMyTransaction = pMyNdb->startTransaction();
if (!pMyTransaction) error_handler(pMyNdb->getNdbError(), NO_FAIL);
- pMyOperation = pMyTransaction->getNdbOperation(tableName[0]);
+ pMyOperation = pMyTransaction->getNdbOperation(tableName);
if (!pMyOperation) error_handler(pMyNdb->getNdbError(), NO_FAIL);
check = pMyOperation->readTuple();
@@ -421,7 +417,7 @@ void read_and_verify_rows(Ndb* pMyNdb, bool pre) {
pMyTransaction = pMyNdb->startTransaction();
if (!pMyTransaction) error_handler(pMyNdb->getNdbError(), NO_FAIL);
- MyOp = pMyTransaction->getNdbOperation(tableName[0]);
+ MyOp = pMyTransaction->getNdbOperation(tableName);
if (!MyOp) error_handler( pMyTransaction->getNdbError(), NO_FAIL);
@@ -1232,14 +1228,13 @@ void scan_rows(Ndb* pMyNdb, int opType, int tupleType, int scanType) {
int readValue = 0 ;
int readValue2 = 0 ;
int scanCount = 0 ;
- NdbRecAttr* tTmp = NULL ;
TTYPE fail = NO_FAIL ;
for (int count=0 ; count < loop_count_ops ; count++) {
NdbConnection* MyTransaction = pMyNdb->startTransaction();
if (!MyTransaction) error_handler(pMyNdb->getNdbError(), NO_FAIL);
- NdbOperation* MyOperation = MyTransaction->getNdbOperation(tableName[0]);
+ NdbOperation* MyOperation = MyTransaction->getNdbOperation(tableName);
if (!MyOperation) error_handler(pMyNdb->getNdbError(), NO_FAIL);
if (opType == 1)
@@ -1306,7 +1301,7 @@ void scan_rows(Ndb* pMyNdb, int opType, int tupleType, int scanType) {
}else{
// Sends the SCAN_NEXTREQ signal(s) and reads the answer in TRANS_ID signals.
// SCAN_TABCONF or SCAN_TABREF is the confirmation.
- while (eOf = MyTransaction->nextScanResult() == 0) {
+ while ((eOf = MyTransaction->nextScanResult()) == 0) {
ndbout << readValue <<"; ";
// Here we call takeOverScanOp for update of the tuple.
}
@@ -1348,7 +1343,7 @@ void update_rows(Ndb* pMyNdb, int tupleType, int opType) {
return;
}//if
- MyOperation = MyTransaction->getNdbOperation(tableName[0]);
+ MyOperation = MyTransaction->getNdbOperation(tableName);
if (MyOperation == NULL) {
error_handler(pMyNdb->getNdbError(), NO_FAIL);
return;
@@ -1442,7 +1437,7 @@ void delete_rows(Ndb* pMyNdb, int tupleTest, int opType) {
MyTransaction = pMyNdb->startTransaction();
if (!MyTransaction) error_handler(pMyNdb->getNdbError(), NO_FAIL) ;
- MyOperation = MyTransaction->getNdbOperation(tableName[0]);
+ MyOperation = MyTransaction->getNdbOperation(tableName);
if (!MyOperation) error_handler(pMyNdb->getNdbError(), NO_FAIL) ;
check = MyOperation->interpretedDeleteTuple();
@@ -1517,8 +1512,6 @@ inline void setAttrNames(){
inline void setTableNames(){
- for (int i = 0; i < MAXTABLES; i++){
- snprintf(tableName[i], MAXSTRLEN, "TAB%d", i);
- }
+ snprintf(tableName, MAXSTRLEN, "TAB1");
}
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp b/ndb/test/ndbapi/mainAsyncGenerator.cpp
index f613c66d07b..f613c66d07b 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/mainAsyncGenerator.cpp
+++ b/ndb/test/ndbapi/mainAsyncGenerator.cpp
diff --git a/ndb/test/ndbapi/telco/msa.cpp b/ndb/test/ndbapi/msa.cpp
index 39ddaac2019..7a734f9cb79 100644
--- a/ndb/test/ndbapi/telco/msa.cpp
+++ b/ndb/test/ndbapi/msa.cpp
@@ -17,6 +17,7 @@
#include <ndb_global.h>
#include <NdbApi.hpp>
+#include <NdbSchemaCon.hpp>
#include <NdbCondition.h>
#include <NdbMutex.h>
#include <NdbSleep.h>
@@ -849,7 +850,7 @@ int CreateCallContextTable(Ndb* pNdb, const char* szTableName, bool bStored)
NdbError err;
memset(&err, 0, sizeof(err));
- NdbSchemaCon* pNdbSchemaCon = pNdb->startSchemaTransaction();
+ NdbSchemaCon* pNdbSchemaCon = NdbSchemaCon::startSchemaTrans(pNdb);
if(pNdbSchemaCon)
{
NdbSchemaOp* pNdbSchemaOp = pNdbSchemaCon->getNdbSchemaOp();
@@ -874,7 +875,8 @@ int CreateCallContextTable(Ndb* pNdb, const char* szTableName, bool bStored)
}
else
err = pNdbSchemaCon->getNdbError();
- pNdb->closeSchemaTransaction(pNdbSchemaCon);
+
+ NdbSchemaCon::closeSchemaTrans(pNdbSchemaCon);
}
else
err = pNdb->getNdbError();
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async1.cpp b/ndb/test/ndbapi/ndb_async1.cpp
index 2a84f6b2aca..2a84f6b2aca 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async1.cpp
+++ b/ndb/test/ndbapi/ndb_async1.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async2.cpp b/ndb/test/ndbapi/ndb_async2.cpp
index 0c1d138defb..0c1d138defb 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_async2.cpp
+++ b/ndb/test/ndbapi/ndb_async2.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp b/ndb/test/ndbapi/ndb_user_populate.cpp
index ce3a76cdd59..ce3a76cdd59 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_populate.cpp
+++ b/ndb/test/ndbapi/ndb_user_populate.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction.cpp b/ndb/test/ndbapi/ndb_user_transaction.cpp
index 182f1f99586..182f1f99586 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction2.cpp b/ndb/test/ndbapi/ndb_user_transaction2.cpp
index df3c7a7989e..df3c7a7989e 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction2.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction2.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction3.cpp b/ndb/test/ndbapi/ndb_user_transaction3.cpp
index d2c92ecd424..d2c92ecd424 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction3.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction3.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction4.cpp b/ndb/test/ndbapi/ndb_user_transaction4.cpp
index e652c7bfed8..e652c7bfed8 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction4.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction4.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction5.cpp b/ndb/test/ndbapi/ndb_user_transaction5.cpp
index 86580008d10..86580008d10 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction5.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction5.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction6.cpp b/ndb/test/ndbapi/ndb_user_transaction6.cpp
index 262f38e9ffb..262f38e9ffb 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_user_transaction6.cpp
+++ b/ndb/test/ndbapi/ndb_user_transaction6.cpp
diff --git a/ndb/test/ndbapi/acid/Makefile b/ndb/test/ndbapi/old_dirs/acid/Makefile
index 33dc49fcdea..33dc49fcdea 100644
--- a/ndb/test/ndbapi/acid/Makefile
+++ b/ndb/test/ndbapi/old_dirs/acid/Makefile
diff --git a/ndb/test/ndbapi/acid2/Makefile b/ndb/test/ndbapi/old_dirs/acid2/Makefile
index 69c9d409b9e..69c9d409b9e 100644
--- a/ndb/test/ndbapi/acid2/Makefile
+++ b/ndb/test/ndbapi/old_dirs/acid2/Makefile
diff --git a/ndb/test/ndbapi/acid2/TraceNdbApi.hpp b/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp
index 2bd4eab6b70..2bd4eab6b70 100644
--- a/ndb/test/ndbapi/acid2/TraceNdbApi.hpp
+++ b/ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp
diff --git a/ndb/test/ndbapi/acid2/VerifyNdbApi.hpp b/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp
index 4a5b8cc8111..4a5b8cc8111 100644
--- a/ndb/test/ndbapi/acid2/VerifyNdbApi.hpp
+++ b/ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp
diff --git a/ndb/test/ndbapi/basicAsynch/Makefile b/ndb/test/ndbapi/old_dirs/basicAsynch/Makefile
index 802c5e5a2bd..802c5e5a2bd 100755
--- a/ndb/test/ndbapi/basicAsynch/Makefile
+++ b/ndb/test/ndbapi/old_dirs/basicAsynch/Makefile
diff --git a/ndb/test/ndbapi/bulk_copy/Makefile b/ndb/test/ndbapi/old_dirs/bulk_copy/Makefile
index 22c05b138b7..22c05b138b7 100644
--- a/ndb/test/ndbapi/bulk_copy/Makefile
+++ b/ndb/test/ndbapi/old_dirs/bulk_copy/Makefile
diff --git a/ndb/test/ndbapi/create_all_tabs/Makefile b/ndb/test/ndbapi/old_dirs/create_all_tabs/Makefile
index 58309807682..58309807682 100644
--- a/ndb/test/ndbapi/create_all_tabs/Makefile
+++ b/ndb/test/ndbapi/old_dirs/create_all_tabs/Makefile
diff --git a/ndb/test/ndbapi/create_tab/Makefile b/ndb/test/ndbapi/old_dirs/create_tab/Makefile
index c2ea0b52b15..c2ea0b52b15 100644
--- a/ndb/test/ndbapi/create_tab/Makefile
+++ b/ndb/test/ndbapi/old_dirs/create_tab/Makefile
diff --git a/ndb/test/ndbapi/drop_all_tabs/Makefile b/ndb/test/ndbapi/old_dirs/drop_all_tabs/Makefile
index 96db0781417..96db0781417 100644
--- a/ndb/test/ndbapi/drop_all_tabs/Makefile
+++ b/ndb/test/ndbapi/old_dirs/drop_all_tabs/Makefile
diff --git a/ndb/test/ndbapi/flexAsynch/Makefile b/ndb/test/ndbapi/old_dirs/flexAsynch/Makefile
index 2c77c8e21df..2c77c8e21df 100644
--- a/ndb/test/ndbapi/flexAsynch/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexAsynch/Makefile
diff --git a/ndb/test/ndbapi/old_dirs/flexBench/Makefile.am b/ndb/test/ndbapi/old_dirs/flexBench/Makefile.am
new file mode 100644
index 00000000000..d4de4b92b60
--- /dev/null
+++ b/ndb/test/ndbapi/old_dirs/flexBench/Makefile.am
@@ -0,0 +1,10 @@
+
+bin_PROGRAMS = flexBench
+
+flexBench_SOURCES = flexBench.cpp
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/test/ndbapi/flexBench/Makefile b/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old
index bfff5cd161a..bfff5cd161a 100644
--- a/ndb/test/ndbapi/flexBench/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old
diff --git a/ndb/test/ndbapi/flexBench/ndbplot.pl b/ndb/test/ndbapi/old_dirs/flexBench/ndbplot.pl
index b16f6d5897d..b16f6d5897d 100755
--- a/ndb/test/ndbapi/flexBench/ndbplot.pl
+++ b/ndb/test/ndbapi/old_dirs/flexBench/ndbplot.pl
diff --git a/ndb/test/ndbapi/flexHammer/Makefile b/ndb/test/ndbapi/old_dirs/flexHammer/Makefile
index c8e436fb7f5..c8e436fb7f5 100644
--- a/ndb/test/ndbapi/flexHammer/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexHammer/Makefile
diff --git a/ndb/test/ndbapi/flexHammer/README b/ndb/test/ndbapi/old_dirs/flexHammer/README
index 556582aab96..556582aab96 100644
--- a/ndb/test/ndbapi/flexHammer/README
+++ b/ndb/test/ndbapi/old_dirs/flexHammer/README
diff --git a/ndb/test/ndbapi/flexScan/Makefile b/ndb/test/ndbapi/old_dirs/flexScan/Makefile
index 78f9d481063..78f9d481063 100644
--- a/ndb/test/ndbapi/flexScan/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexScan/Makefile
diff --git a/ndb/test/ndbapi/flexScan/README b/ndb/test/ndbapi/old_dirs/flexScan/README
index cddbdea5336..cddbdea5336 100644
--- a/ndb/test/ndbapi/flexScan/README
+++ b/ndb/test/ndbapi/old_dirs/flexScan/README
diff --git a/ndb/test/ndbapi/flexTT/Makefile b/ndb/test/ndbapi/old_dirs/flexTT/Makefile
index a63bd803d95..a63bd803d95 100644
--- a/ndb/test/ndbapi/flexTT/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexTT/Makefile
diff --git a/ndb/test/ndbapi/flexTimedAsynch/Makefile b/ndb/test/ndbapi/old_dirs/flexTimedAsynch/Makefile
index e9995dbd16f..e9995dbd16f 100644
--- a/ndb/test/ndbapi/flexTimedAsynch/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flexTimedAsynch/Makefile
diff --git a/ndb/test/ndbapi/flex_bench_mysql/Makefile b/ndb/test/ndbapi/old_dirs/flex_bench_mysql/Makefile
index d2608526cae..d2608526cae 100644
--- a/ndb/test/ndbapi/flex_bench_mysql/Makefile
+++ b/ndb/test/ndbapi/old_dirs/flex_bench_mysql/Makefile
diff --git a/ndb/test/ndbapi/indexTest/Makefile b/ndb/test/ndbapi/old_dirs/indexTest/Makefile
index d842e487ee5..d842e487ee5 100644
--- a/ndb/test/ndbapi/indexTest/Makefile
+++ b/ndb/test/ndbapi/old_dirs/indexTest/Makefile
diff --git a/ndb/test/ndbapi/indexTest2/Makefile b/ndb/test/ndbapi/old_dirs/indexTest2/Makefile
index ad78fd51986..ad78fd51986 100644
--- a/ndb/test/ndbapi/indexTest2/Makefile
+++ b/ndb/test/ndbapi/old_dirs/indexTest2/Makefile
diff --git a/ndb/test/ndbapi/interpreterInTup/Makefile b/ndb/test/ndbapi/old_dirs/interpreterInTup/Makefile
index 074adbf674a..074adbf674a 100644
--- a/ndb/test/ndbapi/interpreterInTup/Makefile
+++ b/ndb/test/ndbapi/old_dirs/interpreterInTup/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/Makefile
index af472b1589f..af472b1589f 100644
--- a/ndb/test/ndbapi/lmc-bench/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/Makefile
index 744d6171139..744d6171139 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/generator/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/generator/Makefile
index c1f84a3ef70..c1f84a3ef70 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/generator/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/generator/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/include/dbGenerator.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h
index 2256498e151..2256498e151 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/include/dbGenerator.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/include/testData.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h
index 3db85e7342e..3db85e7342e 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/include/testData.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/include/userInterface.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h
index 94bd1e80ab3..94bd1e80ab3 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/include/userInterface.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/Makefile
index c0b532a8359..c0b532a8359 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h
index 22b7f564490..22b7f564490 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/macros.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp
index 9e6c5e55e73..9e6c5e55e73 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp
diff --git a/ndb/test/ndbapi/lmc-bench/bin/.empty b/ndb/test/ndbapi/old_dirs/lmc-bench/bin/.empty
index e69de29bb2d..e69de29bb2d 100644
--- a/ndb/test/ndbapi/lmc-bench/bin/.empty
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/bin/.empty
diff --git a/ndb/test/ndbapi/lmc-bench/include/ndb_schema.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp
index af08bc2eecd..af08bc2eecd 100644
--- a/ndb/test/ndbapi/lmc-bench/include/ndb_schema.hpp
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp
diff --git a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h b/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h
index 2f4aeb30975..2f4aeb30975 100644
--- a/ndb/test/ndbapi/lmc-bench/include/testDefinitions.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h
diff --git a/ndb/test/ndbapi/lmc-bench/lib/.empty b/ndb/test/ndbapi/old_dirs/lmc-bench/lib/.empty
index e69de29bb2d..e69de29bb2d 100644
--- a/ndb/test/ndbapi/lmc-bench/lib/.empty
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/lib/.empty
diff --git a/ndb/test/ndbapi/lmc-bench/script/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/script/Makefile
index 240b5957573..240b5957573 100644
--- a/ndb/test/ndbapi/lmc-bench/script/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/script/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l-p10.sh b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l-p10.sh
index 1ce3969f9fb..1ce3969f9fb 100755
--- a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l-p10.sh
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l-p10.sh
diff --git a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l.sh b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l.sh
index a5de71395c4..a5de71395c4 100755
--- a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-l.sh
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-l.sh
diff --git a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-p10.sh b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-p10.sh
index 92c853cdd86..92c853cdd86 100755
--- a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench-p10.sh
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench-p10.sh
diff --git a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench.sh b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench.sh
index da8e9d9bf42..da8e9d9bf42 100755
--- a/ndb/test/ndbapi/lmc-bench/script/async-lmc-bench.sh
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/script/async-lmc-bench.sh
diff --git a/ndb/test/ndbapi/lmc-bench/src/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/src/Makefile
index ae7fac9c49b..ae7fac9c49b 100644
--- a/ndb/test/ndbapi/lmc-bench/src/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/src/README b/ndb/test/ndbapi/old_dirs/lmc-bench/src/README
index e81c8ba0051..e81c8ba0051 100644
--- a/ndb/test/ndbapi/lmc-bench/src/README
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/README
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/Makefile
index 143d9ba655e..143d9ba655e 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c
index 7484c7647f5..7484c7647f5 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h
index 824688b6cf9..824688b6cf9 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/dbGenerator.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c
index 4a31db0b4e9..4a31db0b4e9 100644
--- a/ndb/test/ndbapi/lmc-bench/src/generator/mainGenerator.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/include/testData.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h
index 863c230502b..863c230502b 100644
--- a/ndb/test/ndbapi/lmc-bench/src/include/testData.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/include/userInterface.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h
index b70ded87756..b70ded87756 100644
--- a/ndb/test/ndbapi/lmc-bench/src/include/userInterface.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/makevars.linux b/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.linux
index a933669cfe7..a933669cfe7 100644
--- a/ndb/test/ndbapi/lmc-bench/src/makevars.linux
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.linux
diff --git a/ndb/test/ndbapi/lmc-bench/src/makevars.sparc b/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.sparc
index 57ab8bf982f..57ab8bf982f 100644
--- a/ndb/test/ndbapi/lmc-bench/src/makevars.sparc
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/makevars.sparc
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/Makefile
index 2107c948843..2107c948843 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c
index 42fbb52f3b2..42fbb52f3b2 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h
index 1916720e141..1916720e141 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/dbPopulate.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c
index 838ac8a7196..838ac8a7196 100644
--- a/ndb/test/ndbapi/lmc-bench/src/populator/mainPopulate.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/Makefile
index 9bf229ac84c..9bf229ac84c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c
index dd100507016..dd100507016 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/localDbPrepare.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/macros.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h
index 363f247b93f..363f247b93f 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/macros.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp
index b3aaeac822e..b3aaeac822e 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/ndb_error.hpp
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/Makefile b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/Makefile
index 9b1247d44af..9b1247d44af 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/Makefile
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/Makefile
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userHandle.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h
index 1de468d4dad..1de468d4dad 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userHandle.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c
index bacf1861dde..bacf1861dde 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userInterface.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c
index a2f4787bb0c..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/old/userTransaction.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userHandle.h b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h
index 6da76fc2bff..6da76fc2bff 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userHandle.h
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp
index 67c4e037215..fe3c17acbf5 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp
@@ -32,6 +32,7 @@
#include <NdbSleep.h>
#include "ndb_schema.hpp"
#include <NDBT.hpp>
+#include <NdbSchemaCon.hpp>
/***************************************************************
* L O C A L C O N S T A N T S *
@@ -141,13 +142,11 @@ extern int useIndexTables;
int
-create_table_server(Ndb * pNDB){
-
+create_table_server(Ndb * pNdb){
int check;
-
- NdbSchemaCon * MySchemaTransaction = pNDB->startSchemaTransaction();
+ NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if( MySchemaTransaction == NULL )
- error_handler("startSchemaTransaction", pNDB->getNdbError(), 0);
+ error_handler("startSchemaTransaction", pNdb->getNdbError(), 0);
NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( MySchemaOp == NULL )
@@ -246,17 +245,17 @@ create_table_server(Ndb * pNDB){
error_handler("schemaTransaction->execute()",
MySchemaTransaction->getNdbError(), 0);
}
- pNDB->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return 0;
}
int
-create_table_group(Ndb * pNDB){
+create_table_group(Ndb * pNdb){
int check;
- NdbSchemaCon * MySchemaTransaction = pNDB->startSchemaTransaction();
+ NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if( MySchemaTransaction == NULL )
- error_handler("startSchemaTransaction", pNDB->getNdbError(), 0);
+ error_handler("startSchemaTransaction", pNdb->getNdbError(), 0);
NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( MySchemaOp == NULL )
@@ -340,16 +339,16 @@ create_table_group(Ndb * pNDB){
error_handler("schemaTransaction->execute()",
MySchemaTransaction->getNdbError(), 0);
}
- pNDB->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return 0;
}
int
-create_table_subscriber(Ndb * pNDB){
+create_table_subscriber(Ndb * pNdb){
int check;
- NdbSchemaCon * MySchemaTransaction = pNDB->startSchemaTransaction();
+ NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if( MySchemaTransaction == NULL )
- error_handler("startSchemaTransaction", pNDB->getNdbError(), 0);
+ error_handler("startSchemaTransaction", pNdb->getNdbError(), 0);
NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( MySchemaOp == NULL )
@@ -459,16 +458,16 @@ create_table_subscriber(Ndb * pNDB){
error_handler("schemaTransaction->execute()",
MySchemaTransaction->getNdbError(), 0);
}
- pNDB->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return 0;
}
int
-create_table_session(Ndb * pNDB){
+create_table_session(Ndb * pNdb){
int check;
- NdbSchemaCon * MySchemaTransaction = pNDB->startSchemaTransaction();
+ NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb);
if( MySchemaTransaction == NULL )
- error_handler("startSchemaTransaction", pNDB->getNdbError(), 0);
+ error_handler("startSchemaTransaction", pNdb->getNdbError(), 0);
NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp();
if( MySchemaOp == NULL )
@@ -533,29 +532,29 @@ create_table_session(Ndb * pNDB){
error_handler("schemaTransaction->execute()",
MySchemaTransaction->getNdbError(), 0);
}
- pNDB->closeSchemaTransaction(MySchemaTransaction);
+ NdbSchemaCon::closeSchemaTrans(MySchemaTransaction);
return 0;
}
void
-create_table(const char * name, int (* function)(Ndb * pNDB), Ndb* pNDB){
+create_table(const char * name, int (* function)(Ndb * pNdb), Ndb* pNdb){
printf("creating table %s...", name);
- if(pNDB->getDictionary()->getTable(name) != 0){
+ if(pNdb->getDictionary()->getTable(name) != 0){
printf(" it already exists\n");
return;
} else {
printf("\n");
}
- function(pNDB);
+ function(pNdb);
printf("creating table %s... done\n", name);
}
-static int dbCreate(Ndb * pNDB)
+static int dbCreate(Ndb * pNdb)
{
- create_table(SUBSCRIBER_TABLE, create_table_subscriber, pNDB);
- create_table(GROUP_TABLE , create_table_group, pNDB);
- create_table(SESSION_TABLE , create_table_session, pNDB);
- create_table(SERVER_TABLE , create_table_server, pNDB);
+ create_table(SUBSCRIBER_TABLE, create_table_subscriber, pNdb);
+ create_table(GROUP_TABLE , create_table_group, pNdb);
+ create_table(SESSION_TABLE , create_table_session, pNdb);
+ create_table(SERVER_TABLE , create_table_server, pNdb);
return 0;
}
@@ -570,23 +569,23 @@ userDbConnect(uint32 createDb, char *dbName)
{
NdbMutex_Lock(startupMutex);
- Ndb * pNDB = new Ndb("");
+ Ndb * pNdb = new Ndb("");
//printf("Initializing...\n");
- pNDB->init();
+ pNdb->init();
//printf("Waiting...");
- while(pNDB->waitUntilReady() != 0){
+ while(pNdb->waitUntilReady() != 0){
//printf("...");
}
// printf("done\n");
if( createDb )
- dbCreate(pNDB);
+ dbCreate(pNdb);
UserHandle * uh = new UserHandle;
- uh->pNDB = pNDB;
+ uh->pNDB = pNdb;
uh->pCurrTrans = 0;
NdbMutex_Unlock(startupMutex);
diff --git a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c
index a2f4787bb0c..a2f4787bb0c 100644
--- a/ndb/test/ndbapi/lmc-bench/src/user/userTransaction.c
+++ b/ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c
diff --git a/ndb/test/ndbapi/restarter/Makefile b/ndb/test/ndbapi/old_dirs/restarter/Makefile
index 041fbfd82ba..041fbfd82ba 100644
--- a/ndb/test/ndbapi/restarter/Makefile
+++ b/ndb/test/ndbapi/old_dirs/restarter/Makefile
diff --git a/ndb/test/ndbapi/restarter2/Makefile b/ndb/test/ndbapi/old_dirs/restarter2/Makefile
index ba33a2e21dc..ba33a2e21dc 100644
--- a/ndb/test/ndbapi/restarter2/Makefile
+++ b/ndb/test/ndbapi/old_dirs/restarter2/Makefile
diff --git a/ndb/test/ndbapi/restarts/Makefile b/ndb/test/ndbapi/old_dirs/restarts/Makefile
index 9f14b81fae5..9f14b81fae5 100644
--- a/ndb/test/ndbapi/restarts/Makefile
+++ b/ndb/test/ndbapi/old_dirs/restarts/Makefile
diff --git a/ndb/test/ndbapi/ronja/Makefile b/ndb/test/ndbapi/old_dirs/ronja/Makefile
index a11a27c5fd7..a11a27c5fd7 100644
--- a/ndb/test/ndbapi/ronja/Makefile
+++ b/ndb/test/ndbapi/old_dirs/ronja/Makefile
diff --git a/ndb/test/ndbapi/ronja/benchronja/Makefile b/ndb/test/ndbapi/old_dirs/ronja/benchronja/Makefile
index f0521c3ba77..f0521c3ba77 100644
--- a/ndb/test/ndbapi/ronja/benchronja/Makefile
+++ b/ndb/test/ndbapi/old_dirs/ronja/benchronja/Makefile
diff --git a/ndb/test/ndbapi/ronja/initronja/Makefile b/ndb/test/ndbapi/old_dirs/ronja/initronja/Makefile
index dd66dd813d1..dd66dd813d1 100644
--- a/ndb/test/ndbapi/ronja/initronja/Makefile
+++ b/ndb/test/ndbapi/old_dirs/ronja/initronja/Makefile
diff --git a/ndb/test/ndbapi/telco/Makefile b/ndb/test/ndbapi/old_dirs/telco/Makefile
index 8f82c714119..8f82c714119 100644
--- a/ndb/test/ndbapi/telco/Makefile
+++ b/ndb/test/ndbapi/old_dirs/telco/Makefile
diff --git a/ndb/test/ndbapi/telco/readme b/ndb/test/ndbapi/old_dirs/telco/readme
index 627b4256eef..627b4256eef 100644
--- a/ndb/test/ndbapi/telco/readme
+++ b/ndb/test/ndbapi/old_dirs/telco/readme
diff --git a/ndb/test/ndbapi/testBackup/Makefile b/ndb/test/ndbapi/old_dirs/testBackup/Makefile
index ce0e404803c..ce0e404803c 100644
--- a/ndb/test/ndbapi/testBackup/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testBackup/Makefile
diff --git a/ndb/test/ndbapi/testBasic/Makefile b/ndb/test/ndbapi/old_dirs/testBasic/Makefile
index 755b19939cb..755b19939cb 100644
--- a/ndb/test/ndbapi/testBasic/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testBasic/Makefile
diff --git a/ndb/test/ndbapi/testBlobs/Makefile b/ndb/test/ndbapi/old_dirs/testBlobs/Makefile
index cc5bb629c17..cc5bb629c17 100644
--- a/ndb/test/ndbapi/testBlobs/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testBlobs/Makefile
diff --git a/ndb/test/ndbapi/testDataBuffers/Makefile b/ndb/test/ndbapi/old_dirs/testDataBuffers/Makefile
index 181fbc829d4..181fbc829d4 100644
--- a/ndb/test/ndbapi/testDataBuffers/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testDataBuffers/Makefile
diff --git a/ndb/test/ndbapi/testDict/Makefile b/ndb/test/ndbapi/old_dirs/testDict/Makefile
index 75d493c3424..75d493c3424 100644
--- a/ndb/test/ndbapi/testDict/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testDict/Makefile
diff --git a/ndb/test/ndbapi/testGrep/Makefile b/ndb/test/ndbapi/old_dirs/testGrep/Makefile
index 34fdd7113d0..34fdd7113d0 100644
--- a/ndb/test/ndbapi/testGrep/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testGrep/Makefile
diff --git a/ndb/test/ndbapi/testGrep/verify/Makefile b/ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile
index 4e6182de6b2..4e6182de6b2 100644
--- a/ndb/test/ndbapi/testGrep/verify/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile
diff --git a/ndb/test/ndbapi/testIndex/Makefile b/ndb/test/ndbapi/old_dirs/testIndex/Makefile
index e5cd4542c9c..e5cd4542c9c 100644
--- a/ndb/test/ndbapi/testIndex/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testIndex/Makefile
diff --git a/ndb/test/ndbapi/testInterpreter/Makefile b/ndb/test/ndbapi/old_dirs/testInterpreter/Makefile
index e84287a1b16..e84287a1b16 100644
--- a/ndb/test/ndbapi/testInterpreter/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testInterpreter/Makefile
diff --git a/ndb/test/ndbapi/testMgm/Makefile b/ndb/test/ndbapi/old_dirs/testMgm/Makefile
index be50d3dae7e..be50d3dae7e 100644
--- a/ndb/test/ndbapi/testMgm/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testMgm/Makefile
diff --git a/ndb/test/ndbapi/testNdbApi/Makefile b/ndb/test/ndbapi/old_dirs/testNdbApi/Makefile
index 3bb3cba427e..3bb3cba427e 100644
--- a/ndb/test/ndbapi/testNdbApi/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testNdbApi/Makefile
diff --git a/ndb/test/ndbapi/testNodeRestart/Makefile b/ndb/test/ndbapi/old_dirs/testNodeRestart/Makefile
index 8c13ab3beb4..8c13ab3beb4 100644
--- a/ndb/test/ndbapi/testNodeRestart/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testNodeRestart/Makefile
diff --git a/ndb/test/ndbapi/testOIBasic/Makefile b/ndb/test/ndbapi/old_dirs/testOIBasic/Makefile
index 1bbbcf1d17e..1bbbcf1d17e 100644
--- a/ndb/test/ndbapi/testOIBasic/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testOIBasic/Makefile
diff --git a/ndb/test/ndbapi/testOIBasic/times.txt b/ndb/test/ndbapi/old_dirs/testOIBasic/times.txt
index 641e9ddb4bf..641e9ddb4bf 100644
--- a/ndb/test/ndbapi/testOIBasic/times.txt
+++ b/ndb/test/ndbapi/old_dirs/testOIBasic/times.txt
diff --git a/ndb/test/ndbapi/testOperations/Makefile b/ndb/test/ndbapi/old_dirs/testOperations/Makefile
index 25546ade639..25546ade639 100644
--- a/ndb/test/ndbapi/testOperations/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testOperations/Makefile
diff --git a/ndb/test/ndbapi/testOrderedIndex/Makefile b/ndb/test/ndbapi/old_dirs/testOrderedIndex/Makefile
index d8899a37895..d8899a37895 100644
--- a/ndb/test/ndbapi/testOrderedIndex/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testOrderedIndex/Makefile
diff --git a/ndb/test/ndbapi/testRestartGci/Makefile b/ndb/test/ndbapi/old_dirs/testRestartGci/Makefile
index 24f449b747d..24f449b747d 100644
--- a/ndb/test/ndbapi/testRestartGci/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testRestartGci/Makefile
diff --git a/ndb/test/ndbapi/testScan/Makefile b/ndb/test/ndbapi/old_dirs/testScan/Makefile
index fe48f5bc926..fe48f5bc926 100644
--- a/ndb/test/ndbapi/testScan/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testScan/Makefile
diff --git a/ndb/test/ndbapi/testScanInterpreter/Makefile b/ndb/test/ndbapi/old_dirs/testScanInterpreter/Makefile
index c7d96494148..c7d96494148 100644
--- a/ndb/test/ndbapi/testScanInterpreter/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testScanInterpreter/Makefile
diff --git a/ndb/test/ndbapi/testSystemRestart/Makefile b/ndb/test/ndbapi/old_dirs/testSystemRestart/Makefile
index 7a306eb313d..7a306eb313d 100644
--- a/ndb/test/ndbapi/testSystemRestart/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testSystemRestart/Makefile
diff --git a/ndb/test/ndbapi/testTimeout/Makefile b/ndb/test/ndbapi/old_dirs/testTimeout/Makefile
index 01a9df9887f..01a9df9887f 100644
--- a/ndb/test/ndbapi/testTimeout/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testTimeout/Makefile
diff --git a/ndb/test/ndbapi/testTransactions/Makefile b/ndb/test/ndbapi/old_dirs/testTransactions/Makefile
index 0279a526923..0279a526923 100644
--- a/ndb/test/ndbapi/testTransactions/Makefile
+++ b/ndb/test/ndbapi/old_dirs/testTransactions/Makefile
diff --git a/ndb/test/ndbapi/test_event/Makefile b/ndb/test/ndbapi/old_dirs/test_event/Makefile
index 6299fa47845..6299fa47845 100644
--- a/ndb/test/ndbapi/test_event/Makefile
+++ b/ndb/test/ndbapi/old_dirs/test_event/Makefile
diff --git a/ndb/test/ndbapi/vw_test/Makefile b/ndb/test/ndbapi/old_dirs/vw_test/Makefile
index 144873dcc69..144873dcc69 100644
--- a/ndb/test/ndbapi/vw_test/Makefile
+++ b/ndb/test/ndbapi/old_dirs/vw_test/Makefile
diff --git a/ndb/test/ndbapi/vw_test/bcd.h b/ndb/test/ndbapi/old_dirs/vw_test/bcd.h
index d0aaffbd8b7..d0aaffbd8b7 100644
--- a/ndb/test/ndbapi/vw_test/bcd.h
+++ b/ndb/test/ndbapi/old_dirs/vw_test/bcd.h
diff --git a/ndb/test/ndbapi/vw_test/script/client_start b/ndb/test/ndbapi/old_dirs/vw_test/script/client_start
index 2965be6fbb5..2965be6fbb5 100644
--- a/ndb/test/ndbapi/vw_test/script/client_start
+++ b/ndb/test/ndbapi/old_dirs/vw_test/script/client_start
diff --git a/ndb/test/ndbapi/vw_test/utv.h b/ndb/test/ndbapi/old_dirs/vw_test/utv.h
index 6f378e5595b..6f378e5595b 100644
--- a/ndb/test/ndbapi/vw_test/utv.h
+++ b/ndb/test/ndbapi/old_dirs/vw_test/utv.h
diff --git a/ndb/test/ndbapi/vw_test/vcdrfunc.h b/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h
index 3c5444d733b..3c5444d733b 100644
--- a/ndb/test/ndbapi/vw_test/vcdrfunc.h
+++ b/ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h
diff --git a/ndb/test/ndbapi/restarter/restarter.cpp b/ndb/test/ndbapi/restarter.cpp
index 9a522f5dcac..9a522f5dcac 100644
--- a/ndb/test/ndbapi/restarter/restarter.cpp
+++ b/ndb/test/ndbapi/restarter.cpp
diff --git a/ndb/test/ndbapi/restarter2/restarter2.cpp b/ndb/test/ndbapi/restarter2.cpp
index f2bcf6f8e7b..f2bcf6f8e7b 100644
--- a/ndb/test/ndbapi/restarter2/restarter2.cpp
+++ b/ndb/test/ndbapi/restarter2.cpp
diff --git a/ndb/test/ndbapi/restarts/restarts.cpp b/ndb/test/ndbapi/restarts.cpp
index 0ec2883d53c..0ec2883d53c 100644
--- a/ndb/test/ndbapi/restarts/restarts.cpp
+++ b/ndb/test/ndbapi/restarts.cpp
diff --git a/ndb/test/ndbapi/vw_test/size.cpp b/ndb/test/ndbapi/size.cpp
index c506771ebde..c506771ebde 100644
--- a/ndb/test/ndbapi/vw_test/size.cpp
+++ b/ndb/test/ndbapi/size.cpp
diff --git a/ndb/test/ndbapi/testBackup/testBackup.cpp b/ndb/test/ndbapi/testBackup.cpp
index f9ae7ffcbbc..129eced54b0 100644
--- a/ndb/test/ndbapi/testBackup/testBackup.cpp
+++ b/ndb/test/ndbapi/testBackup.cpp
@@ -205,8 +205,7 @@ int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
-
-#include "../bank/Bank.hpp"
+#include "bank/Bank.hpp"
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
diff --git a/ndb/test/ndbapi/testBasic/testBasic.cpp b/ndb/test/ndbapi/testBasic.cpp
index 64dfe492c2c..64dfe492c2c 100644
--- a/ndb/test/ndbapi/testBasic/testBasic.cpp
+++ b/ndb/test/ndbapi/testBasic.cpp
diff --git a/ndb/test/ndbapi/basicAsynch/testBasicAsynch.cpp b/ndb/test/ndbapi/testBasicAsynch.cpp
index a97920e53da..a97920e53da 100755..100644
--- a/ndb/test/ndbapi/basicAsynch/testBasicAsynch.cpp
+++ b/ndb/test/ndbapi/testBasicAsynch.cpp
diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp
new file mode 100644
index 00000000000..001ec83630a
--- /dev/null
+++ b/ndb/test/ndbapi/testBlobs.cpp
@@ -0,0 +1,1213 @@
+/* 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 */
+
+/*
+ * testBlobs
+ */
+
+#include <ndb_global.h>
+#include <NdbMain.h>
+#include <NdbOut.hpp>
+#include <NdbTest.hpp>
+
+struct Bcol {
+ bool m_nullable;
+ unsigned m_inline;
+ unsigned m_partsize;
+ unsigned m_stripe;
+ char m_btname[NdbBlob::BlobTableNameSize];
+ Bcol(bool a, unsigned b, unsigned c, unsigned d) :
+ m_nullable(a),
+ m_inline(b),
+ m_partsize(c),
+ m_stripe(d)
+ {}
+};
+
+struct Opt {
+ bool m_core;
+ bool m_dbg;
+ bool m_dbgall;
+ bool m_full;
+ unsigned m_loop;
+ unsigned m_parts;
+ unsigned m_rows;
+ unsigned m_seed;
+ char m_skip[255];
+ // metadata
+ const char* m_tname;
+ const char* m_x1name; // hash index
+ const char* m_x2name; // ordered index
+ unsigned m_pk1off;
+ unsigned m_pk2len;
+ bool m_oneblob;
+ Bcol m_blob1;
+ Bcol m_blob2;
+ // bugs
+ int m_bug;
+ int (*m_bugtest)();
+ Opt() :
+ m_core(false),
+ m_dbg(false),
+ m_dbgall(false),
+ m_full(false),
+ m_loop(1),
+ m_parts(10),
+ m_rows(100),
+ m_seed(0),
+ // metadata
+ m_tname("TBLOB1"),
+ m_x1name("TBLOB1X1"),
+ m_x2name("TBLOB1X2"),
+ m_pk1off(0x12340000),
+ m_pk2len(55),
+ m_oneblob(false),
+ m_blob1(false, 7, 1137, 10),
+ m_blob2(true, 99, 55, 1),
+ // bugs
+ m_bug(0),
+ m_bugtest(0) {
+ memset(m_skip, false, sizeof(m_skip));
+ }
+};
+
+static const unsigned g_max_pk2len = 256;
+
+static void
+printusage()
+{
+ Opt d;
+ ndbout
+ << "usage: testBlobs options [default/max]" << endl
+ << " -core dump core on error" << endl
+ << " -dbg print debug" << endl
+ << " -dbgall print also NDB API debug (if compiled in)" << endl
+ << " -full read/write only full blob values" << endl
+ << " -inline read/write only blobs which fit inline" << endl
+ << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl
+ << " -parts N max parts in blob value [" << d.m_parts << "]" << endl
+ << " -rows N number of rows [" << d.m_rows << "]" << endl
+ << " -seed N random seed 0=loop number [" << d.m_seed << "]" << endl
+ << " -skip xxx skip these tests (see list)" << endl
+ << "metadata" << endl
+ << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl
+ << " -oneblob only 1 blob attribute [default 2]" << endl
+ << "testcases for -skip" << endl
+ << " k primary key ops" << endl
+ << " i hash index ops" << endl
+ << " s table scans" << endl
+ << " r ordered index scans" << endl
+ << " u update blob value" << endl
+ << " v getValue / setValue" << endl
+ << " w readData / writeData" << endl
+ << "bug tests (no blob test)" << endl
+ << " -bug 4088 ndb api hang with mixed ops on index table" << endl
+ << " -bug 2222 delete + write gives 626" << endl
+ << " -bug 3333 acc crash on delete and long key" << endl
+ ;
+}
+
+static Opt g_opt;
+
+static char&
+skip(unsigned x)
+{
+ assert(x < sizeof(g_opt.m_skip));
+ return g_opt.m_skip[x];
+}
+
+static Ndb* g_ndb = 0;
+static NdbDictionary::Dictionary* g_dic = 0;
+static NdbConnection* g_con = 0;
+static NdbOperation* g_opr = 0;
+static NdbIndexOperation* g_opx = 0;
+static NdbScanOperation* g_ops = 0;
+static NdbBlob* g_bh1 = 0;
+static NdbBlob* g_bh2 = 0;
+static bool g_printerror = true;
+
+static void
+printerror(int line, const char* msg)
+{
+ ndbout << "line " << line << ": " << msg << " failed" << endl;
+ if (! g_printerror) {
+ return;
+ }
+ if (g_ndb != 0 && g_ndb->getNdbError().code != 0) {
+ ndbout << "ndb: " << g_ndb->getNdbError() << endl;
+ }
+ if (g_dic != 0 && g_dic->getNdbError().code != 0) {
+ ndbout << "dic: " << g_dic->getNdbError() << endl;
+ }
+ if (g_con != 0 && g_con->getNdbError().code != 0) {
+ ndbout << "con: " << g_con->getNdbError() << endl;
+ if (g_opr != 0 && g_opr->getNdbError().code != 0) {
+ ndbout << "opr: table=" << g_opr->getTableName() << " " << g_opr->getNdbError() << endl;
+ }
+ if (g_opx != 0 && g_opx->getNdbError().code != 0) {
+ ndbout << "opx: table=" << g_opx->getTableName() << " " << g_opx->getNdbError() << endl;
+ }
+ if (g_ops != 0 && g_ops->getNdbError().code != 0) {
+ ndbout << "ops: table=" << g_ops->getTableName() << " " << g_ops->getNdbError() << endl;
+ }
+ NdbOperation* ope = g_con->getNdbErrorOperation();
+ if (ope != 0 && ope->getNdbError().code != 0) {
+ if (ope != g_opr && ope != g_opx && ope != g_ops)
+ ndbout << "ope: table=" << ope->getTableName() << " " << ope->getNdbError() << endl;
+ }
+ }
+ if (g_bh1 != 0 && g_bh1->getNdbError().code != 0) {
+ ndbout << "bh1: " << g_bh1->getNdbError() << endl;
+ }
+ if (g_bh2 != 0 && g_bh2->getNdbError().code != 0) {
+ ndbout << "bh2: " << g_bh2->getNdbError() << endl;
+ }
+ if (g_opt.m_core) {
+ abort();
+ }
+ g_printerror = false;
+}
+
+#define CHK(x) \
+ do { \
+ if (x) break; \
+ printerror(__LINE__, #x); return -1; \
+ } while (0)
+#define DBG(x) \
+ do { \
+ if (! g_opt.m_dbg) break; \
+ ndbout << "line " << __LINE__ << " " << x << endl; \
+ } while (0)
+
+static int
+dropTable()
+{
+ NdbDictionary::Table tab(g_opt.m_tname);
+ if (g_dic->getTable(g_opt.m_tname) != 0)
+ CHK(g_dic->dropTable(tab) == 0);
+ return 0;
+}
+
+static int
+createTable()
+{
+ NdbDictionary::Table tab(g_opt.m_tname);
+ // col PK1 - Uint32
+ { NdbDictionary::Column col("PK1");
+ col.setType(NdbDictionary::Column::Unsigned);
+ col.setPrimaryKey(true);
+ tab.addColumn(col);
+ }
+ // col BL1 - Blob not-nullable
+ { NdbDictionary::Column col("BL1");
+ const Bcol& b = g_opt.m_blob1;
+ col.setType(NdbDictionary::Column::Blob);
+ col.setInlineSize(b.m_inline);
+ col.setPartSize(b.m_partsize);
+ col.setStripeSize(b.m_stripe);
+ tab.addColumn(col);
+ }
+ // col PK2 - Char[55]
+ if (g_opt.m_pk2len != 0)
+ { NdbDictionary::Column col("PK2");
+ col.setType(NdbDictionary::Column::Char);
+ col.setLength(g_opt.m_pk2len);
+ col.setPrimaryKey(true);
+ tab.addColumn(col);
+ }
+ // col BL2 - Clob nullable
+ if (! g_opt.m_oneblob)
+ { NdbDictionary::Column col("BL2");
+ const Bcol& b = g_opt.m_blob2;
+ col.setType(NdbDictionary::Column::Clob);
+ col.setNullable(true);
+ col.setInlineSize(b.m_inline);
+ col.setPartSize(b.m_partsize);
+ col.setStripeSize(b.m_stripe);
+ tab.addColumn(col);
+ }
+ // create table
+ CHK(g_dic->createTable(tab) == 0);
+ // unique hash index on PK2
+ if (g_opt.m_pk2len != 0)
+ { NdbDictionary::Index idx(g_opt.m_x1name);
+ idx.setType(NdbDictionary::Index::UniqueHashIndex);
+ idx.setTable(g_opt.m_tname);
+ idx.addColumnName("PK2");
+ CHK(g_dic->createIndex(idx) == 0);
+ }
+ // ordered index on PK2
+ if (g_opt.m_pk2len != 0)
+ { NdbDictionary::Index idx(g_opt.m_x2name);
+ idx.setType(NdbDictionary::Index::OrderedIndex);
+ idx.setLogging(false);
+ idx.setTable(g_opt.m_tname);
+ idx.addColumnName("PK2");
+ CHK(g_dic->createIndex(idx) == 0);
+ }
+ return 0;
+}
+
+// tuples
+
+struct Bval {
+ char* m_val;
+ unsigned m_len;
+ char* m_buf;
+ unsigned m_buflen;
+ Bval() :
+ m_val(0),
+ m_len(0),
+ m_buf(0), // read/write buffer
+ m_buflen(0)
+ {}
+ ~Bval() { delete [] m_val; delete [] m_buf; }
+ void alloc(unsigned buflen) {
+ m_buflen = buflen;
+ delete [] m_buf;
+ m_buf = new char [m_buflen];
+ trash();
+ }
+ void copy(const Bval& v) {
+ m_len = v.m_len;
+ delete [] m_val;
+ if (v.m_val == 0)
+ m_val = 0;
+ else
+ m_val = (char*)memcpy(new char [m_len], v.m_val, m_len);
+ }
+ void trash() const {
+ assert(m_buf != 0);
+ memset(m_buf, 'x', m_buflen);
+ }
+private:
+ Bval(const Bval&);
+ Bval& operator=(const Bval&);
+};
+
+struct Tup {
+ bool m_exists; // exists in table
+ Uint32 m_pk1; // primary keys concatenated like keyinfo
+ char m_pk2[g_max_pk2len + 1];
+ Bval m_blob1;
+ Bval m_blob2;
+ Tup() :
+ m_exists(false)
+ {}
+ ~Tup() { }
+ // alloc buffers of max size
+ void alloc() {
+ m_blob1.alloc(g_opt.m_blob1.m_inline + g_opt.m_blob1.m_partsize * g_opt.m_parts);
+ m_blob2.alloc(g_opt.m_blob2.m_inline + g_opt.m_blob2.m_partsize * g_opt.m_parts);
+ }
+ void copy(const Tup& tup) {
+ assert(m_pk1 == tup.m_pk1);
+ m_blob1.copy(tup.m_blob1);
+ m_blob2.copy(tup.m_blob2);
+ }
+private:
+ Tup(const Tup&);
+ Tup& operator=(const Tup&);
+};
+
+static Tup* g_tups;
+
+static unsigned
+urandom(unsigned n)
+{
+ return n == 0 ? 0 : random() % n;
+}
+
+static void
+calcBval(const Bcol& b, Bval& v, bool keepsize)
+{
+ if (b.m_nullable && urandom(10) == 0) {
+ v.m_len = 0;
+ delete v.m_val;
+ v.m_val = 0;
+ v.m_buf = new char [1];
+ } else {
+ if (keepsize && v.m_val != 0)
+ ;
+ else if (urandom(10) == 0)
+ v.m_len = urandom(b.m_inline);
+ else
+ v.m_len = urandom(b.m_inline + g_opt.m_parts * b.m_partsize + 1);
+ delete v.m_val;
+ v.m_val = new char [v.m_len + 1];
+ for (unsigned i = 0; i < v.m_len; i++)
+ v.m_val[i] = 'a' + urandom(25);
+ v.m_val[v.m_len] = 0;
+ v.m_buf = new char [v.m_len];
+ }
+ v.m_buflen = v.m_len;
+ v.trash();
+}
+
+static void
+calcTups(bool keepsize)
+{
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ tup.m_pk1 = g_opt.m_pk1off + k;
+ for (unsigned i = 0, n = k; i < g_opt.m_pk2len; i++) {
+ if (n != 0) {
+ tup.m_pk2[i] = '0' + n % 10;
+ n = n / 10;
+ } else {
+ tup.m_pk2[i] = 'a' + i % 26;
+ }
+ }
+ calcBval(g_opt.m_blob1, tup.m_blob1, keepsize);
+ if (! g_opt.m_oneblob)
+ calcBval(g_opt.m_blob2, tup.m_blob2, keepsize);
+ }
+}
+
+// blob handle ops
+
+static int
+getBlobLength(NdbBlob* h, unsigned& len)
+{
+ Uint64 len2 = (unsigned)-1;
+ CHK(h->getLength(len2) == 0);
+ len = (unsigned)len2;
+ assert(len == len2);
+ return 0;
+}
+
+static int
+setBlobValue(NdbBlob* h, const Bval& v)
+{
+ bool null = (v.m_val == 0);
+ bool isNull;
+ unsigned len;
+ DBG("set " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null);
+ if (null) {
+ CHK(h->setNull() == 0);
+ isNull = false;
+ CHK(h->getNull(isNull) == 0 && isNull == true);
+ CHK(getBlobLength(h, len) == 0 && len == 0);
+ } else {
+ CHK(h->setValue(v.m_val, v.m_len) == 0);
+ CHK(h->getNull(isNull) == 0 && isNull == false);
+ CHK(getBlobLength(h, len) == 0 && len == v.m_len);
+ }
+ return 0;
+}
+
+static int
+getBlobValue(NdbBlob* h, const Bval& v)
+{
+ bool null = (v.m_val == 0);
+ DBG("get " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null);
+ CHK(h->getValue(v.m_buf, v.m_buflen) == 0);
+ return 0;
+}
+
+static int
+getBlobValue(const Tup& tup)
+{
+ CHK(getBlobValue(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(getBlobValue(g_bh2, tup.m_blob2) == 0);
+ return 0;
+}
+
+static int
+verifyBlobValue(NdbBlob* h, const Bval& v)
+{
+ bool null = (v.m_val == 0);
+ bool isNull;
+ unsigned len;
+ if (null) {
+ isNull = false;
+ CHK(h->getNull(isNull) == 0 && isNull == true);
+ CHK(getBlobLength(h, len) == 0 && len == 0);
+ } else {
+ isNull = true;
+ CHK(h->getNull(isNull) == 0 && isNull == false);
+ CHK(getBlobLength(h, len) == 0 && len == v.m_len);
+ for (unsigned i = 0; i < v.m_len; i++)
+ CHK(v.m_val[i] == v.m_buf[i]);
+ }
+ return 0;
+}
+
+static int
+verifyBlobValue(const Tup& tup)
+{
+ CHK(verifyBlobValue(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(verifyBlobValue(g_bh2, tup.m_blob2) == 0);
+ return 0;
+}
+
+static int
+writeBlobData(NdbBlob* h, const Bval& v)
+{
+ bool null = (v.m_val == 0);
+ bool isNull;
+ unsigned len;
+ DBG("write " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null);
+ if (null) {
+ CHK(h->setNull() == 0);
+ isNull = false;
+ CHK(h->getNull(isNull) == 0 && isNull == true);
+ CHK(getBlobLength(h, len) == 0 && len == 0);
+ } else {
+ unsigned n = 0;
+ do {
+ unsigned m = g_opt.m_full ? v.m_len : urandom(v.m_len + 1);
+ if (m > v.m_len - n)
+ m = v.m_len - n;
+ DBG("write pos=" << n << " cnt=" << m);
+ CHK(h->writeData(v.m_val + n, m) == 0);
+ n += m;
+ } while (n < v.m_len);
+ assert(n == v.m_len);
+ isNull = true;
+ CHK(h->getNull(isNull) == 0 && isNull == false);
+ CHK(getBlobLength(h, len) == 0 && len == v.m_len);
+ }
+ return 0;
+}
+
+static int
+readBlobData(NdbBlob* h, const Bval& v)
+{
+ bool null = (v.m_val == 0);
+ bool isNull;
+ unsigned len;
+ DBG("read " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null);
+ if (null) {
+ isNull = false;
+ CHK(h->getNull(isNull) == 0 && isNull == true);
+ CHK(getBlobLength(h, len) == 0 && len == 0);
+ } else {
+ isNull = true;
+ CHK(h->getNull(isNull) == 0 && isNull == false);
+ CHK(getBlobLength(h, len) == 0 && len == v.m_len);
+ v.trash();
+ unsigned n = 0;
+ while (n < v.m_len) {
+ unsigned m = g_opt.m_full ? v.m_len : urandom(v.m_len + 1);
+ if (m > v.m_len - n)
+ m = v.m_len - n;
+ DBG("read pos=" << n << " cnt=" << m);
+ const unsigned m2 = m;
+ CHK(h->readData(v.m_buf + n, m) == 0);
+ CHK(m2 == m);
+ n += m;
+ }
+ assert(n == v.m_len);
+ // need to execute to see the data
+ CHK(g_con->execute(NoCommit) == 0);
+ for (unsigned i = 0; i < v.m_len; i++)
+ CHK(v.m_val[i] == v.m_buf[i]);
+ }
+ return 0;
+}
+
+static int
+readBlobData(const Tup& tup)
+{
+ CHK(readBlobData(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(readBlobData(g_bh2, tup.m_blob2) == 0);
+ return 0;
+}
+
+// verify blob data
+
+static int
+verifyHeadInline(const Bcol& c, const Bval& v, NdbRecAttr* ra)
+{
+ if (v.m_val == 0) {
+ CHK(ra->isNULL() == 1);
+ } else {
+ CHK(ra->isNULL() == 0);
+ CHK(ra->u_64_value() == v.m_len);
+ }
+ return 0;
+}
+
+static int
+verifyHeadInline(const Tup& tup)
+{
+ DBG("verifyHeadInline pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->readTuple() == 0);
+ CHK(g_opr->equal("PK1", tup.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ NdbRecAttr* ra1;
+ NdbRecAttr* ra2;
+ CHK((ra1 = g_opr->getValue("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((ra2 = g_opr->getValue("BL2")) != 0);
+ if (tup.m_exists) {
+ CHK(g_con->execute(Commit) == 0);
+ DBG("verifyHeadInline BL1");
+ CHK(verifyHeadInline(g_opt.m_blob1, tup.m_blob1, ra1) == 0);
+ if (! g_opt.m_oneblob) {
+ DBG("verifyHeadInline BL2");
+ CHK(verifyHeadInline(g_opt.m_blob2, tup.m_blob2, ra2) == 0);
+ }
+ } else {
+ CHK(g_con->execute(Commit) == -1 && g_con->getNdbError().code == 626);
+ }
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ return 0;
+}
+
+static int
+verifyBlobTable(const Bcol& b, const Bval& v, Uint32 pk1, bool exists)
+{
+ DBG("verify " << b.m_btname << " pk1=" << pk1);
+ NdbRecAttr* ra_pk;
+ NdbRecAttr* ra_part;
+ NdbRecAttr* ra_data;
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(b.m_btname)) != 0);
+ CHK(g_opr->openScanRead() == 0);
+ CHK((ra_pk = g_opr->getValue("PK")) != 0);
+ CHK((ra_part = g_opr->getValue("PART")) != 0);
+ CHK((ra_data = g_opr->getValue("DATA")) != 0);
+ CHK(g_con->executeScan() == 0);
+ unsigned partcount;
+ if (! exists || v.m_len <= b.m_inline)
+ partcount = 0;
+ else
+ partcount = (v.m_len - b.m_inline + b.m_partsize - 1) / b.m_partsize;
+ char* seen = new char [partcount];
+ memset(seen, 0, partcount);
+ while (1) {
+ int ret;
+ CHK((ret = g_con->nextScanResult()) == 0 || ret == 1);
+ if (ret == 1)
+ break;
+ if (pk1 != ra_pk->u_32_value())
+ continue;
+ Uint32 part = ra_part->u_32_value();
+ DBG("part " << part << " of " << partcount);
+ const char* data = ra_data->aRef();
+ CHK(part < partcount && ! seen[part]);
+ seen[part] = 1;
+ unsigned n = b.m_inline + part * b.m_partsize;
+ assert(exists && v.m_val != 0 && n < v.m_len);
+ unsigned m = v.m_len - n;
+ if (m > b.m_partsize)
+ m = b.m_partsize;
+ CHK(memcmp(data, v.m_val + n, m) == 0);
+ }
+ for (unsigned i = 0; i < partcount; i++)
+ CHK(seen[i] == 1);
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ return 0;
+}
+
+static int
+verifyBlobTable(const Tup& tup)
+{
+ CHK(verifyBlobTable(g_opt.m_blob1, tup.m_blob1, tup.m_pk1, tup.m_exists) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(verifyBlobTable(g_opt.m_blob2, tup.m_blob2, tup.m_pk1, tup.m_exists) == 0);
+ return 0;
+}
+
+static int
+verifyBlob()
+{
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ const Tup& tup = g_tups[k];
+ DBG("verifyBlob pk1=" << tup.m_pk1);
+ CHK(verifyHeadInline(tup) == 0);
+ CHK(verifyBlobTable(tup) == 0);
+ }
+ return 0;
+}
+
+// operations
+
+static int
+insertPk(bool rw)
+{
+ DBG("--- insertPk ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("insertPk pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->insertTuple() == 0);
+ CHK(g_opr->equal("PK1", tup.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(setBlobValue(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(setBlobValue(g_bh2, tup.m_blob2) == 0);
+ } else {
+ // non-nullable must be set
+ CHK(g_bh1->setValue("", 0) == 0);
+ CHK(g_con->execute(NoCommit) == 0);
+ CHK(writeBlobData(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(writeBlobData(g_bh2, tup.m_blob2) == 0);
+ }
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ tup.m_exists = true;
+ }
+ return 0;
+}
+
+static int
+updatePk(bool rw)
+{
+ DBG("--- updatePk ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("updatePk pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->updateTuple() == 0);
+ CHK(g_opr->equal("PK1", tup.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(setBlobValue(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(setBlobValue(g_bh2, tup.m_blob2) == 0);
+ } else {
+ CHK(g_con->execute(NoCommit) == 0);
+ CHK(writeBlobData(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(writeBlobData(g_bh2, tup.m_blob2) == 0);
+ }
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ tup.m_exists = true;
+ }
+ return 0;
+}
+
+static int
+updateIdx(bool rw)
+{
+ DBG("--- updateIdx ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("updateIdx pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0);
+ CHK(g_opx->updateTuple() == 0);
+ CHK(g_opx->equal("PK2", tup.m_pk2) == 0);
+ CHK((g_bh1 = g_opx->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_opx->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(setBlobValue(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(setBlobValue(g_bh2, tup.m_blob2) == 0);
+ } else {
+ CHK(g_con->execute(NoCommit) == 0);
+ CHK(writeBlobData(g_bh1, tup.m_blob1) == 0);
+ if (! g_opt.m_oneblob)
+ CHK(writeBlobData(g_bh2, tup.m_blob2) == 0);
+ }
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_opx = 0;
+ g_con = 0;
+ tup.m_exists = true;
+ }
+ return 0;
+}
+
+static int
+readPk(bool rw)
+{
+ DBG("--- readPk ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("readPk pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->readTuple() == 0);
+ CHK(g_opr->equal("PK1", tup.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(getBlobValue(tup) == 0);
+ } else {
+ CHK(g_con->execute(NoCommit) == 0);
+ CHK(readBlobData(tup) == 0);
+ }
+ CHK(g_con->execute(Commit) == 0);
+ if (! rw) {
+ CHK(verifyBlobValue(tup) == 0);
+ }
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ }
+ return 0;
+}
+
+static int
+readIdx(bool rw)
+{
+ DBG("--- readIdx ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("readIdx pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0);
+ CHK(g_opx->readTuple() == 0);
+ CHK(g_opx->equal("PK2", tup.m_pk2) == 0);
+ CHK((g_bh1 = g_opx->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_opx->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(getBlobValue(tup) == 0);
+ } else {
+ CHK(g_con->execute(NoCommit) == 0);
+ CHK(readBlobData(tup) == 0);
+ }
+ CHK(g_con->execute(Commit) == 0);
+ if (! rw) {
+ CHK(verifyBlobValue(tup) == 0);
+ }
+ g_ndb->closeTransaction(g_con);
+ g_opx = 0;
+ g_con = 0;
+ }
+ return 0;
+}
+
+static int
+readScan(bool rw, bool idx)
+{
+ const char* func = ! idx ? "scan read table" : "scan read index";
+ DBG("--- " << func << " ---");
+ Tup tup;
+ tup.alloc(); // allocate buffers
+ NdbResultSet* rs;
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ if (! idx) {
+ CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_tname)) != 0);
+ } else {
+ CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_x2name, g_opt.m_tname)) != 0);
+ }
+ CHK((rs = g_ops->readTuples(240, NdbScanOperation::LM_Exclusive)) != 0);
+ CHK(g_ops->getValue("PK1", (char*)&tup.m_pk1) != 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_ops->getValue("PK2", tup.m_pk2) != 0);
+ CHK((g_bh1 = g_ops->getBlobHandle("BL1")) != 0);
+ if (! g_opt.m_oneblob)
+ CHK((g_bh2 = g_ops->getBlobHandle("BL2")) != 0);
+ if (! rw) {
+ CHK(getBlobValue(tup) == 0);
+ }
+ CHK(g_con->execute(NoCommit) == 0);
+ unsigned rows = 0;
+ while (1) {
+ int ret;
+ tup.m_pk1 = (Uint32)-1;
+ memset(tup.m_pk2, 'x', g_opt.m_pk2len);
+ CHK((ret = rs->nextResult(true)) == 0 || ret == 1);
+ if (ret == 1)
+ break;
+ DBG(func << " pk1=" << tup.m_pk1);
+ Uint32 k = tup.m_pk1 - g_opt.m_pk1off;
+ CHK(k < g_opt.m_rows && g_tups[k].m_exists);
+ tup.copy(g_tups[k]);
+ if (! rw) {
+ CHK(verifyBlobValue(tup) == 0);
+ } else {
+ CHK(readBlobData(tup) == 0);
+ }
+ rows++;
+ }
+ g_ndb->closeTransaction(g_con);
+ g_con = 0;
+ g_ops = 0;
+ CHK(g_opt.m_rows == rows);
+ return 0;
+}
+
+static int
+deletePk()
+{
+ DBG("--- deletePk ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("deletePk pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0);
+ CHK(g_opr->deleteTuple() == 0);
+ CHK(g_opr->equal("PK1", tup.m_pk1) == 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_opr = 0;
+ g_con = 0;
+ tup.m_exists = false;
+ }
+ return 0;
+}
+
+static int
+deleteIdx()
+{
+ DBG("--- deleteIdx ---");
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ DBG("deleteIdx pk1=" << tup.m_pk1);
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0);
+ CHK(g_opx->deleteTuple() == 0);
+ CHK(g_opx->equal("PK2", tup.m_pk2) == 0);
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_opx = 0;
+ g_con = 0;
+ tup.m_exists = false;
+ }
+ return 0;
+}
+
+static int
+deleteScan(bool idx)
+{
+ const char* func = ! idx ? "scan delete table" : "scan delete index";
+ DBG("--- " << func << " ---");
+ Tup tup;
+ NdbResultSet* rs;
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ if (! idx) {
+ CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_tname)) != 0);
+ } else {
+ CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_x2name, g_opt.m_tname)) != 0);
+ }
+ CHK((rs = g_ops->readTuples(240, NdbScanOperation::LM_Exclusive)) != 0);
+ CHK(g_ops->getValue("PK1", (char*)&tup.m_pk1) != 0);
+ if (g_opt.m_pk2len != 0)
+ CHK(g_ops->getValue("PK2", tup.m_pk2) != 0);
+ CHK(g_con->execute(NoCommit) == 0);
+ unsigned rows = 0;
+ while (1) {
+ int ret;
+ tup.m_pk1 = (Uint32)-1;
+ memset(tup.m_pk2, 'x', g_opt.m_pk2len);
+ CHK((ret = rs->nextResult()) == 0 || ret == 1);
+ if (ret == 1)
+ break;
+ DBG(func << " pk1=" << tup.m_pk1);
+ CHK(rs->deleteTuple() == 0);
+ CHK(g_con->execute(NoCommit) == 0);
+ Uint32 k = tup.m_pk1 - g_opt.m_pk1off;
+ CHK(k < g_opt.m_rows && g_tups[k].m_exists);
+ g_tups[k].m_exists = false;
+ rows++;
+ }
+ CHK(g_con->execute(Commit) == 0);
+ g_ndb->closeTransaction(g_con);
+ g_con = 0;
+ g_opr = 0;
+ g_ops = 0;
+ CHK(g_opt.m_rows == rows);
+ return 0;
+}
+
+// main
+
+static int
+testmain()
+{
+ g_ndb = new Ndb("TEST_DB");
+ CHK(g_ndb->init() == 0);
+ CHK(g_ndb->waitUntilReady() == 0);
+ g_dic = g_ndb->getDictionary();
+ g_tups = new Tup [g_opt.m_rows];
+ CHK(dropTable() == 0);
+ CHK(createTable() == 0);
+ if (g_opt.m_bugtest != 0) {
+ // test a general bug instead of blobs
+ CHK((*g_opt.m_bugtest)() == 0);
+ return 0;
+ }
+ Bcol& b1 = g_opt.m_blob1;
+ CHK(NdbBlob::getBlobTableName(b1.m_btname, g_ndb, g_opt.m_tname, "BL1") == 0);
+ DBG("BL1: inline=" << b1.m_inline << " part=" << b1.m_partsize << " table=" << b1.m_btname);
+ if (! g_opt.m_oneblob) {
+ Bcol& b2 = g_opt.m_blob2;
+ CHK(NdbBlob::getBlobTableName(b2.m_btname, g_ndb, g_opt.m_tname, "BL2") == 0);
+ DBG("BL2: inline=" << b2.m_inline << " part=" << b2.m_partsize << " table=" << b2.m_btname);
+ }
+ if (g_opt.m_seed != 0)
+ srandom(g_opt.m_seed);
+ for (unsigned loop = 0; g_opt.m_loop == 0 || loop < g_opt.m_loop; loop++) {
+ DBG("=== loop " << loop << " ===");
+ if (g_opt.m_seed == 0)
+ srandom(loop);
+ bool llim = skip('v') ? true : false;
+ bool ulim = skip('w') ? false : true;
+ // pk
+ for (int rw = llim; rw <= ulim; rw++) {
+ if (skip('k'))
+ continue;
+ DBG("--- pk ops " << (! rw ? "get/set" : "read/write") << " ---");
+ calcTups(false);
+ CHK(insertPk(rw) == 0);
+ CHK(verifyBlob() == 0);
+ CHK(readPk(rw) == 0);
+ if (! skip('u')) {
+ calcTups(rw);
+ CHK(updatePk(rw) == 0);
+ CHK(verifyBlob() == 0);
+ }
+ CHK(readPk(rw) == 0);
+ CHK(deletePk() == 0);
+ CHK(verifyBlob() == 0);
+ }
+ // hash index
+ for (int rw = llim; rw <= ulim; rw++) {
+ if (skip('i'))
+ continue;
+ DBG("--- idx ops " << (! rw ? "get/set" : "read/write") << " ---");
+ calcTups(false);
+ CHK(insertPk(rw) == 0);
+ CHK(verifyBlob() == 0);
+ CHK(readIdx(rw) == 0);
+ calcTups(rw);
+ if (! skip('u')) {
+ CHK(updateIdx(rw) == 0);
+ CHK(verifyBlob() == 0);
+ CHK(readIdx(rw) == 0);
+ }
+ CHK(deleteIdx() == 0);
+ CHK(verifyBlob() == 0);
+ }
+ // scan table
+ for (int rw = llim; rw <= ulim; rw++) {
+ if (skip('s'))
+ continue;
+ DBG("--- table scan " << (! rw ? "get/set" : "read/write") << " ---");
+ calcTups(false);
+ CHK(insertPk(rw) == 0);
+ CHK(verifyBlob() == 0);
+ CHK(readScan(rw, false) == 0);
+ CHK(deleteScan(false) == 0);
+ CHK(verifyBlob() == 0);
+ }
+ // scan index
+ for (int rw = llim; rw <= ulim; rw++) {
+ if (skip('r'))
+ continue;
+ DBG("--- index scan " << (! rw ? "get/set" : "read/write") << " ---");
+ calcTups(false);
+ CHK(insertPk(rw) == 0);
+ CHK(verifyBlob() == 0);
+ CHK(readScan(rw, true) == 0);
+ CHK(deleteScan(true) == 0);
+ CHK(verifyBlob() == 0);
+ }
+ }
+ delete g_ndb;
+ return 0;
+}
+
+// bug tests
+
+static int
+bugtest_4088()
+{
+ DBG("bug test 4088 - ndb api hang with mixed ops on index table");
+ // insert rows
+ calcTups(false);
+ CHK(insertPk(false) == 0);
+ // new trans
+ CHK((g_con = g_ndb->startTransaction()) != 0);
+ for (unsigned k = 0; k < g_opt.m_rows; k++) {
+ Tup& tup = g_tups[k];
+ // read table pk via index as a table
+ const unsigned pkcnt = 2;
+ Tup pktup[pkcnt];
+ for (unsigned i = 0; i < pkcnt; i++) {
+ char name[20];
+ // XXX guess table id
+ sprintf(name, "%d/%s", 4, g_opt.m_x1name);
+ CHK((g_opr = g_con->getNdbOperation(name)) != 0);
+ CHK(g_opr->readTuple() == 0);
+ CHK(g_opr->equal("PK2", tup.m_pk2) == 0);
+ CHK(g_opr->getValue("NDB$PK", (char*)&pktup[i].m_pk1) != 0);
+ }
+ // read blob inline via index as an index
+ CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0);
+ CHK(g_opx->readTuple() == 0);
+ CHK(g_opx->equal("PK2", tup.m_pk2) == 0);
+ assert(tup.m_blob1.m_buf != 0);
+ CHK(g_opx->getValue("BL1", (char*)tup.m_blob1.m_buf) != 0);
+ // execute
+ // BUG 4088: gets 1 tckeyconf, 1 tcindxconf, then hangs
+ CHK(g_con->execute(Commit) == 0);
+ // verify
+ for (unsigned i = 0; i < pkcnt; i++) {
+ CHK(pktup[i].m_pk1 == tup.m_pk1);
+ CHK(memcmp(pktup[i].m_pk2, tup.m_pk2, g_opt.m_pk2len) == 0);
+ }
+ CHK(memcmp(tup.m_blob1.m_val, tup.m_blob1.m_buf, 8 + g_opt.m_blob1.m_inline) == 0);
+ }
+ return 0;
+}
+
+static int
+bugtest_2222()
+{
+ return 0;
+}
+
+static int
+bugtest_3333()
+{
+ return 0;
+}
+
+static struct {
+ int m_bug;
+ int (*m_test)();
+} g_bugtest[] = {
+ { 4088, bugtest_4088 },
+ { 2222, bugtest_2222 },
+ { 3333, bugtest_3333 }
+};
+
+NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)
+{
+ while (++argv, --argc > 0) {
+ const char* arg = argv[0];
+ if (strcmp(arg, "-core") == 0) {
+ g_opt.m_core = true;
+ continue;
+ }
+ if (strcmp(arg, "-dbg") == 0) {
+ g_opt.m_dbg = true;
+ continue;
+ }
+ if (strcmp(arg, "-dbgall") == 0) {
+ g_opt.m_dbg = true;
+ g_opt.m_dbgall = true;
+ putenv("NDB_BLOB_DEBUG=1");
+ continue;
+ }
+ if (strcmp(arg, "-full") == 0) {
+ g_opt.m_full = true;
+ continue;
+ }
+ if (strcmp(arg, "-loop") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_loop = atoi(argv[0]);
+ continue;
+ }
+ }
+ if (strcmp(arg, "-parts") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_parts = atoi(argv[0]);
+ continue;
+ }
+ }
+ if (strcmp(arg, "-rows") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_rows = atoi(argv[0]);
+ continue;
+ }
+ }
+ if (strcmp(arg, "-seed") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_seed = atoi(argv[0]);
+ continue;
+ }
+ }
+ if (strcmp(arg, "-skip") == 0) {
+ if (++argv, --argc > 0) {
+ for (const char* p = argv[0]; *p != 0; p++) {
+ skip(*p) = true;
+ }
+ continue;
+ }
+ }
+ // metadata
+ if (strcmp(arg, "-pk2len") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_pk2len = atoi(argv[0]);
+ if (g_opt.m_pk2len == 0) {
+ skip('i') = true;
+ skip('r') = true;
+ }
+ if (g_opt.m_pk2len <= g_max_pk2len)
+ continue;
+ }
+ }
+ if (strcmp(arg, "-oneblob") == 0) {
+ g_opt.m_oneblob = true;
+ continue;
+ }
+ // bugs
+ if (strcmp(arg, "-bug") == 0) {
+ if (++argv, --argc > 0) {
+ g_opt.m_bug = atoi(argv[0]);
+ for (unsigned i = 0; i < sizeof(g_bugtest)/sizeof(g_bugtest[0]); i++) {
+ if (g_opt.m_bug == g_bugtest[i].m_bug) {
+ g_opt.m_bugtest = g_bugtest[i].m_test;
+ break;
+ }
+ }
+ if (g_opt.m_bugtest != 0)
+ continue;
+ }
+ }
+ ndbout << "testOIBasic: unknown option " << arg << endl;
+ printusage();
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
+ }
+ if (testmain() == -1) {
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+ return NDBT_ProgramExit(NDBT_OK);
+}
+
+// vim: set sw=2 et:
diff --git a/ndb/test/ndbapi/testBlobs/testBlobs.cpp b/ndb/test/ndbapi/testBlobs/testBlobs.cpp
deleted file mode 100644
index 9f959702402..00000000000
--- a/ndb/test/ndbapi/testBlobs/testBlobs.cpp
+++ /dev/null
@@ -1,195 +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 */
-
-/*
- * testBlobs
- */
-
-#include <ndb_global.h>
-
-#include <NdbMain.h>
-#include <NdbOut.hpp>
-#include <NdbThread.h>
-#include <NdbMutex.h>
-#include <NdbCondition.h>
-#include <NdbTest.hpp>
-#include <NdbTick.h>
-#include <ndb_limits.h>
-
-struct Opt {
- bool m_core;
- const char* m_table;
- Opt() :
- m_core(false),
- m_table("TB1")
- {
- }
-};
-
-static Opt opt;
-
-static void printusage()
-{
- Opt d;
- ndbout
- << "usage: testBlobs [options]" << endl
- << "-core dump core on error - default " << d.m_core << endl
- ;
-}
-
-static Ndb* myNdb = 0;
-static NdbDictionary::Dictionary* myDic = 0;
-static NdbConnection* myCon = 0;
-static NdbOperation* myOp = 0;
-static NdbBlob* myBlob = 0;
-
-static void
-fatal(const char* fmt, ...)
-{
- va_list ap;
- char buf[200];
- va_start(ap, fmt);
- vsnprintf(buf, sizeof(buf), fmt, ap);
- va_end(ap);
- ndbout << "fatal: " << buf << endl;
- if (myNdb != 0 && myNdb->getNdbError().code != 0)
- ndbout << "ndb - " << myNdb->getNdbError() << endl;
- if (myDic != 0 && myDic->getNdbError().code != 0)
- ndbout << "dic - " << myDic->getNdbError() << endl;
- if (opt.m_core)
- abort();
- NDBT_ProgramExit(NDBT_FAILED);
- exit(1);
-}
-
-static void
-dropBlobsTable()
-{
- NdbDictionary::Table tab(NDB_BLOB_TABLE_NAME);
- if (myDic->dropTable(tab) == -1)
- if (myDic->getNdbError().code != 709)
- fatal("dropTable");
-}
-
-static void
-createBlobsTable()
-{
- NdbDictionary::Table tab(NDB_BLOB_TABLE_NAME);
- // col 0
- NdbDictionary::Column col0("BLOBID");
- col0.setPrimaryKey(true);
- col0.setType(NdbDictionary::Column::Bigunsigned);
- tab.addColumn(col0);
- // col 1
- NdbDictionary::Column col1("DATA");
- col1.setPrimaryKey(false);
- col1.setType(NdbDictionary::Column::Binary);
- col1.setLength(NDB_BLOB_PIECE_SIZE);
- tab.addColumn(col1);
- // create
- if (myDic->createTable(tab) == -1)
- fatal("createTable");
-}
-
-static void
-dropTable()
-{
- NdbDictionary::Table tab(opt.m_table);
- if (myDic->dropTable(tab) == -1)
- if (myDic->getNdbError().code != 709)
- fatal("dropTable");
-}
-
-static void
-createTable()
-{
- NdbDictionary::Table tab(opt.m_table);
- // col 0
- NdbDictionary::Column col0("A");
- col0.setPrimaryKey(true);
- col0.setType(NdbDictionary::Column::Unsigned);
- tab.addColumn(col0);
- // col 1
- NdbDictionary::Column col1("B");
- col1.setPrimaryKey(false);
- col1.setType(NdbDictionary::Column::Blob);
- tab.addColumn(col1);
- // create
- if (myDic->createTable(tab) == -1)
- fatal("createTable");
-}
-
-static void
-insertData(Uint32 key)
-{
-}
-
-static void
-insertTuples()
-{
- for (Uint32 key = 0; key <= 99; key++) {
- if ((myCon = myNdb->startTransaction()) == 0)
- fatal("startTransaction");
- if ((myOp = myCon->getNdbOperation(opt.m_table)) == 0)
- fatal("getNdbOperation");
- if (myOp->insertTuple() == -1)
- fatal("insertTuple");
- if (myOp->setValue((unsigned)0, key) == -1)
- fatal("setValue %u", (unsigned)key);
- if ((myBlob = myOp->setBlob(1)) == 0)
- fatal("setBlob");
- if (myCon->execute(NoCommit) == -1)
- fatal("execute NoCommit");
- insertData(key);
- if (myCon->execute(Commit) == -1)
- fatal("execute Commit");
- myNdb->closeTransaction(myCon);
- myOp = 0;
- myBlob = 0;
- myCon = 0;
- }
-}
-
-static void
-testMain()
-{
- myNdb = new Ndb("TEST_DB");
- if (myNdb->init() != 0)
- fatal("init");
- if (myNdb->waitUntilReady() < 0)
- fatal("waitUntilReady");
- myDic = myNdb->getDictionary();
- dropBlobsTable();
- createBlobsTable(); // until moved to Ndbcntr
- dropTable();
- createTable();
- insertTuples();
-}
-
-NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)
-{
- while (++argv, --argc > 0) {
- const char* arg = argv[0];
- if (strcmp(arg, "-core") == 0) {
- opt.m_core = true;
- continue;
- }
- }
- testMain();
- return NDBT_ProgramExit(NDBT_OK);
-}
-
-// vim: set sw=4:
diff --git a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp
index b8e0fef6cef..75773040113 100644
--- a/ndb/test/ndbapi/testDataBuffers/testDataBuffers.cpp
+++ b/ndb/test/ndbapi/testDataBuffers.cpp
@@ -34,7 +34,7 @@
#include <NdbOut.hpp>
#include <NdbApi.hpp>
#include <NdbTest.hpp>
-
+#include <NdbSchemaCon.hpp>
// limits
static int const MaxAttr = 64;
static int const MaxOper = 1000;
@@ -99,7 +99,7 @@ ndberror(char const* fmt, ...)
if (tcon)
ndbout << "tcon: " << tcon->getNdbError() << endl;
if (top)
- ndbout << "top : " << top->getNdbError() << endl;
+ ndbout << "top: " << top->getNdbError() << endl;
if (con)
ndbout << "con : " << con->getNdbError() << endl;
if (op)
@@ -258,7 +258,7 @@ testcase(int flag)
if (ndb->waitUntilReady(30) < 0)
return ndberror("waitUntilReady");
- if ((tcon = ndb->startSchemaTransaction()) == 0)
+ if ((tcon = NdbSchemaCon::startSchemaTrans(ndb)) == 0)
return ndberror("startSchemaTransaction");
if ((top = tcon->getNdbSchemaOp()) == 0)
return ndberror("getNdbSchemaOp");
diff --git a/ndb/test/ndbapi/testDict/testDict.cpp b/ndb/test/ndbapi/testDict.cpp
index 06614690b8d..1451c942362 100644
--- a/ndb/test/ndbapi/testDict/testDict.cpp
+++ b/ndb/test/ndbapi/testDict.cpp
@@ -1003,9 +1003,9 @@ int runGetPrimaryKey(NDBT_Context* ctx, NDBT_Step* step){
int
NF_codes[] = {
- 14000
- ,14001
- //,14002
+ 6003
+ ,6004
+ //,6005
};
int
diff --git a/ndb/test/ndbapi/testGrep/testGrep.cpp b/ndb/test/ndbapi/testGrep.cpp
index 4b870f6f9a9..4b870f6f9a9 100644
--- a/ndb/test/ndbapi/testGrep/testGrep.cpp
+++ b/ndb/test/ndbapi/testGrep.cpp
diff --git a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp b/ndb/test/ndbapi/testGrepVerify.cpp
index 7fd2c19d9f7..05445c1ba1b 100644
--- a/ndb/test/ndbapi/testGrep/verify/testGrepVerify.cpp
+++ b/ndb/test/ndbapi/testGrepVerify.cpp
@@ -74,16 +74,13 @@ int main(int argc, const char** argv){
if(table == 0)
return NDBT_ProgramExit(NDBT_WRONGARGS);
- Ndb::useFullyQualifiedNames(false);
-
Ndb * m_ndb = new Ndb("");
+ m_ndb->useFullyQualifiedNames(false);
m_ndb->setConnectString(connectString);
- Ndb::useFullyQualifiedNames(false);
/**
* @todo Set proper max no of transactions?? needed?? Default 12??
*/
m_ndb->init(2048);
- Ndb::useFullyQualifiedNames(false);
if (m_ndb->waitUntilReady() != 0){
ndbout_c("NDB Cluster not ready for connections");
}
diff --git a/ndb/test/ndbapi/testIndex/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp
index 47db0b3cff7..47db0b3cff7 100644
--- a/ndb/test/ndbapi/testIndex/testIndex.cpp
+++ b/ndb/test/ndbapi/testIndex.cpp
diff --git a/ndb/test/ndbapi/testInterpreter/testInterpreter.cpp b/ndb/test/ndbapi/testInterpreter.cpp
index 9c584d6f581..9c584d6f581 100644
--- a/ndb/test/ndbapi/testInterpreter/testInterpreter.cpp
+++ b/ndb/test/ndbapi/testInterpreter.cpp
diff --git a/ndb/test/ndbapi/testMgm/testMgm.cpp b/ndb/test/ndbapi/testMgm.cpp
index d5b9372cc9b..d5b9372cc9b 100644
--- a/ndb/test/ndbapi/testMgm/testMgm.cpp
+++ b/ndb/test/ndbapi/testMgm.cpp
diff --git a/ndb/test/ndbapi/testNdbApi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp
index c0e262f590f..2e08ebbed4e 100644
--- a/ndb/test/ndbapi/testNdbApi/testNdbApi.cpp
+++ b/ndb/test/ndbapi/testNdbApi.cpp
@@ -23,8 +23,8 @@
#include <Vector.hpp>
#include <random.h>
#include <NdbTick.h>
-#include <AttrType.hpp>
+#define MAX_NDB_OBJECTS 32678
#define CHECK(b) if (!(b)) { \
ndbout << "ERR: "<< step->getName() \
@@ -79,7 +79,7 @@ int runTestMaxNdb(NDBT_Context* ctx, NDBT_Step* step){
ndbout << i << " ndb objects created" << endl;
- if (l > 0 && i != oldi && init != MAX_NO_THREADS){
+ if (l > 0 && i != oldi && init != MAX_NDB_OBJECTS){
ndbout << l << ": not as manyNdb objects created" << endl
<< i << " != " << oldi << endl;
result = NDBT_FAILED;
diff --git a/ndb/test/ndbapi/testNodeRestart/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp
index fd591f04c69..fd591f04c69 100644
--- a/ndb/test/ndbapi/testNodeRestart/testNodeRestart.cpp
+++ b/ndb/test/ndbapi/testNodeRestart.cpp
diff --git a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp
index a47d9d2099e..0ca8ce79e2e 100644
--- a/ndb/test/ndbapi/testOIBasic/testOIBasic.cpp
+++ b/ndb/test/ndbapi/testOIBasic.cpp
@@ -39,6 +39,7 @@ struct Opt {
NdbDictionary::Object::FragmentType m_fragtype;
const char* m_index;
unsigned m_loop;
+ bool m_nologging;
unsigned m_rows;
unsigned m_scanrd;
unsigned m_scanex;
@@ -54,6 +55,7 @@ struct Opt {
m_fragtype(NdbDictionary::Object::FragUndefined),
m_index(0),
m_loop(1),
+ m_nologging(false),
m_rows(1000),
m_scanrd(240),
m_scanex(240),
@@ -82,6 +84,7 @@ printhelp()
<< " -fragtype T fragment type single/small/medium/large" << endl
<< " -index xyz only given index numbers (digits 1-9)" << endl
<< " -loop N loop count full suite forever=0 [" << d.m_loop << "]" << endl
+ << " -nologging create tables in no-logging mode" << endl
<< " -rows N rows per thread [" << d.m_rows << "]" << endl
<< " -scanrd N scan read parallelism [" << d.m_scanrd << "]" << endl
<< " -scanex N scan exclusive parallelism [" << d.m_scanex << "]" << endl
@@ -476,7 +479,7 @@ tt1 = {
"TT1", 5, tt1col, 4, tt1itab
};
-// tt2 + tt2x1 tt2x2 tt2x3
+// tt2 + tt2x1 tt2x2 tt2x3 tt2x4
static const Col
tt2col[] = {
@@ -505,6 +508,14 @@ tt2x3col[] = {
{ 1, tt2col[4] }
};
+static const ICol
+tt2x4col[] = {
+ { 0, tt2col[4] },
+ { 1, tt2col[3] },
+ { 2, tt2col[2] },
+ { 3, tt2col[1] }
+};
+
static const ITab
tt2x1 = {
"TT2X1", 2, tt2x1col
@@ -521,15 +532,21 @@ tt2x3 = {
};
static const ITab
+tt2x4 = {
+ "TT2X4", 4, tt2x4col
+};
+
+static const ITab
tt2itab[] = {
tt2x1,
tt2x2,
- tt2x3
+ tt2x3,
+ tt2x4
};
static const Tab
tt2 = {
- "TT2", 5, tt2col, 3, tt2itab
+ "TT2", 5, tt2col, 4, tt2itab
};
// all tables
@@ -823,6 +840,9 @@ createtable(Par par)
if (par.m_fragtype != NdbDictionary::Object::FragUndefined) {
t.setFragmentType(par.m_fragtype);
}
+ if (par.m_nologging) {
+ t.setLogging(false);
+ }
for (unsigned k = 0; k < tab.m_cols; k++) {
const Col& col = tab.m_col[k];
NdbDictionary::Column c(col.m_name);
@@ -2202,7 +2222,6 @@ pkupdateindexbuild(Par par)
{
if (par.m_no == 0) {
CHK(createindex(par) == 0);
- CHK(invalidateindex(par) == 0);
} else {
CHK(pkupdate(par) == 0);
}
@@ -2493,6 +2512,7 @@ tbusybuild(Par par)
RUNSTEP(par, pkinsert, MT);
for (unsigned i = 0; i < par.m_subloop; i++) {
RUNSTEP(par, pkupdateindexbuild, MT);
+ RUNSTEP(par, invalidateindex, MT);
RUNSTEP(par, readverify, MT);
RUNSTEP(par, dropindex, ST);
}
@@ -2500,9 +2520,28 @@ tbusybuild(Par par)
}
static int
-ttiming(Par par)
+ttimebuild(Par par)
+{
+ Tmr t1;
+ RUNSTEP(par, droptable, ST);
+ RUNSTEP(par, createtable, ST);
+ RUNSTEP(par, invalidatetable, MT);
+ for (unsigned i = 0; i < par.m_subloop; i++) {
+ RUNSTEP(par, pkinsert, MT);
+ t1.on();
+ RUNSTEP(par, createindex, ST);
+ t1.off(par.m_totrows);
+ RUNSTEP(par, invalidateindex, MT);
+ RUNSTEP(par, dropindex, ST);
+ }
+ LL1("build index - " << t1.time());
+ return 0;
+}
+
+static int
+ttimemaint(Par par)
{
- Tmr t0, t1, t2;
+ Tmr t1, t2;
RUNSTEP(par, droptable, ST);
RUNSTEP(par, createtable, ST);
RUNSTEP(par, invalidatetable, MT);
@@ -2511,16 +2550,13 @@ ttiming(Par par)
t1.on();
RUNSTEP(par, pkupdate, MT);
t1.off(par.m_totrows);
- t0.on();
RUNSTEP(par, createindex, ST);
RUNSTEP(par, invalidateindex, MT);
- t0.off(par.m_totrows);
t2.on();
RUNSTEP(par, pkupdate, MT);
t2.off(par.m_totrows);
RUNSTEP(par, dropindex, ST);
}
- LL1("build index - " << t0.time());
LL1("update - " << t1.time());
LL1("update indexed - " << t2.time());
LL1("overhead - " << t2.over(t1));
@@ -2551,7 +2587,8 @@ tcaselist[] = {
TCase("b", tpkops, "pk operations and scan reads"),
TCase("c", tmixedops, "pk operations and scan operations"),
TCase("d", tbusybuild, "pk operations and index build"),
- TCase("t", ttiming, "time index build and maintenance"),
+ TCase("t", ttimebuild, "time index build"),
+ TCase("u", ttimemaint, "time index maintenance"),
TCase("z", tdrop, "drop test tables")
};
@@ -2689,6 +2726,10 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535)
continue;
}
}
+ if (strcmp(arg, "-nologging") == 0) {
+ g_opt.m_nologging = true;
+ continue;
+ }
if (strcmp(arg, "-rows") == 0) {
if (++argv, --argc > 0) {
g_opt.m_rows = atoi(argv[0]);
diff --git a/ndb/test/ndbapi/testOperations/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp
index bb58e69e898..bb58e69e898 100644
--- a/ndb/test/ndbapi/testOperations/testOperations.cpp
+++ b/ndb/test/ndbapi/testOperations.cpp
diff --git a/ndb/test/ndbapi/testOrderedIndex/testOrderedIndex.cpp b/ndb/test/ndbapi/testOrderedIndex.cpp
index 51cc53c9975..51cc53c9975 100644
--- a/ndb/test/ndbapi/testOrderedIndex/testOrderedIndex.cpp
+++ b/ndb/test/ndbapi/testOrderedIndex.cpp
diff --git a/ndb/test/ndbapi/testRestartGci/testRestartGci.cpp b/ndb/test/ndbapi/testRestartGci.cpp
index 1e36368ba62..e3dd1f8e2ce 100644
--- a/ndb/test/ndbapi/testRestartGci/testRestartGci.cpp
+++ b/ndb/test/ndbapi/testRestartGci.cpp
@@ -121,7 +121,7 @@ int runVerifyInserts(NDBT_Context* ctx, NDBT_Step* step){
HugoOperations hugoOps(*ctx->getTab());
NdbRestarter restarter;
- int restartGCI = pNdb->NdbTamper(ReadRestartGCI, 0);
+ int restartGCI = pNdb->NdbTamper(Ndb::ReadRestartGCI, 0);
ndbout << "restartGCI = " << restartGCI << endl;
int count = 0;
diff --git a/ndb/test/ndbapi/testScan/testScan.cpp b/ndb/test/ndbapi/testScan.cpp
index dbf91f016d8..bc3be0b7dc9 100644
--- a/ndb/test/ndbapi/testScan/testScan.cpp
+++ b/ndb/test/ndbapi/testScan.cpp
@@ -379,6 +379,31 @@ int runScanReadUntilStoppedNoCount(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
+int runScanReadUntilStoppedPrintTime(NDBT_Context* ctx, NDBT_Step* step){
+ int records = ctx->getNumRecords();
+ int i = 0;
+ int parallelism = ctx->getProperty("Parallelism", 240);
+ NdbTimer timer;
+ Ndb* ndb = GETNDB(step);
+
+
+ HugoTransactions hugoTrans(*ctx->getTab());
+ while (ctx->isTestStopped() == false) {
+ timer.doReset();
+ timer.doStart();
+ g_info << i << ": ";
+ if (ndb->waitUntilReady() != 0)
+ return NDBT_FAILED;
+ if (hugoTrans.scanReadRecords(GETNDB(step), records, 0, parallelism) != 0)
+ return NDBT_FAILED;
+ timer.doStop();
+ if ((timer.elapsedTime()/1000) > 1)
+ timer.printTotalTime();
+ i++;
+ }
+ return NDBT_OK;
+}
+
int runPkRead(NDBT_Context* ctx, NDBT_Step* step){
int loops = ctx->getNumLoops();
@@ -504,6 +529,64 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+
+int runStopAndStartNode(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ NdbRestarter restarter;
+ int i = 0;
+ int lastId = 0;
+ int timeout = 240;
+
+ if (restarter.getNumDbNodes() < 2){
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+ while(i<loops && result != NDBT_FAILED){
+ if(restarter.waitClusterStarted(timeout) != 0){
+ g_err << "Cluster failed to start 1" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+ NdbSleep_SecSleep(1);
+ int nodeId = restarter.getDbNodeId(lastId);
+ lastId = (lastId + 1) % restarter.getNumDbNodes();
+ g_err << "Stopping node " << nodeId << endl;
+
+ if(restarter.restartOneDbNode(nodeId, false, true) != 0){
+ g_err << "Failed to restartOneDbNode" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+
+ if(restarter.waitNodesNoStart(&nodeId, 1, timeout) != 0){
+ g_err << "Node failed to reach NoStart" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+
+ g_info << "Sleeping for 10 secs" << endl;
+ NdbSleep_SecSleep(10);
+
+ g_err << "Starting node " << nodeId << endl;
+ if(restarter.startNodes(&nodeId, 1) != 0){
+ g_err << "Failed to start the node" << endl;
+ result = NDBT_FAILED;
+ break;
+ }
+
+ i++;
+ }
+ if(restarter.waitClusterStarted(timeout) != 0){
+ g_err << "Cluster failed to start 2" << endl;
+ result = NDBT_FAILED;
+ }
+
+ ctx->stopTest();
+
+ return result;
+}
+
int runRestarter9999(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
int loops = ctx->getNumLoops();
@@ -1302,6 +1385,14 @@ TESTCASE("CheckAfterTerror",
STEPS(runScanRead, 5);
FINALIZER(runClearTable);
}
+TESTCASE("ScanReadWhileNodeIsDown",
+ "Scan requirement:A scan should be able to run as fast when "\
+ "one or more nodes in the cluster is down."){
+ INITIALIZER(runLoadTable);
+ STEP(runScanReadUntilStoppedPrintTime);
+ STEP(runStopAndStartNode);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testScan);
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/testScanInterpreter/testScanInterpreter.cpp b/ndb/test/ndbapi/testScanInterpreter.cpp
index 18fd98bdbb3..3b5baf954e0 100644
--- a/ndb/test/ndbapi/testScanInterpreter/testScanInterpreter.cpp
+++ b/ndb/test/ndbapi/testScanInterpreter.cpp
@@ -214,8 +214,8 @@ TESTCASE("ScanLessThan",
"Read all records in table TX with attrX less "\
"than a value and store the resultset in TX_RES."\
"Then compare records in TX_RES with records in TX."){
- TABLE("T1");
- TABLE("T2");
+ // TABLE("T1");
+ // TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanLessThan);
@@ -227,8 +227,8 @@ TESTCASE("ScanEqual",
"Read all records in table TX with attrX equal "\
"to a value and store the resultset in TX_RES."\
"Then compare records in TX_RES with records in TX."){
- TABLE("T1");
- TABLE("T2");
+ // TABLE("T1");
+ // TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqual);
@@ -239,8 +239,8 @@ TESTCASE("ScanEqual",
TESTCASE("ScanEqualLoop",
"Scan all records in TX equal to a value."\
"Do this loop number of times"){
- TABLE("T1");
- TABLE("T2");
+ // TABLE("T1");
+ // TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqualLoop);
@@ -251,8 +251,8 @@ TESTCASE("ScanEqualVerifyLoop",
"Scan all records in TX equal to a value."\
"Verify record in TX_RES table"\
"Do this loop number of times"){
- TABLE("T1");
- TABLE("T2");
+ // TABLE("T1");
+ // TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqualVerifyLoop);
@@ -262,8 +262,8 @@ TESTCASE("ScanEqualVerifyLoop",
TESTCASE("ScanLessThanLoop",
"Scan all records in TX less than a value."\
"Do this loop number of times"){
- TABLE("T1");
- TABLE("T2");
+ // TABLE("T1");
+ // TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanLessThanLoop);
diff --git a/ndb/test/ndbapi/testScanPerf/Makefile b/ndb/test/ndbapi/testScanPerf/Makefile
new file mode 100644
index 00000000000..fdf5980b385
--- /dev/null
+++ b/ndb/test/ndbapi/testScanPerf/Makefile
@@ -0,0 +1,9 @@
+include .defs.mk
+
+TYPE = ndbapitest
+
+BIN_TARGET = testScanPerf
+
+SOURCES = testScanPerf.cpp
+
+include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/test/ndbapi/testScanPerf/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf/testScanPerf.cpp
new file mode 100644
index 00000000000..61af1ffb989
--- /dev/null
+++ b/ndb/test/ndbapi/testScanPerf/testScanPerf.cpp
@@ -0,0 +1,368 @@
+/* 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 <NDBT.hpp>
+#include <NDBT_Test.hpp>
+#include <HugoTransactions.hpp>
+#include <UtilTransactions.hpp>
+#include <random.h>
+#include <getarg.h>
+
+struct Parameter {
+ char * name;
+ unsigned value;
+ unsigned min;
+ unsigned max;
+};
+
+#define P_BATCH 0
+#define P_PARRA 1
+#define P_LOCK 2
+#define P_FILT 3
+#define P_BOUND 4
+#define P_ACCESS 5
+#define P_FETCH 6
+#define P_ROWS 7
+#define P_LOOPS 8
+#define P_CREATE 9
+#define P_LOAD 10
+
+#define P_MAX 11
+
+static
+Parameter
+g_paramters[] = {
+ { "batch", 0, 0, 1 }, // 0, 15
+ { "parallelism", 0, 0, 1 }, // 0, 1
+ { "lock", 0, 0, 2 }, // read, exclusive, dirty
+ { "filter", 0, 0, 3 }, // all, none, 1, 100
+ { "range", 0, 0, 3 }, // all, none, 1, 100
+ { "access", 0, 0, 2 }, // scan, idx, idx sorted
+ { "fetch", 0, 0, 1 }, // No, yes
+ { "size", 1000000, 1, ~0 },
+ { "iterations", 3, 1, ~0 },
+ { "create_drop", 1, 0, 1 },
+ { "data", 1, 0, 1 }
+};
+
+static Ndb* g_ndb = 0;
+static const NdbDictionary::Table * g_table;
+static const NdbDictionary::Index * g_index;
+static char g_tablename[256];
+static char g_indexname[256];
+
+int create_table();
+int load_table();
+int run_scan();
+int clear_table();
+int drop_table();
+
+int
+main(int argc, const char** argv){
+ int verbose = 1;
+ int optind = 0;
+
+ struct getargs args[1+P_MAX] = {
+ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" }
+ };
+ const int num_args = 1 + P_MAX;
+ for(int i = 0; i<P_MAX; i++){
+ args[i+1].long_name = g_paramters[i].name;
+ args[i+1].short_name = * g_paramters[i].name;
+ args[i+1].type = arg_integer;
+ args[i+1].value = &g_paramters[i].value;
+ BaseString tmp;
+ tmp.assfmt("min: %d max: %d", g_paramters[i].min, g_paramters[i].max);
+ args[i+1].help = strdup(tmp.c_str());
+ args[i+1].arg_help = 0;
+ }
+
+ if(getarg(args, num_args, argc, argv, &optind)) {
+ arg_printusage(args, num_args, argv[0], "tabname1 tabname2 ...");
+ return NDBT_WRONGARGS;
+ }
+
+ myRandom48Init(NdbTick_CurrentMillisecond());
+
+ g_ndb = new Ndb("TEST_DB");
+ if(g_ndb->init() != 0){
+ g_err << "init() failed" << endl;
+ goto error;
+ }
+ if(g_ndb->waitUntilReady() != 0){
+ g_err << "Wait until ready failed" << endl;
+ goto error;
+ }
+ for(int i = optind; i<argc; i++){
+ const char * T = argv[i];
+ g_info << "Testing " << T << endl;
+ snprintf(g_tablename, sizeof(g_tablename), T);
+ snprintf(g_indexname, sizeof(g_indexname), "IDX_%s", T);
+ if(create_table())
+ goto error;
+ if(load_table())
+ goto error;
+ if(run_scan())
+ goto error;
+ if(clear_table())
+ goto error;
+ if(drop_table())
+ goto error;
+ }
+
+ if(g_ndb) delete g_ndb;
+ return NDBT_OK;
+ error:
+ if(g_ndb) delete g_ndb;
+ return NDBT_FAILED;
+}
+
+int
+create_table(){
+ NdbDictionary::Dictionary* dict = g_ndb->getDictionary();
+ assert(dict);
+ if(g_paramters[P_CREATE].value){
+ const NdbDictionary::Table * pTab = NDBT_Tables::getTable(g_tablename);
+ assert(pTab);
+ NdbDictionary::Table copy = * pTab;
+ copy.setLogging(false);
+ if(dict->createTable(copy) != 0){
+ g_err << "Failed to create table: " << g_tablename << endl;
+ return -1;
+ }
+
+ NdbDictionary::Index x(g_indexname);
+ x.setTable(g_tablename);
+ x.setType(NdbDictionary::Index::OrderedIndex);
+ x.setLogging(false);
+ for (unsigned k = 0; k < copy.getNoOfColumns(); k++){
+ if(copy.getColumn(k)->getPrimaryKey()){
+ x.addColumnName(copy.getColumn(k)->getName());
+ }
+ }
+
+ if(dict->createIndex(x) != 0){
+ g_err << "Failed to create index: " << endl;
+ return -1;
+ }
+ }
+ g_table = dict->getTable(g_tablename);
+ g_index = dict->getIndex(g_indexname, g_tablename);
+ assert(g_table);
+ assert(g_index);
+ return 0;
+}
+
+int
+drop_table(){
+ if(!g_paramters[P_CREATE].value)
+ return 0;
+ if(g_ndb->getDictionary()->dropTable(g_table->getName()) != 0){
+ g_err << "Failed to drop table: " << g_table->getName() << endl;
+ return -1;
+ }
+ g_table = 0;
+ return 0;
+}
+
+int
+load_table(){
+ if(!g_paramters[P_LOAD].value)
+ return 0;
+
+ int rows = g_paramters[P_ROWS].value;
+ HugoTransactions hugoTrans(* g_table);
+ if (hugoTrans.loadTable(g_ndb, rows)){
+ g_err.println("Failed to load %s with %d rows", g_table->getName(), rows);
+ return -1;
+ }
+ return 0;
+}
+
+int
+clear_table(){
+ if(!g_paramters[P_LOAD].value)
+ return 0;
+
+ int rows = g_paramters[P_ROWS].value;
+
+ UtilTransactions utilTrans(* g_table);
+ if (utilTrans.clearTable(g_ndb, rows) != 0){
+ g_err.println("Failed to clear table %s", g_table->getName());
+ return -1;
+ }
+ return 0;
+}
+
+inline
+void err(NdbError e){
+ ndbout << e << endl;
+}
+
+int
+run_scan(){
+ int iter = g_paramters[P_LOOPS].value;
+ Uint64 start1;
+ Uint64 sum1 = 0;
+
+ Uint32 tot = g_paramters[P_ROWS].value;
+
+ for(int i = 0; i<iter; i++){
+ start1 = NdbTick_CurrentMillisecond();
+ NdbConnection * pTrans = g_ndb->startTransaction();
+ if(!pTrans){
+ g_err << "Failed to start transaction" << endl;
+ err(g_ndb->getNdbError());
+ return -1;
+ }
+
+ NdbScanOperation * pOp;
+#ifdef NdbIndexScanOperation_H
+ NdbIndexScanOperation * pIOp;
+#else
+ NdbScanOperation * pIOp;
+#endif
+
+ NdbResultSet * rs;
+ int par = g_paramters[P_PARRA].value;
+ int bat = g_paramters[P_BATCH].value;
+ NdbScanOperation::LockMode lm;
+ switch(g_paramters[P_LOCK].value){
+ case 0:
+ lm = NdbScanOperation::LM_Read;
+ break;
+ case 1:
+ lm = NdbScanOperation::LM_Exclusive;
+ break;
+ case 2:
+ lm = NdbScanOperation::LM_CommittedRead;
+ break;
+ default:
+ abort();
+ }
+
+ if(g_paramters[P_ACCESS].value == 0){
+ pOp = pTrans->getNdbScanOperation(g_tablename);
+ assert(pOp);
+#ifdef NdbIndexScanOperation_H
+ rs = pOp->readTuples(lm, bat, par);
+#else
+ int oldp = (par == 0 ? 240 : par) * (bat == 0 ? 15 : bat);
+ rs = pOp->readTuples(oldp > 240 ? 240 : oldp, lm);
+#endif
+ } else {
+#ifdef NdbIndexScanOperation_H
+ pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename);
+ bool ord = g_paramters[P_ACCESS].value == 2;
+ rs = pIOp->readTuples(lm, bat, par, ord);
+#else
+ pOp = pIOp = pTrans->getNdbScanOperation(g_indexname, g_tablename);
+ assert(pOp);
+ int oldp = (par == 0 ? 240 : par) * (bat == 0 ? 15 : bat);
+ rs = pIOp->readTuples(oldp > 240 ? 240 : oldp, lm);
+#endif
+ switch(g_paramters[P_BOUND].value){
+ case 0: // All
+ break;
+ case 1: // None
+#ifdef NdbIndexScanOperation_H
+ pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, 0);
+#else
+ pIOp->setBound((Uint32)0, NdbOperation::BoundEQ, 0);
+#endif
+ break;
+ case 2: { // 1 row
+ default:
+ assert(g_table->getNoOfPrimaryKeys() == 1); // only impl. so far
+ abort();
+#if 0
+ int tot = g_paramters[P_ROWS].value;
+ int row = rand() % tot;
+ fix_eq_bound(pIOp, row);
+#endif
+ break;
+ }
+ }
+ }
+ assert(pOp);
+ assert(rs);
+
+ int check = 0;
+ switch(g_paramters[P_FILT].value){
+ case 0: // All
+ check = pOp->interpret_exit_ok();
+ break;
+ case 1: // None
+ check = pOp->interpret_exit_nok();
+ break;
+ case 2: { // 1 row
+ default:
+ assert(g_table->getNoOfPrimaryKeys() == 1); // only impl. so far
+ abort();
+#if 0
+ int tot = g_paramters[P_ROWS].value;
+ int row = rand() % tot;
+ NdbScanFilter filter(pOp) ;
+ filter.begin(NdbScanFilter::AND);
+ fix_eq(filter, pOp, row);
+ filter.end();
+ break;
+#endif
+ }
+ }
+ if(check != 0){
+ err(pOp->getNdbError());
+ return -1;
+ }
+ assert(check == 0);
+
+ for(int i = 0; i<g_table->getNoOfColumns(); i++){
+ pOp->getValue(i);
+ }
+
+ int rows = 0;
+ check = pTrans->execute(NoCommit);
+ assert(check == 0);
+ int fetch = g_paramters[P_FETCH].value;
+ while((check = rs->nextResult(true)) == 0){
+ do {
+ rows++;
+ } while(!fetch && ((check = rs->nextResult(false)) == 0));
+ if(check == -1){
+ err(pTrans->getNdbError());
+ return -1;
+ }
+ assert(check == 2);
+ }
+
+ if(check == -1){
+ err(pTrans->getNdbError());
+ return -1;
+ }
+ assert(check == 1);
+ g_info << "Found " << rows << " rows" << endl;
+
+ pTrans->close();
+
+ Uint64 stop = NdbTick_CurrentMillisecond();
+ start1 = (stop - start1);
+ sum1 += start1;
+ }
+ sum1 /= iter;
+
+ g_err.println("Avg time: %Ldms = %d rows/sec", sum1, (1000*tot)/sum1);
+ return 0;
+}
diff --git a/ndb/test/ndbapi/testSystemRestart/testSystemRestart.cpp b/ndb/test/ndbapi/testSystemRestart.cpp
index 1b8a35487cb..61e086ff941 100644
--- a/ndb/test/ndbapi/testSystemRestart/testSystemRestart.cpp
+++ b/ndb/test/ndbapi/testSystemRestart.cpp
@@ -805,6 +805,207 @@ int runSystemRestart5(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+int runSystemRestart6(NDBT_Context* ctx, NDBT_Step* step){
+ Ndb* pNdb = GETNDB(step);
+ int result = NDBT_OK;
+ int timeout = 300;
+ Uint32 loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ Uint32 i = 1;
+
+ const Uint32 nodeCount = restarter.getNumDbNodes();
+ if(nodeCount < 2){
+ g_info << "SR6 - Needs atleast 2 nodes to test" << endl;
+ return NDBT_OK;
+ }
+
+ Vector<int> nodeIds;
+ for(Uint32 i = 0; i<nodeCount; i++)
+ nodeIds.push_back(restarter.getDbNodeId(i));
+
+ Uint32 currentRestartNodeIndex = 0;
+ UtilTransactions utilTrans(*ctx->getTab());
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ while(i<=loops && result != NDBT_FAILED){
+
+ g_info << "Loop " << i << "/"<< loops <<" started" << endl;
+ /**
+ * 1. Load data
+ * 2. Restart all node -nostart
+ * 3. Restart some nodes -i -nostart
+ * 4. Start all nodes verify records
+ */
+ g_info << "Loading records..." << endl;
+ hugoTrans.loadTable(pNdb, records);
+
+ CHECK(restarter.restartAll(false, true, false) == 0);
+
+ Uint32 nodeId = nodeIds[currentRestartNodeIndex];
+ currentRestartNodeIndex = (currentRestartNodeIndex + 1 ) % nodeCount;
+
+ CHECK(restarter.restartOneDbNode(nodeId, true, true,false) == 0);
+ CHECK(restarter.waitClusterNoStart(timeout) == 0);
+ CHECK(restarter.startAll() == 0);
+ CHECK(restarter.waitClusterStarted(timeout) == 0);
+ CHECK(pNdb->waitUntilReady(timeout) == 0);
+ int count = records - 1;
+ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
+ CHECK(count == records);
+ CHECK(utilTrans.clearTable(pNdb) == 0);
+ i++;
+ }
+
+ g_info << "runSystemRestart6 finished" << endl;
+
+ return result;
+}
+
+int runSystemRestart7(NDBT_Context* ctx, NDBT_Step* step){
+ Ndb* pNdb = GETNDB(step);
+ int result = NDBT_OK;
+ Uint32 loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ Uint32 i = 1;
+
+ const Uint32 nodeCount = restarter.getNumDbNodes();
+ if(nodeCount < 2){
+ g_info << "SR8 - Needs atleast 2 nodes to test" << endl;
+ return NDBT_OK;
+ }
+
+ Vector<int> nodeIds;
+ for(Uint32 i = 0; i<nodeCount; i++)
+ nodeIds.push_back(restarter.getDbNodeId(i));
+
+ int a_nodeIds[64];
+ if(nodeCount > 64)
+ abort();
+
+ Uint32 currentRestartNodeIndex = 1;
+ UtilTransactions utilTrans(*ctx->getTab());
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ while(i<=loops && result != NDBT_FAILED){
+
+ g_info << "Loop " << i << "/"<< loops <<" started" << endl;
+ /**
+ * 1. Load data
+ * 2. Restart all node -nostart
+ * 3. Start all but one node
+ * 4. Wait for startphase >= 2
+ * 5. Start last node
+ * 6. Verify records
+ */
+ g_info << "Loading records..." << endl;
+ hugoTrans.loadTable(pNdb, records);
+
+ CHECK(restarter.restartAll(false, true, false) == 0);
+
+ int nodeId = nodeIds[currentRestartNodeIndex];
+ currentRestartNodeIndex = (currentRestartNodeIndex + 1 ) % nodeCount;
+
+ Uint32 j = 0;
+ for(Uint32 k = 0; k<nodeCount; k++){
+ if(nodeIds[k] != nodeId){
+ a_nodeIds[j++] = nodeIds[k];
+ }
+ }
+
+ CHECK(restarter.startNodes(a_nodeIds, nodeCount - 1) == 0);
+ CHECK(restarter.waitNodesStarted(a_nodeIds, nodeCount - 1, 120) == 0);
+ CHECK(pNdb->waitUntilReady(5) == 0);
+ int count = records - 1;
+ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
+ CHECK(count == records);
+
+ CHECK(restarter.startNodes(&nodeId, 1) == 0);
+ CHECK(restarter.waitNodesStarted(&nodeId, 1, 120) == 0);
+
+ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
+ CHECK(count == records);
+ CHECK(utilTrans.clearTable(pNdb) == 0);
+
+ i++;
+ }
+
+ g_info << "runSystemRestart7 finished" << endl;
+
+ return result;
+}
+
+int runSystemRestart8(NDBT_Context* ctx, NDBT_Step* step){
+ Ndb* pNdb = GETNDB(step);
+ int result = NDBT_OK;
+ int timeout = 300;
+ Uint32 loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ Uint32 i = 1;
+
+ const Uint32 nodeCount = restarter.getNumDbNodes();
+ if(nodeCount < 2){
+ g_info << "SR8 - Needs atleast 2 nodes to test" << endl;
+ return NDBT_OK;
+ }
+
+ Vector<int> nodeIds;
+ for(Uint32 i = 0; i<nodeCount; i++)
+ nodeIds.push_back(restarter.getDbNodeId(i));
+
+ int a_nodeIds[64];
+ if(nodeCount > 64)
+ abort();
+
+ Uint32 currentRestartNodeIndex = 1;
+ UtilTransactions utilTrans(*ctx->getTab());
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ while(i<=loops && result != NDBT_FAILED){
+
+ g_info << "Loop " << i << "/"<< loops <<" started" << endl;
+ /**
+ * 1. Load data
+ * 2. Restart all node -nostart
+ * 3. Start all but one node
+ * 4. Verify records
+ * 5. Start last node
+ * 6. Verify records
+ */
+ g_info << "Loading records..." << endl;
+ hugoTrans.loadTable(pNdb, records);
+
+ CHECK(restarter.restartAll(false, true, false) == 0);
+
+ int nodeId = nodeIds[currentRestartNodeIndex];
+ currentRestartNodeIndex = (currentRestartNodeIndex + 1 ) % nodeCount;
+
+ Uint32 j = 0;
+ for(Uint32 k = 0; k<nodeCount; k++){
+ if(nodeIds[k] != nodeId){
+ a_nodeIds[j++] = nodeIds[k];
+ }
+ }
+
+ CHECK(restarter.startNodes(a_nodeIds, nodeCount-1) == 0);
+ CHECK(restarter.waitNodesStartPhase(a_nodeIds, nodeCount-1, 3, 120) == 0);
+ CHECK(restarter.startNodes(&nodeId, 1) == 0);
+ CHECK(restarter.waitClusterStarted(timeout) == 0);
+
+ int count = records - 1;
+ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
+ CHECK(count == records);
+ CHECK(utilTrans.clearTable(pNdb) == 0);
+ i++;
+ }
+
+ g_info << "runSystemRestart7 finished" << endl;
+
+ return result;
+}
+
int runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
@@ -817,8 +1018,13 @@ int runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){
int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
int records = ctx->getNumRecords();
- UtilTransactions utilTrans(*ctx->getTab());
- if (utilTrans.clearTable2(GETNDB(step), records) != 0){
+ Ndb* pNdb = GETNDB(step);
+ if(pNdb->waitUntilReady(5) != 0){
+ return NDBT_FAILED;
+ }
+
+ UtilTransactions utilTrans(*ctx->getTab());
+ if (utilTrans.clearTable2(pNdb, records) != 0){
return NDBT_FAILED;
}
return NDBT_OK;
@@ -933,6 +1139,43 @@ TESTCASE("SR5",
STEP(runSystemRestart5);
FINALIZER(runClearTable);
}
+TESTCASE("SR6",
+ "Perform system restart with some nodes having FS others wo/\n"
+ "* 1. Load data\n"
+ "* 2. Restart all node -nostart\n"
+ "* 3. Restart some nodes -i -nostart\n"
+ "* 4. Start all nodes verify records\n"){
+ INITIALIZER(runWaitStarted);
+ INITIALIZER(runClearTable);
+ STEP(runSystemRestart6);
+ FINALIZER(runClearTable);
+}
+TESTCASE("SR7",
+ "Perform partition win system restart\n"
+ "* 1. Load data\n"
+ "* 2. Restart all node -nostart\n"
+ "* 3. Start all but one node\n"
+ "* 4. Verify records\n"
+ "* 5. Start last node\n"
+ "* 6. Verify records\n"){
+ INITIALIZER(runWaitStarted);
+ INITIALIZER(runClearTable);
+ STEP(runSystemRestart7);
+ FINALIZER(runClearTable);
+}
+TESTCASE("SR8",
+ "Perform partition win system restart with other nodes delayed\n"
+ "* 1. Load data\n"
+ "* 2. Restart all node -nostart\n"
+ "* 3. Start all but one node\n"
+ "* 4. Wait for startphase >= 2\n"
+ "* 5. Start last node\n"
+ "* 6. Verify records\n"){
+ INITIALIZER(runWaitStarted);
+ INITIALIZER(runClearTable);
+ STEP(runSystemRestart8);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testSystemRestart);
int main(int argc, const char** argv){
diff --git a/ndb/test/ndbapi/testTimeout/testTimeout.cpp b/ndb/test/ndbapi/testTimeout.cpp
index de1d2cfc40b..8a7866880b3 100644
--- a/ndb/test/ndbapi/testTimeout/testTimeout.cpp
+++ b/ndb/test/ndbapi/testTimeout.cpp
@@ -57,8 +57,8 @@ int runTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){
int stepNo = step->getStepNo();
Uint32 timeoutVal;
if (!conf.getProperty(nodeId,
- "DB",
- "TransactionInactiveTimeout",
+ NODE_TYPE_DB,
+ CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
&timeoutVal)){
return NDBT_FAILED;
}
@@ -103,8 +103,8 @@ int runDontTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){
int stepNo = step->getStepNo();
Uint32 timeoutVal;
if (!conf.getProperty(nodeId,
- "DB",
- "TransactionInactiveTimeout",
+ NODE_TYPE_DB,
+ CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
&timeoutVal)){
return NDBT_FAILED;
}
@@ -151,8 +151,8 @@ int runBuddyTransNoTimeout(NDBT_Context* ctx, NDBT_Step* step){
int stepNo = step->getStepNo();
Uint32 timeoutVal;
if (!conf.getProperty(nodeId,
- "DB",
- "TransactionInactiveTimeout",
+ NODE_TYPE_DB,
+ CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
&timeoutVal)){
return NDBT_FAILED;
}
diff --git a/ndb/test/ndbapi/testTransactions/testTransactions.cpp b/ndb/test/ndbapi/testTransactions.cpp
index 9ce928f8736..9ce928f8736 100644
--- a/ndb/test/ndbapi/testTransactions/testTransactions.cpp
+++ b/ndb/test/ndbapi/testTransactions.cpp
diff --git a/ndb/test/ndbapi/test_event/test_event.cpp b/ndb/test/ndbapi/test_event.cpp
index 40fc1c6defa..40fc1c6defa 100644
--- a/ndb/test/ndbapi/test_event/test_event.cpp
+++ b/ndb/test/ndbapi/test_event.cpp
diff --git a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp b/ndb/test/ndbapi/userInterface.cpp
index fdbc229cc98..fdbc229cc98 100644
--- a/ndb/test/ndbapi/lmc-bench/async-src/user/userInterface.cpp
+++ b/ndb/test/ndbapi/userInterface.cpp
diff --git a/ndb/test/newtonapi/Makefile b/ndb/test/newtonapi/Makefile
deleted file mode 100644
index e3eabd26c64..00000000000
--- a/ndb/test/newtonapi/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include .defs.mk
-
-DIRS := \
- basic_test \
- perf_test
-
-include $(NDB_TOP)/Epilogue.mk
-
diff --git a/ndb/test/odbc/Makefile b/ndb/test/odbc/Makefile
deleted file mode 100644
index eb9f2dc9e3e..00000000000
--- a/ndb/test/odbc/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-include .defs.mk
-
-DIRS += driver
-
-#ifneq ($(findstring odbc, $(wildcard /usr/lib/libodbc.so)),)
-#DIRS += dm-unixodbc
-#endif
-
-ifneq ($(findstring $(NDB_OS), SOLARIS),)
-DIRS += dm-iodbc
-endif
-
-include ${NDB_TOP}/Epilogue.mk
diff --git a/ndb/test/odbc/driver/testOdbcDriver.cpp b/ndb/test/odbc/driver/testOdbcDriver.cpp
index b856b6a21f2..d3b3802ebe1 100644
--- a/ndb/test/odbc/driver/testOdbcDriver.cpp
+++ b/ndb/test/odbc/driver/testOdbcDriver.cpp
@@ -37,6 +37,7 @@
*/
#include <ndb_global.h>
+#undef test
#include <ndb_version.h>
#include <kernel/ndb_limits.h>
#include <Bitmask.hpp>
@@ -1281,6 +1282,7 @@ struct Fld {
return test.verify(m_double, m_ind, fld.m_double, fld.m_ind);
}
assert(false);
+ return false;
}
// debug
void print() const {
diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am
new file mode 100644
index 00000000000..3dd9632ce4b
--- /dev/null
+++ b/ndb/test/run-test/Makefile.am
@@ -0,0 +1,18 @@
+
+ndbtest_PROGRAMS = atrt
+
+atrt_SOURCES = main.cpp
+
+ndbtest_SCRIPTS = atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
+ atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh
+EXTRA_DIST = $(ndbtest_SCRIPTS)
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient
+LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o $(top_builddir)/ndb/src/libndbclient.la
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_util.mk.am
+include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/test/run-test/Makefile b/ndb/test/run-test/Makefile_old
index 6b4689b2dbb..6b4689b2dbb 100644
--- a/ndb/test/run-test/Makefile
+++ b/ndb/test/run-test/Makefile_old
diff --git a/ndb/test/run-test/README b/ndb/test/run-test/README
new file mode 100644
index 00000000000..d5da8f05c17
--- /dev/null
+++ b/ndb/test/run-test/README
@@ -0,0 +1,43 @@
+run-test/README
+
+This document describes how atrt works and how to use it.
+
+atrt is a test program driver.
+atrt supports fully distributed test and utilizes ndb_cpcd.
+
+=================================
+atrt has the following main loop:
+
+/**
+ * Psuedo code for atrt
+ */
+ read config file (default d.txt)
+ contact each ndb_cpcd
+ start each ndb_mgmd
+ connect to each ndb_mgmd
+ for each read(test case)
+ do
+ if previous test failed (or is first test)
+ stop each ndbd
+ start each ndbd
+ wait for ndbd to get started
+
+ start each mysqld
+
+ start each test prg
+
+ wait while all is running and max time not elapsed
+
+ stop each mysqld
+
+ stop each test prg
+
+ gather result
+
+ done
+/**
+ * End of psuedo code
+ */
+
+=================================
+
diff --git a/ndb/test/run-test/atrt-example.tgz b/ndb/test/run-test/atrt-example.tgz
new file mode 100644
index 00000000000..8455b2eb00d
--- /dev/null
+++ b/ndb/test/run-test/atrt-example.tgz
Binary files differ
diff --git a/ndb/test/run-test/basic.txt b/ndb/test/run-test/basic.txt
new file mode 100644
index 00000000000..a952320db08
--- /dev/null
+++ b/ndb/test/run-test/basic.txt
@@ -0,0 +1,763 @@
+# BASIC FUNCTIONALITY
+max-time: 500
+cmd: testBasic
+args: -n PkRead
+
+max-time: 500
+cmd: testBasic
+args: -n PkUpdate
+
+max-time: 500
+cmd: testBasic
+args: -n PkDelete
+
+max-time: 500
+cmd: testBasic
+args: -n PkInsert
+
+max-time: 600
+cmd: testBasic
+args: -n UpdateAndRead
+
+max-time: 500
+cmd: testBasic
+args: -n PkReadAndLocker T6
+
+max-time: 500
+cmd: testBasic
+args: -n PkReadAndLocker2 T6
+
+max-time: 500
+cmd: testBasic
+args: -n PkReadUpdateAndLocker T6
+
+max-time: 500
+cmd: testBasic
+args: -n ReadWithLocksAndInserts T6
+
+max-time: 500
+cmd: testBasic
+args: -n PkInsertTwice T1 T6 T10
+
+max-time: 1500
+cmd: testBasic
+args: -n Fill T1
+
+max-time: 1500
+cmd: testBasic
+args: -n Fill T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommitSleep T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommit626 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommitAndClose T6
+
+max-time: 500
+cmd: testBasic
+args: -n Commit626 T6
+
+max-time: 500
+cmd: testBasic
+args: -n CommitTry626 T6
+
+max-time: 500
+cmd: testBasic
+args: -n CommitAsMuch626 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommit626 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommitRollback626 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n Commit630 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n CommitTry630 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n CommitAsMuch630 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommit630 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommitRollback630 T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n NoCommitAndClose T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n RollbackUpdate T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n RollbackDeleteMultiple T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n ImplicitRollbackDelete T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n CommitDelete T1 T6
+
+max-time: 500
+cmd: testBasic
+args: -n RollbackNothing T1 T6
+
+max-time: 500
+cmd: testBasicAsynch
+args: -n PkInsertAsynch
+
+max-time: 500
+cmd: testBasicAsynch
+args: -n PkReadAsynch
+
+max-time: 500
+cmd: testBasicAsynch
+args: -n PkUpdateAsynch
+
+max-time: 500
+cmd: testBasicAsynch
+args: -n PkDeleteAsynch
+
+max-time: 500
+cmd: testBasic
+args: -n MassiveRollback T1 T6 T13
+
+max-time: 500
+cmd: testBasic
+args: -n MassiveRollback2 T1 T6 T13
+
+#-m 500 1: testBasic -n ReadConsistency T6
+cmd: testTimeout
+args: -n DontTimeoutTransaction T1
+
+cmd: testTimeout
+args: -n DontTimeoutTransaction5 T1
+
+cmd: testTimeout
+args: -n TimeoutTransaction T1
+
+cmd: testTimeout
+args: -n TimeoutTransaction5 T1
+
+cmd: testTimeout
+args: -n BuddyTransNoTimeout T1
+
+cmd: testTimeout
+args: -n BuddyTransNoTimeout5 T1
+
+#
+# SCAN TESTS
+#
+max-time: 500
+cmd: testScan
+args: -n ScanRead16
+
+max-time: 500
+cmd: testScan
+args: -n ScanRead240
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadCommitted240
+
+max-time: 500
+cmd: testScan
+args: -n ScanUpdate
+
+max-time: 500
+cmd: testScan
+args: -n ScanUpdate2 T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanDelete
+
+max-time: 500
+cmd: testScan
+args: -n ScanDelete2 T10
+
+max-time: 500
+cmd: testScan
+args: -n ScanUpdateAndScanRead T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadAndLocker T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadAndPkRead T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanRead488 -l 10 T6
+
+max-time: 600
+cmd: testScan
+args: -n ScanRead40 -l 100 T2
+
+max-time: 1800
+cmd: testScan
+args: -n ScanRead100 -l 100 T1
+
+max-time: 600
+cmd: testScan
+args: -n ScanRead40 -l 100 T1
+
+max-time: 1800
+cmd: testScan
+args: -n ScanRead40RandomTable -l 100 T1
+
+max-time: 3600
+cmd: testScan
+args: -n ScanRead40RandomTable -l 1000 T2
+
+max-time: 500
+cmd: testScan
+args: -n ScanWithLocksAndInserts T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadAbort T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadAbort15 T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadAbort240 T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanUpdateAbort16 T6
+
+max-time: 3600
+cmd: testScan
+args: -n ScanReadRestart T1 T6 T13
+
+max-time: 500
+cmd: testScan
+args: -n ScanUpdateRestart T6
+
+max-time: 500
+cmd: testScan
+args: -n CheckGetValue T6
+
+max-time: 500
+cmd: testScan
+args: -n CloseWithoutStop T6
+
+max-time: 500
+cmd: testScan
+args: -n NextScanWhenNoMore T6
+
+max-time: 500
+cmd: testScan
+args: -n ExecuteScanWithoutOpenScan T6
+
+max-time: 500
+cmd: testScan
+args: -n OnlyOpenScanOnce T6
+
+max-time: 500
+cmd: testScan
+args: -n OnlyOneOpInScanTrans T6
+
+max-time: 500
+cmd: testScan
+args: -n OnlyOneOpBeforeOpenScan T6
+
+max-time: 500
+cmd: testScan
+args: -n OnlyOneScanPerTrans T6
+
+max-time: 500
+cmd: testScan
+args: -n NoCloseTransaction T6
+
+max-time: 500
+cmd: testScan
+args: -n CheckInactivityTimeOut T6
+
+max-time: 500
+cmd: testScan
+args: -n CheckInactivityBeforeClose T6
+
+max-time: 500
+cmd: testScan
+args: -n CheckAfterTerror T6
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadError5021 T1
+
+max-time: 500
+cmd: testScan
+args: -n ScanReaderror5022 T1
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadError5023 T1
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadError5024 T1
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadError5025 T1
+
+max-time: 500
+cmd: testScan
+args: -n ScanReadError5030 T1
+
+# OLD FLEX
+max-time: 500
+cmd: flexBench
+args: -c 25 -t 10
+
+max-time: 500
+cmd: flexHammer
+args: -r 5 -t 32
+
+#
+# DICT TESTS
+max-time: 1500
+cmd: testDict
+args: -n CreateAndDrop
+
+max-time: 1500
+cmd: testDict
+args: -n CreateAndDropWithData
+
+max-time: 1500
+cmd: testDict
+args: -n CreateAndDropDuring T6 T10
+
+max-time: 1500
+cmd: testDict
+args: -n CreateInvalidTables
+
+max-time: 1500
+cmd: testDict
+args: -n CreateTableWhenDbIsFull T6
+
+max-time: 1500
+cmd: testDict
+args: -n CreateMaxTables T6
+
+max-time: 500
+cmd: testDict
+args: -n FragmentTypeSingle T1
+
+max-time: 1500
+cmd: testDict
+args: -n FragmentTypeAll T1 T6 T7 T8
+
+max-time: 1500
+cmd: testDict
+args: -n FragmentTypeAllLarge T1 T6 T7 T8
+
+max-time: 1500
+cmd: testDict
+args: -n TemporaryTables T1 T6 T7 T8
+
+#
+# TEST NDBAPI
+#
+max-time: 500
+cmd: testDataBuffers
+args:
+
+# Testsuite: testNdbApi
+# Number of tests: 5
+max-time: 500
+cmd: testNdbApi
+args: -n MaxNdb T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n MaxTransactions T1 T6 T7 T8 T13
+
+max-time: 500
+cmd: testNdbApi
+args: -n MaxOperations T1 T6 T7 T8 T13
+
+max-time: 500
+cmd: testNdbApi
+args: -n MaxGetValue T1 T6 T7 T8 T13
+
+max-time: 500
+cmd: testNdbApi
+args: -n MaxEqual
+
+max-time: 500
+cmd: testNdbApi
+args: -n DeleteNdb T1 T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n WaitUntilReady T1 T6 T7 T8 T13
+
+max-time: 500
+cmd: testNdbApi
+args: -n GetOperationNoTab T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n NdbErrorOperation T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n MissingOperation T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n GetValueInUpdate T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n UpdateWithoutKeys T6
+
+max-time: 500
+cmd: testNdbApi
+args: -n UpdateWithoutValues T6
+
+max-time: 500
+cmd: testInterpreter
+args: T1
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadRead
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadRead
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExRead
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertRead
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateRead
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteRead
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteReadEx
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteInsert
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteUpdate
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteDelete
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadDirtyRead
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n FReadDirtyRead
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n ReadExDirtyRead
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n InsertDirtyRead
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n UpdateDirtyRead
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteSimpleRead
+
+max-time: 1500
+cmd: testOperations
+args: -n DeleteDirtyRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadReadEx
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadInsert
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadUpdate
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadDelete
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExReadEx
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExInsert
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExUpdate
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExDelete
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertReadEx
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertInsert
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertUpdate
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertDelete
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateReadEx
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateInsert
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateUpdate
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateDelete
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteReadEx
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteInsert
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteUpdate
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteDelete
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadSimpleRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadDirtyRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExSimpleRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n ReadExDirtyRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertSimpleRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n InsertDirtyRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateSimpleRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n UpdateDirtyRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteSimpleRead
+
+max-time: 1500
+cmd: testTransactions
+args: -n DeleteDirtyRead
+
+max-time: 1500
+cmd: testRestartGci
+args: T6
+
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index eb8a626dc2b..9e318b0219e 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -30,35 +30,6 @@
#include <mgmapi.h>
#include "CpcClient.hpp"
-/**
- psuedo code for run-test.bin
-
- define autotest_wrapper process at each host
- start ndb-processes
-
- for each testcase
- do
- start mysqld processes
- start replication processes
- start test programs
-
- wait until test program finished or max time passed
-
- stop test program
- stop replication processes
- stop mysqld processes
-
- write report data-file
- if test failed and ! last test
- restart ndb processes
-
- drop all tables created by test
- done
-
- stop ndb processes
- undefined wrapper processes
-*/
-
/** Global variables */
static const char progname[] = "ndb_atrt";
static const char * g_gather_progname = "atrt-gather-result.sh";
@@ -75,6 +46,7 @@ static const char * g_report_filename = 0;
static const char * g_default_user = 0;
static const char * g_default_base_dir = 0;
static int g_default_base_port = 0;
+static int g_mysqld_use_base = 1;
static int g_report = 0;
static int g_verbosity = 0;
@@ -158,10 +130,17 @@ main(int argc, const char ** argv){
if(!start_processes(g_config, atrt_process::NDB_DB))
goto end;
-
- if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED))
- goto end;
-
+
+ if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_NOT_STARTED))
+ goto end;
+
+ for(Uint32 i = 0; i<3; i++)
+ if(wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED))
+ goto started;
+
+ goto end;
+
+started:
g_logger.info("Ndb start completed");
}
@@ -347,7 +326,7 @@ parse_args(int argc, const char** argv){
return false;
}
- g_default_user = strdup(getenv("USER"));
+ g_default_user = strdup(getenv("LOGNAME"));
return true;
}
@@ -377,6 +356,8 @@ setup_config(atrt_config& config){
int lineno = 0;
char buf[2048];
+ BaseString connect_string;
+ int mysql_port_offset = 0;
while(fgets(buf, 2048, f)){
lineno++;
@@ -408,6 +389,11 @@ setup_config(atrt_config& config){
continue;
}
+ if(split1[0].trim() == "mysqld-use-base" && split1[1].trim() == "no"){
+ g_mysqld_use_base = 0;
+ continue;
+ }
+
Vector<BaseString> hosts;
if(split1[1].trim().split(hosts) <= 0){
g_logger.warning("Invalid line %d in %s - ignoring",
@@ -449,8 +435,10 @@ setup_config(atrt_config& config){
for(size_t i = 0; i<hosts.size(); i++){
BaseString & tmp = hosts[i];
atrt_host * host = find(tmp, config.m_hosts);
+ BaseString & dir = host->m_base_dir;
const int index = config.m_processes.size() + 1;
+
atrt_process proc;
proc.m_index = index;
proc.m_host = host;
@@ -458,8 +446,8 @@ setup_config(atrt_config& config){
proc.m_proc.m_type = "temporary";
proc.m_proc.m_owner = "atrt";
proc.m_proc.m_group = "group";
- proc.m_proc.m_cwd.assign(host->m_base_dir).append("/run/");
- proc.m_proc.m_env.assign("LD_LIBRARY_PATH=").append(host->m_base_dir).append("/lib");
+ proc.m_proc.m_cwd.assign(dir).append("/run/");
+ proc.m_proc.m_env.assfmt("LD_LIBRARY_PATH=%s/lib/mysql", dir.c_str());
proc.m_proc.m_stdout = "log.out";
proc.m_proc.m_stderr = "2>&1";
proc.m_proc.m_runas = proc.m_host->m_user;
@@ -468,16 +456,33 @@ setup_config(atrt_config& config){
proc.m_ndb_mgm_port = g_default_base_port;
if(split1[0] == "mgm"){
proc.m_type = atrt_process::NDB_MGM;
- proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgm");
- proc.m_proc.m_path.assign(host->m_base_dir).append("/bin/mgmtsrvr");
+ proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgmd");
+ proc.m_proc.m_path.assign(dir).append("/libexec/ndb_mgmd");
proc.m_proc.m_args = "-n -c initconfig.txt";
- proc.m_proc.m_cwd.appfmt("%d.ndb_mgm", index);
+ proc.m_proc.m_cwd.appfmt("%d.ndb_mgmd", index);
+ connect_string.appfmt(";host=%s:%d",
+ proc.m_hostname.c_str(), proc.m_ndb_mgm_port);
} else if(split1[0] == "ndb"){
proc.m_type = atrt_process::NDB_DB;
- proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_db");
- proc.m_proc.m_path.assign(host->m_base_dir).append("/bin/ndb");
+ proc.m_proc.m_name.assfmt("%d-%s", index, "ndbd");
+ proc.m_proc.m_path.assign(dir).append("/libexec/ndbd");
proc.m_proc.m_args = "-i -n";
- proc.m_proc.m_cwd.appfmt("%d.ndb_db", index);
+ proc.m_proc.m_cwd.appfmt("%d.ndbd", index);
+ } else if(split1[0] == "mysqld"){
+ proc.m_type = atrt_process::MYSQL_SERVER;
+ proc.m_proc.m_name.assfmt("%d-%s", index, "mysqld");
+ proc.m_proc.m_path.assign(dir).append("/libexec/mysqld");
+ proc.m_proc.m_args = "--core-file --ndbcluster";
+ proc.m_proc.m_cwd.appfmt("%d.mysqld", index);
+ if(mysql_port_offset > 0 || g_mysqld_use_base){
+ // setup mysql specific stuff
+ const char * basedir = proc.m_proc.m_cwd.c_str();
+ proc.m_proc.m_args.appfmt("--datadir=%s", basedir);
+ proc.m_proc.m_args.appfmt("--pid-file=%s/mysql.pid", basedir);
+ proc.m_proc.m_args.appfmt("--socket=%s/mysql.sock", basedir);
+ proc.m_proc.m_args.appfmt("--port=%d",
+ g_default_base_port-(++mysql_port_offset));
+ }
} else if(split1[0] == "api"){
proc.m_type = atrt_process::NDB_API;
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api");
@@ -494,7 +499,13 @@ setup_config(atrt_config& config){
config.m_processes.push_back(proc);
}
}
-
+
+ // Setup connect string
+ for(size_t i = 0; i<config.m_processes.size(); i++){
+ config.m_processes[i].m_proc.m_env.appfmt(" NDB_CONNECTSTRING=nodeid=%d%s",
+ i+1, connect_string.c_str());
+ }
+
end:
fclose(f);
return result;
@@ -622,6 +633,11 @@ wait_ndb(atrt_config& config, int goal){
g_logger.critical("Strange DB status during start: %d %d", i, min2);
return false;
}
+
+ if(min2 < min){
+ g_logger.critical("wait ndb failed node: %d %d %d %d",
+ state->node_states[i].node_id, min, min2, goal);
+ }
}
}
@@ -691,7 +707,7 @@ bool
start_processes(atrt_config& config, int types){
for(size_t i = 0; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
- if((types & proc.m_type) != 0){
+ if((types & proc.m_type) != 0 && proc.m_proc.m_path != ""){
if(!start_process(proc)){
return false;
}
@@ -759,18 +775,24 @@ update_status(atrt_config& config, int){
for(size_t i = 0; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
- Vector<SimpleCpcClient::Process> & h_procs = m_procs[proc.m_host->m_index];
- bool found = false;
- for(size_t j = 0; j<h_procs.size(); j++){
- if(proc.m_proc.m_id == h_procs[j].m_id){
- found = true;
- proc.m_proc.m_status = h_procs[j].m_status;
- break;
+ if(proc.m_proc.m_id != -1){
+ Vector<SimpleCpcClient::Process> &h_procs= m_procs[proc.m_host->m_index];
+ bool found = false;
+ for(size_t j = 0; j<h_procs.size(); j++){
+ if(proc.m_proc.m_id == h_procs[j].m_id){
+ found = true;
+ proc.m_proc.m_status = h_procs[j].m_status;
+ break;
+ }
+ }
+ if(!found){
+ g_logger.error("update_status: not found");
+ g_logger.error("id: %d host: %s cmd: %s",
+ proc.m_proc.m_id,
+ proc.m_hostname.c_str(),
+ proc.m_proc.m_path.c_str());
+ return false;
}
- }
- if(!found){
- g_logger.error("update_status: not found");
- return false;
}
}
return true;
@@ -877,16 +899,24 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){
return false;
}
- for(size_t i = 0; i<config.m_processes.size(); i++){
+ size_t i = 0;
+ for(; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){
- proc.m_proc.m_path.assign(proc.m_host->m_base_dir).append("/bin/").append(tc.m_command);
+ proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(),
+ tc.m_command.c_str());
proc.m_proc.m_args.assign(tc.m_args);
- return true;
+ break;
}
}
-
- return false;
+ for(i++; i<config.m_processes.size(); i++){
+ atrt_process & proc = config.m_processes[i];
+ if(proc.m_type == atrt_process::NDB_API){
+ proc.m_proc.m_path.assign("");
+ proc.m_proc.m_args.assign("");
+ }
+ }
+ return true;
}
bool
diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh
index 079650a729f..89f13a4b62a 100755
--- a/ndb/test/run-test/make-html-reports.sh
+++ b/ndb/test/run-test/make-html-reports.sh
@@ -1,106 +1,23 @@
#!/bin/sh
-# NAME
-# make-html-reports.sh
-#
-# SYNOPSIS
-# make-html-reports.sh [-q] [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ]
-#
-# DESCRIPTION
-#
-# OPTIONS
-#
-# EXAMPLES
-#
-#
-# ENVIRONMENT
-# NDB_PROJ_HOME Home dir for ndb
-#
-# FILES
-# $NDB_PROJ_HOME/lib/funcs.sh general shell script functions
-#
-#
-# SEE ALSO
-#
-# DIAGNOSTICTS
-#
-# VERSION
-# 1.0
-#
-# AUTHOR
-# Jonas Oreland
-#
-
-progname=`basename $0`
-synopsis="make-html-reports.sh [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ]"
-
-: ${NDB_PROJ_HOME:?} # If undefined, exit with error message
-
-: ${NDB_LOCAL_BUILD_OPTIONS:=--} # If undef, set to --. Keeps getopts happy.
- # You may have to experiment a bit
- # to get quoting right (if you need it).
-
-
-. $NDB_PROJ_HOME/lib/funcs.sh # Load some good stuff
-
-# defaults for options related variables
-#
-
-
-src_dir=`pwd`
-dst_dir=`pwd`
-conf_dir=`pwd`
-report_date=`date '+%Y-%m-%d'`
-uniq_id=$$.$$
-verbose=yes
-
-# used if error when parsing the options environment variable
-#
-env_opterr="options environment variable: <<$options>>"
-
-# Option parsing, for the options variable as well as the command line.
-#
-# We want to be able to set options in an environment variable,
-# as well as on the command line. In order not to have to repeat
-# the same getopts information twice, we loop two times over the
-# getopts while loop. The first time, we process options from
-# the options environment variable, the second time we process
-# options from the command line.
-#
-# The things to change are the actual options and what they do.
-#
-#
-
-for optstring in "$options" "" # 1. options variable 2. cmd line
-do
-
- while getopts q:s:R:d:c: i $optstring # optstring empty => no arg => cmd line
- do
- case $i in
-
- q) verbose="";; # echo important things
- d) dst_dir=$OPTARG;; # Destination directory
- s) src_dir=$OPTARG;; # Destination directory
- c) conf_dir=$OPTARG;; #
- R) report_date=$OPTARG;; #
- \?) syndie $env_opterr;; # print synopsis and exit
-
- esac
- done
-
- [ -n "$optstring" ] && OPTIND=1 # Reset for round 2, cmdline options
- env_opterr= # Round 2 should not use the value
+src_dir=$1
+run=$2
+date=$3
+src_file=$src_dir/report.txt
-done
-shift `expr $OPTIND - 1`
-
-src_dir=`abspath $src_dir`
-dst_dir=`abspath $dst_dir`
-conf_dir=`abspath $conf_dir`
+if [ ! -f $src_dir/report.txt ]
+then
+ echo "$src_dir/report.txt is missing"
+ exit 1
+fi
###
#
# General html functions
+trim(){
+ echo $*
+}
+
header(){
cat <<EOF
<html><head><title>$*</title></head>
@@ -166,64 +83,7 @@ hr(){
EOF
}
-# --- option parsing done ---
-
# -- Verify
-trace "Verifying arguments"
-summary_file=$src_dir/reports/summary.$report_date
-
-if [ ! -r $summary_file ]
-then
- syndie "Invalid src directory or report date: $summary_file not found"
-fi
-
-if [ ! -d $conf_dir/configurations ]
-then
- syndie "Invalid src directory: $conf_dir/configurations not found"
-fi
-
-if [ ! -d $conf_dir/testcases ]
-then
- syndie "Invalid src directory: $conf_dir/testcases not found"
-fi
-
-if [ ! -d $dst_dir ]
-then
- syndie "Invalid dst dir..."
-fi
-
-# --- option verifying done ---
-
-trace "src_dir: $src_dir"
-trace "dst_dir: $dst_dir"
-trace "conf_dir: $conf_dir"
-trace "report date: $report_date"
-
-###
-config_spec(){
- cat <<EOF
-<a href=#$1>$1</a>
-EOF
-}
-
-config_spec_include(){
- # Print the $1 file to the file we are generating
- cat <<EOF
-<a name=$1><pre>
-EOF
- if [ -r $conf_dir/configurations/$1 ]
- then
- cat -E $conf_dir/configurations/$1 | sed 's/\$/<BR>/g'
- else
- cat <<EOF
- Config spec $1 not found
-EOF
- fi
-cat <<EOF
-</pre></a>
-EOF
-}
-
time_spec(){
# $1 - secs
_ts_tmp=$1
@@ -232,8 +92,14 @@ time_spec(){
_ts_tmp=`expr $_ts_tmp / 60`
_ts_m=`expr $_ts_tmp % 60`
- _ts_tmp=`expr $_ts_tmp / 60`
+ if [ $_ts_tmp -ge 60 ]
+ then
+ _ts_tmp=`expr $_ts_tmp / 60`
+ else
+ _ts_tmp=0
+ fi
+ a=3
_ts_h=$_ts_tmp
if [ $_ts_h -gt 0 ]
@@ -247,191 +113,77 @@ time_spec(){
echo $ret
}
-log_spec(){
- _ff_=$src_dir/log/$report_date/$1.$2/test.$3.out
- if [ -r $_ff_ ] && [ -s $_ff_ ]
- then
- _f2_=$dst_dir/log.$report_date.$1.$2.$3.out.gz
- if [ -r $_f2_ ]
- then
- rm $_f2_
- fi
- cp $_ff_ $dst_dir/log.$report_date.$1.$2.$3.out
- gzip $dst_dir/log.$report_date.$1.$2.$3.out
- rm -f $dst_dir/log.$report_date.$1.$2.$3.out
- echo "<a href=log.$report_date.$1.$2.$3.out.gz>Log file</a>"
- else
- echo "-"
- fi
-}
+### Main
-err_spec(){
- _ff_=$src_dir/log/$report_date/$1.$2/test.$3.err.tar
- if [ -r $_ff_ ] && [ -s $_ff_ ]
- then
- cp $_ff_ $dst_dir/err.$report_date.$1.$2.$3.err.tar
- gzip $dst_dir/err.$report_date.$1.$2.$3.err.tar
- rm -f $dst_dir/err.$report_date.$1.$2.$3.err.tar
- echo "<a href=err.$report_date.$1.$2.$3.err.tar.gz>Error tarball</a>"
- else
- echo "-"
- fi
-}
+report_file=$src_dir/report.html
+summary_file=$src_dir/summary.html
-command_spec(){
- echo $* | sed 's/;/<BR>/g'
-}
+passed=0
+failed=0
+total=0
-### Main
+pass(){
+ passed=`expr $passed + 1`
+}
-html_summary_file=$dst_dir/summary.$report_date.html
+fail(){
+ failed=`expr $failed + 1`
+}
-trace "Creating summary"
(
- eval `grep "TOTAL" $summary_file | awk -F";" '{ printf("test_file=\"%s\"; elapsed=\"%s\"; started=\"%s\"; stopped=\"%s\"", $2, $3, $4, $5); }'`
-
- header "Autotest summary $report_date"
- heading 1 "Autotest summary $report_date"
- table
- row ; column `bold test file: `; column $test_file ; end_row
- row ; column `bold Started:` ; column "$started "; end_row
- row ; column `bold Stopped:` ; column "$stopped "; end_row
- row ; column `bold Elapsed:` ; column "`time_spec $elapsed secs`" ; end_row
- end_table
- hr
-
- table "border=1"
- row
- c_column `bold Report`
- c_column `bold Tag`
- c_column `bold Version`
- c_column `bold Distr-Config`
- c_column `bold Db-Config`
- c_column `bold Type`
- c_column `bold Test file`
- c_column `bold Make`
- c_column `bold Config`
- c_column `bold Test time`
- c_column `bold Passed`
- c_column `bold Failed`
- end_row
-
- grep -v "^#" $summary_file | grep -v TOTAL | sed 's/;/ /g' | \
- while read tag version config template type test_file make_res make_time conf_res conf_time test_time passed failed
- do
+ header Report $run $date
+ table "border=1"
row
- if [ -r $src_dir/reports/report.$tag.$version.$config.$template.$type.$test_file.$report_date ]
- then
- column "<a href=\"report.$tag.$version.$config.$template.$type.$test_file.$report_date.html\">report</a>"
- else
- column "-"
- fi
-
- column $tag
- column $version
- column $config
- column $template
- column $type
- column $test_file
- column "$make_res(`time_spec $make_time`)"
- column "$conf_res(`time_spec $conf_time`)"
- c_column "`time_spec $test_time`"
- c_column `bold $passed`
- c_column `bold $failed`
+ column `bold Test case`
+ column `bold Result`
+ column `bold Elapsed`
+ column `bold Log`
end_row
- done
- end_table
+) > $report_file
- footer
-) > $html_summary_file
-
-for i in $src_dir/reports/report.*.$report_date
+cat $src_file | while read line
do
- f=`basename $i`
- trace "Creating report: $f"
- eval `echo $f | awk -F"." '{printf("tag=%s;version=%s;config=%s;template=%s;type=%s;test_file=%s", $2, $3, $4, $5, $6, $7);}'`
-
- (
- header "Autotest report $report_date"
- heading 1 "Autotest report $report_date"
- table #"border=1"
- row ; column `bold Tag:`; column $tag ; end_row
- row ; column `bold Version:` ; column $version ; end_row
- row ; column `bold Configuration:` ; column `config_spec $config`; end_row
- row ; column `bold Template:` ; column `config_spec $template`; end_row
- row ; column `bold Type:` ; column $type ; end_row
- row ; column `bold Test file:` ; column $test_file; end_row
- end_table
- hr
-
- table "border=1"
- row
- c_column `bold Test case`
- c_column `bold Result`
- c_column `bold Test time`
- c_column `bold Logfile`
- c_column `bold Error tarfile`
- end_row
-
- grep -v "^#" $i | sed 's/;/ /g' | \
- while read test_no test_res test_time cmd
- do
- row
- column "`command_spec $cmd`"
- case "$test_res" in
- 0)
- column "PASSED";;
- 1001)
- column "API error";;
- 1002)
- column "Max time expired";;
- 1003)
- column "Mgm port busy";;
- *)
- column "Unknown: $test_res";;
- esac
-
- column "`time_spec $test_time`"
-
- column "`log_spec $tag $version $test_no`"
- column "`err_spec $tag $version $test_no`"
- end_row
- done
- end_table
-
- # Last on page we include spec
- # of used machines and template for config
- # for future reference
- hr
- table "border=1"
- row; column `bold Configuration:` $config; end_row
- row; column `config_spec_include $config`; end_row
- end_table
- hr
- table "border=1"
- row; column `bold Template:` $template; end_row
- row; column `config_spec_include $template`; end_row
- end_table
-
- footer
-
- ) > $dst_dir/$f.html
+ eval `echo $line | awk -F";" '{ printf("prg=\"%s\"; no=\"%s\"; res=\"%s\"; time=\"%s\"", $1, $2, $3, $4); }'`
+
+ prg=`trim $prg`
+ no=`trim $no`
+ res=`trim $res`
+ time=`trim $time`
+ res_dir="<a href=\"result.$no/\">log</a>"
+
+ ts=`time_spec $time`
+ res_txt=""
+ case $res in
+ 0) pass; res_txt="PASSED"; res_dir="&nbsp;";;
+ *) fail; res_txt="FAILED";;
+ esac
+ total=`expr $total + $time`
+
+ (
+ row
+ column $prg
+ column $res_txt
+ column $ts
+ column $res_dir
+ end_row
+ ) >> $report_file
+
+ (
+ row
+ column $run
+ column $date
+ column $passed
+ column $failed
+ column `time_spec $total`
+ column "<a href=\"result-$run/$date/report.html\">report</a>"
+ column "<a href=\"result-$run/$date/log.txt\">log.txt</a>"
+ end_row
+ ) > $summary_file
done
-# Re creating index
-trace "Recreating index"
(
- header "Autotest super-duper index"
- heading 1 "<center>Autotest super-duper index</center>"
- hr
- for i in `ls $dst_dir/summary.*.html | sort -r -n`
- do
- f=`basename $i`
- cat <<EOF
-<p><a href=$f>$f</a></p>
-EOF
- done
- footer
-) > $dst_dir/index.html
+ end_table
+ footer
+) >> $report_file
exit 0
diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am
new file mode 100644
index 00000000000..a513086dc33
--- /dev/null
+++ b/ndb/test/src/Makefile.am
@@ -0,0 +1,20 @@
+
+noinst_LIBRARIES = libNDBT.a
+
+libNDBT_a_SOURCES = \
+ NDBT_ReturnCodes.cpp \
+ NDBT_Error.cpp NDBT_Tables.cpp NDBT_ResultRow.cpp \
+ NDBT_Test.cpp HugoCalculator.cpp \
+ HugoOperations.cpp HugoTransactions.cpp \
+ HugoAsynchTransactions.cpp UtilTransactions.cpp \
+ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \
+ NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \
+ NdbSchemaCon.cpp NdbSchemaOp.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/test/src/Makefile b/ndb/test/src/Makefile_old
index 2b634bcd3cd..2738ce1aba2 100644
--- a/ndb/test/src/Makefile
+++ b/ndb/test/src/Makefile_old
@@ -15,10 +15,12 @@ SOURCES = NDBT_ReturnCodes.cpp \
SOURCES.c =
CFLAGS_NdbRestarter.cpp := -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon)
-CFLAGS_NdbBackup.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon)
-CFLAGS_NdbConfig.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon)
+CFLAGS_NdbConfig.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
+ -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
CFLAGS_NdbRestarts.cpp := -I$(call fixpath,$(NDB_TOP)/include/kernel)
-CFLAGS_NdbBackup.cpp += -I$(call fixpath,$(NDB_TOP)/include/kernel)
+CFLAGS_NdbBackup.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
+ -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \
+ -I$(call fixpath,$(NDB_TOP)/include/kernel)
CFLAGS_NdbGrep.cpp += -I$(call fixpath,$(NDB_TOP)/include/kernel) -I$(call fixpath,$(NDB_TOP)/include/mgmcommon)
include $(NDB_TOP)/Epilogue.mk
diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp
index ba46be203e1..7c419444760 100644
--- a/ndb/test/src/NDBT_ResultRow.cpp
+++ b/ndb/test/src/NDBT_ResultRow.cpp
@@ -17,6 +17,7 @@
#include <ndb_global.h>
#include "NDBT_ResultRow.hpp"
#include <NdbOut.hpp>
+#include <NdbSchemaCon.hpp>
NDBT_ResultRow::NDBT_ResultRow(const NdbDictionary::Table& tab,
char attrib_delimiter)
@@ -111,77 +112,8 @@ BaseString NDBT_ResultRow::c_str() {
NdbOut &
operator << (NdbOut& ndbout, const NDBT_ResultRow & res) {
- for(int i = 0; i<res.cols; i++){
- if(res.data[i]->isNULL())
- ndbout << "NULL";
- else{
- const int size = res.data[i]->attrSize();
- const int aSize = res.data[i]->arraySize();
- switch(res.data[i]->attrType()){
- case UnSigned:
- switch(size){
- case 8:
- ndbout << res.data[i]->u_64_value();
- break;
- case 4:
- ndbout << res.data[i]->u_32_value();
- break;
- case 2:
- ndbout << res.data[i]->u_short_value();
- break;
- case 1:
- ndbout << (unsigned) res.data[i]->u_char_value();
- break;
- default:
- ndbout << "Unknown size";
- }
- break;
-
- case Signed:
- switch(size){
- case 8:
- ndbout << res.data[i]->int64_value();
- break;
- case 4:
- ndbout << res.data[i]->int32_value();
- break;
- case 2:
- ndbout << res.data[i]->short_value();
- break;
- case 1:
- ndbout << (int) res.data[i]->char_value();
- break;
- default:
- ndbout << "Unknown size";
- }
- break;
-
- case String:
- {
- char * buf = new char[aSize+1];
- memcpy(buf, res.data[i]->aRef(), aSize);
- buf[aSize] = 0;
- ndbout << buf;
- delete [] buf;
- // Null terminate string
- //res.data[i][res.sizes[i]] = 0;
- //ndbout << res.data[i];
- }
- break;
-
- case Float:
- ndbout_c("%f", res.data[i]->float_value());
- break;
-
- default:
- ndbout << "Unknown(" << res.data[i]->attrType() << ")";
- break;
- }
- }
- if (i < res.cols-1)
- ndbout << res.ad;
- }
-
+ for(int i = 0; i<res.cols; i++)
+ ndbout << *(res.data[i]) << "\t";
return ndbout;
}
diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp
index c520b01c990..485377e690a 100644
--- a/ndb/test/src/NDBT_Table.cpp
+++ b/ndb/test/src/NDBT_Table.cpp
@@ -14,105 +14,35 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include "NDBT_Table.hpp"
+#include <NDBT_Table.hpp>
#include <NdbTimer.hpp>
#include <NDBT.hpp>
-
class NdbOut&
operator <<(class NdbOut& ndbout, const NDBT_Attribute & attr){
NdbDictionary::Column::Type type = attr.getType();
- bool key = attr.getPrimaryKey();
- bool null = attr.getNullable();
- ndbout << attr.getName() << "\t";
- char tmp[100];
- if(attr.getLength() != 1)
- snprintf(tmp, 100," [%d]", attr.getLength());
- else
- tmp[0] = 0;
+ ndbout << attr.getName() << " " << type;
switch(type){
- case NdbDictionary::Column::Tinyint:
- ndbout << "Tinyint" << tmp;
- break;
- case NdbDictionary::Column::Tinyunsigned:
- ndbout << "Tinyunsigned" << tmp;
- break;
- case NdbDictionary::Column::Smallint:
- ndbout << "Smallint" << tmp;
- break;
- case NdbDictionary::Column::Smallunsigned:
- ndbout << "Smallunsigned" << tmp;
- break;
- case NdbDictionary::Column::Mediumint:
- ndbout << "Mediumint" << tmp;
- break;
- case NdbDictionary::Column::Mediumunsigned:
- ndbout << "Mediumunsigned" << tmp;
- break;
- case NdbDictionary::Column::Int:
- ndbout << "Int" << tmp;
- break;
- case NdbDictionary::Column::Unsigned:
- ndbout << "Unsigned" << tmp;
- break;
- case NdbDictionary::Column::Bigint:
- ndbout << "Bigint" << tmp;
- break;
- case NdbDictionary::Column::Bigunsigned:
- ndbout << "Bigunsigned" << tmp;
- break;
- case NdbDictionary::Column::Float:
- ndbout << "Float" << tmp;
- break;
- case NdbDictionary::Column::Double:
- ndbout << "Double" << tmp;
- break;
case NdbDictionary::Column::Decimal:
- ndbout << "Decimal("
- << attr.getScale() << ", " << attr.getPrecision() << ")"
- << tmp;
- break;
- case NdbDictionary::Column::Char:
- ndbout << "Char(" << attr.getLength() << ")";
- break;
- case NdbDictionary::Column::Varchar:
- ndbout << "Varchar(" << attr.getLength() << ")";
- break;
- case NdbDictionary::Column::Binary:
- ndbout << "Binary(" << attr.getLength() << ")";
- break;
- case NdbDictionary::Column::Varbinary:
- ndbout << "Varbinary(" << attr.getLength() << ")";
- break;
- case NdbDictionary::Column::Datetime:
- ndbout << "Datetime" << tmp;
- break;
- case NdbDictionary::Column::Timespec:
- ndbout << "Timespec" << tmp;
- break;
- case NdbDictionary::Column::Blob:
- ndbout << "Blob" << tmp;
- break;
- case NdbDictionary::Column::Undefined:
- ndbout << "Undefined" << tmp;
+ ndbout << "(" << attr.getScale() << ", " << attr.getPrecision() << ")";
break;
default:
- ndbout << "Unknown(" << type << ")";
+ break;
}
- ndbout << "\t";
- if(null){
- ndbout << "NULL";
- } else {
- ndbout << "NOT NULL";
- }
- ndbout << "\t";
+ if(attr.getLength() != 1)
+ ndbout << "[" << attr.getLength() << "]";
+
+ if(attr.getNullable())
+ ndbout << " NULL";
+ else
+ ndbout << " NOT NULL";
- if(key)
- ndbout << "\tprimary key";
+ if(attr.getPrimaryKey())
+ ndbout << " PRIMARY KEY";
return ndbout;
}
@@ -130,6 +60,9 @@ operator <<(class NdbOut& ndbout, const NDBT_Table & tab)
ndbout << "Temporary table: " << (tab.getStoredTable() ? "no" : "yes") << endl;
ndbout << "Number of attributes: " << tab.getNoOfColumns() << endl;
ndbout << "Number of primary keys: " << tab.getNoOfPrimaryKeys() << endl;
+ ndbout << "Length of frm data: " << tab.getFrmLength() << endl;
+
+
//<< ((tab.getTupleKey() == TupleId) ? " tupleid" : "") <<endl;
ndbout << "TableStatus: ";
switch(tab.getObjectStatus()){
@@ -154,3 +87,32 @@ operator <<(class NdbOut& ndbout, const NDBT_Table & tab)
return ndbout;
}
+
+class NdbOut& operator <<(class NdbOut&, const NdbDictionary::Index & idx)
+{
+ ndbout << idx.getName();
+ ndbout << "(";
+ for (unsigned i=0; i < idx.getNoOfColumns(); i++)
+ {
+ const NdbDictionary::Column *col = idx.getColumn(i);
+ ndbout << col->getName();
+ if (i < idx.getNoOfColumns()-1)
+ ndbout << ", ";
+ }
+ ndbout << ")";
+
+ ndbout << " - ";
+ switch (idx.getType()) {
+ case NdbDictionary::Object::UniqueHashIndex:
+ ndbout << "UniqueHashIndex";
+ break;
+ case NdbDictionary::Object::OrderedIndex:
+ ndbout << "OrderedIndex";
+ break;
+ default:
+ ndbout << "Type " << idx.getType();
+ break;
+ }
+ return ndbout;
+}
+
diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp
index 6cbb69508f5..169034e0c07 100644
--- a/ndb/test/src/NdbBackup.cpp
+++ b/ndb/test/src/NdbBackup.cpp
@@ -19,7 +19,6 @@
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
#include <NdbConfig.h>
-#include <ConfigRetriever.hpp>
#include <ndb_version.h>
#include <NDBT.hpp>
#include <NdbSleep.h>
@@ -32,6 +31,10 @@
<< " (Line: " << __LINE__ << ")" << "- " << _xx << endl; \
return NDBT_FAILED; } }
+#include <ConfigRetriever.hpp>
+#include <mgmapi.h>
+#include <mgmapi_config_parameters.h>
+#include <mgmapi_configuration.hpp>
int
NdbBackup::start(unsigned int & _backup_id){
@@ -68,16 +71,12 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
*/
ConfigRetriever cr;
-
- Properties * p = cr.getConfig(host,
- port,
- _node_id,
- NDB_VERSION);
+ ndb_mgm_configuration * p = cr.getConfig(host, port, 0);
if(p == 0){
const char * s = cr.getErrorString();
if(s == 0)
s = "No error given!";
-
+
ndbout << "Could not fetch configuration" << endl;
ndbout << s << endl;
return NULL;
@@ -86,19 +85,20 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
/**
* Setup cluster configuration data
*/
- const Properties * db = 0;
- if (!p->get("Node", _node_id, &db)) {
+ ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
+ if (iter.find(CFG_NODE_ID, _node_id)){
ndbout << "Invalid configuration fetched, DB missing" << endl;
return NULL;
}
- const char * type;
- if(!(db->get("Type", &type) && strcmp(type, "DB") == 0)){
+ unsigned int type = 123456;
+ if(iter.get(CFG_TYPE_OF_SECTION, &type) || type != NODE_TYPE_DB){
+ ndbout <<"type = " << type << endl;
ndbout <<"Invalid configuration fetched, I'm wrong type of node" << endl;
return NULL;
}
-
+
const char * path;
- if (!db->get("FileSystemPath", &path)){
+ if (iter.get(CFG_DB_FILESYSTEM_PATH, &path)){
ndbout << "FileSystemPath not found" << endl;
return NULL;
}
@@ -115,10 +115,13 @@ NdbBackup::execRestore(bool _restore_data,
const int buf_len = 1000;
char buf[buf_len];
+ ndbout << "getFileSystemPathForNode "<< _node_id <<endl;
+
const char* path = getFileSystemPathForNode(_node_id);
if (path == NULL)
return -1;
+ ndbout << "getHostName "<< _node_id <<endl;
const char *host;
if (!getHostName(_node_id, &host)){
return -1;
@@ -139,7 +142,7 @@ NdbBackup::execRestore(bool _restore_data,
ndbout << "res: " << res << endl;
#if 0
- snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d",
+ snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d",
ownNodeId,
addr,
_node_id,
@@ -151,7 +154,7 @@ NdbBackup::execRestore(bool _restore_data,
#endif
- snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .",
+ snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .",
ownNodeId,
addr,
_node_id,
diff --git a/ndb/test/src/NdbConfig.cpp b/ndb/test/src/NdbConfig.cpp
index 3a254bc1577..2fb466d1b8f 100644
--- a/ndb/test/src/NdbConfig.cpp
+++ b/ndb/test/src/NdbConfig.cpp
@@ -17,144 +17,67 @@
#include "NdbConfig.hpp"
#include <NdbOut.hpp>
#include <NDBT_Output.hpp>
+#include <assert.h>
#include <NdbConfig.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
-
-
+#include <mgmapi.h>
+#include <mgmapi_config_parameters.h>
+#include <mgmapi_configuration.hpp>
bool
-NdbConfig::getPropsForNode(unsigned int node_id,
- const char* type,
- const Properties ** props) const {
-
- /**
- * Fetch configuration from management server
- */
- ConfigRetriever cr;
-
-
- Properties * p = cr.getConfig(host,
- port,
- node_id,
- NDB_VERSION);
+NdbConfig::getHostName(unsigned int node_id, const char ** hostname) {
+
+ ndb_mgm_configuration * p = getConfig();
if(p == 0){
- const char * s = cr.getErrorString();
- if(s == 0)
- s = "No error given!";
-
- ndbout << "Could not fetch configuration" << endl;
- ndbout << s << endl;
return false;
- }
+ }
/**
* Setup cluster configuration data
*/
- if (!p->get("Node", node_id, props)) {
- ndbout << "Invalid configuration fetched no info for nodeId = "
- << node_id << endl;
+ ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
+ if (iter.find(CFG_NODE_ID, node_id)){
+ ndbout << "Invalid configuration fetched, DB missing" << endl;
return false;
}
- const char * str;
- if(!((*props)->get("Type", &str) && strcmp(str, type) == 0)){
- ndbout <<"Invalid configuration fetched, type != " << type << endl;
- return false;
- }
- return true;
-}
-
-bool
-NdbConfig::getProperty(unsigned int node_id,
- const char* type,
- const char* name,
- const char ** value) const {
- const Properties * db = 0;
-
- if(!getPropsForNode(node_id, type, &db)){
+ if (iter.get(CFG_NODE_HOST, hostname)){
+ ndbout << "Host not found" << endl;
return false;
}
- if (!db->get(name, value)){
- ndbout << name << " not found" << endl;
- return false;
- }
-
return true;
}
bool
-NdbConfig::getProperty(unsigned int node_id,
- const char* type,
- const char* name,
- Uint32 * value) const {
- const Properties * db = 0;
-
- if(!getPropsForNode(node_id, type, &db)){
- return false;
- }
-
- if (!db->get(name, value)){
- ndbout << name << " not found" << endl;
- return false;
- }
-
- return true;
-}
-
-
-bool
-NdbConfig::getHostName(unsigned int node_id,
- const char ** hostname) const {
- /**
- * Fetch configuration from management server
- */
- ConfigRetriever cr;
-
-
- Properties * p = cr.getConfig(host,
- port,
- node_id,
- NDB_VERSION);
+NdbConfig::getProperty(unsigned nodeid,
+ unsigned type, unsigned key, Uint32 * val){
+ ndb_mgm_configuration * p = getConfig();
if(p == 0){
- const char * s = cr.getErrorString();
- if(s == 0)
- s = "No error given!";
-
- ndbout << "Could not fetch configuration" << endl;
- ndbout << s << endl;
return false;
- }
+ }
/**
* Setup cluster configuration data
*/
- const Properties * node_props;
- if (!p->get("Node", node_id, &node_props)) {
- ndbout << "Invalid configuration fetched no info for node = "
- << node_id << endl;
- return false;
- }
- const char* computer_id_str;
- if (!node_props->get("ExecuteOnComputer", &computer_id_str)){
- ndbout << "ExecuteOnComputer not found" << endl;
+ ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
+ if (iter.find(CFG_NODE_ID, nodeid)){
+ ndbout << "Invalid configuration fetched, DB missing" << endl;
return false;
}
-
- const Properties * comp_props;
- if (!p->get("Computer", atoi(computer_id_str), &comp_props)) {
- ndbout << "Invalid configuration fetched no info for computer = "
- << node_id << endl;
+ unsigned _type;
+ if (iter.get(CFG_TYPE_OF_SECTION, &_type) || type != _type){
+ ndbout << "No such node in configuration" << endl;
return false;
}
- if (!comp_props->get("HostName", hostname)){
- ndbout << "HostName not found" << endl;
+
+ if (iter.get(key, val)){
+ ndbout << "No such key: " << key << " in configuration" << endl;
return false;
}
-
-
+
return true;
}
diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp
index cc2fab46cc5..b731cccb259 100644
--- a/ndb/test/src/NdbRestarter.cpp
+++ b/ndb/test/src/NdbRestarter.cpp
@@ -36,7 +36,8 @@ NdbRestarter::NdbRestarter(const char* _addr):
addr(_addr),
host(NULL),
port(-1),
- handle(NULL)
+ handle(NULL),
+ m_config(0)
{
if (addr == NULL){
LocalConfig lcfg;
@@ -661,3 +662,13 @@ int NdbRestarter::exitSingleUserMode(){
}
return reply.return_code;
}
+
+ndb_mgm_configuration*
+NdbRestarter::getConfig(){
+ if(m_config) return m_config;
+
+ if (!isConnected())
+ return 0;
+ m_config = ndb_mgm_get_configuration(handle, 0);
+ return m_config;
+}
diff --git a/ndb/src/ndbapi/NdbSchemaCon.cpp b/ndb/test/src/NdbSchemaCon.cpp
index fbf30c70d12..0de49ff983f 100644
--- a/ndb/src/ndbapi/NdbSchemaCon.cpp
+++ b/ndb/test/src/NdbSchemaCon.cpp
@@ -14,28 +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 */
+
+
/*********************************************************************
-Name: NdbSchemaCon.C
+Name: NdbSchemaCon.cpp
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
EMIKRON Mikael Ronstrom
Date: 020826
-Version: 2.0
-Description: Interface between application and NDB
+Version: 3.0
+Description: Old Interface between application and NDB
Documentation:
Adjust: 980126 UABMNST First version.
020826 EMIKRON New version adapted to new DICT version
-************************************************************************************************/
-#include "NdbSchemaCon.hpp"
-#include "NdbSchemaOp.hpp"
-#include "NdbApiSignal.hpp"
-#include "TransporterFacade.hpp"
-#include <RefConvert.hpp>
-#include <signaldata/CreateIndx.hpp>
-#include <signaldata/DropIndx.hpp>
-#include <signaldata/CreateTable.hpp>
-#include <NdbOut.hpp>
+ 040524 Magnus Svensson - Adapted to not be included in public NdbApi
+ unless the user wants to use it.
+
+ NOTE: This file is only used as a compatibility layer for old test programs,
+ New programs should use NdbDictionary.hpp
+*********************************************************************/
+
+#include <ndb_global.h>
+#include <NdbApi.hpp>
+#include <NdbSchemaCon.hpp>
+#include <NdbSchemaOp.hpp>
+
/*********************************************************************
NdbSchemaCon(Ndb* aNdb);
@@ -139,20 +143,22 @@ NdbSchemaCon::release()
return;
}//NdbSchemaCon::release()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#include <NdbError.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 &
+NdbSchemaCon::getNdbError() const {
+ update(theError);
+ return theError;
+}
diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/test/src/NdbSchemaOp.cpp
index 9e495229661..a296094ea9d 100644
--- a/ndb/src/ndbapi/NdbSchemaOp.cpp
+++ b/ndb/test/src/NdbSchemaOp.cpp
@@ -16,23 +16,30 @@
/*****************************************************************************
-Name: NdbSchemaOp.C
+Name: NdbSchemaOp.cpp
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
EMIKRON Mikael Ronstrom
-Date: 020826
-Version: 2.0
+Date: 040524
+Version: 3.0
Description: Interface between application and NDB
Documentation: Handles createTable and createAttribute calls
Adjust: 980125 UABMNST First version.
020826 EMIKRON New version for new DICT
+ 040524 Magnus Svensson - Adapted to not be included in public NdbApi
+ unless the user wants to use it.
+
+ NOTE: This file is only used as a compatibility layer for old test programs,
+ New programs should use NdbDictionary.hpp
*****************************************************************************/
-#include <assert.h>
-#include "NdbSchemaOp.hpp"
-#include "NdbSchemaCon.hpp"
-#include "API.hpp"
+
+#include <ndb_global.h>
+#include <NdbApi.hpp>
+#include <NdbSchemaOp.hpp>
+#include <NdbSchemaCon.hpp>
+
/*****************************************************************************
NdbSchemaOp(Ndb* aNdb, Table* aTable);
@@ -203,3 +210,11 @@ NdbSchemaOp::init(NdbSchemaCon* aSchemaCon)
theSchemaCon = aSchemaCon;
return 0;
}//NdbSchemaOp::init()
+
+
+const NdbError &
+NdbSchemaOp::getNdbError() const
+{
+ return theSchemaCon->getNdbError();
+}
+
diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp
index 2e6ff360123..3ef31a2f535 100644
--- a/ndb/test/src/UtilTransactions.cpp
+++ b/ndb/test/src/UtilTransactions.cpp
@@ -980,8 +980,8 @@ UtilTransactions::verifyIndex(Ndb* pNdb,
}
switch (pIndex->getType()){
- case UniqueHashIndex:
- case OrderedIndex:
+ case NdbDictionary::Index::UniqueHashIndex:
+ case NdbDictionary::Index::OrderedIndex:
return verifyUniqueIndex(pNdb, indexName, parallelism, transactional);
break;
default:
diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am
new file mode 100644
index 00000000000..8d94c21b721
--- /dev/null
+++ b/ndb/test/tools/Makefile.am
@@ -0,0 +1,31 @@
+
+ndbtest_PROGRAMS = hugoCalculator hugoLoad hugoFill hugoLockRecords hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate hugoScanRead hugoScanUpdate restart verify_index copy_tab create_index ndb_cpcc
+
+# transproxy
+
+hugoCalculator_SOURCES = hugoCalculator.cpp
+hugoFill_SOURCES = hugoFill.cpp
+hugoLoad_SOURCES = hugoLoad.cpp
+hugoLockRecords_SOURCES = hugoLockRecords.cpp
+hugoPkDelete_SOURCES = hugoPkDelete.cpp
+hugoPkRead_SOURCES = hugoPkRead.cpp
+hugoPkReadRecord_SOURCES = hugoPkReadRecord.cpp
+hugoPkUpdate_SOURCES = hugoPkUpdate.cpp
+hugoScanRead_SOURCES = hugoScanRead.cpp
+hugoScanUpdate_SOURCES = hugoScanUpdate.cpp
+restart_SOURCES = restart.cpp
+# transproxy_SOURCES = transproxy.cpp
+verify_index_SOURCES = verify_index.cpp
+copy_tab_SOURCES = copy_tab.cpp
+create_index_SOURCES = create_index.cpp
+ndb_cpcc_SOURCES = cpcc.cpp
+
+INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am
+
+ndb_cpcc_LDADD = $(LDADD) $(top_builddir)/ndb/src/mgmclient/CpcClient.o
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/test/tools/Makefile b/ndb/test/tools/Makefile_old
index b8e90ae207f..b8e90ae207f 100644
--- a/ndb/test/tools/Makefile
+++ b/ndb/test/tools/Makefile_old
diff --git a/ndb/tools/copy_tab/copy_tab.cpp b/ndb/test/tools/copy_tab.cpp
index 33ce8e01d9a..33ce8e01d9a 100644
--- a/ndb/tools/copy_tab/copy_tab.cpp
+++ b/ndb/test/tools/copy_tab.cpp
diff --git a/ndb/tools/cpcc/cpcc.cpp b/ndb/test/tools/cpcc.cpp
index e768d707bbc..e768d707bbc 100644
--- a/ndb/tools/cpcc/cpcc.cpp
+++ b/ndb/test/tools/cpcc.cpp
diff --git a/ndb/tools/create_index/create_index.cpp b/ndb/test/tools/create_index.cpp
index dc9e6c606d6..dc9e6c606d6 100644
--- a/ndb/tools/create_index/create_index.cpp
+++ b/ndb/test/tools/create_index.cpp
diff --git a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp b/ndb/test/tools/hugoCalculator.cpp
index 7f2751be2ba..7f2751be2ba 100644
--- a/ndb/test/tools/hugoCalculator/hugoCalculator.cpp
+++ b/ndb/test/tools/hugoCalculator.cpp
diff --git a/ndb/test/tools/hugoFill/hugoFill.cpp b/ndb/test/tools/hugoFill.cpp
index dee6ce2e6c8..dee6ce2e6c8 100644
--- a/ndb/test/tools/hugoFill/hugoFill.cpp
+++ b/ndb/test/tools/hugoFill.cpp
diff --git a/ndb/test/tools/hugoLoad/hugoLoad.cpp b/ndb/test/tools/hugoLoad.cpp
index be7f878d106..be7f878d106 100644
--- a/ndb/test/tools/hugoLoad/hugoLoad.cpp
+++ b/ndb/test/tools/hugoLoad.cpp
diff --git a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp b/ndb/test/tools/hugoLockRecords.cpp
index e2c2cd13f00..e2c2cd13f00 100644
--- a/ndb/test/tools/hugoLockRecords/hugoLockRecords.cpp
+++ b/ndb/test/tools/hugoLockRecords.cpp
diff --git a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp b/ndb/test/tools/hugoPkDelete.cpp
index 1855f19796f..1855f19796f 100644
--- a/ndb/test/tools/hugoPkDelete/hugoPkDel.cpp
+++ b/ndb/test/tools/hugoPkDelete.cpp
diff --git a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp b/ndb/test/tools/hugoPkRead.cpp
index 50351f08195..50351f08195 100644
--- a/ndb/test/tools/hugoPkRead/hugoPkRead.cpp
+++ b/ndb/test/tools/hugoPkRead.cpp
diff --git a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp b/ndb/test/tools/hugoPkReadRecord.cpp
index ac17ffffee8..ac17ffffee8 100644
--- a/ndb/test/tools/hugoPkReadRecord/hugoPkReadRecord.cpp
+++ b/ndb/test/tools/hugoPkReadRecord.cpp
diff --git a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp b/ndb/test/tools/hugoPkUpdate.cpp
index e7edc3a991d..e7edc3a991d 100644
--- a/ndb/test/tools/hugoPkUpdate/hugoPkUpd.cpp
+++ b/ndb/test/tools/hugoPkUpdate.cpp
diff --git a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead.cpp
index 47ea8f4a8a7..47ea8f4a8a7 100644
--- a/ndb/test/tools/hugoScanRead/hugoScanRead.cpp
+++ b/ndb/test/tools/hugoScanRead.cpp
diff --git a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp b/ndb/test/tools/hugoScanUpdate.cpp
index 3e2255ca0f3..3e2255ca0f3 100644
--- a/ndb/test/tools/hugoScanUpdate/hugoScanUpd.cpp
+++ b/ndb/test/tools/hugoScanUpdate.cpp
diff --git a/ndb/test/tools/hugoCalculator/Makefile b/ndb/test/tools/old_dirs/hugoCalculator/Makefile
index a29deeaacd3..a29deeaacd3 100644
--- a/ndb/test/tools/hugoCalculator/Makefile
+++ b/ndb/test/tools/old_dirs/hugoCalculator/Makefile
diff --git a/ndb/test/tools/hugoFill/Makefile b/ndb/test/tools/old_dirs/hugoFill/Makefile
index 3da745810b6..3da745810b6 100644
--- a/ndb/test/tools/hugoFill/Makefile
+++ b/ndb/test/tools/old_dirs/hugoFill/Makefile
diff --git a/ndb/test/tools/hugoLoad/Makefile b/ndb/test/tools/old_dirs/hugoLoad/Makefile
index 7c5756d0d41..7c5756d0d41 100644
--- a/ndb/test/tools/hugoLoad/Makefile
+++ b/ndb/test/tools/old_dirs/hugoLoad/Makefile
diff --git a/ndb/test/tools/hugoLockRecords/Makefile b/ndb/test/tools/old_dirs/hugoLockRecords/Makefile
index 3235750cbf8..3235750cbf8 100644
--- a/ndb/test/tools/hugoLockRecords/Makefile
+++ b/ndb/test/tools/old_dirs/hugoLockRecords/Makefile
diff --git a/ndb/test/tools/hugoPkDelete/Makefile b/ndb/test/tools/old_dirs/hugoPkDelete/Makefile
index e6d53611c54..e6d53611c54 100644
--- a/ndb/test/tools/hugoPkDelete/Makefile
+++ b/ndb/test/tools/old_dirs/hugoPkDelete/Makefile
diff --git a/ndb/test/tools/hugoPkRead/Makefile b/ndb/test/tools/old_dirs/hugoPkRead/Makefile
index 03580dc0d18..03580dc0d18 100644
--- a/ndb/test/tools/hugoPkRead/Makefile
+++ b/ndb/test/tools/old_dirs/hugoPkRead/Makefile
diff --git a/ndb/test/tools/hugoPkReadRecord/Makefile b/ndb/test/tools/old_dirs/hugoPkReadRecord/Makefile
index 158a79a5666..158a79a5666 100644
--- a/ndb/test/tools/hugoPkReadRecord/Makefile
+++ b/ndb/test/tools/old_dirs/hugoPkReadRecord/Makefile
diff --git a/ndb/test/tools/hugoPkUpdate/Makefile b/ndb/test/tools/old_dirs/hugoPkUpdate/Makefile
index 48795b62206..48795b62206 100644
--- a/ndb/test/tools/hugoPkUpdate/Makefile
+++ b/ndb/test/tools/old_dirs/hugoPkUpdate/Makefile
diff --git a/ndb/test/tools/hugoScanRead/Makefile b/ndb/test/tools/old_dirs/hugoScanRead/Makefile
index b88377c299e..b88377c299e 100644
--- a/ndb/test/tools/hugoScanRead/Makefile
+++ b/ndb/test/tools/old_dirs/hugoScanRead/Makefile
diff --git a/ndb/test/tools/hugoScanUpdate/Makefile b/ndb/test/tools/old_dirs/hugoScanUpdate/Makefile
index ec0e07bfd84..ec0e07bfd84 100644
--- a/ndb/test/tools/hugoScanUpdate/Makefile
+++ b/ndb/test/tools/old_dirs/hugoScanUpdate/Makefile
diff --git a/ndb/test/tools/restart/Makefile b/ndb/test/tools/old_dirs/restart/Makefile
index 05d9e98c5bc..05d9e98c5bc 100644
--- a/ndb/test/tools/restart/Makefile
+++ b/ndb/test/tools/old_dirs/restart/Makefile
diff --git a/ndb/tools/transproxy/Makefile b/ndb/test/tools/old_dirs/transproxy/Makefile
index d6a76ed2e3d..d6a76ed2e3d 100644
--- a/ndb/tools/transproxy/Makefile
+++ b/ndb/test/tools/old_dirs/transproxy/Makefile
diff --git a/ndb/tools/verify_index/Makefile b/ndb/test/tools/old_dirs/verify_index/Makefile
index f6b31e4dc8e..f6b31e4dc8e 100644
--- a/ndb/tools/verify_index/Makefile
+++ b/ndb/test/tools/old_dirs/verify_index/Makefile
diff --git a/ndb/test/tools/waiter/Makefile b/ndb/test/tools/old_dirs/waiter/Makefile_old
index da2c9daff00..da2c9daff00 100644
--- a/ndb/test/tools/waiter/Makefile
+++ b/ndb/test/tools/old_dirs/waiter/Makefile_old
diff --git a/ndb/test/tools/waiter/waiter.cpp b/ndb/test/tools/old_dirs/waiter/waiter.cpp
index d57daff3aea..d57daff3aea 100644
--- a/ndb/test/tools/waiter/waiter.cpp
+++ b/ndb/test/tools/old_dirs/waiter/waiter.cpp
diff --git a/ndb/test/tools/restart/restart.cpp b/ndb/test/tools/restart.cpp
index 88cfb231a72..88cfb231a72 100644
--- a/ndb/test/tools/restart/restart.cpp
+++ b/ndb/test/tools/restart.cpp
diff --git a/ndb/tools/transproxy/transproxy.cpp b/ndb/test/tools/transproxy.cpp
index 384a8a34f03..384a8a34f03 100644
--- a/ndb/tools/transproxy/transproxy.cpp
+++ b/ndb/test/tools/transproxy.cpp
diff --git a/ndb/tools/verify_index/verify_index.cpp b/ndb/test/tools/verify_index.cpp
index 1295b657e9b..1295b657e9b 100644
--- a/ndb/tools/verify_index/verify_index.cpp
+++ b/ndb/test/tools/verify_index.cpp
diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am
new file mode 100644
index 00000000000..64625f69ea2
--- /dev/null
+++ b/ndb/tools/Makefile.am
@@ -0,0 +1,36 @@
+
+ndbtools_PROGRAMS = \
+ ndb_waiter \
+ ndb_drop_table \
+ ndb_delete_all \
+ ndb_desc \
+ ndb_drop_index \
+ ndb_show_tables \
+ ndb_select_all \
+ ndb_select_count
+
+tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp
+
+ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources)
+ndb_delete_all_SOURCES = delete_all.cpp $(tools_common_sources)
+ndb_desc_SOURCES = desc.cpp $(tools_common_sources)
+ndb_drop_index_SOURCES = drop_index.cpp $(tools_common_sources)
+ndb_drop_table_SOURCES = drop_tab.cpp $(tools_common_sources)
+ndb_show_tables_SOURCES = listTables.cpp $(tools_common_sources)
+ndb_select_all_SOURCES = select_all.cpp ../test/src/NDBT_ResultRow.cpp $(tools_common_sources)
+ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources)
+
+include $(top_srcdir)/ndb/config/common.mk.am
+include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am
+
+ndb_waiter_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_drop_table_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_delete_all_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_desc_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_drop_index_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_show_tables_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_select_all_LDFLAGS = @ndb_bin_am_ldflags@
+ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/ndb/tools/Makefile b/ndb/tools/Makefile_old
index b9dc6883e18..b9dc6883e18 100644
--- a/ndb/tools/Makefile
+++ b/ndb/tools/Makefile_old
diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp
new file mode 100644
index 00000000000..dabd9a0e8fa
--- /dev/null
+++ b/ndb/tools/delete_all.cpp
@@ -0,0 +1,181 @@
+/* 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 <NdbOut.hpp>
+#include <NdbApi.hpp>
+#include <NdbSleep.h>
+#include <NDBT.hpp>
+
+#include <getarg.h>
+
+static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240);
+
+int main(int argc, const char** argv){
+
+ const char* _tabname = NULL;
+ const char* _dbname = "TEST_DB";
+ int _help = 0;
+
+ struct getargs args[] = {
+ { "usage", '?', arg_flag, &_help, "Print help", "" },
+ { "database", 'd', arg_string, &_dbname, "dbname",
+ "Name of database table is in"}
+ };
+ int num_args = sizeof(args) / sizeof(args[0]);
+ int optind = 0;
+ char desc[] =
+ "tabname\n"\
+ "This program will delete all records in the specified table using scan delete.\n";
+
+ if(getarg(args, num_args, argc, argv, &optind) ||
+ argv[optind] == NULL || _help) {
+ arg_printusage(args, num_args, argv[0], desc);
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
+ }
+ _tabname = argv[optind];
+
+ // Connect to Ndb
+ Ndb MyNdb(_dbname);
+
+ if(MyNdb.init() != 0){
+ ERR(MyNdb.getNdbError());
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ // Connect to Ndb and wait for it to become ready
+ while(MyNdb.waitUntilReady() != 0)
+ ndbout << "Waiting for ndb to become ready..." << endl;
+
+ // Check if table exists in db
+ int res = NDBT_OK;
+ for(int i = optind; i<argc; i++){
+ const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]);
+ if(pTab == NULL){
+ ndbout << " Table " << _tabname << " does not exist!" << endl;
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
+ }
+
+ ndbout << "Deleting all from " << argv[i] << "...";
+ if(clear_table(&MyNdb, pTab) == NDBT_FAILED){
+ res = NDBT_FAILED;
+ ndbout << "FAILED" << endl;
+ }
+ }
+ return NDBT_ProgramExit(res);
+}
+
+
+int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
+{
+ // Scan all records exclusive and delete
+ // them one by one
+ int retryAttempt = 0;
+ const int retryMax = 10;
+ int deletedRows = 0;
+ int check;
+ NdbConnection *pTrans;
+ NdbScanOperation *pOp;
+ NdbError err;
+
+ int par = parallelism;
+ while (true){
+ restart:
+ if (retryAttempt++ >= retryMax){
+ g_info << "ERROR: has retried this operation " << retryAttempt
+ << " times, failing!" << endl;
+ return NDBT_FAILED;
+ }
+
+ pTrans = pNdb->startTransaction();
+ if (pTrans == NULL) {
+ err = pNdb->getNdbError();
+ if (err.status == NdbError::TemporaryError){
+ ERR(err);
+ NdbSleep_MilliSleep(50);
+ continue;
+ }
+ goto failed;
+ }
+
+ pOp = pTrans->getNdbScanOperation(pTab->getName());
+ if (pOp == NULL) {
+ goto failed;
+ }
+
+ NdbResultSet * rs = pOp->readTuplesExclusive(par);
+ if( rs == 0 ) {
+ goto failed;
+ }
+
+ if(pTrans->execute(NoCommit) != 0){
+ err = pTrans->getNdbError();
+ if(err.status == NdbError::TemporaryError){
+ ERR(err);
+ pNdb->closeTransaction(pTrans);
+ NdbSleep_MilliSleep(50);
+ continue;
+ }
+ goto failed;
+ }
+
+ while((check = rs->nextResult(true)) == 0){
+ do {
+ if (rs->deleteTuple() != 0){
+ goto failed;
+ }
+ deletedRows++;
+ } while((check = rs->nextResult(false)) == 0);
+
+ if(check != -1){
+ check = pTrans->execute(Commit);
+ pTrans->releaseCompletedOperations();
+ }
+
+ err = pTrans->getNdbError();
+ if(check == -1){
+ if(err.status == NdbError::TemporaryError){
+ ERR(err);
+ pNdb->closeTransaction(pTrans);
+ NdbSleep_MilliSleep(50);
+ par = 1;
+ goto restart;
+ }
+ goto failed;
+ }
+ }
+ if(check == -1){
+ err = pTrans->getNdbError();
+ if(err.status == NdbError::TemporaryError){
+ ERR(err);
+ pNdb->closeTransaction(pTrans);
+ NdbSleep_MilliSleep(50);
+ par = 1;
+ goto restart;
+ }
+ goto failed;
+ }
+ pNdb->closeTransaction(pTrans);
+ return NDBT_OK;
+ }
+ return NDBT_FAILED;
+
+ failed:
+ if(pTrans != 0) pNdb->closeTransaction(pTrans);
+ ERR(err);
+ return (err.code != 0 ? err.code : NDBT_FAILED);
+}
diff --git a/ndb/tools/delete_all/delete_all.cpp b/ndb/tools/delete_all/delete_all.cpp
deleted file mode 100644
index 9cbba503e68..00000000000
--- a/ndb/tools/delete_all/delete_all.cpp
+++ /dev/null
@@ -1,93 +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 */
-
-#include <ndb_global.h>
-
-#include <NdbOut.hpp>
-#include <NdbApi.hpp>
-#include <NdbSleep.h>
-#include <NDBT.hpp>
-
-#include <getarg.h>
-
-#include <UtilTransactions.hpp>
-
-int main(int argc, const char** argv){
-
- const char* _tabname = NULL;
- const char* _dbname = "TEST_DB";
- int _help = 0;
- int _ver2 = 1;
-
- struct getargs args[] = {
- { "usage", '?', arg_flag, &_help, "Print help", "" },
- { "ver2", '2', arg_flag, &_ver2, "Use version 2 of clearTable (default)", "" },
- { "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of clearTable", "" },
- { "database", 'd', arg_string, &_dbname, "dbname",
- "Name of database table is in"}
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- char desc[] =
- "tabname\n"\
- "This program will delete all records in the specified table using scan delete.\n";
-
- if(getarg(args, num_args, argc, argv, &optind) ||
- argv[optind] == NULL || _help) {
- arg_printusage(args, num_args, argv[0], desc);
- return NDBT_ProgramExit(NDBT_WRONGARGS);
- }
- _tabname = argv[optind];
-
- // Connect to Ndb
- Ndb MyNdb(_dbname);
-
- if(MyNdb.init() != 0){
- ERR(MyNdb.getNdbError());
- return NDBT_ProgramExit(NDBT_FAILED);
- }
-
- // Connect to Ndb and wait for it to become ready
- while(MyNdb.waitUntilReady() != 0)
- ndbout << "Waiting for ndb to become ready..." << endl;
-
- // Check if table exists in db
- int res = NDBT_OK;
- for(int i = optind; i<argc; i++){
- const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]);
- if(pTab == NULL){
- ndbout << " Table " << _tabname << " does not exist!" << endl;
- return NDBT_ProgramExit(NDBT_WRONGARGS);
- }
-
- ndbout << "Deleting all from " << argv[i] << "...";
- UtilTransactions utilTrans(*pTab);
- int tmp = NDBT_OK;
- if (_ver2 == 0){
- if(utilTrans.clearTable(&MyNdb) == NDBT_FAILED)
- tmp = NDBT_FAILED;
- } else {
- if(utilTrans.clearTable3(&MyNdb) == NDBT_FAILED)
- tmp = NDBT_FAILED;
- }
- if(tmp == NDBT_FAILED){
- res = tmp;
- ndbout << "FAILED" << endl;
- }
- }
- return NDBT_ProgramExit(res);
-}
-
diff --git a/ndb/tools/desc/desc.cpp b/ndb/tools/desc.cpp
index 7481190614c..a5ff11edca9 100644
--- a/ndb/tools/desc/desc.cpp
+++ b/ndb/tools/desc.cpp
@@ -19,19 +19,19 @@
#include <NdbApi.hpp>
+
+
int main(int argc, const char** argv){
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
- int _frm = 0;
int _unqualified = 0;
int _help = 0;
struct getargs args[] = {
- { "unqualified", 'u', arg_integer, &_unqualified, "unqualified",
+ { "unqualified", 'u', arg_flag, &_unqualified, "unqualified",
"Use unqualified table names"},
{ "database", 'd', arg_string, &_dbname, "dbname",
"Name of database table is in"},
- { "frm-data", 'f', arg_flag, &_frm, "Show frm data for table", "" } ,
{ "usage", '?', arg_flag, &_help, "Print help", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
@@ -62,15 +62,40 @@ int main(int argc, const char** argv){
NdbDictionary::Dictionary * dict = pMyNdb->getDictionary();
for (int i = optind; i < argc; i++) {
NDBT_Table* pTab = (NDBT_Table*)dict->getTable(argv[i]);
- if (pTab != 0) {
+ if (pTab != 0){
ndbout << (* pTab) << endl;
- if (_frm){
- ndbout << "getFrmLength: "<< endl
- << pTab->getFrmLength() << endl;
- }
- } else {
- ndbout << argv[i] << ": " << dict->getNdbError() << endl;
+
+ NdbDictionary::Dictionary::List list;
+ if (dict->listIndexes(list, argv[i]) != 0){
+ ndbout << argv[i] << ": " << dict->getNdbError() << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ ndbout << "-- Indexes -- " << endl;
+ ndbout << "PRIMARY KEY(";
+ for (unsigned j= 0; j < pTab->getNoOfPrimaryKeys(); j++)
+ {
+ const NdbDictionary::Column * col = pTab->getColumn(j);
+ ndbout << col->getName();
+ if (j < pTab->getNoOfPrimaryKeys()-1)
+ ndbout << ", ";
+ }
+ ndbout << ") - UniqueHashIndex" << endl;
+
+ for (unsigned j= 0; j < list.count; j++) {
+ NdbDictionary::Dictionary::List::Element& elt = list.elements[j];
+ const NdbDictionary::Index *pIdx = dict->getIndex(elt.name, argv[i]);
+ if (!pIdx){
+ ndbout << argv[i] << ": " << dict->getNdbError() << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ ndbout << (*pIdx) << endl;
+ }
+ ndbout << endl;
}
+ else
+ ndbout << argv[i] << ": " << dict->getNdbError() << endl;
}
delete pMyNdb;
diff --git a/ndb/tools/drop_index/drop_index.cpp b/ndb/tools/drop_index.cpp
index 327f15741c9..327f15741c9 100644
--- a/ndb/tools/drop_index/drop_index.cpp
+++ b/ndb/tools/drop_index.cpp
diff --git a/ndb/tools/drop_tab/drop_tab.cpp b/ndb/tools/drop_tab.cpp
index 70e5d85aabe..70e5d85aabe 100644
--- a/ndb/tools/drop_tab/drop_tab.cpp
+++ b/ndb/tools/drop_tab.cpp
diff --git a/ndb/tools/list_tables/listTables.cpp b/ndb/tools/listTables.cpp
index 41433862304..bddf61848e8 100644
--- a/ndb/tools/list_tables/listTables.cpp
+++ b/ndb/tools/listTables.cpp
@@ -30,6 +30,7 @@
static Ndb* ndb = 0;
static NdbDictionary::Dictionary* dic = 0;
+static int _unqualified = 0;
static void
fatal(char const* fmt, ...)
@@ -59,7 +60,7 @@ list(const char * tabname,
if (dic->listIndexes(list, tabname) == -1)
fatal("listIndexes");
}
- if (Ndb::usingFullyQualifiedNames())
+ if (ndb->usingFullyQualifiedNames())
ndbout_c("%-5s %-20s %-8s %-7s %-12s %-8s %s", "id", "type", "state", "logging", "database", "schema", "name");
else
ndbout_c("%-5s %-20s %-8s %-7s %s", "id", "type", "state", "logging", "name");
@@ -137,7 +138,7 @@ list(const char * tabname,
break;
}
}
- if (Ndb::usingFullyQualifiedNames())
+ if (ndb->usingFullyQualifiedNames())
ndbout_c("%-5d %-20s %-8s %-7s %-12s %-8s %s", elt.id, type, state, store, (elt.database)?elt.database:"", (elt.schema)?elt.schema:"", elt.name);
else
ndbout_c("%-5d %-20s %-8s %-7s %s", elt.id, type, state, store, elt.name);
@@ -148,7 +149,6 @@ int main(int argc, const char** argv){
int _loops = 1;
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
- int _unqualified = 0;
int _type = 0;
int _help = 0;
diff --git a/ndb/tools/ndbsql/ndbsql.cpp b/ndb/tools/ndbsql.cpp
index ce73a972f47..6af5f47f6f4 100644
--- a/ndb/tools/ndbsql/ndbsql.cpp
+++ b/ndb/tools/ndbsql.cpp
@@ -33,6 +33,12 @@
#include <ctype.h>
#include <wctype.h>
+#ifndef SQL_BLOB
+#define SQL_BLOB 30
+#endif
+#ifndef SQL_CLOB
+#define SQL_CLOB 40
+#endif
/**************************************************************************
* ------------------------------------------------------------------------
@@ -138,6 +144,7 @@ bool emptyString(const char* s) {
* to obtain the row count.
*/
#define MAXCOLS 100
+#undef max
#define max(a,b) ((a)>(b)?(a):(b))
#define MAX_MESSAGE 500
@@ -210,8 +217,10 @@ SQLINTEGER display_length(SQLSMALLINT coltype, SQLINTEGER collen,
switch (coltype) {
case SQL_VARCHAR:
case SQL_CHAR:
- //case SQL_BLOB:
- //case SQL_CLOB:
+ case SQL_VARBINARY:
+ case SQL_BINARY:
+ case SQL_BLOB:
+ case SQL_CLOB:
case SQL_BIT:
//case SQL_REF:
//case SQL_BIT_VARYING:
diff --git a/ndb/tools/copy_tab/Makefile b/ndb/tools/old_dirs/copy_tab/Makefile
index 4ad33a26652..4ad33a26652 100644
--- a/ndb/tools/copy_tab/Makefile
+++ b/ndb/tools/old_dirs/copy_tab/Makefile
diff --git a/ndb/tools/cpcc/Makefile b/ndb/tools/old_dirs/cpcc/Makefile
index 78f8c61e464..78f8c61e464 100644
--- a/ndb/tools/cpcc/Makefile
+++ b/ndb/tools/old_dirs/cpcc/Makefile
diff --git a/ndb/tools/create_index/Makefile b/ndb/tools/old_dirs/create_index/Makefile
index 38f2df970c4..38f2df970c4 100644
--- a/ndb/tools/create_index/Makefile
+++ b/ndb/tools/old_dirs/create_index/Makefile
diff --git a/ndb/tools/delete_all/Makefile b/ndb/tools/old_dirs/delete_all/Makefile
index 1cae240eb8f..1cae240eb8f 100644
--- a/ndb/tools/delete_all/Makefile
+++ b/ndb/tools/old_dirs/delete_all/Makefile
diff --git a/ndb/tools/desc/Makefile b/ndb/tools/old_dirs/desc/Makefile
index 614984cfd35..614984cfd35 100644
--- a/ndb/tools/desc/Makefile
+++ b/ndb/tools/old_dirs/desc/Makefile
diff --git a/ndb/tools/drop_index/Makefile b/ndb/tools/old_dirs/drop_index/Makefile
index 969bee51064..969bee51064 100644
--- a/ndb/tools/drop_index/Makefile
+++ b/ndb/tools/old_dirs/drop_index/Makefile
diff --git a/ndb/tools/drop_tab/Makefile b/ndb/tools/old_dirs/drop_tab/Makefile
index d7b21fe982c..d7b21fe982c 100644
--- a/ndb/tools/drop_tab/Makefile
+++ b/ndb/tools/old_dirs/drop_tab/Makefile
diff --git a/ndb/tools/list_tables/Makefile b/ndb/tools/old_dirs/list_tables/Makefile
index b60f161ee68..b60f161ee68 100644
--- a/ndb/tools/list_tables/Makefile
+++ b/ndb/tools/old_dirs/list_tables/Makefile
diff --git a/ndb/tools/ndbnet/Makefile.PL b/ndb/tools/old_dirs/ndbnet/Makefile.PL
index 4b27a17de15..4b27a17de15 100644
--- a/ndb/tools/ndbnet/Makefile.PL
+++ b/ndb/tools/old_dirs/ndbnet/Makefile.PL
diff --git a/ndb/tools/ndbnet/lib/NDB/Net.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net.pm
index 3b7b16bb3cf..3b7b16bb3cf 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Base.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Base.pm
index 900446138e8..900446138e8 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Base.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Base.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Client.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Client.pm
index d34a18d63af..d34a18d63af 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Client.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Client.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Command.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Command.pm
index 30145d09fa9..30145d09fa9 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Command.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Command.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Config.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Config.pm
index 4c5db3cd3f5..4c5db3cd3f5 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Config.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Config.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Database.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Database.pm
index 7ea15be0650..7ea15be0650 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Database.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Database.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Env.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Env.pm
index d79e72f2bb3..d79e72f2bb3 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Env.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Env.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Node.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Node.pm
index f41bf51168d..f41bf51168d 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Node.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Node.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/NodeApi.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeApi.pm
index 08f5f85577d..08f5f85577d 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/NodeApi.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeApi.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/NodeDb.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeDb.pm
index 88a35ba4f8d..88a35ba4f8d 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/NodeDb.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeDb.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/NodeMgmt.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeMgmt.pm
index 1056e3df623..1056e3df623 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/NodeMgmt.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/NodeMgmt.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/Server.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Server.pm
index 5d2118f0ffe..5d2118f0ffe 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/Server.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/Server.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/ServerINET.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerINET.pm
index a065c186855..a065c186855 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/ServerINET.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerINET.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Net/ServerUNIX.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerUNIX.pm
index b3fa245d5ee..b3fa245d5ee 100644
--- a/ndb/tools/ndbnet/lib/NDB/Net/ServerUNIX.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Net/ServerUNIX.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Run.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run.pm
index a8cabde544c..a8cabde544c 100644
--- a/ndb/tools/ndbnet/lib/NDB/Run.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Run/Base.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Base.pm
index 4769f2c4441..4769f2c4441 100644
--- a/ndb/tools/ndbnet/lib/NDB/Run/Base.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Base.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Run/Database.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Database.pm
index 9a12ddb20b3..9a12ddb20b3 100644
--- a/ndb/tools/ndbnet/lib/NDB/Run/Database.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Database.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Run/Env.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Env.pm
index e851a82636b..e851a82636b 100644
--- a/ndb/tools/ndbnet/lib/NDB/Run/Env.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Env.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Run/Node.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Node.pm
index e657021b229..e657021b229 100644
--- a/ndb/tools/ndbnet/lib/NDB/Run/Node.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Run/Node.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util.pm
index d5db35cbf13..d5db35cbf13 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Base.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Base.pm
index 20df78a3b9b..20df78a3b9b 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Base.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Base.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Dir.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Dir.pm
index 90609b971c7..90609b971c7 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Dir.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Dir.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Event.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Event.pm
index a3ad32cd7fb..a3ad32cd7fb 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Event.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Event.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/File.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/File.pm
index 4b3cb38191c..4b3cb38191c 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/File.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/File.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/IO.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/IO.pm
index 34f4d0a150d..34f4d0a150d 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/IO.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/IO.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Lock.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Lock.pm
index b515e633059..b515e633059 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Lock.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Lock.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Log.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Log.pm
index 44b39df84e6..44b39df84e6 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Log.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Log.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/Socket.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Socket.pm
index 00e8b6eca51..00e8b6eca51 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/Socket.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/Socket.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/SocketINET.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketINET.pm
index faaa568a08e..faaa568a08e 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/SocketINET.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketINET.pm
diff --git a/ndb/tools/ndbnet/lib/NDB/Util/SocketUNIX.pm b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketUNIX.pm
index 9c6b3115f6a..9c6b3115f6a 100644
--- a/ndb/tools/ndbnet/lib/NDB/Util/SocketUNIX.pm
+++ b/ndb/tools/old_dirs/ndbnet/lib/NDB/Util/SocketUNIX.pm
diff --git a/ndb/tools/ndbnet/ndbnet.pl b/ndb/tools/old_dirs/ndbnet/ndbnet.pl
index 5f6648da46d..5f6648da46d 100644
--- a/ndb/tools/ndbnet/ndbnet.pl
+++ b/ndb/tools/old_dirs/ndbnet/ndbnet.pl
diff --git a/ndb/tools/ndbnet/ndbnetd.pl b/ndb/tools/old_dirs/ndbnet/ndbnetd.pl
index 95fa5322abc..95fa5322abc 100644
--- a/ndb/tools/ndbnet/ndbnetd.pl
+++ b/ndb/tools/old_dirs/ndbnet/ndbnetd.pl
diff --git a/ndb/tools/ndbnet/ndbrun b/ndb/tools/old_dirs/ndbnet/ndbrun
index 99121276d99..99121276d99 100644
--- a/ndb/tools/ndbnet/ndbrun
+++ b/ndb/tools/old_dirs/ndbnet/ndbrun
diff --git a/ndb/tools/ndbsql/Makefile b/ndb/tools/old_dirs/ndbsql/Makefile
index 81ca87b0414..81ca87b0414 100644
--- a/ndb/tools/ndbsql/Makefile
+++ b/ndb/tools/old_dirs/ndbsql/Makefile
diff --git a/ndb/tools/select_all/Makefile b/ndb/tools/old_dirs/select_all/Makefile
index e14e411b3a5..e14e411b3a5 100644
--- a/ndb/tools/select_all/Makefile
+++ b/ndb/tools/old_dirs/select_all/Makefile
diff --git a/ndb/tools/select_count/Makefile b/ndb/tools/old_dirs/select_count/Makefile
index 35a53c6b046..35a53c6b046 100644
--- a/ndb/tools/select_count/Makefile
+++ b/ndb/tools/old_dirs/select_count/Makefile
diff --git a/ndb/tools/src/counterviewer/CounterViewer.java b/ndb/tools/old_dirs/src/counterviewer/CounterViewer.java
index 317c1c75e28..317c1c75e28 100644
--- a/ndb/tools/src/counterviewer/CounterViewer.java
+++ b/ndb/tools/old_dirs/src/counterviewer/CounterViewer.java
diff --git a/ndb/tools/select_all/select_all.cpp b/ndb/tools/select_all.cpp
index 34f63a095bb..34f63a095bb 100644
--- a/ndb/tools/select_all/select_all.cpp
+++ b/ndb/tools/select_all.cpp
diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp
new file mode 100644
index 00000000000..cae91feb378
--- /dev/null
+++ b/ndb/tools/select_count.cpp
@@ -0,0 +1,199 @@
+/* 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 <NdbOut.hpp>
+
+#include <NdbApi.hpp>
+#include <NdbMain.h>
+#include <NDBT.hpp>
+#include <NdbSleep.h>
+#include <getarg.h>
+#include <UtilTransactions.hpp>
+
+static int
+select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
+ int parallelism,
+ int* count_rows,
+ UtilTransactions::ScanLock lock,
+ NdbConnection* pBuddyTrans=0);
+
+int main(int argc, const char** argv){
+ const char* _dbname = "TEST_DB";
+ int _parallelism = 240;
+ int _help = 0;
+ int _lock = 0;
+
+ struct getargs args[] = {
+ { "database", 'd', arg_string, &_dbname, "dbname",
+ "Name of database table is in"},
+ { "parallelism", 's', arg_integer, &_parallelism, "parallelism", "parallelism" },
+ { "usage", '?', arg_flag, &_help, "Print help", "" },
+ { "lock", 'l', arg_integer, &_lock,
+ "Read(0), Read-hold(1), Exclusive(2)", "lock"}
+
+ };
+ int num_args = sizeof(args) / sizeof(args[0]);
+ int optind = 0;
+ char desc[] =
+ "tabname1 ... tabnameN\n"\
+ "This program will count the number of records in tables\n";
+
+ if(getarg(args, num_args, argc, argv, &optind) ||
+ argv[optind] == NULL || _help) {
+ arg_printusage(args, num_args, argv[0], desc);
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
+ }
+
+ // Connect to Ndb
+ Ndb MyNdb(_dbname);
+
+ if(MyNdb.init() != 0){
+ ERR(MyNdb.getNdbError());
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ // Connect to Ndb and wait for it to become ready
+ while(MyNdb.waitUntilReady() != 0)
+ ndbout << "Waiting for ndb to become ready..." << endl;
+
+ for(int i = optind; i<argc; i++){
+ // Check if table exists in db
+ const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]);
+ if(pTab == NULL){
+ ndbout << " Table " << argv[i] << " does not exist!" << endl;
+ continue;
+ }
+
+ int rows = 0;
+ if (select_count(&MyNdb, pTab, _parallelism, &rows,
+ (UtilTransactions::ScanLock)_lock) != 0){
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ ndbout << rows << " records in table " << argv[i] << endl;
+ }
+ return NDBT_ProgramExit(NDBT_OK);
+}
+
+int
+select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
+ int parallelism,
+ int* count_rows,
+ UtilTransactions::ScanLock lock,
+ NdbConnection* pBuddyTrans){
+
+ int retryAttempt = 0;
+ const int retryMax = 100;
+ int check;
+ NdbConnection *pTrans;
+ NdbOperation *pOp;
+
+ while (true){
+
+ if (retryAttempt >= retryMax){
+ g_info << "ERROR: has retried this operation " << retryAttempt
+ << " times, failing!" << endl;
+ return NDBT_FAILED;
+ }
+
+ pTrans = pNdb->hupp(pBuddyTrans);
+ if (pTrans == NULL) {
+ const NdbError err = pNdb->getNdbError();
+
+ if (err.status == NdbError::TemporaryError){
+ NdbSleep_MilliSleep(50);
+ retryAttempt++;
+ continue;
+ }
+ ERR(err);
+ return NDBT_FAILED;
+ }
+ pOp = pTrans->getNdbOperation(pTab->getName());
+ if (pOp == NULL) {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ switch(lock){
+ case UtilTransactions::SL_ReadHold:
+ check = pOp->openScanReadHoldLock(parallelism);
+ break;
+ case UtilTransactions::SL_Exclusive:
+ check = pOp->openScanExclusive(parallelism);
+ break;
+ case UtilTransactions::SL_Read:
+ default:
+ check = pOp->openScanRead(parallelism);
+ }
+
+ if( check == -1 ) {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ check = pOp->interpret_exit_ok();
+ if( check == -1 ) {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ check = pTrans->executeScan();
+ if( check == -1 ) {
+ ERR(pTrans->getNdbError());
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ int eof;
+ int rows = 0;
+ eof = pTrans->nextScanResult();
+
+ while(eof == 0){
+ rows++;
+ eof = pTrans->nextScanResult();
+ }
+ if (eof == -1) {
+ const NdbError err = pTrans->getNdbError();
+
+ if (err.status == NdbError::TemporaryError){
+ pNdb->closeTransaction(pTrans);
+ NdbSleep_MilliSleep(50);
+ retryAttempt++;
+ continue;
+ }
+ ERR(err);
+ pNdb->closeTransaction(pTrans);
+ return NDBT_FAILED;
+ }
+
+ pNdb->closeTransaction(pTrans);
+
+ if (count_rows != NULL){
+ *count_rows = rows;
+ }
+
+ return NDBT_OK;
+ }
+ return NDBT_FAILED;
+}
+
+
diff --git a/ndb/tools/select_count/select_count.cpp b/ndb/tools/select_count/select_count.cpp
deleted file mode 100644
index b1513ad4135..00000000000
--- a/ndb/tools/select_count/select_count.cpp
+++ /dev/null
@@ -1,90 +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 */
-
-
-#include <ndb_global.h>
-
-#include <NdbOut.hpp>
-
-#include <NdbApi.hpp>
-#include <NdbMain.h>
-#include <NDBT.hpp>
-#include <NdbSleep.h>
-#include <getarg.h>
-#include <UtilTransactions.hpp>
-
-
-int main(int argc, const char** argv){
- const char* _dbname = "TEST_DB";
- int _parallelism = 240;
- int _help = 0;
- int _lock = 0;
-
- struct getargs args[] = {
- { "database", 'd', arg_string, &_dbname, "dbname",
- "Name of database table is in"},
- { "parallelism", 's', arg_integer, &_parallelism, "parallelism", "parallelism" },
- { "usage", '?', arg_flag, &_help, "Print help", "" },
- { "lock", 'l', arg_integer, &_lock,
- "Read(0), Read-hold(1), Exclusive(2)", "lock"}
-
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- char desc[] =
- "tabname1 ... tabnameN\n"\
- "This program will count the number of records in tables\n";
-
- if(getarg(args, num_args, argc, argv, &optind) ||
- argv[optind] == NULL || _help) {
- arg_printusage(args, num_args, argv[0], desc);
- return NDBT_ProgramExit(NDBT_WRONGARGS);
- }
-
- // Connect to Ndb
- Ndb MyNdb(_dbname);
-
- if(MyNdb.init() != 0){
- ERR(MyNdb.getNdbError());
- return NDBT_ProgramExit(NDBT_FAILED);
- }
-
- // Connect to Ndb and wait for it to become ready
- while(MyNdb.waitUntilReady() != 0)
- ndbout << "Waiting for ndb to become ready..." << endl;
-
- for(int i = optind; i<argc; i++){
- // Check if table exists in db
- const NdbDictionary::Table * pTab = NDBT_Table::discoverTableFromDb(&MyNdb, argv[i]);
- if(pTab == NULL){
- ndbout << " Table " << argv[i] << " does not exist!" << endl;
- continue;
- }
-
- int rows = 0;
- UtilTransactions utilTrans(*pTab);
- if (utilTrans.selectCount(&MyNdb, _parallelism, &rows,
- (UtilTransactions::ScanLock)_lock) != 0){
- return NDBT_ProgramExit(NDBT_FAILED);
- }
-
- ndbout << rows << " records in table " << argv[i] << endl;
- }
- return NDBT_ProgramExit(NDBT_OK);
-}
-
-
-
diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp
new file mode 100644
index 00000000000..7ce2739a157
--- /dev/null
+++ b/ndb/tools/waiter.cpp
@@ -0,0 +1,299 @@
+/* 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 <mgmapi.h>
+#include <string.h>
+#include <NdbMain.h>
+#include <NdbOut.hpp>
+#include <NdbSleep.h>
+#include <getarg.h>
+#include <kernel/ndb_limits.h>
+#include "../src/common/mgmcommon/LocalConfig.hpp"
+
+#include <NDBT.hpp>
+
+int
+waitClusterStarted(const char* _addr, unsigned int _timeout= 120);
+
+int main(int argc, const char** argv){
+
+ const char* _hostName = NULL;
+ int _help = 0;
+
+ struct getargs args[] = {
+ { "usage", '?', arg_flag, &_help, "Print help", "" }
+ };
+ int num_args = sizeof(args) / sizeof(args[0]);
+ int optind = 0;
+ char desc[] =
+ "hostname:port\n"\
+ "This program will connect to the mgmsrv of a NDB cluster.\n"\
+ "It will then wait for all nodes to be started\n";
+
+ if(getarg(args, num_args, argc, argv, &optind) || _help) {
+ arg_printusage(args, num_args, argv[0], desc);
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
+ }
+
+ char buf[255];
+ _hostName = argv[optind];
+
+ if (_hostName == NULL){
+ LocalConfig lcfg;
+ if(!lcfg.init())
+ {
+ lcfg.printError();
+ lcfg.printUsage();
+ g_err << "Error parsing local config file" << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ for (int i = 0; i<lcfg.items; i++)
+ {
+ MgmtSrvrId * m = lcfg.ids[i];
+
+ switch(m->type){
+ case MgmId_TCP:
+ snprintf(buf, 255, "%s:%d", m->data.tcp.remoteHost, m->data.tcp.port);
+ _hostName = buf;
+ break;
+ case MgmId_File:
+ break;
+ default:
+ break;
+ }
+ if (_hostName != NULL)
+ break;
+ }
+ if (_hostName == NULL)
+ {
+ g_err << "No management servers configured in local config file" << endl;
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+ }
+
+ if (waitClusterStarted(_hostName) != 0)
+ return NDBT_ProgramExit(NDBT_FAILED);
+
+ return NDBT_ProgramExit(NDBT_OK);
+}
+
+#define MGMERR(h) \
+ ndbout << "latest_error="<<ndb_mgm_get_latest_error(h) \
+ << ", line="<<ndb_mgm_get_latest_error_line(h) \
+ << endl;
+
+NdbMgmHandle handle= NULL;
+
+Vector<ndb_mgm_node_state> ndbNodes;
+Vector<ndb_mgm_node_state> mgmNodes;
+Vector<ndb_mgm_node_state> apiNodes;
+
+int
+getStatus(){
+ int retries = 0;
+ struct ndb_mgm_cluster_state * status;
+ struct ndb_mgm_node_state * node;
+
+ ndbNodes.clear();
+ mgmNodes.clear();
+ apiNodes.clear();
+
+ while(retries < 10){
+ status = ndb_mgm_get_status(handle);
+ if (status == NULL){
+ ndbout << "status==NULL, retries="<<retries<<endl;
+ MGMERR(handle);
+ retries++;
+ continue;
+ }
+ for (int i = 0; i < status->no_of_nodes; i++){
+ node = &status->node_states[i];
+ switch(node->node_type){
+ case NDB_MGM_NODE_TYPE_NDB:
+ ndbNodes.push_back(*node);
+ break;
+ case NDB_MGM_NODE_TYPE_MGM:
+ mgmNodes.push_back(*node);
+ break;
+ case NDB_MGM_NODE_TYPE_API:
+ apiNodes.push_back(*node);
+ break;
+ default:
+ if(node->node_status == NDB_MGM_NODE_STATUS_UNKNOWN ||
+ node->node_status == NDB_MGM_NODE_STATUS_NO_CONTACT){
+ retries++;
+ ndbNodes.clear();
+ mgmNodes.clear();
+ apiNodes.clear();
+ free(status);
+ status = NULL;
+ i = status->no_of_nodes;
+
+ ndbout << "kalle"<< endl;
+ break;
+ }
+ abort();
+ break;
+ }
+ }
+ if(status == 0){
+ ndbout << "status == 0" << endl;
+ continue;
+ }
+ free(status);
+ return 0;
+ }
+
+ g_err << "getStatus failed" << endl;
+ return -1;
+}
+
+int
+waitClusterStarted(const char* _addr, unsigned int _timeout)
+{
+ ndb_mgm_node_status _status = NDB_MGM_NODE_STATUS_STARTED;
+ int _startphase = -1;
+
+ int _nodes[MAX_NDB_NODES];
+ int _num_nodes = 0;
+
+ handle = ndb_mgm_create_handle();
+ if (handle == NULL){
+ g_err << "handle == NULL" << endl;
+ return -1;
+ }
+ g_info << "Connecting to mgmsrv at " << _addr << endl;
+ if (ndb_mgm_connect(handle, _addr) == -1) {
+ MGMERR(handle);
+ g_err << "Connection to " << _addr << " failed" << endl;
+ return -1;
+ }
+
+ if (getStatus() != 0)
+ return -1;
+
+ // Collect all nodes into nodes
+ for (size_t i = 0; i < ndbNodes.size(); i++){
+ _nodes[i] = ndbNodes[i].node_id;
+ _num_nodes++;
+ }
+
+ unsigned int attempts = 0;
+ unsigned int resetAttempts = 0;
+ const unsigned int MAX_RESET_ATTEMPTS = 10;
+ bool allInState = false;
+ while (allInState == false){
+ if (_timeout > 0 && attempts > _timeout){
+ /**
+ * Timeout has expired waiting for the nodes to enter
+ * the state we want
+ */
+ bool waitMore = false;
+ /**
+ * Make special check if we are waiting for
+ * cluster to become started
+ */
+ if(_status == NDB_MGM_NODE_STATUS_STARTED){
+ waitMore = true;
+ /**
+ * First check if any node is not starting
+ * then it's no idea to wait anymore
+ */
+ for (size_t n = 0; n < ndbNodes.size(); n++){
+ if (ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTED &&
+ ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTING)
+ waitMore = false;
+
+ }
+ }
+
+ if (!waitMore || resetAttempts > MAX_RESET_ATTEMPTS){
+ g_err << "waitNodeState("
+ << ndb_mgm_get_node_status_string(_status)
+ <<", "<<_startphase<<")"
+ << " timeout after " << attempts <<" attemps" << endl;
+ return -1;
+ }
+
+ g_err << "waitNodeState("
+ << ndb_mgm_get_node_status_string(_status)
+ <<", "<<_startphase<<")"
+ << " resetting number of attempts "
+ << resetAttempts << endl;
+ attempts = 0;
+ resetAttempts++;
+
+ }
+
+ allInState = true;
+ if (getStatus() != 0){
+ g_err << "getStatus != 0" << endl;
+ return -1;
+ }
+
+ // ndbout << "waitNodeState; _num_nodes = " << _num_nodes << endl;
+ // for (int i = 0; i < _num_nodes; i++)
+ // ndbout << " node["<<i<<"] =" <<_nodes[i] << endl;
+
+ for (int i = 0; i < _num_nodes; i++){
+ ndb_mgm_node_state* ndbNode = NULL;
+ for (size_t n = 0; n < ndbNodes.size(); n++){
+ if (ndbNodes[n].node_id == _nodes[i])
+ ndbNode = &ndbNodes[n];
+ }
+
+ if(ndbNode == NULL){
+ allInState = false;
+ continue;
+ }
+
+ g_info << "State node " << ndbNode->node_id << " "
+ << ndb_mgm_get_node_status_string(ndbNode->node_status)<< endl;
+
+ assert(ndbNode != NULL);
+
+ if(_status == NDB_MGM_NODE_STATUS_STARTING &&
+ ((ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTING &&
+ ndbNode->start_phase >= _startphase) ||
+ (ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTED)))
+ continue;
+
+ if (_status == NDB_MGM_NODE_STATUS_STARTING){
+ g_info << "status = "
+ << ndb_mgm_get_node_status_string(ndbNode->node_status)
+ <<", start_phase="<<ndbNode->start_phase<<endl;
+ if (ndbNode->node_status != _status) {
+ if (ndbNode->node_status < _status)
+ allInState = false;
+ else
+ g_info << "node_status(" << ndbNode->node_status
+ <<") != _status("<<_status<<")"<<endl;
+ } else if (ndbNode->start_phase < _startphase)
+ allInState = false;
+ } else {
+ if (ndbNode->node_status != _status)
+ allInState = false;
+ }
+ }
+ g_info << "Waiting for cluster enter state"
+ << ndb_mgm_get_node_status_string(_status)<< endl;
+ NdbSleep_SecSleep(1);
+ attempts++;
+ }
+ return 0;
+}