Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3c4c866f
Commit
3c4c866f
authored
Dec 29, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - Update test programs to use new Ndb constructor
parent
9378af0e
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
195 additions
and
60 deletions
+195
-60
ndb/test/include/NDBT_Test.hpp
ndb/test/include/NDBT_Test.hpp
+13
-7
ndb/test/ndbapi/bank/Bank.cpp
ndb/test/ndbapi/bank/Bank.cpp
+2
-2
ndb/test/ndbapi/bank/Bank.hpp
ndb/test/ndbapi/bank/Bank.hpp
+1
-1
ndb/test/ndbapi/bank/bankCreator.cpp
ndb/test/ndbapi/bank/bankCreator.cpp
+7
-1
ndb/test/ndbapi/bank/bankMakeGL.cpp
ndb/test/ndbapi/bank/bankMakeGL.cpp
+7
-1
ndb/test/ndbapi/bank/bankSumAccounts.cpp
ndb/test/ndbapi/bank/bankSumAccounts.cpp
+7
-1
ndb/test/ndbapi/bank/bankTimer.cpp
ndb/test/ndbapi/bank/bankTimer.cpp
+7
-1
ndb/test/ndbapi/bank/bankTransactionMaker.cpp
ndb/test/ndbapi/bank/bankTransactionMaker.cpp
+7
-1
ndb/test/ndbapi/bank/bankValidateAllGLs.cpp
ndb/test/ndbapi/bank/bankValidateAllGLs.cpp
+7
-1
ndb/test/ndbapi/bank/testBank.cpp
ndb/test/ndbapi/bank/testBank.cpp
+6
-6
ndb/test/ndbapi/create_all_tabs.cpp
ndb/test/ndbapi/create_all_tabs.cpp
+6
-1
ndb/test/ndbapi/create_tab.cpp
ndb/test/ndbapi/create_tab.cpp
+6
-2
ndb/test/ndbapi/drop_all_tabs.cpp
ndb/test/ndbapi/drop_all_tabs.cpp
+7
-1
ndb/test/ndbapi/flexBench.cpp
ndb/test/ndbapi/flexBench.cpp
+12
-2
ndb/test/src/NDBT_Test.cpp
ndb/test/src/NDBT_Test.cpp
+28
-18
ndb/test/tools/copy_tab.cpp
ndb/test/tools/copy_tab.cpp
+6
-3
ndb/test/tools/create_index.cpp
ndb/test/tools/create_index.cpp
+6
-1
ndb/test/tools/hugoFill.cpp
ndb/test/tools/hugoFill.cpp
+6
-1
ndb/test/tools/hugoLoad.cpp
ndb/test/tools/hugoLoad.cpp
+6
-1
ndb/test/tools/hugoLockRecords.cpp
ndb/test/tools/hugoLockRecords.cpp
+6
-1
ndb/test/tools/hugoPkDelete.cpp
ndb/test/tools/hugoPkDelete.cpp
+6
-1
ndb/test/tools/hugoPkRead.cpp
ndb/test/tools/hugoPkRead.cpp
+6
-1
ndb/test/tools/hugoPkReadRecord.cpp
ndb/test/tools/hugoPkReadRecord.cpp
+6
-1
ndb/test/tools/hugoPkUpdate.cpp
ndb/test/tools/hugoPkUpdate.cpp
+6
-1
ndb/test/tools/hugoScanRead.cpp
ndb/test/tools/hugoScanRead.cpp
+6
-1
ndb/test/tools/hugoScanUpdate.cpp
ndb/test/tools/hugoScanUpdate.cpp
+6
-1
ndb/test/tools/verify_index.cpp
ndb/test/tools/verify_index.cpp
+6
-1
No files found.
ndb/test/include/NDBT_Test.hpp
View file @
3c4c866f
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <NdbCondition.h>
#include <NdbCondition.h>
#include <NdbTimer.hpp>
#include <NdbTimer.hpp>
#include <Vector.hpp>
#include <Vector.hpp>
#include <NdbApi.hpp>
#include <NdbDictionary.hpp>
#include <NdbDictionary.hpp>
class
NDBT_Step
;
class
NDBT_Step
;
...
@@ -34,7 +35,9 @@ class NDBT_TestCaseImpl1;
...
@@ -34,7 +35,9 @@ class NDBT_TestCaseImpl1;
class
NDBT_Context
{
class
NDBT_Context
{
public:
public:
NDBT_Context
();
Ndb_cluster_connection
&
m_cluster_connection
;
NDBT_Context
(
Ndb_cluster_connection
&
);
~
NDBT_Context
();
~
NDBT_Context
();
const
NdbDictionary
::
Table
*
getTab
();
const
NdbDictionary
::
Table
*
getTab
();
NDBT_TestSuite
*
getSuite
();
NDBT_TestSuite
*
getSuite
();
...
@@ -120,7 +123,7 @@ public:
...
@@ -120,7 +123,7 @@ public:
NDBT_TESTFUNC
*
pfunc
);
NDBT_TESTFUNC
*
pfunc
);
virtual
~
NDBT_Step
()
{}
virtual
~
NDBT_Step
()
{}
int
execute
(
NDBT_Context
*
);
int
execute
(
NDBT_Context
*
);
virtual
int
setUp
()
=
0
;
virtual
int
setUp
(
Ndb_cluster_connection
&
)
=
0
;
virtual
void
tearDown
()
=
0
;
virtual
void
tearDown
()
=
0
;
void
setContext
(
NDBT_Context
*
);
void
setContext
(
NDBT_Context
*
);
NDBT_Context
*
getContext
();
NDBT_Context
*
getContext
();
...
@@ -142,7 +145,7 @@ public:
...
@@ -142,7 +145,7 @@ public:
const
char
*
pname
,
const
char
*
pname
,
NDBT_TESTFUNC
*
pfunc
);
NDBT_TESTFUNC
*
pfunc
);
virtual
~
NDBT_NdbApiStep
()
{}
virtual
~
NDBT_NdbApiStep
()
{}
virtual
int
setUp
();
virtual
int
setUp
(
Ndb_cluster_connection
&
);
virtual
void
tearDown
();
virtual
void
tearDown
();
Ndb
*
getNdb
();
Ndb
*
getNdb
();
...
@@ -347,10 +350,13 @@ public:
...
@@ -347,10 +350,13 @@ public:
int
addTest
(
NDBT_TestCase
*
pTest
);
int
addTest
(
NDBT_TestCase
*
pTest
);
private:
private:
int
executeOne
(
const
char
*
_tabname
,
const
char
*
testname
=
NULL
);
int
executeOne
(
Ndb_cluster_connection
&
,
int
executeAll
(
const
char
*
testname
=
NULL
);
const
char
*
_tabname
,
const
char
*
testname
=
NULL
);
int
executeAll
(
Ndb_cluster_connection
&
,
const
char
*
testname
=
NULL
);
void
execute
(
Ndb_cluster_connection
&
,
Ndb
*
,
const
NdbDictionary
::
Table
*
,
const
char
*
testname
=
NULL
);
void
execute
(
Ndb
*
,
const
NdbDictionary
::
Table
*
,
const
char
*
testname
=
NULL
);
int
report
(
const
char
*
_tcname
=
NULL
);
int
report
(
const
char
*
_tcname
=
NULL
);
int
reportAllTables
(
const
char
*
);
int
reportAllTables
(
const
char
*
);
const
char
*
name
;
const
char
*
name
;
...
...
ndb/test/ndbapi/bank/Bank.cpp
View file @
3c4c866f
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
#include <NdbSleep.h>
#include <NdbSleep.h>
#include <UtilTransactions.hpp>
#include <UtilTransactions.hpp>
Bank
::
Bank
()
:
Bank
::
Bank
(
Ndb_cluster_connection
&
con
)
:
m_ndb
(
"BANK"
),
m_ndb
(
&
con
,
"BANK"
),
m_maxAccount
(
-
1
),
m_maxAccount
(
-
1
),
m_initialized
(
false
)
m_initialized
(
false
)
{
{
...
...
ndb/test/ndbapi/bank/Bank.hpp
View file @
3c4c866f
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
class
Bank
{
class
Bank
{
public:
public:
Bank
();
Bank
(
Ndb_cluster_connection
&
);
int
createAndLoadBank
(
bool
overWrite
,
int
num_accounts
=
10
);
int
createAndLoadBank
(
bool
overWrite
,
int
num_accounts
=
10
);
int
dropBank
();
int
dropBank
();
...
...
ndb/test/ndbapi/bank/bankCreator.cpp
View file @
3c4c866f
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
int
overWriteExisting
=
true
;
int
overWriteExisting
=
true
;
if
(
bank
.
createAndLoadBank
(
overWriteExisting
)
!=
NDBT_OK
)
if
(
bank
.
createAndLoadBank
(
overWriteExisting
)
!=
NDBT_OK
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/bankMakeGL.cpp
View file @
3c4c866f
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
if
(
bank
.
performMakeGLs
()
!=
0
)
if
(
bank
.
performMakeGLs
()
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/bankSumAccounts.cpp
View file @
3c4c866f
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
...
@@ -43,7 +43,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
if
(
bank
.
performSumAccounts
()
!=
0
)
if
(
bank
.
performSumAccounts
()
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/bankTimer.cpp
View file @
3c4c866f
...
@@ -46,7 +46,13 @@ int main(int argc, const char** argv){
...
@@ -46,7 +46,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
if
(
bank
.
performIncreaseTime
(
_wait
)
!=
0
)
if
(
bank
.
performIncreaseTime
(
_wait
)
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/bankTransactionMaker.cpp
View file @
3c4c866f
...
@@ -46,7 +46,13 @@ int main(int argc, const char** argv){
...
@@ -46,7 +46,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
if
(
bank
.
performTransactions
(
_wait
)
!=
0
)
if
(
bank
.
performTransactions
(
_wait
)
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/bankValidateAllGLs.cpp
View file @
3c4c866f
...
@@ -44,7 +44,13 @@ int main(int argc, const char** argv){
...
@@ -44,7 +44,13 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Bank
bank
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Bank
bank
(
con
);
if
(
bank
.
performValidateAllGLs
()
!=
0
)
if
(
bank
.
performValidateAllGLs
()
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/ndbapi/bank/testBank.cpp
View file @
3c4c866f
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#include "Bank.hpp"
#include "Bank.hpp"
int
runCreateBank
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runCreateBank
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
int
overWriteExisting
=
true
;
int
overWriteExisting
=
true
;
if
(
bank
.
createAndLoadBank
(
overWriteExisting
)
!=
NDBT_OK
)
if
(
bank
.
createAndLoadBank
(
overWriteExisting
)
!=
NDBT_OK
)
return
NDBT_FAILED
;
return
NDBT_FAILED
;
...
@@ -40,7 +40,7 @@ int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -40,7 +40,7 @@ int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
}
}
int
runBankTimer
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runBankTimer
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
int
wait
=
30
;
// Max seconds between each "day"
int
wait
=
30
;
// Max seconds between each "day"
int
yield
=
1
;
// Loops before bank returns
int
yield
=
1
;
// Loops before bank returns
...
@@ -51,7 +51,7 @@ int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -51,7 +51,7 @@ int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
}
}
int
runBankTransactions
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runBankTransactions
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
int
wait
=
10
;
// Max ms between each transaction
int
wait
=
10
;
// Max ms between each transaction
int
yield
=
100
;
// Loops before bank returns
int
yield
=
100
;
// Loops before bank returns
...
@@ -62,7 +62,7 @@ int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -62,7 +62,7 @@ int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
}
}
int
runBankGL
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runBankGL
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
int
yield
=
20
;
// Loops before bank returns
int
yield
=
20
;
// Loops before bank returns
int
result
=
NDBT_OK
;
int
result
=
NDBT_OK
;
...
@@ -76,7 +76,7 @@ int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -76,7 +76,7 @@ int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
}
}
int
runBankSum
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runBankSum
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
int
wait
=
2000
;
// Max ms between each sum of accounts
int
wait
=
2000
;
// Max ms between each sum of accounts
int
yield
=
1
;
// Loops before bank returns
int
yield
=
1
;
// Loops before bank returns
int
result
=
NDBT_OK
;
int
result
=
NDBT_OK
;
...
@@ -91,7 +91,7 @@ int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -91,7 +91,7 @@ int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
}
}
int
runDropBank
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runDropBank
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Bank
bank
;
Bank
bank
(
ctx
->
m_cluster_connection
)
;
if
(
bank
.
dropBank
()
!=
NDBT_OK
)
if
(
bank
.
dropBank
()
!=
NDBT_OK
)
return
NDBT_FAILED
;
return
NDBT_FAILED
;
return
NDBT_OK
;
return
NDBT_OK
;
...
...
ndb/test/ndbapi/create_all_tabs.cpp
View file @
3c4c866f
...
@@ -47,7 +47,12 @@ int main(int argc, const char** argv){
...
@@ -47,7 +47,12 @@ int main(int argc, const char** argv){
}
}
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/ndbapi/create_tab.cpp
View file @
3c4c866f
...
@@ -77,8 +77,12 @@ int main(int argc, const char** argv){
...
@@ -77,8 +77,12 @@ int main(int argc, const char** argv){
*/
*/
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
(
_connectstr
);
MyNdb
.
setConnectString
(
_connectstr
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/ndbapi/drop_all_tabs.cpp
View file @
3c4c866f
...
@@ -40,7 +40,13 @@ int main(int argc, const char** argv){
...
@@ -40,7 +40,13 @@ int main(int argc, const char** argv){
}
}
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/ndbapi/flexBench.cpp
View file @
3c4c866f
...
@@ -279,6 +279,8 @@ tellThreads(ThreadData* pt, StartType what)
...
@@ -279,6 +279,8 @@ tellThreads(ThreadData* pt, StartType what)
pt
[
i
].
threadStart
=
what
;
pt
[
i
].
threadStart
=
what
;
}
}
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
NDB_COMMAND
(
flexBench
,
"flexBench"
,
"flexBench"
,
"flexbench"
,
65535
)
NDB_COMMAND
(
flexBench
,
"flexBench"
,
"flexBench"
,
"flexbench"
,
65535
)
{
{
ndb_init
();
ndb_init
();
...
@@ -326,8 +328,16 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
...
@@ -326,8 +328,16 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
NdbThread_SetConcurrencyLevel
(
tNoOfThreads
+
2
);
NdbThread_SetConcurrencyLevel
(
tNoOfThreads
+
2
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
g_cluster_connection
=
&
con
;
Ndb
*
pNdb
;
Ndb
*
pNdb
;
pNdb
=
new
Ndb
(
"TEST_DB"
);
pNdb
=
new
Ndb
(
&
con
,
"TEST_DB"
);
pNdb
->
init
();
pNdb
->
init
();
tNodeId
=
pNdb
->
getNodeId
();
tNodeId
=
pNdb
->
getNodeId
();
...
@@ -605,7 +615,7 @@ static void* flexBenchThread(void* pArg)
...
@@ -605,7 +615,7 @@ static void* flexBenchThread(void* pArg)
attrValue
=
(
int
*
)
malloc
(
nReadBuffSize
)
;
attrValue
=
(
int
*
)
malloc
(
nReadBuffSize
)
;
attrRefValue
=
(
int
*
)
malloc
(
nRefBuffSize
)
;
attrRefValue
=
(
int
*
)
malloc
(
nRefBuffSize
)
;
pOps
=
(
NdbOperation
**
)
malloc
(
tNoOfTables
*
sizeof
(
NdbOperation
*
))
;
pOps
=
(
NdbOperation
**
)
malloc
(
tNoOfTables
*
sizeof
(
NdbOperation
*
))
;
pNdb
=
new
Ndb
(
"TEST_DB"
);
pNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
if
(
!
attrValue
||
!
attrRefValue
||
!
pOps
||
!
pNdb
){
if
(
!
attrValue
||
!
attrRefValue
||
!
pOps
||
!
pNdb
){
// Check allocations to make sure we got all the memory we asked for
// Check allocations to make sure we got all the memory we asked for
...
...
ndb/test/src/NDBT_Test.cpp
View file @
3c4c866f
...
@@ -26,7 +26,9 @@
...
@@ -26,7 +26,9 @@
// No verbose outxput
// No verbose outxput
NDBT_Context
::
NDBT_Context
(){
NDBT_Context
::
NDBT_Context
(
Ndb_cluster_connection
&
con
)
:
m_cluster_connection
(
con
)
{
tab
=
NULL
;
tab
=
NULL
;
suite
=
NULL
;
suite
=
NULL
;
testcase
=
NULL
;
testcase
=
NULL
;
...
@@ -239,7 +241,7 @@ int NDBT_Step::execute(NDBT_Context* ctx) {
...
@@ -239,7 +241,7 @@ int NDBT_Step::execute(NDBT_Context* ctx) {
g_info
<<
" |- "
<<
name
<<
" started ["
<<
ctx
->
suite
->
getDate
()
<<
"]"
g_info
<<
" |- "
<<
name
<<
" started ["
<<
ctx
->
suite
->
getDate
()
<<
"]"
<<
endl
;
<<
endl
;
result
=
setUp
();
result
=
setUp
(
ctx
->
m_cluster_connection
);
if
(
result
!=
NDBT_OK
){
if
(
result
!=
NDBT_OK
){
return
result
;
return
result
;
}
}
...
@@ -279,8 +281,8 @@ NDBT_NdbApiStep::NDBT_NdbApiStep(NDBT_TestCase* ptest,
...
@@ -279,8 +281,8 @@ NDBT_NdbApiStep::NDBT_NdbApiStep(NDBT_TestCase* ptest,
int
int
NDBT_NdbApiStep
::
setUp
(){
NDBT_NdbApiStep
::
setUp
(
Ndb_cluster_connection
&
con
){
ndb
=
new
Ndb
(
"TEST_DB"
);
ndb
=
new
Ndb
(
&
con
,
"TEST_DB"
);
ndb
->
init
(
1024
);
ndb
->
init
(
1024
);
int
result
=
ndb
->
waitUntilReady
(
300
);
// 5 minutes
int
result
=
ndb
->
waitUntilReady
(
300
);
// 5 minutes
...
@@ -745,14 +747,15 @@ int NDBT_TestSuite::addTest(NDBT_TestCase* pTest){
...
@@ -745,14 +747,15 @@ int NDBT_TestSuite::addTest(NDBT_TestCase* pTest){
return
0
;
return
0
;
}
}
int
NDBT_TestSuite
::
executeAll
(
const
char
*
_testname
){
int
NDBT_TestSuite
::
executeAll
(
Ndb_cluster_connection
&
con
,
const
char
*
_testname
){
if
(
tests
.
size
()
==
0
)
if
(
tests
.
size
()
==
0
)
return
NDBT_FAILED
;
return
NDBT_FAILED
;
Ndb
ndb
(
"TEST_DB"
);
Ndb
ndb
(
&
con
,
"TEST_DB"
);
ndb
.
init
(
1024
);
ndb
.
init
(
1024
);
int
result
=
ndb
.
waitUntilReady
(
3
00
);
// 5 minutes
int
result
=
ndb
.
waitUntilReady
(
5
00
);
// 5 minutes
if
(
result
!=
0
){
if
(
result
!=
0
){
g_err
<<
name
<<
": Ndb was not ready"
<<
endl
;
g_err
<<
name
<<
": Ndb was not ready"
<<
endl
;
return
NDBT_FAILED
;
return
NDBT_FAILED
;
...
@@ -765,18 +768,19 @@ int NDBT_TestSuite::executeAll(const char* _testname){
...
@@ -765,18 +768,19 @@ int NDBT_TestSuite::executeAll(const char* _testname){
for
(
int
t
=
0
;
t
<
NDBT_Tables
::
getNumTables
();
t
++
){
for
(
int
t
=
0
;
t
<
NDBT_Tables
::
getNumTables
();
t
++
){
const
NdbDictionary
::
Table
*
ptab
=
NDBT_Tables
::
getTable
(
t
);
const
NdbDictionary
::
Table
*
ptab
=
NDBT_Tables
::
getTable
(
t
);
ndbout
<<
"|- "
<<
ptab
->
getName
()
<<
endl
;
ndbout
<<
"|- "
<<
ptab
->
getName
()
<<
endl
;
execute
(
&
ndb
,
ptab
,
_testname
);
execute
(
con
,
&
ndb
,
ptab
,
_testname
);
}
}
testSuiteTimer
.
doStop
();
testSuiteTimer
.
doStop
();
return
reportAllTables
(
_testname
);
return
reportAllTables
(
_testname
);
}
}
int
int
NDBT_TestSuite
::
executeOne
(
const
char
*
_tabname
,
const
char
*
_testname
){
NDBT_TestSuite
::
executeOne
(
Ndb_cluster_connection
&
con
,
const
char
*
_tabname
,
const
char
*
_testname
){
if
(
tests
.
size
()
==
0
)
if
(
tests
.
size
()
==
0
)
return
NDBT_FAILED
;
return
NDBT_FAILED
;
Ndb
ndb
(
"TEST_DB"
);
Ndb
ndb
(
&
con
,
"TEST_DB"
);
ndb
.
init
(
1024
);
ndb
.
init
(
1024
);
int
result
=
ndb
.
waitUntilReady
(
300
);
// 5 minutes
int
result
=
ndb
.
waitUntilReady
(
300
);
// 5 minutes
...
@@ -793,7 +797,7 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){
...
@@ -793,7 +797,7 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){
ndbout
<<
"|- "
<<
ptab
->
getName
()
<<
endl
;
ndbout
<<
"|- "
<<
ptab
->
getName
()
<<
endl
;
execute
(
&
ndb
,
ptab
,
_testname
);
execute
(
con
,
&
ndb
,
ptab
,
_testname
);
if
(
numTestsFail
>
0
){
if
(
numTestsFail
>
0
){
return
NDBT_FAILED
;
return
NDBT_FAILED
;
...
@@ -802,7 +806,8 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){
...
@@ -802,7 +806,8 @@ NDBT_TestSuite::executeOne(const char* _tabname, const char* _testname){
}
}
}
}
void
NDBT_TestSuite
::
execute
(
Ndb
*
ndb
,
const
NdbDictionary
::
Table
*
pTab
,
void
NDBT_TestSuite
::
execute
(
Ndb_cluster_connection
&
con
,
Ndb
*
ndb
,
const
NdbDictionary
::
Table
*
pTab
,
const
char
*
_testname
){
const
char
*
_testname
){
int
result
;
int
result
;
...
@@ -844,7 +849,7 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab,
...
@@ -844,7 +849,7 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab,
pTab2
=
pTab
;
pTab2
=
pTab
;
}
}
ctx
=
new
NDBT_Context
();
ctx
=
new
NDBT_Context
(
con
);
ctx
->
setTab
(
pTab2
);
ctx
->
setTab
(
pTab2
);
ctx
->
setNumRecords
(
records
);
ctx
->
setNumRecords
(
records
);
ctx
->
setNumLoops
(
loops
);
ctx
->
setNumLoops
(
loops
);
...
@@ -1023,14 +1028,19 @@ int NDBT_TestSuite::execute(int argc, const char** argv){
...
@@ -1023,14 +1028,19 @@ int NDBT_TestSuite::execute(int argc, const char** argv){
loops
=
_loops
;
loops
=
_loops
;
timer
=
_timer
;
timer
=
_timer
;
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
))
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
if
(
optind
==
argc
){
if
(
optind
==
argc
){
// No table specified
// No table specified
res
=
executeAll
(
_testname
);
res
=
executeAll
(
con
,
_testname
);
}
else
{
}
else
{
testSuiteTimer
.
doStart
();
testSuiteTimer
.
doStart
();
Ndb
ndb
(
"TEST_DB"
);
ndb
.
init
();
for
(
int
i
=
optind
;
i
<
argc
;
i
++
){
for
(
int
i
=
optind
;
i
<
argc
;
i
++
){
executeOne
(
argv
[
i
],
_testname
);
executeOne
(
con
,
argv
[
i
],
_testname
);
}
}
testSuiteTimer
.
doStop
();
testSuiteTimer
.
doStop
();
res
=
report
(
_testname
);
res
=
report
(
_testname
);
...
...
ndb/test/tools/copy_tab.cpp
View file @
3c4c866f
...
@@ -56,9 +56,12 @@ int main(int argc, const char** argv){
...
@@ -56,9 +56,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
_to_tabname
=
argv
[
optind
+
1
];
_to_tabname
=
argv
[
optind
+
1
];
if
(
_connectstr
)
Ndb_cluster_connection
con
(
_connectstr
);
Ndb
::
setConnectString
(
_connectstr
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
Ndb
MyNdb
(
_dbname
);
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/tools/create_index.cpp
View file @
3c4c866f
...
@@ -53,8 +53,13 @@ main(int argc, const char** argv){
...
@@ -53,8 +53,13 @@ main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
_dbname
);
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
...
ndb/test/tools/hugoFill.cpp
View file @
3c4c866f
...
@@ -51,7 +51,12 @@ int main(int argc, const char** argv){
...
@@ -51,7 +51,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoLoad.cpp
View file @
3c4c866f
...
@@ -54,7 +54,12 @@ int main(int argc, const char** argv){
...
@@ -54,7 +54,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoLockRecords.cpp
View file @
3c4c866f
...
@@ -59,7 +59,12 @@ int main(int argc, const char** argv){
...
@@ -59,7 +59,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoPkDelete.cpp
View file @
3c4c866f
...
@@ -55,7 +55,12 @@ int main(int argc, const char** argv){
...
@@ -55,7 +55,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoPkRead.cpp
View file @
3c4c866f
...
@@ -60,7 +60,12 @@ int main(int argc, const char** argv){
...
@@ -60,7 +60,12 @@ int main(int argc, const char** argv){
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoPkReadRecord.cpp
View file @
3c4c866f
...
@@ -62,7 +62,12 @@ int main(int argc, const char** argv)
...
@@ -62,7 +62,12 @@ int main(int argc, const char** argv)
<<
"Row: "
<<
_row
<<
", PrimaryKey: "
<<
_primaryKey
<<
"Row: "
<<
_row
<<
", PrimaryKey: "
<<
_primaryKey
<<
endl
;
<<
endl
;
Ndb
*
ndb
=
new
Ndb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
*
ndb
=
new
Ndb
(
&
con
,
"TEST_DB"
);
if
(
ndb
->
init
()
==
0
&&
ndb
->
waitUntilReady
(
30
)
==
0
)
if
(
ndb
->
init
()
==
0
&&
ndb
->
waitUntilReady
(
30
)
==
0
)
{
{
NdbConnection
*
conn
=
ndb
->
startTransaction
();
NdbConnection
*
conn
=
ndb
->
startTransaction
();
...
...
ndb/test/tools/hugoPkUpdate.cpp
View file @
3c4c866f
...
@@ -57,7 +57,12 @@ int main(int argc, const char** argv){
...
@@ -57,7 +57,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanRead.cpp
View file @
3c4c866f
...
@@ -61,7 +61,12 @@ int main(int argc, const char** argv){
...
@@ -61,7 +61,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanUpdate.cpp
View file @
3c4c866f
...
@@ -58,7 +58,12 @@ int main(int argc, const char** argv){
...
@@ -58,7 +58,12 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
_tabname
=
argv
[
optind
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/verify_index.cpp
View file @
3c4c866f
...
@@ -53,7 +53,12 @@ int main(int argc, const char** argv){
...
@@ -53,7 +53,12 @@ int main(int argc, const char** argv){
_indexname
=
argv
[
optind
+
1
];
_indexname
=
argv
[
optind
+
1
];
// Connect to Ndb
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment