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
7786fce2
Commit
7786fce2
authored
Aug 03, 2004
by
mysqldev@o2k.irixworld.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile fixes for irix
parent
954542b0
Changes
15
Expand all
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 @
7786fce2
...
...
@@ -488,14 +488,14 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
assign
(
const
typename
BitmaskPOD
<
size
>::
Data
&
src
)
{
assign
(
rep
.
data
,
src
.
data
);
BitmaskPOD
<
size
>::
assign
(
rep
.
data
,
src
.
data
);
}
template
<
unsigned
size
>
inline
void
BitmaskPOD
<
size
>::
assign
(
const
BitmaskPOD
<
size
>
&
src
)
{
assign
(
rep
.
data
,
src
.
rep
.
data
);
BitmaskPOD
<
size
>::
assign
(
rep
.
data
,
src
.
rep
.
data
);
}
template
<
unsigned
size
>
...
...
@@ -523,7 +523,7 @@ template <unsigned size>
inline
bool
BitmaskPOD
<
size
>::
get
(
unsigned
n
)
const
{
return
get
(
rep
.
data
,
n
);
return
BitmaskPOD
<
size
>::
get
(
rep
.
data
,
n
);
}
template
<
unsigned
size
>
...
...
@@ -537,7 +537,7 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
set
(
unsigned
n
,
bool
value
)
{
set
(
rep
.
data
,
n
,
value
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
,
n
,
value
);
}
template
<
unsigned
size
>
...
...
@@ -551,7 +551,7 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
set
(
unsigned
n
)
{
set
(
rep
.
data
,
n
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
,
n
);
}
template
<
unsigned
size
>
...
...
@@ -565,7 +565,7 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
set
()
{
set
(
rep
.
data
);
BitmaskPOD
<
size
>::
set
(
rep
.
data
);
}
template
<
unsigned
size
>
...
...
@@ -579,7 +579,7 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
clear
(
unsigned
n
)
{
clear
(
rep
.
data
,
n
);
BitmaskPOD
<
size
>::
clear
(
rep
.
data
,
n
);
}
template
<
unsigned
size
>
...
...
@@ -593,7 +593,7 @@ template <unsigned size>
inline
void
BitmaskPOD
<
size
>::
clear
()
{
clear
(
rep
.
data
);
BitmaskPOD
<
size
>::
clear
(
rep
.
data
);
}
template
<
unsigned
size
>
...
...
@@ -607,7 +607,7 @@ template <unsigned size>
inline
bool
BitmaskPOD
<
size
>::
isclear
()
const
{
return
isclear
(
rep
.
data
);
return
BitmaskPOD
<
size
>::
isclear
(
rep
.
data
);
}
template
<
unsigned
size
>
...
...
@@ -621,7 +621,7 @@ template <unsigned size>
inline
unsigned
BitmaskPOD
<
size
>::
count
()
const
{
return
count
(
rep
.
data
);
return
BitmaskPOD
<
size
>::
count
(
rep
.
data
);
}
template
<
unsigned
size
>
...
...
@@ -635,7 +635,7 @@ template <unsigned size>
inline
unsigned
BitmaskPOD
<
size
>::
find
(
unsigned
n
)
const
{
return
find
(
rep
.
data
,
n
);
return
BitmaskPOD
<
size
>::
find
(
rep
.
data
,
n
);
}
template
<
unsigned
size
>
...
...
@@ -649,7 +649,7 @@ template <unsigned size>
inline
bool
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
>
...
...
@@ -663,7 +663,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitOR
(
const
BitmaskPOD
<
size
>&
mask2
)
{
bitOR
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitOR
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
}
...
...
@@ -678,7 +678,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitAND
(
const
BitmaskPOD
<
size
>&
mask2
)
{
bitAND
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitAND
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
}
...
...
@@ -693,7 +693,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitANDC
(
const
BitmaskPOD
<
size
>&
mask2
)
{
bitANDC
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitANDC
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
}
...
...
@@ -708,7 +708,7 @@ template <unsigned size>
inline
BitmaskPOD
<
size
>&
BitmaskPOD
<
size
>::
bitXOR
(
const
BitmaskPOD
<
size
>&
mask2
)
{
bitXOR
(
rep
.
data
,
mask2
.
rep
.
data
);
BitmaskPOD
<
size
>::
bitXOR
(
rep
.
data
,
mask2
.
rep
.
data
);
return
*
this
;
}
...
...
@@ -723,7 +723,7 @@ template <unsigned size>
inline
char
*
BitmaskPOD
<
size
>::
getText
(
char
*
buf
)
const
{
return
getText
(
rep
.
data
,
buf
);
return
BitmaskPOD
<
size
>::
getText
(
rep
.
data
,
buf
);
}
template
<
unsigned
size
>
...
...
@@ -737,7 +737,7 @@ template <unsigned size>
inline
bool
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
>
...
...
@@ -751,7 +751,7 @@ template <unsigned size>
inline
bool
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
>
...
...
ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
View file @
7786fce2
...
...
@@ -261,4 +261,6 @@ const unsigned short NO_OF_PRINT_FUNCTIONS = sizeof(SignalDataPrintFunctions)/si
template
class
Bitmask
<
1
>;
template
class
Bitmask
<
2
>;
template
class
Bitmask
<
4
>;
template
struct
BitmaskPOD
<
1
>;
template
struct
BitmaskPOD
<
2
>;
template
struct
BitmaskPOD
<
4
>;
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
7786fce2
...
...
@@ -2822,6 +2822,7 @@ NdbDictInterface::execLIST_TABLES_CONF(NdbApiSignal* signal,
}
}
template
class
Vector
<
int
>;
template
class
Vector
<
Uint32
>;
template
class
Vector
<
Vector
<
Uint32
>
>
;
template
class
Vector
<
NdbTableImpl
*
>;
...
...
ndb/test/ndbapi/flexAsynch.cpp
View file @
7786fce2
...
...
@@ -146,7 +146,7 @@ tellThreads(StartType what)
NDB_COMMAND
(
flexAsynch
,
"flexAsynch"
,
"flexAsynch"
,
"flexAsynch"
,
65535
)
{
ThreadNdb
*
pThreadData
;
int
tLoops
=
0
;
int
tLoops
=
0
,
i
;
int
returnValue
=
NDBT_OK
;
flexAsynchErrorData
=
new
ErrorData
;
...
...
@@ -256,7 +256,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"insert"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
ci
=
1
;
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
...
...
@@ -293,7 +293,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cr
=
1
;
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
...
@@ -330,7 +330,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"update"
,
noOfTransacts
,
tNoOfOpsPerTrans
)
;
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cu
=
1
;
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
...
@@ -366,7 +366,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"read"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cr2
=
1
;
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
...
@@ -403,7 +403,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
PRINT_TIMER
(
"delete"
,
noOfTransacts
,
tNoOfOpsPerTrans
);
if
(
0
<
failed
)
{
i
nt
i
=
retry_opt
;
i
=
retry_opt
;
int
cd
=
1
;
while
(
0
<
failed
&&
0
<
i
){
ndbout
<<
failed
<<
" of the transactions returned errors!"
<<
endl
;
...
...
@@ -438,7 +438,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
execute
(
stStop
);
void
*
tmp
;
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_Destroy
(
&
threadLife
[
i
]);
}
...
...
ndb/test/ndbapi/flexBench.cpp
View file @
7786fce2
...
...
@@ -282,7 +282,7 @@ tellThreads(ThreadData* pt, StartType what)
NDB_COMMAND
(
flexBench
,
"flexBench"
,
"flexBench"
,
"flexbench"
,
65535
)
{
ThreadData
*
pThreadsData
;
int
tLoops
=
0
;
int
tLoops
=
0
,
i
;
int
returnValue
=
NDBT_OK
;
if
(
readArguments
(
argc
,
argv
)
!=
0
){
...
...
@@ -355,7 +355,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
****************************************************************/
resetThreads
(
pThreadsData
);
for
(
unsigned
int
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
pThreadsData
[
i
].
threadNo
=
i
;
pThreadsData
[
i
].
threadLife
=
NdbThread_Create
(
flexBenchThread
,
(
void
**
)
&
pThreadsData
[
i
],
...
...
@@ -531,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
waitForThreads
(
pThreadsData
);
void
*
tmp
;
for
(
Uint32
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
pThreadsData
[
i
].
threadLife
,
&
tmp
);
NdbThread_Destroy
(
&
pThreadsData
[
i
].
threadLife
);
}
...
...
@@ -540,7 +540,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if
(
useLongKeys
==
true
)
{
// Only free these areas if they have been allocated
// Otherwise cores will happen
for
(
Uint32
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
for
(
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
free
(
longKeyAttrName
[
i
]);
free
(
longKeyAttrName
);
}
// if
...
...
@@ -629,9 +629,10 @@ static void* flexBenchThread(void* pArg)
if
(
useLongKeys
){
// Allocate and populate the longkey array.
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
);
for
(
Uint32
n
=
0
;
n
<
tNoOfOperations
;
n
++
){
for
(
n
=
0
;
n
<
tNoOfOperations
;
n
++
){
for
(
Uint32
i
=
0
;
i
<
tNoOfLongPK
;
i
++
)
{
longKeyAttrValue
[
n
][
i
]
=
(
unsigned
*
)
malloc
(
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
memset
(
longKeyAttrValue
[
n
][
i
],
0
,
sizeof
(
unsigned
)
*
tSizeOfLongPK
);
...
...
@@ -1064,13 +1065,14 @@ static void sleepBeforeStartingTest(int seconds){
static
int
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
);
}
// Note! Uses only uppercase letters in table name's
// 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
){
snprintf
(
tableName
[
i
],
MAXSTRLEN
,
"TAB%d_%d"
,
i
,
(
int
)(
NdbTick_CurrentMillisecond
()
/
1000
));
...
...
@@ -1079,7 +1081,7 @@ createTables(Ndb* pMyNdb){
}
}
for
(
unsigned
i
=
0
;
i
<
tNoOfTables
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfTables
;
i
++
){
ndbout
<<
"Creating "
<<
tableName
[
i
]
<<
"... "
;
NdbDictionary
::
Table
tmpTable
(
tableName
[
i
]);
...
...
ndb/test/ndbapi/flexTT.cpp
View file @
7786fce2
...
...
@@ -173,7 +173,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
{
ThreadNdb
*
pThreadData
;
int
returnValue
=
NDBT_OK
;
int
i
;
flexTTErrorData
=
new
ErrorData
;
flexTTErrorData
->
resetErrorCounters
();
...
...
@@ -250,7 +250,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
* Create NDB objects. *
****************************************************************/
resetThreads
();
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
)
{
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
)
{
pThreadData
[
i
].
threadNo
=
i
;
threadLife
[
i
]
=
NdbThread_Create
(
threadLoop
,
(
void
**
)
&
pThreadData
[
i
],
...
...
@@ -301,7 +301,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
execute
(
stStop
);
void
*
tmp
;
for
(
i
nt
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
for
(
i
=
0
;
i
<
tNoOfThreads
;
i
++
){
NdbThread_WaitFor
(
threadLife
[
i
],
&
tmp
);
NdbThread_Destroy
(
&
threadLife
[
i
]);
}
...
...
ndb/test/ndbapi/testBasic.cpp
View file @
7786fce2
...
...
@@ -264,7 +264,7 @@ static
int
readOneNoCommit
(
Ndb
*
pNdb
,
NdbConnection
*
pTrans
,
const
NdbDictionary
::
Table
*
tab
,
NDBT_ResultRow
*
row
){
int
a
;
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
->
getName
());
if
(
pOp
==
NULL
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -280,7 +280,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
}
// 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
(
tmp
.
equalForAttr
(
pOp
,
a
,
0
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -290,7 +290,7 @@ readOneNoCommit(Ndb* pNdb, NdbConnection* pTrans,
}
// Define attributes to read
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
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -639,35 +639,35 @@ int runNoCommitRollback630(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
());
Ndb
*
pNdb
=
GETNDB
(
step
);
do
{
// Read
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
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Update
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
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Delete
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
.
execute_NoCommit
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
// Try to insert, record should already exist
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
.
execute_Commit
(
pNdb
)
==
630
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
...
...
@@ -781,14 +781,14 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
Uint32
updatesValue
=
0
;
Uint32
j
;
for
(
Uint32
i
=
0
;
i
<
1
;
i
++
){
// Read record 5 - 10
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
5
,
true
,
10
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
for
(
Uint32
j
=
0
;
j
<
10
;
j
++
){
for
(
j
=
0
;
j
<
10
;
j
++
){
// Update record 5 - 10
updatesValue
++
;
CHECK
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
5
,
10
,
updatesValue
)
==
0
);
...
...
@@ -799,7 +799,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
CHECK
(
hugoOps
.
verifyUpdatesValue
(
updatesValue
)
==
0
);
}
for
(
Uint32
j
=
0
;
j
<
10
;
j
++
){
for
(
j
=
0
;
j
<
10
;
j
++
){
// Delete record 5 - 10 times
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
5
,
10
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
...
...
ndb/test/ndbapi/testBlobs.cpp
View file @
7786fce2
...
...
@@ -1170,6 +1170,7 @@ deleteScan(bool idx)
static
int
testmain
()
{
int
style
;
g_ndb
=
new
Ndb
(
"TEST_DB"
);
CHK
(
g_ndb
->
init
()
==
0
);
CHK
(
g_ndb
->
waitUntilReady
()
==
0
);
...
...
@@ -1197,7 +1198,7 @@ testmain()
if
(
g_opt
.
m_seed
==
0
)
srandom
(
g_loop
);
// pk
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'k'
)
||
skipstyle
(
style
))
continue
;
DBG
(
"--- pk ops "
<<
stylename
[
style
]
<<
" ---"
);
...
...
@@ -1215,7 +1216,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
}
// hash index
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'i'
)
||
skipstyle
(
style
))
continue
;
DBG
(
"--- idx ops "
<<
stylename
[
style
]
<<
" ---"
);
...
...
@@ -1233,7 +1234,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
}
// scan table
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
's'
)
||
skipstyle
(
style
))
continue
;
DBG
(
"--- table scan "
<<
stylename
[
style
]
<<
" ---"
);
...
...
@@ -1249,7 +1250,7 @@ testmain()
CHK
(
verifyBlob
()
==
0
);
}
// scan index
for
(
int
style
=
0
;
style
<=
2
;
style
++
)
{
for
(
style
=
0
;
style
<=
2
;
style
++
)
{
if
(
skipcase
(
'r'
)
||
skipstyle
(
style
))
continue
;
DBG
(
"--- index scan "
<<
stylename
[
style
]
<<
" ---"
);
...
...
@@ -1274,6 +1275,7 @@ testmain()
static
int
bugtest_4088
()
{
unsigned
i
;
DBG
(
"bug test 4088 - ndb api hang with mixed ops on index table"
);
// insert rows
calcTups
(
false
);
...
...
@@ -1285,7 +1287,7 @@ bugtest_4088()
// read table pk via index as a table
const
unsigned
pkcnt
=
2
;
Tup
pktup
[
pkcnt
];
for
(
unsigned
i
=
0
;
i
<
pkcnt
;
i
++
)
{
for
(
i
=
0
;
i
<
pkcnt
;
i
++
)
{
char
name
[
20
];
// XXX guess table id
sprintf
(
name
,
"%d/%s"
,
4
,
g_opt
.
m_x1name
);
...
...
@@ -1304,7 +1306,7 @@ bugtest_4088()
// BUG 4088: gets 1 tckeyconf, 1 tcindxconf, then hangs
CHK
(
g_con
->
execute
(
Commit
)
==
0
);
// verify
for
(
unsigned
i
=
0
;
i
<
pkcnt
;
i
++
)
{
for
(
i
=
0
;
i
<
pkcnt
;
i
++
)
{
CHK
(
pktup
[
i
].
m_pk1
==
tup
.
m_pk1
);
CHK
(
memcmp
(
pktup
[
i
].
m_pk2
,
tup
.
m_pk2
,
g_opt
.
m_pk2len
)
==
0
);
}
...
...
ndb/test/src/HugoAsynchTransactions.cpp
View file @
7786fce2
...
...
@@ -165,12 +165,13 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
allocRows
(
trans
*
operations
);
allocTransactions
(
trans
);
int
a
,
t
,
r
;
for
(
int
i
=
0
;
i
<
batch
;
i
++
)
{
// For each batch
while
(
cRecords
<
records
*
batch
)
{
cTrans
=
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
();
if
(
transactions
[
t
]
==
NULL
)
{
ERR
(
pNdb
->
getNdbError
());
...
...
@@ -187,7 +188,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
// Read
// Define primary keys
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
(
equalForAttr
(
pOp
,
a
,
cReadRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -197,7 +198,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
((
rows
[
cReadIndex
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -225,7 +226,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
// Verify the data!
for
(
int
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
for
(
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
g_info
<<
"|- Verify failed..."
<<
endl
;
// Close all transactions
...
...
@@ -239,7 +240,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
// Update
cTrans
=
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
NdbOperation
*
pOp
=
transactions
[
t
]
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
...
...
@@ -258,7 +259,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -269,7 +270,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
}
// 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
(
setValueForAttr
(
pOp
,
a
,
cRecords
,
updates
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -298,7 +299,7 @@ HugoAsynchTransactions::pkUpdateRecordsAsynch(Ndb* pNdb,
pNdb
->
sendPollNdb
(
3000
,
0
,
0
);
// Close all transactions
for
(
int
t
=
0
;
t
<
cTrans
;
t
++
)
{
for
(
t
=
0
;
t
<
cTrans
;
t
++
)
{
pNdb
->
closeTransaction
(
transactions
[
t
]);
}
...
...
@@ -346,6 +347,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
int
cTrans
=
0
;
int
cRecords
=
0
;
int
cIndex
=
0
;
int
a
,
t
,
r
;
transactionsCompleted
=
0
;
allocTransactions
(
trans
);
...
...
@@ -354,7 +356,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
while
(
cRecords
<
records
*
batch
)
{
cTrans
=
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
();
if
(
transactions
[
t
]
==
NULL
)
{
ERR
(
pNdb
->
getNdbError
());
...
...
@@ -379,7 +381,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
// 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
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
pNdb
->
closeTransaction
(
transactions
[
t
]);
...
...
@@ -394,7 +396,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
case
NO_READ
:
// Define primary keys
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
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
){
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -404,7 +406,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
)
{
if
((
rows
[
cIndex
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -423,7 +425,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
cRecords
)
!=
0
)
{
ERR
(
transactions
[
t
]
->
getNdbError
());
...
...
@@ -462,7 +464,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
switch
(
theOperation
)
{
case
NO_READ
:
// Verify the data!
for
(
int
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
for
(
r
=
0
;
r
<
trans
*
operations
;
r
++
)
{
if
(
calc
.
verifyRowValues
(
rows
[
r
])
!=
0
)
{
g_info
<<
"|- Verify failed..."
<<
endl
;
// Close all transactions
...
...
@@ -480,7 +482,7 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb,
}
// Close all transactions
for
(
int
t
=
0
;
t
<
cTrans
;
t
++
)
{
for
(
t
=
0
;
t
<
cTrans
;
t
++
)
{
pNdb
->
closeTransaction
(
transactions
[
t
]);
}
...
...
ndb/test/src/HugoOperations.cpp
View file @
7786fce2
...
...
@@ -51,7 +51,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
int
recordNo
,
bool
exclusive
,
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -71,7 +71,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -81,7 +81,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -95,7 +95,7 @@ int HugoOperations::pkReadRecord(Ndb* pNdb,
int
HugoOperations
::
pkDirtyReadRecord
(
Ndb
*
pNdb
,
int
recordNo
,
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -113,7 +113,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -123,7 +123,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -137,7 +137,7 @@ int HugoOperations::pkDirtyReadRecord(Ndb* pNdb,
int
HugoOperations
::
pkSimpleReadRecord
(
Ndb
*
pNdb
,
int
recordNo
,
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -155,7 +155,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -165,7 +165,7 @@ int HugoOperations::pkSimpleReadRecord(Ndb* pNdb,
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -180,7 +180,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
int
recordNo
,
int
numRecords
,
int
updatesValue
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -197,7 +197,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -207,7 +207,7 @@ int HugoOperations::pkUpdateRecord(Ndb* pNdb,
}
// 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
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -224,7 +224,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
int
numRecords
,
int
updatesValue
){
int
check
;
int
a
,
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
...
...
@@ -239,7 +239,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -249,7 +249,7 @@ int HugoOperations::pkInsertRecord(Ndb* pNdb,
}
// 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
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -265,7 +265,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
int
recordNo
,
int
numRecords
){
int
check
;
int
a
,
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
NdbOperation
*
pOp
=
pTrans
->
getNdbOperation
(
tab
.
getName
());
if
(
pOp
==
NULL
)
{
...
...
@@ -280,7 +280,7 @@ int HugoOperations::pkDeleteRecord(Ndb* pNdb,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -619,6 +619,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
bool
exclusive
,
int
numRecords
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -638,7 +639,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -648,7 +649,7 @@ int HugoOperations::indexReadRecords(Ndb*, const char * idxName, int recordNo,
}
// Define attributes to read
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
rows
[
r
]
->
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -665,7 +666,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
int
recordNo
,
int
numRecords
,
int
updatesValue
){
int
a
;
allocRows
(
numRecords
);
int
check
;
for
(
int
r
=
0
;
r
<
numRecords
;
r
++
){
...
...
@@ -682,7 +683,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
}
// 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
(
equalForAttr
(
pOp
,
a
,
r
+
recordNo
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
@@ -692,7 +693,7 @@ HugoOperations::indexUpdateRecord(Ndb*,
}
// 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
(
setValueForAttr
(
pOp
,
a
,
recordNo
+
r
,
updatesValue
)
!=
0
){
ERR
(
pTrans
->
getNdbError
());
...
...
ndb/test/src/HugoTransactions.cpp
View file @
7786fce2
This diff is collapsed.
Click to expand it.
ndb/test/src/NdbRestarts.cpp
View file @
7786fce2
...
...
@@ -625,9 +625,9 @@ int restartNFDuringNR(NdbRestarter& _restarter,
const
NdbRestarts
::
NdbRestart
*
_restart
){
myRandom48Init
(
NdbTick_CurrentMillisecond
());
int
i
;
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
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
int
error
=
NFDuringNR_codes
[
i
];
...
...
@@ -673,7 +673,7 @@ int restartNFDuringNR(NdbRestarter& _restarter,
if
(
NdbEnv_GetEnv
(
"USER"
,
buf
,
256
)
==
0
||
strcmp
(
buf
,
"ejonore"
)
!=
0
)
return
NDBT_OK
;
for
(
i
nt
i
=
0
;
i
<
sz
;
i
++
){
for
(
i
=
0
;
i
<
sz
;
i
++
){
const
int
randomId
=
myRandom48
(
_restarter
.
getNumDbNodes
());
int
nodeId
=
_restarter
.
getDbNodeId
(
randomId
);
const
int
error
=
NFDuringNR_codes
[
i
];
...
...
@@ -753,14 +753,14 @@ NRDuringLCP_NonMaster_codes[] = {
int
restartNodeDuringLCP
(
NdbRestarter
&
_restarter
,
const
NdbRestarts
::
NdbRestart
*
_restart
)
{
int
i
;
// Master
int
val
=
DumpStateOrd
::
DihMinTimeBetweenLCP
;
CHECK
(
_restarter
.
dumpStateAllNodes
(
&
val
,
1
)
==
0
,
"Failed to set LCP to min value"
);
// Set LCP to min val
int
sz
=
sizeof
(
NRDuringLCP_Master_codes
)
/
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
masterNodeId
=
_restarter
.
getMasterNodeId
();
...
...
@@ -798,7 +798,7 @@ int restartNodeDuringLCP(NdbRestarter& _restarter,
// NON-Master
sz
=
sizeof
(
NRDuringLCP_NonMaster_codes
)
/
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
nodeId
=
getRandomNodeId
(
_restarter
);
...
...
ndb/test/src/UtilTransactions.cpp
View file @
7786fce2
...
...
@@ -1040,7 +1040,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
NdbDictionary
::
Index
::
Type
indexType
=
pIndex
->
getType
();
int
retryAttempt
=
0
;
const
int
retryMax
=
100
;
int
check
;
int
check
,
a
;
NdbConnection
*
pTrans1
=
NULL
;
NdbResultSet
*
cursor
=
NULL
;
NdbOperation
*
pOp
;
...
...
@@ -1100,7 +1100,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
printf
(
"PK: "
);
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
const
NdbDictionary
::
Column
*
attr
=
tab
.
getColumn
(
a
);
if
(
attr
->
getPrimaryKey
()
==
true
){
if
(
pOp
->
equal
(
attr
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
())
!=
0
){
...
...
@@ -1119,7 +1119,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
if
((
tabRow
.
attributeStore
(
a
)
=
pOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pTrans1
->
getNdbError
());
...
...
@@ -1170,7 +1170,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
printf
(
"SI: "
);
#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
);
int
r
;
...
...
@@ -1200,7 +1200,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
#endif
for
(
int
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
void
*
pCheck
;
if
(
pIndexOp
)
...
...
ndb/test/tools/cpcc.cpp
View file @
7786fce2
...
...
@@ -192,7 +192,7 @@ main(int argc, const char** argv){
,{
"rm"
,
0
,
arg_flag
,
&
rm
,
"-c rm"
,
"undefine process(es)"
}
};
const
int
num_args
=
10
;
int
i
;
int
optind
=
0
;
char
desc
[]
=
"[host:[port]]
\n
"
;
...
...
@@ -215,13 +215,13 @@ main(int argc, const char** argv){
Expression
*
m_expr
=
0
;
for
(
i
nt
i
=
optind
;
i
<
argc
;
i
++
){
for
(
i
=
optind
;
i
<
argc
;
i
++
){
add_host
(
g_hosts
,
argv
[
i
]);
}
OrExpr
*
orE
=
new
OrExpr
(
new
Operate
(
cmd
,
g_settings
),
true
);
m_expr
=
orE
;
for
(
i
nt
i
=
optind
;
i
<
argc
;
i
++
){
for
(
i
=
optind
;
i
<
argc
;
i
++
){
BaseString
tmp
(
argv
[
i
]);
Vector
<
BaseString
>
split
;
tmp
.
split
(
split
,
":"
);
...
...
ndb/test/tools/hugoPkReadRecord.cpp
View file @
7786fce2
...
...
@@ -43,7 +43,7 @@ int main(int argc, const char** argv)
};
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
)
{
arg_printusage
(
args
,
num_args
,
argv
[
0
],
"table name
\n
"
);
...
...
@@ -80,7 +80,7 @@ int main(int argc, const char** argv)
}
op
->
readTuple
();
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
);
if
(
c
->
getPrimaryKey
())
...
...
@@ -93,11 +93,10 @@ int main(int argc, const char** argv)
data
[
i
]
=
op
->
getValue
(
c
->
getName
(),
NULL
);
}
}
if
(
conn
->
execute
(
Commit
)
==
0
)
{
// 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
);
...
...
@@ -111,7 +110,7 @@ int main(int argc, const char** argv)
{
g_info
<<
hex
;
}
for
(
i
nt
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
for
(
i
=
0
;
i
<
table
->
getNoOfColumns
();
i
++
)
{
NdbRecAttr
*
a
=
data
[
i
];
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