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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0de1b0f2
Commit
0de1b0f2
authored
Jan 01, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - more removal of old constructor usage in test prgs
parent
a7c2a9e0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
12 deletions
+62
-12
ndb/test/ndbapi/flexAsynch.cpp
ndb/test/ndbapi/flexAsynch.cpp
+12
-3
ndb/test/ndbapi/flexHammer.cpp
ndb/test/ndbapi/flexHammer.cpp
+10
-2
ndb/test/ndbapi/flexTT.cpp
ndb/test/ndbapi/flexTT.cpp
+11
-2
ndb/test/ndbapi/slow_select.cpp
ndb/test/ndbapi/slow_select.cpp
+8
-1
ndb/test/ndbapi/testDeadlock.cpp
ndb/test/ndbapi/testDeadlock.cpp
+11
-3
ndb/test/ndbapi/testLcp.cpp
ndb/test/ndbapi/testLcp.cpp
+10
-1
No files found.
ndb/test/ndbapi/flexAsynch.cpp
View file @
0de1b0f2
...
@@ -143,6 +143,8 @@ tellThreads(StartType what)
...
@@ -143,6 +143,8 @@ tellThreads(StartType what)
ThreadStart
[
i
]
=
what
;
ThreadStart
[
i
]
=
what
;
}
}
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
NDB_COMMAND
(
flexAsynch
,
"flexAsynch"
,
"flexAsynch"
,
"flexAsynch"
,
65535
)
NDB_COMMAND
(
flexAsynch
,
"flexAsynch"
,
"flexAsynch"
,
"flexAsynch"
,
65535
)
{
{
ndb_init
();
ndb_init
();
...
@@ -200,7 +202,14 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -200,7 +202,14 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
setAttrNames
();
setAttrNames
();
setTableNames
();
setTableNames
();
Ndb
*
pNdb
=
new
Ndb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
g_cluster_connection
=
&
con
;
Ndb
*
pNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
pNdb
->
init
();
pNdb
->
init
();
tNodeId
=
pNdb
->
getNodeId
();
tNodeId
=
pNdb
->
getNodeId
();
...
@@ -225,7 +234,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -225,7 +234,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
* Create NDB objects. *
* Create NDB objects. *
****************************************************************/
****************************************************************/
resetThreads
();
resetThreads
();
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
)
{
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
)
{
pThreadData
[
i
].
ThreadNo
=
i
pThreadData
[
i
].
ThreadNo
=
i
;
;
threadLife
[
i
]
=
NdbThread_Create
(
threadLoop
,
threadLife
[
i
]
=
NdbThread_Create
(
threadLoop
,
...
@@ -468,7 +477,7 @@ threadLoop(void* ThreadData)
...
@@ -468,7 +477,7 @@ threadLoop(void* ThreadData)
StartType
tType
;
StartType
tType
;
ThreadNdb
*
tabThread
=
(
ThreadNdb
*
)
ThreadData
;
ThreadNdb
*
tabThread
=
(
ThreadNdb
*
)
ThreadData
;
int
threadNo
=
tabThread
->
ThreadNo
;
int
threadNo
=
tabThread
->
ThreadNo
;
localNdb
=
new
Ndb
(
"TEST_DB"
);
localNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
localNdb
->
init
(
1024
);
localNdb
->
init
(
1024
);
localNdb
->
waitUntilReady
(
10000
);
localNdb
->
waitUntilReady
(
10000
);
unsigned
int
threadBase
=
(
threadNo
<<
16
)
+
tNodeId
;
unsigned
int
threadBase
=
(
threadNo
<<
16
)
+
tNodeId
;
...
...
ndb/test/ndbapi/flexHammer.cpp
View file @
0de1b0f2
...
@@ -175,6 +175,8 @@ tellThreads(ThreadNdb* threadArrayP, const StartType what)
...
@@ -175,6 +175,8 @@ tellThreads(ThreadNdb* threadArrayP, const StartType what)
}
// for
}
// for
}
// tellThreads
}
// tellThreads
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
NDB_COMMAND
(
flexHammer
,
"flexHammer"
,
"flexHammer"
,
"flexHammer"
,
65535
)
NDB_COMMAND
(
flexHammer
,
"flexHammer"
,
"flexHammer"
,
"flexHammer"
,
65535
)
//main(int argc, const char** argv)
//main(int argc, const char** argv)
{
{
...
@@ -213,7 +215,13 @@ NDB_COMMAND(flexHammer, "flexHammer", "flexHammer", "flexHammer", 65535)
...
@@ -213,7 +215,13 @@ NDB_COMMAND(flexHammer, "flexHammer", "flexHammer", "flexHammer", 65535)
// NdbThread_SetConcurrencyLevel(tNoOfThreads + 2);
// NdbThread_SetConcurrencyLevel(tNoOfThreads + 2);
// Create and init Ndb object
// Create and init Ndb object
pMyNdb
=
new
Ndb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
g_cluster_connection
=
&
con
;
pMyNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
pMyNdb
->
init
();
pMyNdb
->
init
();
// Wait for Ndb to become ready
// Wait for Ndb to become ready
...
@@ -345,7 +353,7 @@ flexHammerThread(void* pArg)
...
@@ -345,7 +353,7 @@ flexHammerThread(void* pArg)
for
(
i
=
0
;
i
<
MAXATTRSIZE
;
i
++
)
for
(
i
=
0
;
i
<
MAXATTRSIZE
;
i
++
)
attrValue
[
i
]
=
0
;
attrValue
[
i
]
=
0
;
// Ndb object for each thread
// Ndb object for each thread
pMyNdb
=
new
Ndb
(
"TEST_DB"
);
pMyNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
pMyNdb
->
init
();
pMyNdb
->
init
();
if
(
pMyNdb
->
waitUntilReady
(
10000
)
!=
0
)
{
if
(
pMyNdb
->
waitUntilReady
(
10000
)
!=
0
)
{
// Error, NDB is not ready
// Error, NDB is not ready
...
...
ndb/test/ndbapi/flexTT.cpp
View file @
0de1b0f2
...
@@ -169,6 +169,8 @@ tellThreads(StartType what)
...
@@ -169,6 +169,8 @@ tellThreads(StartType what)
ThreadStart
[
i
]
=
what
;
ThreadStart
[
i
]
=
what
;
}
}
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
NDB_COMMAND
(
flexTT
,
"flexTT"
,
"flexTT"
,
"flexTT"
,
65535
)
NDB_COMMAND
(
flexTT
,
"flexTT"
,
"flexTT"
,
"flexTT"
,
65535
)
{
{
ndb_init
();
ndb_init
();
...
@@ -226,7 +228,14 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
...
@@ -226,7 +228,14 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
setAttrNames
();
setAttrNames
();
setTableNames
();
setTableNames
();
Ndb
*
pNdb
=
new
Ndb
(
"TEST_DB"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
g_cluster_connection
=
&
con
;
Ndb
*
pNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
pNdb
->
init
();
pNdb
->
init
();
tNodeId
=
pNdb
->
getNodeId
();
tNodeId
=
pNdb
->
getNodeId
();
...
@@ -334,7 +343,7 @@ threadLoop(void* ThreadData)
...
@@ -334,7 +343,7 @@ threadLoop(void* ThreadData)
void
*
mem
=
malloc
(
sizeof
(
TransNdb
)
*
tNoOfParallelTrans
);
void
*
mem
=
malloc
(
sizeof
(
TransNdb
)
*
tNoOfParallelTrans
);
TransNdb
*
pTransData
=
(
TransNdb
*
)
mem
;
TransNdb
*
pTransData
=
(
TransNdb
*
)
mem
;
localNdb
=
new
Ndb
(
"TEST_DB"
);
localNdb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
localNdb
->
init
(
1024
);
localNdb
->
init
(
1024
);
localNdb
->
waitUntilReady
();
localNdb
->
waitUntilReady
();
...
...
ndb/test/ndbapi/slow_select.cpp
View file @
0de1b0f2
...
@@ -36,7 +36,14 @@ static void lookup();
...
@@ -36,7 +36,14 @@ static void lookup();
int
int
main
(
void
){
main
(
void
){
ndb_init
();
ndb_init
();
Ndb
g_ndb
(
"test"
);
Ndb_cluster_connection
con
;
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
return
1
;
}
Ndb
g_ndb
(
&
con
,
"test"
);
g_ndb
.
init
(
1024
);
g_ndb
.
init
(
1024
);
require
(
g_ndb
.
waitUntilReady
()
==
0
);
require
(
g_ndb
.
waitUntilReady
()
==
0
);
...
...
ndb/test/ndbapi/testDeadlock.cpp
View file @
0de1b0f2
...
@@ -49,7 +49,7 @@ printusage()
...
@@ -49,7 +49,7 @@ printusage()
static
Opt
g_opt
;
static
Opt
g_opt
;
static
NdbMutex
*
ndbout_mutex
=
NULL
;
static
NdbMutex
*
ndbout_mutex
=
NULL
;
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
#define DBG(x) \
#define DBG(x) \
do { \
do { \
if (! g_opt.m_dbg) break; \
if (! g_opt.m_dbg) break; \
...
@@ -217,7 +217,7 @@ Thr::exit()
...
@@ -217,7 +217,7 @@ Thr::exit()
static
int
static
int
runstep_connect
(
Thr
&
thr
)
runstep_connect
(
Thr
&
thr
)
{
{
Ndb
*
ndb
=
thr
.
m_ndb
=
new
Ndb
(
"TEST_DB"
);
Ndb
*
ndb
=
thr
.
m_ndb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
CHN
(
ndb
,
ndb
->
init
()
==
0
);
CHN
(
ndb
,
ndb
->
init
()
==
0
);
CHN
(
ndb
,
ndb
->
waitUntilReady
()
==
0
);
CHN
(
ndb
,
ndb
->
waitUntilReady
()
==
0
);
DBG
(
thr
<<
" connected"
);
DBG
(
thr
<<
" connected"
);
...
@@ -503,6 +503,14 @@ NDB_COMMAND(testOdbcDriver, "testDeadlock", "testDeadlock", "testDeadlock", 6553
...
@@ -503,6 +503,14 @@ NDB_COMMAND(testOdbcDriver, "testDeadlock", "testDeadlock", "testDeadlock", 6553
printusage
();
printusage
();
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
);
}
g_cluster_connection
=
&
con
;
if
(
if
(
strchr
(
g_opt
.
m_scan
,
't'
)
!=
0
&&
wl1822_main
(
't'
)
==
-
1
||
strchr
(
g_opt
.
m_scan
,
't'
)
!=
0
&&
wl1822_main
(
't'
)
==
-
1
||
strchr
(
g_opt
.
m_scan
,
'x'
)
!=
0
&&
wl1822_main
(
'x'
)
==
-
1
strchr
(
g_opt
.
m_scan
,
'x'
)
!=
0
&&
wl1822_main
(
'x'
)
==
-
1
...
...
ndb/test/ndbapi/testLcp.cpp
View file @
0de1b0f2
...
@@ -30,6 +30,7 @@ static CASE g_ops[] =
...
@@ -30,6 +30,7 @@ static CASE g_ops[] =
const
size_t
OP_COUNT
=
(
sizeof
(
g_ops
)
/
sizeof
(
g_ops
[
0
]));
const
size_t
OP_COUNT
=
(
sizeof
(
g_ops
)
/
sizeof
(
g_ops
[
0
]));
static
Ndb
*
g_ndb
=
0
;
static
Ndb
*
g_ndb
=
0
;
static
Ndb_cluster_connection
*
g_cluster_connection
=
0
;
static
CASE
*
g_cases
;
static
CASE
*
g_cases
;
static
HugoOperations
*
g_hugo_ops
;
static
HugoOperations
*
g_hugo_ops
;
...
@@ -133,7 +134,13 @@ static int parse_args(int argc, char** argv)
...
@@ -133,7 +134,13 @@ static int parse_args(int argc, char** argv)
static
int
connect_ndb
()
static
int
connect_ndb
()
{
{
g_ndb
=
new
Ndb
(
"TEST_DB"
);
g_cluster_connection
=
new
Ndb_cluster_connection
();
if
(
g_cluster_connection
->
connect
(
12
,
5
,
1
)
!=
0
)
{
return
1
;
}
g_ndb
=
new
Ndb
(
g_cluster_connection
,
"TEST_DB"
);
g_ndb
->
init
();
g_ndb
->
init
();
if
(
g_ndb
->
waitUntilReady
(
30
)
==
0
){
if
(
g_ndb
->
waitUntilReady
(
30
)
==
0
){
int
args
[]
=
{
DumpStateOrd
::
DihMaxTimeBetweenLCP
};
int
args
[]
=
{
DumpStateOrd
::
DihMaxTimeBetweenLCP
};
...
@@ -145,8 +152,10 @@ static int connect_ndb()
...
@@ -145,8 +152,10 @@ static int connect_ndb()
static
int
disconnect_ndb
()
static
int
disconnect_ndb
()
{
{
delete
g_ndb
;
delete
g_ndb
;
delete
g_cluster_connection
;
g_ndb
=
0
;
g_ndb
=
0
;
g_table
=
0
;
g_table
=
0
;
g_cluster_connection
=
0
;
return
0
;
return
0
;
}
}
...
...
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