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
ff2528f3
Commit
ff2528f3
authored
Jun 28, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb -
ndbapi test of bug#20252
parent
7f307660
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 @
ff2528f3
...
@@ -1151,70 +1151,76 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
...
@@ -1151,70 +1151,76 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
{
{
for
(
int
flags
=
0
;
flags
<
4
;
flags
++
)
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
;
for
(
int
par
=
0
;
par
<
16
;
par
+=
1
+
(
rand
()
%
3
))
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
)
{
{
ERR
(
pCon
->
getNdbError
());
bool
disk
=
flags
&
1
;
return
NDBT_FAILED
;
bool
tups
=
flags
&
2
;
}
g_info
<<
"lm: "
<<
lm
<<
" disk: "
<<
disk
int
check
=
pOp
->
interpret_exit_ok
();
<<
" tup scan: "
<<
tups
if
(
check
==
-
1
)
{
<<
" par: "
<<
par
ERR
(
pCon
->
getNdbError
());
<<
" batch: "
<<
batch
return
NDBT_FAILED
;
<<
endl
;
}
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
// Define attributes to read
NdbScanOperation
*
pOp
=
pCon
->
getNdbScanOperation
(
pTab
->
getName
());
bool
found_disk
=
false
;
if
(
pOp
==
NULL
)
{
for
(
int
a
=
0
;
a
<
pTab
->
getNoOfColumns
();
a
++
){
ERR
(
pCon
->
getNdbError
());
if
(
pTab
->
getColumn
(
a
)
->
getStorageType
()
==
NdbDictionary
::
Column
::
StorageTypeDisk
)
return
NDBT_FAILED
;
{
found_disk
=
true
;
if
(
!
disk
)
continue
;
}
}
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
());
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
}
int
check
=
pOp
->
interpret_exit_ok
();
if
(
!
(
disk
&&
!
found_disk
))
{
check
=
pCon
->
execute
(
NoCommit
);
if
(
check
==
-
1
)
{
if
(
check
==
-
1
)
{
ERR
(
pCon
->
getNdbError
());
ERR
(
pCon
->
getNdbError
());
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
int
res
;
// Define attributes to read
int
row
=
0
;
bool
found_disk
=
false
;
while
((
res
=
pOp
->
nextResult
())
==
0
);
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
;
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