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
52c32382
Commit
52c32382
authored
Jun 28, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb -
ndbapi test of bug#20252 storage/ndb/test/ndbapi/testScan.cpp: ndbapi test of bug#20252
parent
7e39d48e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
48 deletions
+54
-48
storage/ndb/test/ndbapi/testScan.cpp
storage/ndb/test/ndbapi/testScan.cpp
+54
-48
No files found.
storage/ndb/test/ndbapi/testScan.cpp
View file @
52c32382
...
...
@@ -1151,70 +1151,76 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
{
for
(
int
flags
=
0
;
flags
<
4
;
flags
++
)
{
for
(
int
par
=
0
;
par
<
16
;
par
+=
1
+
(
rand
()
%
3
))
for
(
int
batch
=
0
;
batch
<
100
;
batch
+=
(
1
+
batch
+
(
batch
>>
3
)
))
{
bool
disk
=
flags
&
1
;
bool
tups
=
flags
&
2
;
g_info
<<
"lm: "
<<
lm
<<
" disk: "
<<
disk
<<
" tup scan: "
<<
tups
<<
" par: "
<<
par
<<
endl
;
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
NdbScanOperation
*
pOp
=
pCon
->
getNdbScanOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
if
(
pOp
->
readTuples
((
NdbOperation
::
LockMode
)
lm
,
tups
?
NdbScanOperation
::
SF_TupScan
:
0
,
par
)
!=
0
)
for
(
int
par
=
0
;
par
<
16
;
par
+=
1
+
(
rand
()
%
3
))
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
int
check
=
pOp
->
interpret_exit_ok
();
if
(
check
==
-
1
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
// Define attributes to read
bool
found_disk
=
false
;
for
(
int
a
=
0
;
a
<
pTab
->
getNoOfColumns
();
a
++
){
if
(
pTab
->
getColumn
(
a
)
->
getStorageType
()
==
NdbDictionary
::
Column
::
StorageTypeDisk
)
{
found_disk
=
true
;
if
(
!
disk
)
continue
;
bool
disk
=
flags
&
1
;
bool
tups
=
flags
&
2
;
g_info
<<
"lm: "
<<
lm
<<
" disk: "
<<
disk
<<
" tup scan: "
<<
tups
<<
" par: "
<<
par
<<
" batch: "
<<
batch
<<
endl
;
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
NdbScanOperation
*
pOp
=
pCon
->
getNdbScanOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
if
((
pOp
->
getValue
(
pTab
->
getColumn
(
a
)
->
getName
()))
==
0
)
{
if
(
pOp
->
readTuples
((
NdbOperation
::
LockMode
)
lm
,
tups
?
NdbScanOperation
::
SF_TupScan
:
0
,
par
,
batch
)
!=
0
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
}
if
(
!
(
disk
&&
!
found_disk
))
{
check
=
pCon
->
execute
(
NoCommit
);
int
check
=
pOp
->
interpret_exit_ok
();
if
(
check
==
-
1
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
int
res
;
int
row
=
0
;
while
((
res
=
pOp
->
nextResult
())
==
0
);
// Define attributes to read
bool
found_disk
=
false
;
for
(
int
a
=
0
;
a
<
pTab
->
getNoOfColumns
();
a
++
){
if
(
pTab
->
getColumn
(
a
)
->
getStorageType
()
==
NdbDictionary
::
Column
::
StorageTypeDisk
)
{
found_disk
=
true
;
if
(
!
disk
)
continue
;
}
if
((
pOp
->
getValue
(
pTab
->
getColumn
(
a
)
->
getName
()))
==
0
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
}
if
(
!
(
disk
&&
!
found_disk
))
{
check
=
pCon
->
execute
(
NoCommit
);
if
(
check
==
-
1
)
{
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
}
int
res
;
int
row
=
0
;
while
((
res
=
pOp
->
nextResult
())
==
0
);
}
pCon
->
close
();
}
pCon
->
close
();
}
}
}
return
NDBT_OK
;
}
...
...
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