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
ebe79c0b
Commit
ebe79c0b
authored
Aug 03, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile fixes for irix
parent
ec9cd4ec
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
171 additions
and
162 deletions
+171
-162
ndb/include/util/Bitmask.hpp
ndb/include/util/Bitmask.hpp
+19
-19
ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
+3
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+1
-0
ndb/test/ndbapi/flexAsynch.cpp
ndb/test/ndbapi/flexAsynch.cpp
+7
-7
ndb/test/ndbapi/flexBench.cpp
ndb/test/ndbapi/flexBench.cpp
+11
-9
ndb/test/ndbapi/flexTT.cpp
ndb/test/ndbapi/flexTT.cpp
+3
-3
ndb/test/ndbapi/testBasic.cpp
ndb/test/ndbapi/testBasic.cpp
+11
-11
ndb/test/ndbapi/testBlobs.cpp
ndb/test/ndbapi/testBlobs.cpp
+8
-6
ndb/test/src/HugoAsynchTransactions.cpp
ndb/test/src/HugoAsynchTransactions.cpp
+17
-15
ndb/test/src/HugoOperations.cpp
ndb/test/src/HugoOperations.cpp
+23
-22
ndb/test/src/HugoTransactions.cpp
ndb/test/src/HugoTransactions.cpp
+50
-50
ndb/test/src/NdbRestarts.cpp
ndb/test/src/NdbRestarts.cpp
+6
-6
ndb/test/src/UtilTransactions.cpp
ndb/test/src/UtilTransactions.cpp
+5
-5
ndb/test/tools/cpcc.cpp
ndb/test/tools/cpcc.cpp
+3
-3
ndb/test/tools/hugoPkReadRecord.cpp
ndb/test/tools/hugoPkReadRecord.cpp
+4
-5
No files found.
ndb/include/util/Bitmask.hpp
View file @
ebe79c0b
...
@@ -488,14 +488,14 @@ template <unsigned size>
...
@@ -488,14 +488,14 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
assign
(
const
typename
BitmaskPOD
<
size
>::
Data
&
src
)
BitmaskPOD
<
size
>::
assign
(
const
typename
BitmaskPOD
<
size
>::
Data
&
src
)
{
{
assign
(
rep
.
data
,
src
.
data
);
BitmaskPOD
<
size
>::
assign
(
rep
.
data
,
src
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
inline
void
inline
void
BitmaskPOD
<
size
>::
assign
(
const
BitmaskPOD
<
size
>
&
src
)
BitmaskPOD
<
size
>::
assign
(
const
BitmaskPOD
<
size
>
&
src
)
{
{
assign
(
rep
.
data
,
src
.
rep
.
data
);
BitmaskPOD
<
size
>::
assign
(
rep
.
data
,
src
.
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -523,7 +523,7 @@ template <unsigned size>
...
@@ -523,7 +523,7 @@ template <unsigned size>
inline
bool
inline
bool
BitmaskPOD
<
size
>::
get
(
unsigned
n
)
const
BitmaskPOD
<
size
>::
get
(
unsigned
n
)
const
{
{
return
get
(
rep
.
data
,
n
);
return
BitmaskPOD
<
size
>::
get
(
rep
.
data
,
n
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -537,7 +537,7 @@ template <unsigned size>
...
@@ -537,7 +537,7 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
set
(
unsigned
n
,
bool
value
)
BitmaskPOD
<
size
>::
set
(
unsigned
n
,
bool
value
)
{
{
set
(
rep
.
data
,
n
,
value
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
,
n
,
value
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -551,7 +551,7 @@ template <unsigned size>
...
@@ -551,7 +551,7 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
set
(
unsigned
n
)
BitmaskPOD
<
size
>::
set
(
unsigned
n
)
{
{
set
(
rep
.
data
,
n
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
,
n
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -565,7 +565,7 @@ template <unsigned size>
...
@@ -565,7 +565,7 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
set
()
BitmaskPOD
<
size
>::
set
()
{
{
set
(
rep
.
data
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -579,7 +579,7 @@ template <unsigned size>
...
@@ -579,7 +579,7 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
clear
(
unsigned
n
)
BitmaskPOD
<
size
>::
clear
(
unsigned
n
)
{
{
clear
(
rep
.
data
,
n
);
BitmaskPOD
<
size
>::
clear
(
rep
.
data
,
n
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -593,7 +593,7 @@ template <unsigned size>
...
@@ -593,7 +593,7 @@ template <unsigned size>
inline
void
inline
void
BitmaskPOD
<
size
>::
clear
()
BitmaskPOD
<
size
>::
clear
()
{
{
clear
(
rep
.
data
);
BitmaskPOD
<
size
>::
clear
(
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -607,7 +607,7 @@ template <unsigned size>
...
@@ -607,7 +607,7 @@ template <unsigned size>
inline
bool
inline
bool
BitmaskPOD
<
size
>::
isclear
()
const
BitmaskPOD
<
size
>::
isclear
()
const
{
{
return
isclear
(
rep
.
data
);
return
BitmaskPOD
<
size
>::
isclear
(
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -621,7 +621,7 @@ template <unsigned size>
...
@@ -621,7 +621,7 @@ template <unsigned size>
inline
unsigned
inline
unsigned
BitmaskPOD
<
size
>::
count
()
const
BitmaskPOD
<
size
>::
count
()
const
{
{
return
count
(
rep
.
data
);
return
BitmaskPOD
<
size
>::
count
(
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -635,7 +635,7 @@ template <unsigned size>
...
@@ -635,7 +635,7 @@ template <unsigned size>
inline
unsigned
inline
unsigned
BitmaskPOD
<
size
>::
find
(
unsigned
n
)
const
BitmaskPOD
<
size
>::
find
(
unsigned
n
)
const
{
{
return
find
(
rep
.
data
,
n
);
return
BitmaskPOD
<
size
>::
find
(
rep
.
data
,
n
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -649,7 +649,7 @@ template <unsigned size>
...
@@ -649,7 +649,7 @@ template <unsigned size>
inline
bool
inline
bool
BitmaskPOD
<
size
>::
equal
(
const
BitmaskPOD
<
size
>&
mask2
)
const
BitmaskPOD
<
size
>::
equal
(
const
BitmaskPOD
<
size
>&
mask2
)
const
{
{
return
equal
(
rep
.
data
,
mask2
.
rep
.
data
);
return
BitmaskPOD
<
size
>::
equal
(
rep
.
data
,
mask2
.
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -663,7 +663,7 @@ template <unsigned size>
...
@@ -663,7 +663,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitOR
(
const
BitmaskPOD
<
size
>&
mask2
)
BitmaskPOD
<
size
>::
bitOR
(
const
BitmaskPOD
<
size
>&
mask2
)
{
{
bitOR
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitOR
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
return
*
this
;
}
}
...
@@ -678,7 +678,7 @@ template <unsigned size>
...
@@ -678,7 +678,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitAND
(
const
BitmaskPOD
<
size
>&
mask2
)
BitmaskPOD
<
size
>::
bitAND
(
const
BitmaskPOD
<
size
>&
mask2
)
{
{
bitAND
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitAND
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
return
*
this
;
}
}
...
@@ -693,7 +693,7 @@ template <unsigned size>
...
@@ -693,7 +693,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitANDC
(
const
BitmaskPOD
<
size
>&
mask2
)
BitmaskPOD
<
size
>::
bitANDC
(
const
BitmaskPOD
<
size
>&
mask2
)
{
{
bitANDC
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitANDC
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
return
*
this
;
}
}
...
@@ -708,7 +708,7 @@ template <unsigned size>
...
@@ -708,7 +708,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitXOR
(
const
BitmaskPOD
<
size
>&
mask2
)
BitmaskPOD
<
size
>::
bitXOR
(
const
BitmaskPOD
<
size
>&
mask2
)
{
{
bitXOR
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitXOR
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
return
*
this
;
}
}
...
@@ -723,7 +723,7 @@ template <unsigned size>
...
@@ -723,7 +723,7 @@ template <unsigned size>
inline
char
*
inline
char
*
BitmaskPOD
<
size
>::
getText
(
char
*
buf
)
const
BitmaskPOD
<
size
>::
getText
(
char
*
buf
)
const
{
{
return
getText
(
rep
.
data
,
buf
);
return
BitmaskPOD
<
size
>::
getText
(
rep
.
data
,
buf
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -737,7 +737,7 @@ template <unsigned size>
...
@@ -737,7 +737,7 @@ template <unsigned size>
inline
bool
inline
bool
BitmaskPOD
<
size
>::
contains
(
BitmaskPOD
<
size
>
that
)
BitmaskPOD
<
size
>::
contains
(
BitmaskPOD
<
size
>
that
)
{
{
return
contains
(
this
->
rep
.
data
,
that
.
rep
.
data
);
return
BitmaskPOD
<
size
>::
contains
(
this
->
rep
.
data
,
that
.
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
@@ -751,7 +751,7 @@ template <unsigned size>
...
@@ -751,7 +751,7 @@ template <unsigned size>
inline
bool
inline
bool
BitmaskPOD
<
size
>::
overlaps
(
BitmaskPOD
<
size
>
that
)
BitmaskPOD
<
size
>::
overlaps
(
BitmaskPOD
<
size
>
that
)
{
{
return
overlaps
(
this
->
rep
.
data
,
that
.
rep
.
data
);
return
BitmaskPOD
<
size
>::
overlaps
(
this
->
rep
.
data
,
that
.
rep
.
data
);
}
}
template
<
unsigned
size
>
template
<
unsigned
size
>
...
...
ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
View file @
ebe79c0b
...
@@ -261,4 +261,6 @@ const unsigned short NO_OF_PRINT_FUNCTIONS = sizeof(SignalDataPrintFunctions)/si
...
@@ -261,4 +261,6 @@ const unsigned short NO_OF_PRINT_FUNCTIONS = sizeof(SignalDataPrintFunctions)/si
template
class
Bitmask
<
1
>;
template
class
Bitmask
<
1
>;
template
class
Bitmask
<
2
>;
template
class
Bitmask
<
2
>;
template
class
Bitmask
<
4
>;
template
class
Bitmask
<
4
>;
template
struct
BitmaskPOD
<
1
>;
template
struct
BitmaskPOD
<
2
>;
template
struct
BitmaskPOD
<
4
>;
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
ebe79c0b
...
@@ -2822,6 +2822,7 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal,
...
@@ -2822,6 +2822,7 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal,
}
}
}
}
template
class
Vector
<
int
>;
template
class
Vector
<
Uint32
>;
template
class
Vector
<
Uint32
>;
template
class
Vector
<
Vector
<
Uint32
>
>
;
template
class
Vector
<
Vector
<
Uint32
>
>
;
template
class
Vector
<
NdbTableImpl
*
>;
template
class
Vector
<
NdbTableImpl
*
>;
...
...
ndb/test/ndbapi/flexAsynch.cpp
View file @
ebe79c0b
...
@@ -146,7 +146,7 @@ tellThreads(StartType what)
...
@@ -146,7 +146,7 @@ tellThreads(StartType what)
NDB_COMMAND
(
flexAsynch
,
"flexAsynch"
,
"flexAsynch"
,
"flexAsynch"
,
65535
)
NDB_COMMAND
(
flexAsynch
,
"flexAsynch"
,
"flexAsynch"
,
"flexAsynch"
,
65535
)
{
{
ThreadNdb
*
pThreadData
;
ThreadNdb
*
pThreadData
;
int
tLoops
=
0
;
int
tLoops
=
0
,
i
;
int
returnValue
=
NDBT_OK
;
int
returnValue
=
NDBT_OK
;
flexAsynchErrorData
=
new
ErrorData
;
flexAsynchErrorData
=
new
ErrorData
;
...
@@ -256,7 +256,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -256,7 +256,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"insert"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
PRINT_TIMER
(
"insert"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
ci
=
1
;
int
ci
=
1
;
while
(
0
<
failed
&&
0
<
i
){
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
ndbout
<<
failed
<<
" of the transactions returned errors!"
...
@@ -293,7 +293,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -293,7 +293,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cr
=
1
;
int
cr
=
1
;
while
(
0
<
failed
&&
0
<
i
){
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
@@ -330,7 +330,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -330,7 +330,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"update"
,
noOfTransacts
,
tNoOfOpsPerTrans
)
;
PRINT_TIMER
(
"update"
,
noOfTransacts
,
tNoOfOpsPerTrans
)
;
if
(
0
<
failed
)
{
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cu
=
1
;
int
cu
=
1
;
while
(
0
<
failed
&&
0
<
i
){
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
@@ -366,7 +366,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -366,7 +366,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cr2
=
1
;
int
cr2
=
1
;
while
(
0
<
failed
&&
0
<
i
){
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
@@ -403,7 +403,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -403,7 +403,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"delete"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
PRINT_TIMER
(
"delete"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cd
=
1
;
int
cd
=
1
;
while
(
0
<
failed
&&
0
<
i
){
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
@@ -438,7 +438,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
...
@@ -438,7 +438,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
execute
(
stStop
);
execute
(
stStop
);
void
*
tmp
;
void
*
tmp
;
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_Destroy
(
&
threadLife
[
i
]);
NdbThread_Destroy
(
&
threadLife
[
i
]);
}
}
...
...
ndb/test/ndbapi/flexBench.cpp
View file @
ebe79c0b
...
@@ -282,7 +282,7 @@ tellThreads(ThreadData* pt, StartType what)
...
@@ -282,7 +282,7 @@ tellThreads(ThreadData* pt, StartType what)
NDB_COMMAND
(
flexBench
,
"flexBench"
,
"flexBench"
,
"flexbench"
,
65535
)
NDB_COMMAND
(
flexBench
,
"flexBench"
,
"flexBench"
,
"flexbench"
,
65535
)
{
{
ThreadData
*
pThreadsData
;
ThreadData
*
pThreadsData
;
int
tLoops
=
0
;
int
tLoops
=
0
,
i
;
int
returnValue
=
NDBT_OK
;
int
returnValue
=
NDBT_OK
;
if
(
readArguments
(
argc
,
argv
)
!=
0
){
if
(
readArguments
(
argc
,
argv
)
!=
0
){
...
@@ -355,7 +355,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
...
@@ -355,7 +355,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
****************************************************************/
****************************************************************/
resetThreads
(
pThreadsData
);
resetThreads
(
pThreadsData
);
for
(
unsigned
int
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
pThreadsData
[
i
].
threadNo
=
i
;
pThreadsData
[
i
].
threadNo
=
i
;
pThreadsData
[
i
].
threadLife
=
NdbThread_Create
(
flexBenchThread
,
pThreadsData
[
i
].
threadLife
=
NdbThread_Create
(
flexBenchThread
,
(
void
**
)
&
pThreadsData
[
i
],
(
void
**
)
&
pThreadsData
[
i
],
...
@@ -531,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
...
@@ -531,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
waitForThreads
(
pThreadsData
);
waitForThreads
(
pThreadsData
);
void
*
tmp
;
void
*
tmp
;
for
(
Uint32
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
pThreadsData
[
i
].
threadLife
,
&
tmp
);
NdbThread_WaitFor
(
pThreadsData
[
i
].
threadLife
,
&
tmp
);
NdbThread_Destroy
(
&
pThreadsData
[
i
].
threadLife
);
NdbThread_Destroy
(
&
pThreadsData
[
i
].
threadLife
);
}
}
...
@@ -540,7 +540,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
...
@@ -540,7 +540,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if
(
useLongKeys
==
true
)
{
if
(
useLongKeys
==
true
)
{
// Only free these areas if they have been allocated
// Only free these areas if they have been allocated
// Otherwise cores will happen
// Otherwise cores will happen
for
(
Uint32
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
for
(
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
free
(
longKeyAttrName
[
i
]);
free
(
longKeyAttrName
[
i
]);
free
(
longKeyAttrName
);
free
(
longKeyAttrName
);
}
// if
}
// if
...
@@ -629,9 +629,10 @@ static void* flexBenchThread(void* pArg)
...
@@ -629,9 +629,10 @@ static void* flexBenchThread(void* pArg)
if
(
useLongKeys
){
if
(
useLongKeys
){
// Allocate and populate the longkey array.
// Allocate and populate the longkey array.
longKeyAttrValue
=
(
unsigned
***
)
malloc
(
sizeof
(
unsigned
**
)
*
tNoOfOperations
);
longKeyAttrValue
=
(
unsigned
***
)
malloc
(
sizeof
(
unsigned
**
)
*
tNoOfOperations
);
for
(
Uint32
n
=
0
;
n
<
tNoOfOperations
;
n
++
)
Uint32
n
;
for
(
n
=
0
;
n
<
tNoOfOperations
;
n
++
)
longKeyAttrValue
[
n
]
=
(
unsigned
**
)
malloc
(
sizeof
(
unsigned
*
)
*
tNoOfLongPK
);
longKeyAttrValue
[
n
]
=
(
unsigned
**
)
malloc
(
sizeof
(
unsigned
*
)
*
tNoOfLongPK
);
for
(
Uint32
n
=
0
;
n
<
tNoOfOperations
;
n
++
){
for
(
n
=
0
;
n
<
tNoOfOperations
;
n
++
){
for
(
Uint32
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
{
longKeyAttrValue
[
n
][
i
]
=
(
unsigned
*
)
malloc
(
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
longKeyAttrValue
[
n
][
i
]
=
(
unsigned
*
)
malloc
(
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
memset
(
longKeyAttrValue
[
n
][
i
],
0
,
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
memset
(
longKeyAttrValue
[
n
][
i
],
0
,
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
...
@@ -1064,13 +1065,14 @@ static void sleepBeforeStartingTest(int seconds){
...
@@ -1064,13 +1065,14 @@ static void sleepBeforeStartingTest(int seconds){
static
int
static
int
createTables
(
Ndb
*
pMyNdb
){
createTables
(
Ndb
*
pMyNdb
){
for
(
Uint32
i
=
0
;
i
<
tNoOfAttributes
;
i
++
){
int
i
;
for
(
i
=
0
;
i
<
tNoOfAttributes
;
i
++
){
snprintf
(
attrName
[
i
],
MAXSTRLEN
,
"COL%d"
,
i
);
snprintf
(
attrName
[
i
],
MAXSTRLEN
,
"COL%d"
,
i
);
}
}
// Note! Uses only uppercase letters in table name's
// Note! Uses only uppercase letters in table name's
// so that we can look at the tables with SQL
// so that we can look at the tables with SQL
for
(
Uint32
i
=
0
;
i
<
tNoOfTables
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfTables
;
i
++
){
if
(
theStdTableNameFlag
==
0
){
if
(
theStdTableNameFlag
==
0
){
snprintf
(
tableName
[
i
],
MAXSTRLEN
,
"TAB%d_%d"
,
i
,
snprintf
(
tableName
[
i
],
MAXSTRLEN
,
"TAB%d_%d"
,
i
,
(
int
)(
NdbTick_CurrentMillisecond
()
/
1000
));
(
int
)(
NdbTick_CurrentMillisecond
()
/
1000
));
...
@@ -1079,7 +1081,7 @@ createTables(Ndb* pMyNdb){
...
@@ -1079,7 +1081,7 @@ createTables(Ndb* pMyNdb){
}
}
}
}
for
(
unsigned
i
=
0
;
i
<
tNoOfTables
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfTables
;
i
++
){
ndbout
<<
"Creating "
<<
tableName
[
i
]
<<
"... "
;
ndbout
<<
"Creating "
<<
tableName
[
i
]
<<
"... "
;
NdbDictionary
::
Table
tmpTable
(
tableName
[
i
]);
NdbDictionary
::
Table
tmpTable
(
tableName
[
i
]);
...
...
ndb/test/ndbapi/flexTT.cpp
View file @
ebe79c0b
...
@@ -173,7 +173,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
...
@@ -173,7 +173,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
{
{
ThreadNdb
*
pThreadData
;
ThreadNdb
*
pThreadData
;
int
returnValue
=
NDBT_OK
;
int
returnValue
=
NDBT_OK
;
int
i
;
flexTTErrorData
=
new
ErrorData
;
flexTTErrorData
=
new
ErrorData
;
flexTTErrorData
->
resetErrorCounters
();
flexTTErrorData
->
resetErrorCounters
();
...
@@ -250,7 +250,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
...
@@ -250,7 +250,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 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
,
(
void
**
)
&
pThreadData
[
i
],
(
void
**
)
&
pThreadData
[
i
],
...
@@ -301,7 +301,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
...
@@ -301,7 +301,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
execute
(
stStop
);
execute
(
stStop
);
void
*
tmp
;
void
*
tmp
;
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_Destroy
(
&
threadLife
[
i
]);
NdbThread_Destroy
(
&
threadLife
[
i
]);
}
}
...
...
ndb/test/ndbapi/testBasic.cpp
View file @
ebe79c0b
...
@@ -264,7 +264,7 @@ static
...
@@ -264,7 +264,7 @@ static
int
int
readOneNoCommit
(
Ndb
*
pNdb
,
NdbConnection
*
pTrans
,
readOneNoCommit
(
Ndb
*
pNdb
,
NdbConnection
*
pTrans
,
const
NdbDictionary
::
Table
*
tab
,
NDBT_ResultRow
*
row
){
const
NdbDictionary
::
Table
*
tab
,
NDBT_ResultRow
*
row
){
int
a
;
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
->
getName
());
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
->
getName
());
if
(
pOp
==
NULL
){
if
(
pOp
==
NULL
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -280,7 +280,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
...
@@ -280,7 +280,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
->
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
->
getNoOfColumns
();
a
++
){
if
(
tab
->
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
->
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tmp
.
equalForAttr
(
pOp
,
a
,
0
)
!=
0
){
if
(
tmp
.
equalForAttr
(
pOp
,
a
,
0
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -290,7 +290,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
...
@@ -290,7 +290,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
->
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
->
getNoOfColumns
();
a
++
){
if
((
row
->
attributeStore
(
a
)
=
if
((
row
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
->
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
->
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -639,35 +639,35 @@ int runNoCommitRollback630(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -639,35 +639,35 @@ int runNoCommitRollback630(NDBT_Context* ctx, NDBT_Step* step){
int
runNoCommitAndClose
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
runNoCommitAndClose
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
int
i
,
result
=
NDBT_OK
;
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
Ndb
*
pNdb
=
GETNDB
(
step
);
do
{
do
{
// Read
// Read
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
for
(
i
nt
i
=
0
;
i
<
10
;
i
++
)
for
(
i
=
0
;
i
<
10
;
i
++
)
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
i
,
true
)
==
0
);
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
i
,
true
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Update
// Update
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
for
(
i
nt
i
=
0
;
i
<
10
;
i
++
)
for
(
i
=
0
;
i
<
10
;
i
++
)
CHECK
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Delete
// Delete
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
for
(
i
nt
i
=
0
;
i
<
10
;
i
++
)
for
(
i
=
0
;
i
<
10
;
i
++
)
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Try to insert, record should already exist
// Try to insert, record should already exist
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
for
(
i
nt
i
=
0
;
i
<
10
;
i
++
)
for
(
i
=
0
;
i
<
10
;
i
++
)
CHECK
(
hugoOps
.
pkInsertRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
pkInsertRecord
(
pNdb
,
i
)
==
0
);
CHECK
(
hugoOps
.
execute_Commit
(
pNdb
)
==
630
);
CHECK
(
hugoOps
.
execute_Commit
(
pNdb
)
==
630
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
...
@@ -781,14 +781,14 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -781,14 +781,14 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
Uint32
updatesValue
=
0
;
Uint32
updatesValue
=
0
;
Uint32
j
;
for
(
Uint32
i
=
0
;
i
<
1
;
i
++
){
for
(
Uint32
i
=
0
;
i
<
1
;
i
++
){
// Read record 5 - 10
// Read record 5 - 10
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
5
,
true
,
10
)
==
0
);
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
5
,
true
,
10
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
for
(
Uint32
j
=
0
;
j
<
10
;
j
++
){
for
(
j
=
0
;
j
<
10
;
j
++
){
// Update record 5 - 10
// Update record 5 - 10
updatesValue
++
;
updatesValue
++
;
CHECK
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
5
,
10
,
updatesValue
)
==
0
);
CHECK
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
5
,
10
,
updatesValue
)
==
0
);
...
@@ -799,7 +799,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -799,7 +799,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
CHECK
(
hugoOps
.
verifyUpdatesValue
(
updatesValue
)
==
0
);
CHECK
(
hugoOps
.
verifyUpdatesValue
(
updatesValue
)
==
0
);
}
}
for
(
Uint32
j
=
0
;
j
<
10
;
j
++
){
for
(
j
=
0
;
j
<
10
;
j
++
){
// Delete record 5 - 10 times
// Delete record 5 - 10 times
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
5
,
10
)
==
0
);
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
5
,
10
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
...
...
ndb/test/ndbapi/testBlobs.cpp
View file @
ebe79c0b
...
@@ -1170,6 +1170,7 @@ deleteScan(bool idx)
...
@@ -1170,6 +1170,7 @@ deleteScan(bool idx)
static
int
static
int
testmain
()
testmain
()
{
{
int
style
;
g_ndb
=
new
Ndb
(
"TEST_DB"
);
g_ndb
=
new
Ndb
(
"TEST_DB"
);
CHK
(
g_ndb
->
init
()
==
0
);
CHK
(
g_ndb
->
init
()
==
0
);
CHK
(
g_ndb
->
waitUntilReady
()
==
0
);
CHK
(
g_ndb
->
waitUntilReady
()
==
0
);
...
@@ -1197,7 +1198,7 @@ testmain()
...
@@ -1197,7 +1198,7 @@ testmain()
if
(
g_opt
.
m_seed
==
0
)
if
(
g_opt
.
m_seed
==
0
)
srandom
(
g_loop
);
srandom
(
g_loop
);
// pk
// pk
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'k'
)
||
skipstyle
(
style
))
if
(
skipcase
(
'k'
)
||
skipstyle
(
style
))
continue
;
continue
;
DBG
(
"--- pk ops "
<<
stylename
[
style
]
<<
" ---"
);
DBG
(
"--- pk ops "
<<
stylename
[
style
]
<<
" ---"
);
...
@@ -1215,7 +1216,7 @@ testmain()
...
@@ -1215,7 +1216,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
CHK
(
verifyBlob
()
==
0
);
}
}
// hash index
// hash index
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'i'
)
||
skipstyle
(
style
))
if
(
skipcase
(
'i'
)
||
skipstyle
(
style
))
continue
;
continue
;
DBG
(
"--- idx ops "
<<
stylename
[
style
]
<<
" ---"
);
DBG
(
"--- idx ops "
<<
stylename
[
style
]
<<
" ---"
);
...
@@ -1233,7 +1234,7 @@ testmain()
...
@@ -1233,7 +1234,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
CHK
(
verifyBlob
()
==
0
);
}
}
// scan table
// scan table
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
's'
)
||
skipstyle
(
style
))
if
(
skipcase
(
's'
)
||
skipstyle
(
style
))
continue
;
continue
;
DBG
(
"--- table scan "
<<
stylename
[
style
]
<<
" ---"
);
DBG
(
"--- table scan "
<<
stylename
[
style
]
<<
" ---"
);
...
@@ -1249,7 +1250,7 @@ testmain()
...
@@ -1249,7 +1250,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
CHK
(
verifyBlob
()
==
0
);
}
}
// scan index
// scan index
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'r'
)
||
skipstyle
(
style
))
if
(
skipcase
(
'r'
)
||
skipstyle
(
style
))
continue
;
continue
;
DBG
(
"--- index scan "
<<
stylename
[
style
]
<<
" ---"
);
DBG
(
"--- index scan "
<<
stylename
[
style
]
<<
" ---"
);
...
@@ -1274,6 +1275,7 @@ testmain()
...
@@ -1274,6 +1275,7 @@ testmain()
static
int
static
int
bugtest_4088
()
bugtest_4088
()
{
{
unsigned
i
;
DBG
(
"bug test 4088 - ndb api hang with mixed ops on index table"
);
DBG
(
"bug test 4088 - ndb api hang with mixed ops on index table"
);
// insert rows
// insert rows
calcTups
(
false
);
calcTups
(
false
);
...
@@ -1285,7 +1287,7 @@ bugtest_4088()
...
@@ -1285,7 +1287,7 @@ bugtest_4088()
// read table pk via index as a table
// read table pk via index as a table
const
unsigned
pkcnt
=
2
;
const
unsigned
pkcnt
=
2
;
Tup
pktup
[
pkcnt
];
Tup
pktup
[
pkcnt
];
for
(
unsigned
i
=
0
;
i
<
pkcnt
;
i
++
)
{
for
(
i
=
0
;
i
<
pkcnt
;
i
++
)
{
char
name
[
20
];
char
name
[
20
];
// XXX guess table id
// XXX guess table id
sprintf
(
name
,
"%d/%s"
,
4
,
g_opt
.
m_x1name
);
sprintf
(
name
,
"%d/%s"
,
4
,
g_opt
.
m_x1name
);
...
@@ -1304,7 +1306,7 @@ bugtest_4088()
...
@@ -1304,7 +1306,7 @@ bugtest_4088()
// BUG 4088: gets 1 tckeyconf, 1 tcindxconf, then hangs
// BUG 4088: gets 1 tckeyconf, 1 tcindxconf, then hangs
CHK
(
g_con
->
execute
(
Commit
)
==
0
);
CHK
(
g_con
->
execute
(
Commit
)
==
0
);
// verify
// verify
for
(
unsigned
i
=
0
;
i
<
pkcnt
;
i
++
)
{
for
(
i
=
0
;
i
<
pkcnt
;
i
++
)
{
CHK
(
pktup
[
i
].
m_pk1
==
tup
.
m_pk1
);
CHK
(
pktup
[
i
].
m_pk1
==
tup
.
m_pk1
);
CHK
(
memcmp
(
pktup
[
i
].
m_pk2
,
tup
.
m_pk2
,
g_opt
.
m_pk2len
)
==
0
);
CHK
(
memcmp
(
pktup
[
i
].
m_pk2
,
tup
.
m_pk2
,
g_opt
.
m_pk2len
)
==
0
);
}
}
...
...
ndb/test/src/HugoAsynchTransactions.cpp
View file @
ebe79c0b
...
@@ -165,12 +165,13 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -165,12 +165,13 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
allocRows
(
trans
*
operations
);
allocRows
(
trans
*
operations
);
allocTransactions
(
trans
);
allocTransactions
(
trans
);
int
a
,
t
,
r
;
for
(
int
i
=
0
;
i
<
batch
;
i
++
)
{
// For each batch
for
(
int
i
=
0
;
i
<
batch
;
i
++
)
{
// For each batch
while
(
cRecords
<
records
*
batch
)
{
while
(
cRecords
<
records
*
batch
)
{
cTrans
=
0
;
cTrans
=
0
;
cReadIndex
=
0
;
cReadIndex
=
0
;
for
(
int
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
for
(
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
transactions
[
t
]
=
pNdb
->
startTransaction
();
transactions
[
t
]
=
pNdb
->
startTransaction
();
if
(
transactions
[
t
]
==
NULL
)
{
if
(
transactions
[
t
]
==
NULL
)
{
ERR
(
pNdb
->
getNdbError
());
ERR
(
pNdb
->
getNdbError
());
...
@@ -187,7 +188,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -187,7 +188,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
// Read
// Read
// Define primary keys
// Define primary keys
check
=
pOp
->
readTupleExclusive
();
check
=
pOp
->
readTupleExclusive
();
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cReadRecords
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
cReadRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -197,7 +198,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -197,7 +198,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
}
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
((
rows
[
cReadIndex
]
->
attributeStore
(
a
)
=
if
((
rows
[
cReadIndex
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -225,7 +226,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -225,7 +226,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
// Verify the data!
// Verify the data!
for
(
int
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
for
(
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
g_info
<<
"|- Verify failed..."
<<
endl
;
g_info
<<
"|- Verify failed..."
<<
endl
;
// Close all transactions
// Close all transactions
...
@@ -239,7 +240,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -239,7 +240,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
// Update
// Update
cTrans
=
0
;
cTrans
=
0
;
cIndex
=
0
;
cIndex
=
0
;
for
(
int
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
for
(
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
for
(
int
k
=
0
;
k
<
operations
;
k
++
)
{
// For each operation
for
(
int
k
=
0
;
k
<
operations
;
k
++
)
{
// For each operation
NdbOperation
*
pOp
=
transactions
[
t
]
->
getNdbOperation
(
tab
.
getName
());
NdbOperation
*
pOp
=
transactions
[
t
]
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
...
@@ -258,7 +259,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -258,7 +259,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
}
// Set search condition for the record
// Set search condition for the record
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -269,7 +270,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -269,7 +270,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
}
// Update the record
// Update the record
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
{
if
(
setValueForAttr
(
pOp
,
a
,
cRecords
,
updates
)
!=
0
)
{
if
(
setValueForAttr
(
pOp
,
a
,
cRecords
,
updates
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -298,7 +299,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
...
@@ -298,7 +299,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
// Close all transactions
// Close all transactions
for
(
int
t
=
0
;
t
<
cTrans
;
t
++
)
{
for
(
t
=
0
;
t
<
cTrans
;
t
++
)
{
pNdb
->
closeTransaction
(
transactions
[
t
]);
pNdb
->
closeTransaction
(
transactions
[
t
]);
}
}
...
@@ -346,6 +347,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -346,6 +347,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
int
cTrans
=
0
;
int
cTrans
=
0
;
int
cRecords
=
0
;
int
cRecords
=
0
;
int
cIndex
=
0
;
int
cIndex
=
0
;
int
a
,
t
,
r
;
transactionsCompleted
=
0
;
transactionsCompleted
=
0
;
allocTransactions
(
trans
);
allocTransactions
(
trans
);
...
@@ -354,7 +356,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -354,7 +356,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
while
(
cRecords
<
records
*
batch
)
{
while
(
cRecords
<
records
*
batch
)
{
cTrans
=
0
;
cTrans
=
0
;
cIndex
=
0
;
cIndex
=
0
;
for
(
int
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
for
(
t
=
0
;
t
<
trans
;
t
++
)
{
// For each transaction
transactions
[
t
]
=
pNdb
->
startTransaction
();
transactions
[
t
]
=
pNdb
->
startTransaction
();
if
(
transactions
[
t
]
==
NULL
)
{
if
(
transactions
[
t
]
==
NULL
)
{
ERR
(
pNdb
->
getNdbError
());
ERR
(
pNdb
->
getNdbError
());
...
@@ -379,7 +381,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -379,7 +381,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
// Set a calculated value for each attribute in this table
// Set a calculated value for each attribute in this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
setValueForAttr
(
pOp
,
a
,
cRecords
,
0
)
!=
0
)
{
if
(
setValueForAttr
(
pOp
,
a
,
cRecords
,
0
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
pNdb
->
closeTransaction
(
transactions
[
t
]);
...
@@ -394,7 +396,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -394,7 +396,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
case
NO_READ
:
case
NO_READ
:
// Define primary keys
// Define primary keys
check
=
pOp
->
readTuple
();
check
=
pOp
->
readTuple
();
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -404,7 +406,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -404,7 +406,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
((
rows
[
cIndex
]
->
attributeStore
(
a
)
=
if
((
rows
[
cIndex
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -423,7 +425,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -423,7 +425,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
if
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
ERR
(
transactions
[
t
]
->
getNdbError
());
...
@@ -462,7 +464,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -462,7 +464,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
switch
(
theOperation
)
{
switch
(
theOperation
)
{
case
NO_READ
:
case
NO_READ
:
// Verify the data!
// Verify the data!
for
(
int
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
for
(
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
g_info
<<
"|- Verify failed..."
<<
endl
;
g_info
<<
"|- Verify failed..."
<<
endl
;
// Close all transactions
// Close all transactions
...
@@ -480,7 +482,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
...
@@ -480,7 +482,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
// Close all transactions
// Close all transactions
for
(
int
t
=
0
;
t
<
cTrans
;
t
++
)
{
for
(
t
=
0
;
t
<
cTrans
;
t
++
)
{
pNdb
->
closeTransaction
(
transactions
[
t
]);
pNdb
->
closeTransaction
(
transactions
[
t
]);
}
}
...
...
ndb/test/src/HugoOperations.cpp
View file @
ebe79c0b
...
@@ -51,7 +51,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
...
@@ -51,7 +51,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
int
recordNo
,
int
recordNo
,
bool
exclusive
,
bool
exclusive
,
int
numRecords
){
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -71,7 +71,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
...
@@ -71,7 +71,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -81,7 +81,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
...
@@ -81,7 +81,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -95,7 +95,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
...
@@ -95,7 +95,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
int
HugoOperations
::
pkDirtyReadRecord
(
Ndb
*
pNdb
,
int
HugoOperations
::
pkDirtyReadRecord
(
Ndb
*
pNdb
,
int
recordNo
,
int
recordNo
,
int
numRecords
){
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -113,7 +113,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
...
@@ -113,7 +113,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -123,7 +123,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
...
@@ -123,7 +123,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -137,7 +137,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
...
@@ -137,7 +137,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
int
HugoOperations
::
pkSimpleReadRecord
(
Ndb
*
pNdb
,
int
HugoOperations
::
pkSimpleReadRecord
(
Ndb
*
pNdb
,
int
recordNo
,
int
recordNo
,
int
numRecords
){
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -155,7 +155,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
...
@@ -155,7 +155,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -165,7 +165,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
...
@@ -165,7 +165,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -180,7 +180,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
...
@@ -180,7 +180,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
int
recordNo
,
int
recordNo
,
int
numRecords
,
int
numRecords
,
int
updatesValue
){
int
updatesValue
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -197,7 +197,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
...
@@ -197,7 +197,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -207,7 +207,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
...
@@ -207,7 +207,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
}
}
// Define attributes to update
// Define attributes to update
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -224,7 +224,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
...
@@ -224,7 +224,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
int
numRecords
,
int
numRecords
,
int
updatesValue
){
int
updatesValue
){
int
check
;
int
a
,
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
...
@@ -239,7 +239,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
...
@@ -239,7 +239,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -249,7 +249,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
...
@@ -249,7 +249,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
}
}
// Define attributes to update
// Define attributes to update
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -265,7 +265,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
...
@@ -265,7 +265,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
int
recordNo
,
int
recordNo
,
int
numRecords
){
int
numRecords
){
int
check
;
int
a
,
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
...
@@ -280,7 +280,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
...
@@ -280,7 +280,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -619,6 +619,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
...
@@ -619,6 +619,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
bool
exclusive
,
bool
exclusive
,
int
numRecords
){
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -638,7 +639,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
...
@@ -638,7 +639,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -648,7 +649,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
...
@@ -648,7 +649,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -665,7 +666,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
...
@@ -665,7 +666,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
int
recordNo
,
int
recordNo
,
int
numRecords
,
int
numRecords
,
int
updatesValue
){
int
updatesValue
){
int
a
;
allocRows
(
numRecords
);
allocRows
(
numRecords
);
int
check
;
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
@@ -682,7 +683,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
...
@@ -682,7 +683,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -692,7 +693,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
...
@@ -692,7 +693,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
}
}
// Define attributes to update
// Define attributes to update
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
if
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
...
ndb/test/src/HugoTransactions.cpp
View file @
ebe79c0b
...
@@ -46,7 +46,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
...
@@ -46,7 +46,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbScanOperation
*
pOp
;
NdbScanOperation
*
pOp
;
...
@@ -96,7 +96,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
...
@@ -96,7 +96,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
row
.
attributeStore
(
a
)
=
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -220,7 +220,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
...
@@ -220,7 +220,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
#else
#else
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -269,7 +269,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
...
@@ -269,7 +269,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
}
}
// Read all attributes from this table
// Read all attributes from this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
@@ -387,7 +387,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
...
@@ -387,7 +387,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
#else
#else
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -436,7 +436,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
...
@@ -436,7 +436,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
}
}
// Read all attributes from this table
// Read all attributes from this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
@@ -553,7 +553,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
...
@@ -553,7 +553,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
int
parallelism
){
int
parallelism
){
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbScanOperation
*
pOp
;
NdbScanOperation
*
pOp
;
...
@@ -592,7 +592,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
...
@@ -592,7 +592,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
}
}
// Read all attributes from this table
// Read all attributes from this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
NULL
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
@@ -634,7 +634,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
...
@@ -634,7 +634,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
}
}
const
int
updates
=
calc
.
getUpdatesValue
(
&
row
)
+
1
;
const
int
updates
=
calc
.
getUpdatesValue
(
&
row
)
+
1
;
const
int
r
=
calc
.
getIdValue
(
&
row
);
const
int
r
=
calc
.
getIdValue
(
&
row
);
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pUp
,
a
,
r
,
updates
)
!=
0
){
if
(
setValueForAttr
(
pUp
,
a
,
r
,
updates
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -695,7 +695,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
...
@@ -695,7 +695,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
bool
allowConstraintViolation
,
bool
allowConstraintViolation
,
int
doSleep
,
int
doSleep
,
bool
oneTrans
){
bool
oneTrans
){
int
check
;
int
check
,
a
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
int
retryMax
=
5
;
int
retryMax
=
5
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
...
@@ -763,7 +763,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
...
@@ -763,7 +763,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
}
}
// Set a calculated value for each attribute in this table
// Set a calculated value for each attribute in this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
setValueForAttr
(
pOp
,
a
,
c
+
b
,
0
)
!=
0
){
if
(
setValueForAttr
(
pOp
,
a
,
c
+
b
,
0
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
@@ -838,7 +838,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
...
@@ -838,7 +838,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
int
int
HugoTransactions
::
fillTable
(
Ndb
*
pNdb
,
HugoTransactions
::
fillTable
(
Ndb
*
pNdb
,
int
batch
){
int
batch
){
int
check
;
int
check
,
a
,
b
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
int
retryMax
=
5
;
int
retryMax
=
5
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
...
@@ -869,7 +869,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
...
@@ -869,7 +869,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
b
<
batch
;
b
++
){
for
(
b
=
0
;
b
<
batch
;
b
++
){
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
...
@@ -886,7 +886,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
...
@@ -886,7 +886,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
}
}
// Set a calculated value for each attribute in this table
// Set a calculated value for each attribute in this table
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
setValueForAttr
(
pOp
,
a
,
c
+
b
,
0
)
!=
0
){
if
(
setValueForAttr
(
pOp
,
a
,
c
+
b
,
0
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
@@ -1025,7 +1025,7 @@ int
...
@@ -1025,7 +1025,7 @@ int
HugoTransactions
::
eventOperation
(
Ndb
*
pNdb
,
void
*
pstats
,
HugoTransactions
::
eventOperation
(
Ndb
*
pNdb
,
void
*
pstats
,
int
records
)
{
int
records
)
{
int
myXXXXX
=
XXXXX
++
;
int
myXXXXX
=
XXXXX
++
;
Uint32
i
;
const
char
function
[]
=
"HugoTransactions::eventOperation: "
;
const
char
function
[]
=
"HugoTransactions::eventOperation: "
;
struct
receivedEvent
*
recInsertEvent
;
struct
receivedEvent
*
recInsertEvent
;
NdbAutoObjArrayPtr
<
struct
receivedEvent
>
NdbAutoObjArrayPtr
<
struct
receivedEvent
>
...
@@ -1042,7 +1042,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
...
@@ -1042,7 +1042,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
stats
.
n_duplicates
=
0
;
stats
.
n_duplicates
=
0
;
stats
.
n_inconsistent_gcis
=
0
;
stats
.
n_inconsistent_gcis
=
0
;
for
(
i
nt
i
=
0
;
i
<
records
;
i
++
)
{
for
(
i
=
0
;
i
<
records
;
i
++
)
{
recInsertEvent
[
i
].
pk
=
0xFFFFFFFF
;
recInsertEvent
[
i
].
pk
=
0xFFFFFFFF
;
recInsertEvent
[
i
].
count
=
0
;
recInsertEvent
[
i
].
count
=
0
;
recInsertEvent
[
i
].
event
=
0xFFFFFFFF
;
recInsertEvent
[
i
].
event
=
0xFFFFFFFF
;
...
@@ -1150,7 +1150,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
...
@@ -1150,7 +1150,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
}
}
g_info
<<
"overrun "
<<
overrun
<<
" pk "
<<
pk
;
g_info
<<
"overrun "
<<
overrun
<<
" pk "
<<
pk
;
for
(
i
nt
i
=
1
;
i
<
noEventColumnName
;
i
++
)
{
for
(
i
=
1
;
i
<
noEventColumnName
;
i
++
)
{
if
(
recAttr
[
i
]
->
isNULL
()
>=
0
)
{
// we have a value
if
(
recAttr
[
i
]
->
isNULL
()
>=
0
)
{
// we have a value
g_info
<<
" post["
<<
i
<<
"]="
;
g_info
<<
" post["
<<
i
<<
"]="
;
if
(
recAttr
[
i
]
->
isNULL
()
==
0
)
// we have a non-null value
if
(
recAttr
[
i
]
->
isNULL
()
==
0
)
// we have a non-null value
...
@@ -1193,7 +1193,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
...
@@ -1193,7 +1193,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
if
(
stats
.
n_updates
>
0
)
{
if
(
stats
.
n_updates
>
0
)
{
stats
.
n_consecutive
++
;
stats
.
n_consecutive
++
;
}
}
for
(
Uint32
i
=
0
;
i
<
(
Uint32
)
records
/
3
;
i
++
)
{
for
(
i
=
0
;
i
<
(
Uint32
)
records
/
3
;
i
++
)
{
if
(
recInsertEvent
[
i
].
pk
!=
i
)
{
if
(
recInsertEvent
[
i
].
pk
!=
i
)
{
stats
.
n_consecutive
++
;
stats
.
n_consecutive
++
;
ndbout
<<
"missing insert pk "
<<
i
<<
endl
;
ndbout
<<
"missing insert pk "
<<
i
<<
endl
;
...
@@ -1232,7 +1232,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
...
@@ -1232,7 +1232,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -1284,7 +1284,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
...
@@ -1284,7 +1284,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1295,7 +1295,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
...
@@ -1295,7 +1295,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1358,7 +1358,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1358,7 +1358,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
,
b
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -1390,7 +1390,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1390,7 +1390,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
b
<
batch
&&
(
r
+
b
)
<
records
;
b
++
){
for
(
b
=
0
;
b
<
batch
&&
(
r
+
b
)
<
records
;
b
++
){
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1406,7 +1406,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1406,7 +1406,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1417,7 +1417,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1417,7 +1417,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1443,7 +1443,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1443,7 +1443,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
b
<
batch
&&
(
b
+
r
)
<
records
;
b
++
){
for
(
b
=
0
;
b
<
batch
&&
(
b
+
r
)
<
records
;
b
++
){
if
(
calc
.
verifyRowValues
(
rows
[
b
])
!=
0
){
if
(
calc
.
verifyRowValues
(
rows
[
b
])
!=
0
){
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
return
NDBT_FAILED
;
return
NDBT_FAILED
;
...
@@ -1466,7 +1466,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1466,7 +1466,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1476,7 +1476,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
...
@@ -1476,7 +1476,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
}
}
}
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
+
b
,
updates
)
!=
0
){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
+
b
,
updates
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1526,7 +1526,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1526,7 +1526,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
while
(
r
<
records
){
while
(
r
<
records
){
...
@@ -1566,7 +1566,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1566,7 +1566,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1577,7 +1577,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1577,7 +1577,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
}
// Read update value
// Read update value
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
calc
.
isUpdateCol
(
a
)
==
true
){
if
(
calc
.
isUpdateCol
(
a
)
==
true
){
if
((
row
.
attributeStore
(
a
)
=
if
((
row
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
...
@@ -1622,7 +1622,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1622,7 +1622,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
}
// PKs
// PKs
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
)
!=
0
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1633,7 +1633,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1633,7 +1633,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
}
// Update col
// Update col
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
&&
if
((
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
&&
(
calc
.
isUpdateCol
(
a
)
==
true
)){
(
calc
.
isUpdateCol
(
a
)
==
true
)){
...
@@ -1650,7 +1650,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
...
@@ -1650,7 +1650,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
}
// Remaining attributes
// Remaining attributes
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
&&
if
((
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
)
&&
(
calc
.
isUpdateCol
(
a
)
==
false
)){
(
calc
.
isUpdateCol
(
a
)
==
false
)){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
,
updates
)
!=
0
){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
,
updates
)
!=
0
){
...
@@ -1705,7 +1705,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
...
@@ -1705,7 +1705,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -1750,7 +1750,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
...
@@ -1750,7 +1750,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1820,7 +1820,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
...
@@ -1820,7 +1820,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
,
b
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -1857,7 +1857,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
...
@@ -1857,7 +1857,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
(
b
<
lockBatch
)
&&
(
r
+
b
<
records
);
b
++
){
for
(
b
=
0
;
(
b
<
lockBatch
)
&&
(
r
+
b
<
records
);
b
++
){
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1873,7 +1873,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
...
@@ -1873,7 +1873,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1884,7 +1884,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
...
@@ -1884,7 +1884,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1967,7 +1967,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
...
@@ -1967,7 +1967,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
NdbIndexScanOperation
*
sOp
;
NdbIndexScanOperation
*
sOp
;
...
@@ -2039,7 +2039,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
...
@@ -2039,7 +2039,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -2050,7 +2050,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
...
@@ -2050,7 +2050,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -2118,7 +2118,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2118,7 +2118,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
int
r
=
0
;
int
r
=
0
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
,
b
;
NdbConnection
*
pTrans
;
NdbConnection
*
pTrans
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
NdbScanOperation
*
sOp
;
NdbScanOperation
*
sOp
;
...
@@ -2155,7 +2155,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2155,7 +2155,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
b
<
batchsize
&&
(
b
+
r
)
<
records
;
b
++
){
for
(
b
=
0
;
b
<
batchsize
&&
(
b
+
r
)
<
records
;
b
++
){
if
(
!
ordered
){
if
(
!
ordered
){
pOp
=
pTrans
->
getNdbIndexOperation
(
idxName
,
tab
.
getName
());
pOp
=
pTrans
->
getNdbIndexOperation
(
idxName
,
tab
.
getName
());
if
(
pOp
==
NULL
)
{
if
(
pOp
==
NULL
)
{
...
@@ -2183,7 +2183,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2183,7 +2183,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
}
// Define primary keys
// Define primary keys
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -2194,7 +2194,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2194,7 +2194,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
}
// Define attributes to read
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
if
((
rows
[
b
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -2225,7 +2225,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2225,7 +2225,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
for
(
int
b
=
0
;
b
<
batchsize
&&
(
b
+
r
)
<
records
;
b
++
){
for
(
b
=
0
;
b
<
batchsize
&&
(
b
+
r
)
<
records
;
b
++
){
if
(
calc
.
verifyRowValues
(
rows
[
b
])
!=
0
){
if
(
calc
.
verifyRowValues
(
rows
[
b
])
!=
0
){
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
return
NDBT_FAILED
;
return
NDBT_FAILED
;
...
@@ -2254,7 +2254,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2254,7 +2254,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
}
if
(
!
ordered
){
if
(
!
ordered
){
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
+
b
)
!=
0
){
if
(
equalForAttr
(
pUpdOp
,
a
,
r
+
b
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -2265,7 +2265,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
...
@@ -2265,7 +2265,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
}
}
}
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
tab
.
getColumn
(
a
)
->
getPrimaryKey
()
==
false
){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
+
b
,
updates
)
!=
0
){
if
(
setValueForAttr
(
pUpdOp
,
a
,
r
+
b
,
updates
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
...
ndb/test/src/NdbRestarts.cpp
View file @
ebe79c0b
...
@@ -625,9 +625,9 @@ int restartNFDuringNR(NdbRestarter& _restarter,
...
@@ -625,9 +625,9 @@ int restartNFDuringNR(NdbRestarter& _restarter,
const
NdbRestarts
::
NdbRestart
*
_restart
){
const
NdbRestarts
::
NdbRestart
*
_restart
){
myRandom48Init
(
NdbTick_CurrentMillisecond
());
myRandom48Init
(
NdbTick_CurrentMillisecond
());
int
i
;
const
int
sz
=
sizeof
(
NFDuringNR_codes
)
/
sizeof
(
NFDuringNR_codes
[
0
]);
const
int
sz
=
sizeof
(
NFDuringNR_codes
)
/
sizeof
(
NFDuringNR_codes
[
0
]);
for
(
i
nt
i
=
0
;
i
<
sz
;
i
++
){
for
(
i
=
0
;
i
<
sz
;
i
++
){
int
randomId
=
myRandom48
(
_restarter
.
getNumDbNodes
());
int
randomId
=
myRandom48
(
_restarter
.
getNumDbNodes
());
int
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
int
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
int
error
=
NFDuringNR_codes
[
i
];
int
error
=
NFDuringNR_codes
[
i
];
...
@@ -673,7 +673,7 @@ int restartNFDuringNR(NdbRestarter& _restarter,
...
@@ -673,7 +673,7 @@ int restartNFDuringNR(NdbRestarter& _restarter,
if
(
NdbEnv_GetEnv
(
"USER"
,
buf
,
256
)
==
0
||
strcmp
(
buf
,
"ejonore"
)
!=
0
)
if
(
NdbEnv_GetEnv
(
"USER"
,
buf
,
256
)
==
0
||
strcmp
(
buf
,
"ejonore"
)
!=
0
)
return
NDBT_OK
;
return
NDBT_OK
;
for
(
i
nt
i
=
0
;
i
<
sz
;
i
++
){
for
(
i
=
0
;
i
<
sz
;
i
++
){
const
int
randomId
=
myRandom48
(
_restarter
.
getNumDbNodes
());
const
int
randomId
=
myRandom48
(
_restarter
.
getNumDbNodes
());
int
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
int
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
const
int
error
=
NFDuringNR_codes
[
i
];
const
int
error
=
NFDuringNR_codes
[
i
];
...
@@ -753,14 +753,14 @@ NRDuringLCP_NonMaster_codes[] = {
...
@@ -753,14 +753,14 @@ NRDuringLCP_NonMaster_codes[] = {
int
restartNodeDuringLCP
(
NdbRestarter
&
_restarter
,
int
restartNodeDuringLCP
(
NdbRestarter
&
_restarter
,
const
NdbRestarts
::
NdbRestart
*
_restart
)
{
const
NdbRestarts
::
NdbRestart
*
_restart
)
{
int
i
;
// Master
// Master
int
val
=
DumpStateOrd
::
DihMinTimeBetweenLCP
;
int
val
=
DumpStateOrd
::
DihMinTimeBetweenLCP
;
CHECK
(
_restarter
.
dumpStateAllNodes
(
&
val
,
1
)
==
0
,
CHECK
(
_restarter
.
dumpStateAllNodes
(
&
val
,
1
)
==
0
,
"Failed to set LCP to min value"
);
// Set LCP to min val
"Failed to set LCP to min value"
);
// Set LCP to min val
int
sz
=
sizeof
(
NRDuringLCP_Master_codes
)
/
int
sz
=
sizeof
(
NRDuringLCP_Master_codes
)
/
sizeof
(
NRDuringLCP_Master_codes
[
0
]);
sizeof
(
NRDuringLCP_Master_codes
[
0
]);
for
(
i
nt
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
i
=
0
;
i
<
sz
;
i
++
)
{
int
error
=
NRDuringLCP_Master_codes
[
i
];
int
error
=
NRDuringLCP_Master_codes
[
i
];
int
masterNodeId
=
_restarter
.
getMasterNodeId
();
int
masterNodeId
=
_restarter
.
getMasterNodeId
();
...
@@ -798,7 +798,7 @@ int restartNodeDuringLCP(NdbRestarter& _restarter,
...
@@ -798,7 +798,7 @@ int restartNodeDuringLCP(NdbRestarter& _restarter,
// NON-Master
// NON-Master
sz
=
sizeof
(
NRDuringLCP_NonMaster_codes
)
/
sz
=
sizeof
(
NRDuringLCP_NonMaster_codes
)
/
sizeof
(
NRDuringLCP_NonMaster_codes
[
0
]);
sizeof
(
NRDuringLCP_NonMaster_codes
[
0
]);
for
(
i
nt
i
=
0
;
i
<
sz
;
i
++
)
{
for
(
i
=
0
;
i
<
sz
;
i
++
)
{
int
error
=
NRDuringLCP_NonMaster_codes
[
i
];
int
error
=
NRDuringLCP_NonMaster_codes
[
i
];
int
nodeId
=
getRandomNodeId
(
_restarter
);
int
nodeId
=
getRandomNodeId
(
_restarter
);
...
...
ndb/test/src/UtilTransactions.cpp
View file @
ebe79c0b
...
@@ -1040,7 +1040,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1040,7 +1040,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
NdbDictionary
::
Index
::
Type
indexType
=
pIndex
->
getType
();
NdbDictionary
::
Index
::
Type
indexType
=
pIndex
->
getType
();
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans1
=
NULL
;
NdbConnection
*
pTrans1
=
NULL
;
NdbResultSet
*
cursor
=
NULL
;
NdbResultSet
*
cursor
=
NULL
;
NdbOperation
*
pOp
;
NdbOperation
*
pOp
;
...
@@ -1100,7 +1100,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1100,7 +1100,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
#if VERBOSE
printf
(
"PK: "
);
printf
(
"PK: "
);
#endif
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
const
NdbDictionary
::
Column
*
attr
=
tab
.
getColumn
(
a
);
const
NdbDictionary
::
Column
*
attr
=
tab
.
getColumn
(
a
);
if
(
attr
->
getPrimaryKey
()
==
true
){
if
(
attr
->
getPrimaryKey
()
==
true
){
if
(
pOp
->
equal
(
attr
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
())
!=
0
){
if
(
pOp
->
equal
(
attr
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
())
!=
0
){
...
@@ -1119,7 +1119,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1119,7 +1119,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
#if VERBOSE
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
#endif
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
tabRow
.
attributeStore
(
a
)
=
if
((
tabRow
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans1
->
getNdbError
());
ERR
(
pTrans1
->
getNdbError
());
...
@@ -1170,7 +1170,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1170,7 +1170,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
#if VERBOSE
printf
(
"SI: "
);
printf
(
"SI: "
);
#endif
#endif
for
(
int
a
=
0
;
a
<
(
int
)
pIndex
->
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
(
int
)
pIndex
->
getNoOfColumns
();
a
++
){
const
NdbDictionary
::
Column
*
col
=
pIndex
->
getColumn
(
a
);
const
NdbDictionary
::
Column
*
col
=
pIndex
->
getColumn
(
a
);
int
r
;
int
r
;
...
@@ -1200,7 +1200,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1200,7 +1200,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
#if VERBOSE
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
#endif
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
void
*
pCheck
;
void
*
pCheck
;
if
(
pIndexOp
)
if
(
pIndexOp
)
...
...
ndb/test/tools/cpcc.cpp
View file @
ebe79c0b
...
@@ -192,7 +192,7 @@ main(int argc, const char** argv){
...
@@ -192,7 +192,7 @@ main(int argc, const char** argv){
,{
"rm"
,
0
,
arg_flag
,
&
rm
,
"-c rm"
,
"undefine process(es)"
}
,{
"rm"
,
0
,
arg_flag
,
&
rm
,
"-c rm"
,
"undefine process(es)"
}
};
};
const
int
num_args
=
10
;
const
int
num_args
=
10
;
int
i
;
int
optind
=
0
;
int
optind
=
0
;
char
desc
[]
=
"[host:[port]]
\n
"
;
char
desc
[]
=
"[host:[port]]
\n
"
;
...
@@ -215,13 +215,13 @@ main(int argc, const char** argv){
...
@@ -215,13 +215,13 @@ main(int argc, const char** argv){
Expression
*
m_expr
=
0
;
Expression
*
m_expr
=
0
;
for
(
i
nt
i
=
optind
;
i
<
argc
;
i
++
){
for
(
i
=
optind
;
i
<
argc
;
i
++
){
add_host
(
g_hosts
,
argv
[
i
]);
add_host
(
g_hosts
,
argv
[
i
]);
}
}
OrExpr
*
orE
=
new
OrExpr
(
new
Operate
(
cmd
,
g_settings
),
true
);
OrExpr
*
orE
=
new
OrExpr
(
new
Operate
(
cmd
,
g_settings
),
true
);
m_expr
=
orE
;
m_expr
=
orE
;
for
(
i
nt
i
=
optind
;
i
<
argc
;
i
++
){
for
(
i
=
optind
;
i
<
argc
;
i
++
){
BaseString
tmp
(
argv
[
i
]);
BaseString
tmp
(
argv
[
i
]);
Vector
<
BaseString
>
split
;
Vector
<
BaseString
>
split
;
tmp
.
split
(
split
,
":"
);
tmp
.
split
(
split
,
":"
);
...
...
ndb/test/tools/hugoPkReadRecord.cpp
View file @
ebe79c0b
...
@@ -43,7 +43,7 @@ int main(int argc, const char** argv)
...
@@ -43,7 +43,7 @@ int main(int argc, const char** argv)
};
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
int
optind
=
0
,
i
;
if
(
getarg
(
args
,
num_args
,
argc
,
argv
,
&
optind
)
||
argv
[
optind
]
==
NULL
)
{
if
(
getarg
(
args
,
num_args
,
argc
,
argv
,
&
optind
)
||
argv
[
optind
]
==
NULL
)
{
arg_printusage
(
args
,
num_args
,
argv
[
0
],
"table name
\n
"
);
arg_printusage
(
args
,
num_args
,
argv
[
0
],
"table name
\n
"
);
...
@@ -80,7 +80,7 @@ int main(int argc, const char** argv)
...
@@ -80,7 +80,7 @@ int main(int argc, const char** argv)
}
}
op
->
readTuple
();
op
->
readTuple
();
NdbRecAttr
**
data
=
new
NdbRecAttr
*
[
table
->
getNoOfColumns
()];
NdbRecAttr
**
data
=
new
NdbRecAttr
*
[
table
->
getNoOfColumns
()];
for
(
i
nt
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
for
(
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
{
{
const
NdbDictionary
::
Column
*
c
=
table
->
getColumn
(
i
);
const
NdbDictionary
::
Column
*
c
=
table
->
getColumn
(
i
);
if
(
c
->
getPrimaryKey
())
if
(
c
->
getPrimaryKey
())
...
@@ -93,11 +93,10 @@ int main(int argc, const char** argv)
...
@@ -93,11 +93,10 @@ int main(int argc, const char** argv)
data
[
i
]
=
op
->
getValue
(
c
->
getName
(),
NULL
);
data
[
i
]
=
op
->
getValue
(
c
->
getName
(),
NULL
);
}
}
}
}
if
(
conn
->
execute
(
Commit
)
==
0
)
if
(
conn
->
execute
(
Commit
)
==
0
)
{
{
// Print column names
// Print column names
for
(
i
nt
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
for
(
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
{
{
const
NdbDictionary
::
Column
*
c
=
table
->
getColumn
(
i
);
const
NdbDictionary
::
Column
*
c
=
table
->
getColumn
(
i
);
...
@@ -111,7 +110,7 @@ int main(int argc, const char** argv)
...
@@ -111,7 +110,7 @@ int main(int argc, const char** argv)
{
{
g_info
<<
hex
;
g_info
<<
hex
;
}
}
for
(
i
nt
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
for
(
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
{
{
NdbRecAttr
*
a
=
data
[
i
];
NdbRecAttr
*
a
=
data
[
i
];
switch
(
a
->
getType
())
switch
(
a
->
getType
())
...
...
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