Commit 47c877bd authored by unknown's avatar unknown

ndb_init() to all ndb programs


ndb/examples/ndbapi_async_example/ndbapi_async.cpp:
  ndb_init()
ndb/examples/ndbapi_example1/ndbapi_example1.cpp:
  ndb_init()
ndb/examples/ndbapi_example2/ndbapi_example2.cpp:
  ndb_init()
ndb/examples/ndbapi_example3/ndbapi_example3.cpp:
  ndb_init()
ndb/examples/ndbapi_example4/ndbapi_example4.cpp:
  ndb_init()
ndb/examples/ndbapi_example5/ndbapi_example5.cpp:
  ndb_init()
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp:
  ndb_init()
ndb/examples/select_all/select_all.cpp:
  ndb_init()
ndb/include/ndb_global.h:
  ndb_init()
ndb/src/common/util/Makefile.am:
  ndb_init()
ndb/src/kernel/blocks/backup/read.cpp:
  ndb_init()
ndb/src/kernel/blocks/backup/restore/main.cpp:
  ndb_init()
ndb/src/kernel/main.cpp:
  ndb_init()
ndb/src/kernel/vm/Configuration.cpp:
  ndb_init()
ndb/src/mgmclient/main.cpp:
  ndb_init()
ndb/src/mgmsrv/main.cpp:
  ndb_init()
ndb/src/mgmsrv/mkconfig/mkconfig.cpp:
  ndb_init()
ndb/src/ndbapi/Ndbinit.cpp:
  ndb_init()
ndb/test/ndbapi/acid.cpp:
  ndb_init()
ndb/test/ndbapi/acid2.cpp:
  ndb_init()
ndb/test/ndbapi/benchronja.cpp:
  ndb_init()
ndb/test/ndbapi/bulk_copy.cpp:
  ndb_init()
ndb/test/ndbapi/cdrserver.cpp:
  ndb_init()
ndb/test/ndbapi/celloDb.cpp:
  ndb_init()
ndb/test/ndbapi/create_all_tabs.cpp:
  ndb_init()
ndb/test/ndbapi/create_tab.cpp:
  ndb_init()
ndb/test/ndbapi/drop_all_tabs.cpp:
  ndb_init()
ndb/test/ndbapi/flexAsynch.cpp:
  ndb_init()
ndb/test/ndbapi/flexBench.cpp:
  ndb_init()
ndb/test/ndbapi/flexHammer.cpp:
  ndb_init()
ndb/test/ndbapi/flexScan.cpp:
  ndb_init()
ndb/test/ndbapi/flexTT.cpp:
  ndb_init()
ndb/test/ndbapi/flexTimedAsynch.cpp:
  ndb_init()
ndb/test/ndbapi/flex_bench_mysql.cpp:
  ndb_init()
ndb/test/ndbapi/index.cpp:
  ndb_init()
ndb/test/ndbapi/index2.cpp:
  ndb_init()
ndb/test/ndbapi/initronja.cpp:
  ndb_init()
ndb/test/ndbapi/interpreterInTup.cpp:
  ndb_init()
ndb/test/ndbapi/mainAsyncGenerator.cpp:
  ndb_init()
ndb/test/ndbapi/msa.cpp:
  ndb_init()
ndb/test/ndbapi/restarter.cpp:
  ndb_init()
ndb/test/ndbapi/restarter2.cpp:
  ndb_init()
ndb/test/ndbapi/restarts.cpp:
  ndb_init()
ndb/test/ndbapi/size.cpp:
  ndb_init()
ndb/test/ndbapi/slow_select.cpp:
  ndb_init()
ndb/test/ndbapi/testBackup.cpp:
  ndb_init()
ndb/test/ndbapi/testBasic.cpp:
  ndb_init()
ndb/test/ndbapi/testBasicAsynch.cpp:
  ndb_init()
ndb/test/ndbapi/testBlobs.cpp:
  ndb_init()
ndb/test/ndbapi/testDataBuffers.cpp:
  ndb_init()
ndb/test/ndbapi/testDeadlock.cpp:
  ndb_init()
ndb/test/ndbapi/testDict.cpp:
  ndb_init()
ndb/test/ndbapi/testGrep.cpp:
  ndb_init()
ndb/test/ndbapi/testGrepVerify.cpp:
  ndb_init()
ndb/test/ndbapi/testIndex.cpp:
  ndb_init()
ndb/test/ndbapi/testInterpreter.cpp:
  ndb_init()
ndb/test/ndbapi/testMgm.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankCreator.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankMakeGL.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankSumAccounts.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankTimer.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankTransactionMaker.cpp:
  ndb_init()
ndb/test/ndbapi/bank/bankValidateAllGLs.cpp:
  ndb_init()
ndb/test/ndbapi/bank/testBank.cpp:
  ndb_init()
ndb/test/ndbapi/testNdbApi.cpp:
  ndb_init()
ndb/test/ndbapi/testNodeRestart.cpp:
  ndb_init()
ndb/test/ndbapi/testOIBasic.cpp:
  ndb_init()
ndb/test/ndbapi/testOperations.cpp:
  ndb_init()
ndb/test/ndbapi/testOrderedIndex.cpp:
  ndb_init()
ndb/test/ndbapi/testReadPerf.cpp:
  ndb_init()
ndb/test/ndbapi/testRestartGci.cpp:
  ndb_init()
ndb/test/ndbapi/testScan.cpp:
  ndb_init()
ndb/test/ndbapi/testScanInterpreter.cpp:
  ndb_init()
ndb/test/ndbapi/testScanPerf.cpp:
  ndb_init()
ndb/test/ndbapi/testSystemRestart.cpp:
  ndb_init()
ndb/test/ndbapi/testTimeout.cpp:
  ndb_init()
ndb/test/ndbapi/testTransactions.cpp:
  ndb_init()
ndb/test/ndbapi/test_event.cpp:
  ndb_init()
ndb/test/run-test/main.cpp:
  ndb_init()
ndb/test/src/NDBT_Test.cpp:
  ndb_init()
ndb/test/tools/copy_tab.cpp:
  ndb_init()
ndb/test/tools/cpcc.cpp:
  ndb_init()
ndb/test/tools/create_index.cpp:
  ndb_init()
ndb/test/tools/hugoCalculator.cpp:
  ndb_init()
ndb/test/tools/hugoFill.cpp:
  ndb_init()
ndb/test/tools/hugoLoad.cpp:
  ndb_init()
ndb/test/tools/hugoLockRecords.cpp:
  ndb_init()
ndb/test/tools/hugoPkDelete.cpp:
  ndb_init()
ndb/test/tools/hugoPkRead.cpp:
  ndb_init()
ndb/test/tools/hugoPkReadRecord.cpp:
  ndb_init()
ndb/test/tools/hugoPkUpdate.cpp:
  ndb_init()
ndb/test/tools/hugoScanRead.cpp:
  ndb_init()
ndb/test/tools/hugoScanUpdate.cpp:
  ndb_init()
ndb/test/tools/restart.cpp:
  ndb_init()
ndb/test/tools/transproxy.cpp:
  ndb_init()
ndb/test/tools/verify_index.cpp:
  ndb_init()
ndb/tools/delete_all.cpp:
  ndb_init()
ndb/tools/desc.cpp:
  ndb_init()
ndb/tools/drop_index.cpp:
  ndb_init()
ndb/tools/drop_tab.cpp:
  ndb_init()
ndb/tools/listTables.cpp:
  ndb_init()
ndb/tools/ndbsql.cpp:
  ndb_init()
ndb/tools/select_all.cpp:
  ndb_init()
ndb/tools/select_count.cpp:
  ndb_init()
ndb/tools/waiter.cpp:
  ndb_init()
parent ff376da0
......@@ -454,6 +454,7 @@ int populate(Ndb * myNdb, int data, async_callback_t * cbData)
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB" ); // Object representing the database
/*******************************************
......
......@@ -44,6 +44,7 @@
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB_1" ); // Object representing the database
NdbDictionary::Table myTable;
NdbDictionary::Column myColumn;
......
......@@ -39,6 +39,7 @@ static void callback(int result, NdbConnection* NdbObject, void* aObject);
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB_2" ); // Object representing the database
NdbConnection* myNdbConnection[2]; // For transactions
......
......@@ -176,6 +176,7 @@ int executeInsertTransaction(int transactionId, Ndb* myNdb) {
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB_1" ); // Object representing the database
/*******************************************
......
......@@ -44,6 +44,7 @@
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB_1" ); // Object representing the database
NdbDictionary::Table myTable;
NdbDictionary::Column myColumn;
......
......@@ -65,6 +65,7 @@ int myCreateEvent(Ndb* myNdb,
int main()
{
ndb_init();
Ndb* myNdb = myCreateNdb();
NdbDictionary::Dictionary *myDict;
......
......@@ -761,6 +761,7 @@ int scan_print(Ndb * myNdb, int parallelism,
int main()
{
ndb_init();
Ndb* myNdb = new Ndb( "TEST_DB" ); // Object representing the database
......
......@@ -112,6 +112,7 @@ const char* ResultSetContainer::getAttrName(int i) const {return m_names[i];}
int main(int argc, const char** argv)
{
ndb_init();
Ndb* myNdb = new Ndb("ndbapi_example4"); // Object representing the database
NdbConnection* myNdbConnection; // For transactions
NdbOperation* myNdbOperation; // For operations
......
......@@ -76,6 +76,9 @@ extern "C" {
#include <assert.h>
/* call in main() - does not return on error */
extern int ndb_init(void);
#ifndef HAVE_STRDUP
extern char * strdup(const char *s);
#endif
......
......@@ -9,7 +9,7 @@ libgeneral_la_SOURCES = \
NdbSqlUtil.cpp new.cpp \
uucode.c random.c getarg.c version.c \
strdup.c strlcat.c strlcpy.c \
ConfigValues.cpp
ConfigValues.cpp ndb_init.c
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_util.mk.am
......
/* 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 <my_sys.h>
int
ndb_init()
{
if (my_init()) {
const char* err = "my_init() failed - exit\n";
write(2, err, strlen(err));
exit(1);
}
return 0;
}
......@@ -48,6 +48,7 @@ static Uint32 logEntryNo;
int
main(int argc, const char * argv[]){
ndb_init();
if(argc <= 1){
printf("Usage: %s <filename>", argv[0]);
exit(1);
......
......@@ -206,6 +206,7 @@ free_data_callback()
int
main(int argc, const char** argv)
{
ndb_init();
if (!readArguments(argc, argv))
{
return -1;
......
......@@ -56,6 +56,7 @@ const char programName[] = "NDB Kernel";
NDB_MAIN(ndb_kernel){
ndb_init();
// Print to stdout/console
g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("NDB");
......
......@@ -105,7 +105,6 @@ Configuration::init(int argc, const char** argv){
}
// check for depricated flag '-i'
my_init();
#ifndef DBUG_OFF
if (debug_option)
DBUG_PUSH(debug_option);
......
......@@ -44,6 +44,7 @@ handler(int sig){
}
int main(int argc, const char** argv){
ndb_init();
int optind = 0;
const char *_host = 0;
int _port = 0;
......
......@@ -129,6 +129,7 @@ int num_args = sizeof(args) / sizeof(args[0]);
* MAIN
*/
NDB_MAIN(mgmsrv){
ndb_init();
/**
* OSE specific. Enable shared ownership of file system resources.
* This is needed in order to use the cluster log since the events
......@@ -151,7 +152,6 @@ NDB_MAIN(mgmsrv){
glob.daemon= 0;
}
my_init();
#ifndef DBUG_OFF
if (debug_option)
DBUG_PUSH(debug_option);
......
......@@ -32,6 +32,7 @@ void usage(const char * prg){
NDB_COMMAND(mkconfig,
"mkconfig", "mkconfig",
"Make a binary configuration from a config file", 16384){
ndb_init();
if(argc < 3){
usage(argv[0]);
return 0;
......
......@@ -62,7 +62,6 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) {
abort(); // old and new Ndb constructor used mixed
theNoOfNdbObjects++;
if (global_ndb_cluster_connection == 0) {
my_init();
global_ndb_cluster_connection= new Ndb_cluster_connection(ndbConnectString);
global_ndb_cluster_connection->connect();
}
......
......@@ -434,6 +434,7 @@ extern "C" void* NdbThreadFuncRead(void* pArg)
NDB_COMMAND(acid, "acid", "acid", "acid", 65535)
{
ndb_init();
long nSeconds = 60;
int rc = NDBT_OK;
......
......@@ -610,6 +610,7 @@ extern "C" void* ThreadFunc(void*)
int main(int argc, char* argv[])
{
ndb_init();
Uint32 nSeconds = 1;
Uint32 nThread = 1;
......
......@@ -27,6 +27,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
struct getargs args[] = {
......
......@@ -27,6 +27,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
struct getargs args[] = {
......
......@@ -27,6 +27,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
struct getargs args[] = {
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
int _wait = 30;
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
int _wait = 20;
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
struct getargs args[] = {
......
......@@ -141,6 +141,7 @@ TESTCASE("Bank",
NDBT_TESTSUITE_END(testBank);
int main(int argc, const char** argv){
ndb_init();
// Tables should not be auto created
testBank.setCreateTable(false);
......
......@@ -66,6 +66,7 @@ static int ThreadReady[MAXTHREADS];
static int ThreadStart[MAXTHREADS];
NDB_COMMAND(benchronja, "benchronja", "benchronja", "benchronja", 65535){
ndb_init();
ThreadNdb tabThread[MAXTHREADS];
int i = 0 ;
......
......@@ -221,6 +221,7 @@ int insertFile(Ndb* pNdb,
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
int _help = 0;
......
......@@ -113,6 +113,7 @@ using namespace std;
int main(int argc, const char** argv)
{
ndb_init();
/******** NDB ***********/
/*
Ndb MyNdb( "TEST_DB" );
......
......@@ -73,6 +73,7 @@ static int failed = 0 ;
NDB_COMMAND(celloDb, "celloDb", "celloDb", "celloDb", 65535)
{
ndb_init();
int tTableId;
int i;
......
......@@ -25,6 +25,7 @@
int main(int argc, const char** argv){
ndb_init();
int _temp = false;
int _help = 0;
......
......@@ -25,6 +25,7 @@
int main(int argc, const char** argv){
ndb_init();
int _temp = false;
int _help = 0;
......
......@@ -23,6 +23,7 @@
#include <getarg.h>
int main(int argc, const char** argv){
ndb_init();
int _help = 0;
struct getargs args[] = {
......
......@@ -145,6 +145,7 @@ tellThreads(StartType what)
NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
{
ndb_init();
ThreadNdb* pThreadData;
int tLoops=0, i;
int returnValue = NDBT_OK;
......
......@@ -281,6 +281,7 @@ tellThreads(ThreadData* pt, StartType what)
NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
{
ndb_init();
ThreadData* pThreadsData;
int tLoops = 0, i;
int returnValue = NDBT_OK;
......
......@@ -178,6 +178,7 @@ tellThreads(ThreadNdb* threadArrayP, const StartType what)
NDB_COMMAND(flexHammer, "flexHammer", "flexHammer", "flexHammer", 65535)
//main(int argc, const char** argv)
{
ndb_init();
ThreadNdb* pThreads = NULL; // Pointer to thread data array
Ndb* pMyNdb = NULL; // Pointer to Ndb object
int tLoops = 0;
......
......@@ -297,6 +297,7 @@ static int checkThreadResults(ThreadNdb *threadArrayP, char *action)
NDB_COMMAND(flexScan, "flexScan", "flexScan", "flexScan", 65535)
{
ndb_init();
ThreadNdb* pThreads = NULL;
Ndb* pMyNdb = NULL;
int tLoops = 0;
......
......@@ -171,6 +171,7 @@ tellThreads(StartType what)
NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
{
ndb_init();
ThreadNdb* pThreadData;
int returnValue = NDBT_OK;
int i;
......
......@@ -174,6 +174,7 @@ void deleteAttributeSpace(){
NDB_COMMAND(flexTimedAsynch, "flexTimedAsynch", "flexTimedAsynch [-tpoilcas]", "flexTimedAsynch", 65535)
{
ndb_init();
ThreadNdb tabThread[MAXTHREADS];
int tLoops=0;
int returnValue;
......
......@@ -308,6 +308,7 @@ tellThreads(ThreadData* pt, StartType what)
NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
{
ndb_init();
ThreadData* pThreadsData;
int tLoops = 0;
int returnValue = NDBT_OK;
......
......@@ -771,6 +771,7 @@ static void dropIndex(Ndb &myNdb, unsigned int noOfIndexes)
NDB_COMMAND(indexTest, "indexTest", "indexTest", "indexTest", 65535)
{
ndb_init();
bool createTableOp, createIndexOp, dropIndexOp, insertOp, updateOp, deleteOp, readOp, readIndexOp, updateIndexOp, deleteIndexOp, twoKey, longKey;
unsigned int noOfTuples = 1;
unsigned int noOfOperations = 1;
......
......@@ -608,6 +608,7 @@ static void dropIndex(Ndb &myNdb, unsigned int noOfIndexes)
NDB_COMMAND(indexTest, "indexTest", "indexTest", "indexTest", 65535)
{
ndb_init();
bool createTableOp, createIndexOp, dropIndexOp, insertOp, updateOp, deleteOp, readOp, readIndexOp, updateIndexOp, deleteIndexOp, twoKey, longKey;
unsigned int noOfTuples = 1;
unsigned int noOfOperations = 1;
......
......@@ -46,6 +46,7 @@ static char attrName[MAXATTR][MAXSTRLEN];
inline int InsertRecords(Ndb*, int) ;
NDB_COMMAND(initronja, "initronja", "initronja", "initronja", 65535){
ndb_init();
Ndb* pNdb = NULL ;
NdbSchemaCon *MySchemaTransaction = NULL ;
......
......@@ -105,6 +105,7 @@ int bTestPassed = 0;
int main(int argc, const char** argv) {
ndb_init();
int operationType = 0;
int tupTest = 0;
......
......@@ -282,6 +282,7 @@ threadRoutine(void *arg)
NDB_COMMAND(DbAsyncGenerator, "DbAsyncGenerator",
"DbAsyncGenerator", "DbAsyncGenerator", 65535)
{
ndb_init();
int i;
int j;
int k;
......
......@@ -971,6 +971,7 @@ void ShowHelp(const char* szCmd)
int main(int argc, char* argv[])
{
ndb_init();
int iRes = -1;
g_nNumThreads = 0;
g_nMaxCallsPerSecond = 0;
......
......@@ -28,6 +28,7 @@
#include <NDBT.hpp>
int main(int argc, const char** argv){
ndb_init();
const char* _hostName = NULL;
int _loops = 10;
......
......@@ -26,6 +26,7 @@
#include <NDBT.hpp>
int main(int argc, const char** argv){
ndb_init();
const char* _hostName = NULL;
int _loops = 10;
......
......@@ -27,6 +27,7 @@
#include <NDBT.hpp>
int main(int argc, const char** argv){
ndb_init();
const char* _restartName = NULL;
int _loops = 1;
......
......@@ -19,6 +19,7 @@
int main(void)
{
ndb_init();
printf("cdrstruct=%d\n",sizeof(struct cdr_record));
printf("long int=%d\n",sizeof(long int));
printf("int=%d\n",sizeof(int));
......
......@@ -36,6 +36,7 @@ static void lookup();
int
main(void){
ndb_init();
Ndb g_ndb("test");
g_ndb.init(1024);
......
......@@ -473,6 +473,7 @@ TESTCASE("FailSlave",
NDBT_TESTSUITE_END(testBackup);
int main(int argc, const char** argv){
ndb_init();
return testBackup.execute(argc, argv);
}
......
......@@ -1278,6 +1278,7 @@ TESTCASE("MassiveTransaction",
NDBT_TESTSUITE_END(testBasic);
int main(int argc, const char** argv){
ndb_init();
return testBasic.execute(argc, argv);
}
......
......@@ -181,6 +181,7 @@ TESTCASE("PkDeleteAsynch",
NDBT_TESTSUITE_END(testBasicAsynch);
int main(int argc, const char** argv){
ndb_init();
return testBasicAsynch.execute(argc, argv);
}
......@@ -1338,6 +1338,7 @@ static struct {
NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)
{
ndb_init();
while (++argv, --argc > 0) {
const char* arg = argv[0];
if (strcmp(arg, "-batch") == 0) {
......
......@@ -545,6 +545,7 @@ testcase(int flag)
NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuffers", 65535)
{
ndb_init();
while (++argv, --argc > 0) {
char const* p = argv[0];
if (*p++ != '-' || strlen(p) != 1)
......
......@@ -491,6 +491,7 @@ wl1822_main(char scantx)
NDB_COMMAND(testOdbcDriver, "testDeadlock", "testDeadlock", "testDeadlock", 65535)
{
ndb_init();
while (++argv, --argc > 0) {
const char* arg = argv[0];
if (strcmp(arg, "-scan") == 0) {
......
......@@ -1576,6 +1576,7 @@ TESTCASE("DictionaryPerf",
NDBT_TESTSUITE_END(testDict);
int main(int argc, const char** argv){
ndb_init();
// Tables should not be auto created
testDict.setCreateTable(false);
myRandom48Init(NdbTick_CurrentMillisecond());
......
......@@ -533,6 +533,7 @@ TESTCASE("FailSlave",
NDBT_TESTSUITE_END(testGrep);
int main(int argc, const char** argv){
ndb_init();
return testGrep.execute(argc, argv);
}
......
......@@ -40,6 +40,7 @@
continue; }
int main(int argc, const char** argv){
ndb_init();
const char * connectString = NULL;
......
......@@ -1528,6 +1528,7 @@ TESTCASE("UniqueNull",
NDBT_TESTSUITE_END(testIndex);
int main(int argc, const char** argv){
ndb_init();
return testIndex.execute(argc, argv);
}
......
......@@ -224,6 +224,7 @@ TESTCASE("NdbErrorOperation",
NDBT_TESTSUITE_END(testInterpreter);
int main(int argc, const char** argv){
ndb_init();
// TABLE("T1");
return testInterpreter.execute(argc, argv);
}
......
......@@ -178,6 +178,7 @@ TESTCASE("SingleUserMode",
NDBT_TESTSUITE_END(testMgm);
int main(int argc, const char** argv){
ndb_init();
myRandom48Init(NdbTick_CurrentMillisecond());
return testMgm.execute(argc, argv);
}
......
......@@ -1006,6 +1006,7 @@ TESTCASE("NdbErrorOperation",
NDBT_TESTSUITE_END(testNdbApi);
int main(int argc, const char** argv){
ndb_init();
// TABLE("T1");
return testNdbApi.execute(argc, argv);
}
......
......@@ -434,6 +434,7 @@ TESTCASE("StopOnError",
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
ndb_init();
#if 0
// It might be interesting to have longer defaults for num
// loops in this test
......
......@@ -3201,6 +3201,7 @@ runtest(Par par)
NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535)
{
ndb_init();
while (++argv, --argc > 0) {
const char* arg = argv[0];
if (*arg != '-') {
......
......@@ -230,6 +230,7 @@ runClearTable(NDBT_Context* ctx, NDBT_Step* step){
int
main(int argc, const char** argv){
ndb_init();
NDBT_TestSuite ts("testOperations");
for(Uint32 i = 0; i<sizeof(matrix)/sizeof(matrix[0]); i++){
......
......@@ -218,6 +218,7 @@ NDBT_TESTSUITE_END(testOrderedIndex);
int
main(int argc, const char** argv)
{
ndb_init();
return testOrderedIndex.execute(argc, argv);
}
......
......@@ -91,6 +91,7 @@ void print_result();
int
main(int argc, const char** argv){
ndb_init();
int verbose = 1;
int optind = 0;
......
......@@ -214,6 +214,7 @@ TESTCASE("InsertRestartGci",
NDBT_TESTSUITE_END(testRestartGci);
int main(int argc, const char** argv){
ndb_init();
return testRestartGci.execute(argc, argv);
}
......
......@@ -1400,6 +1400,7 @@ TESTCASE("ScanRestart",
NDBT_TESTSUITE_END(testScan);
int main(int argc, const char** argv){
ndb_init();
myRandom48Init(NdbTick_CurrentMillisecond());
return testScan.execute(argc, argv);
}
......
......@@ -273,6 +273,7 @@ TESTCASE("ScanLessThanLoop",
NDBT_TESTSUITE_END(testScanInterpreter);
int main(int argc, const char** argv){
ndb_init();
return testScanInterpreter.execute(argc, argv);
}
......
......@@ -72,6 +72,7 @@ int drop_table();
int
main(int argc, const char** argv){
ndb_init();
int verbose = 1;
int optind = 0;
......
......@@ -1179,6 +1179,7 @@ TESTCASE("SR8",
NDBT_TESTSUITE_END(testSystemRestart);
int main(int argc, const char** argv){
ndb_init();
return testSystemRestart.execute(argc, argv);
}
......
......@@ -406,6 +406,7 @@ TESTCASE("BuddyTransNoTimeout5",
NDBT_TESTSUITE_END(testTimeout);
int main(int argc, const char** argv){
ndb_init();
myRandom48Init(NdbTick_CurrentMillisecond());
return testTimeout.execute(argc, argv);
}
......
......@@ -364,6 +364,7 @@ runClearTable(NDBT_Context* ctx, NDBT_Step* step){
int
main(int argc, const char** argv){
ndb_init();
NDBT_TestSuite ts("testOperations");
for(Uint32 i = 0; i<sizeof(matrix)/sizeof(matrix[0]); i++){
......
......@@ -137,6 +137,7 @@ NDBT_TESTSUITE_END(test_event);
#endif
int main(int argc, const char** argv){
ndb_init();
return test_event.execute(argc, argv);
}
......@@ -79,6 +79,7 @@ const int arg_count = 10;
int
main(int argc, const char ** argv){
ndb_init();
bool restart = true;
int lineno = 1;
......
......@@ -985,7 +985,6 @@ int NDBT_TestSuite::execute(int argc, const char** argv){
}
#ifndef DBUG_OFF
my_init();
if (debug_option)
DBUG_PUSH(debug_option);
#endif
......
......@@ -24,6 +24,7 @@
#include <getarg.h>
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
const char* _to_tabname = NULL;
......
......@@ -173,6 +173,7 @@ add_hosts(Vector<SimpleCpcClient*> & hosts, BaseString list){
int
main(int argc, const char** argv){
ndb_init();
int help = 0;
const char *cmd=0, *name=0, *group=0, *owner=0;
int list = 0, start = 0, stop = 0, rm = 0;
......
......@@ -26,6 +26,7 @@
int
main(int argc, const char** argv){
ndb_init();
const char* _dbname = "TEST_DB";
int _help = 0;
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv)
{
ndb_init();
int _row = 0;
int _column = 0;
int _updates = 0;
......
......@@ -25,6 +25,7 @@
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
const char* _tabname = NULL;
......
......@@ -24,6 +24,7 @@
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
const char* _tabname = NULL;
......
......@@ -27,6 +27,7 @@
#include <HugoTransactions.hpp>
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -27,6 +27,7 @@
#include <HugoTransactions.hpp>
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -28,6 +28,7 @@
int main(int argc, const char** argv)
{
ndb_init();
int _row = 0;
int _hex = 0;
int _primaryKey = 0;
......
......@@ -27,6 +27,7 @@
#include <HugoTransactions.hpp>
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -27,6 +27,7 @@
#include <HugoTransactions.hpp>
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -27,6 +27,7 @@
#include <HugoTransactions.hpp>
int main(int argc, const char** argv){
ndb_init();
int _records = 0;
int _loops = 1;
......
......@@ -27,6 +27,7 @@
#include <NDBT.hpp>
int main(int argc, const char** argv){
ndb_init();
const char* _hostName = NULL;
int _initial = 0;
......
......@@ -346,6 +346,7 @@ start()
int
main(int av, char** ac)
{
ndb_init();
debug("start");
hostname = "ndb-srv7";
if (Ndb_getInAddr(&hostaddr.sin_addr, hostname) != 0) {
......
......@@ -27,6 +27,7 @@
int main(int argc, const char** argv){
ndb_init();
int _parallelism = 240;
const char* _tabname = NULL;
const char* _indexname = NULL;
......
......@@ -26,6 +26,7 @@
static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240);
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
......
......@@ -22,6 +22,7 @@
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
int _unqualified = 0;
......
......@@ -23,6 +23,7 @@
#include <getarg.h>
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
......
......@@ -23,6 +23,7 @@
#include <getarg.h>
int main(int argc, const char** argv){
ndb_init();
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
......
......@@ -167,6 +167,7 @@ const char *debug_option= 0;
#endif
int main(int argc, const char** argv){
ndb_init();
int _loops = 1;
const char* _tabname = NULL;
const char* _dbname = "TEST_DB";
......@@ -209,7 +210,6 @@ int main(int argc, const char** argv){
_tabname = argv[optind];
#ifndef DBUG_OFF
my_init();
if (debug_option)
DBUG_PUSH(debug_option);
#endif
......
......@@ -671,6 +671,7 @@ void print_help_virtual() {
int main(int argc, const char** argv)
{
ndb_init();
const char* usage = "Usage: ndbsql [-h] [-d dsn] [-f file] [stmt]\n-h help\n-d <database name or connect string>\n-f <file name> batch mode\nstmt single SQL statement\n";
const char* dsn = "TEST_DB";
bool helpFlg = false, batchMode = false;
......
......@@ -42,6 +42,7 @@ int scanReadRecords(Ndb*,
bool orderby);
int main(int argc, const char** argv){
ndb_init();
int _parallelism = 240;
const char* _delimiter = "\t";
int _header = true;
......@@ -89,7 +90,6 @@ int main(int argc, const char** argv){
_tabname = argv[optind];
#ifndef DBUG_OFF
my_init();
if (debug_option)
DBUG_PUSH(debug_option);
#endif
......
......@@ -33,6 +33,7 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
UtilTransactions::ScanLock lock);
int main(int argc, const char** argv){
ndb_init();
const char* _dbname = "TEST_DB";
int _parallelism = 240;
int _help = 0;
......
......@@ -30,6 +30,7 @@ int
waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout);
int main(int argc, const char** argv){
ndb_init();
const char* _hostName = NULL;
int _no_contact = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment