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
0f720966
Commit
0f720966
authored
Sep 14, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UtilTransaction::verifyIndex wrt to null handling
parent
b39ddcf9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
78 deletions
+84
-78
ndb/test/src/UtilTransactions.cpp
ndb/test/src/UtilTransactions.cpp
+84
-78
No files found.
ndb/test/src/UtilTransactions.cpp
View file @
0f720966
...
...
@@ -1138,19 +1138,33 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
*/
NdbIndexOperation
*
pIndexOp
=
NULL
;
NdbIndexScanOperation
*
pScanOp
=
NULL
;
NdbOperation
*
pIOp
=
0
;
bool
null_found
=
false
;
for
(
a
=
0
;
a
<
(
int
)
pIndex
->
getNoOfColumns
();
a
++
){
const
NdbDictionary
::
Column
*
col
=
pIndex
->
getColumn
(
a
);
if
(
row
.
attributeStore
(
col
->
getName
())
->
isNULL
())
{
null_found
=
true
;
ndbout_c
(
"null found"
);
break
;
}
}
const
char
*
tabName
=
tab
.
getName
();
if
(
!
null_found
)
{
void
*
pOpCheck
=
NULL
;
if
(
indexType
==
NdbDictionary
::
Index
::
UniqueHashIndex
)
{
p
OpCheck
=
pIndexOp
=
pTrans1
->
getNdbIndexOperation
(
indexName
,
tab
.
getName
()
);
p
IOp
=
pIndexOp
=
pTrans1
->
getNdbIndexOperation
(
indexName
,
tabName
);
}
else
{
p
OpCheck
=
pScanOp
=
pTrans1
->
getNdbIndexScanOperation
(
indexName
,
tab
.
getName
()
);
p
IOp
=
pScanOp
=
pTrans1
->
getNdbIndexScanOperation
(
indexName
,
tabName
);
}
if
(
p
OpCheck
==
NULL
)
{
if
(
p
IOp
==
NULL
)
{
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
}
{
bool
not_ok
;
...
...
@@ -1174,20 +1188,13 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
const
NdbDictionary
::
Column
*
col
=
pIndex
->
getColumn
(
a
);
int
r
;
if
(
pIndexOp
)
r
=
pIndexOp
->
equal
(
col
->
getName
(),
row
.
attributeStore
(
col
->
getName
())
->
aRef
());
else
{
// setBound not possible for null attributes
if
(
!
row
.
attributeStore
(
col
->
getName
())
->
isNULL
()
)
{
r
=
pScanOp
->
setBound
(
col
->
getName
(),
NdbIndexScanOperation
::
BoundEQ
,
row
.
attributeStore
(
col
->
getName
())
->
aRef
());
}
}
if
(
r
!=
0
){
if
(
pIOp
->
equal
(
col
->
getName
(),
row
.
attributeStore
(
col
->
getName
())
->
aRef
())
!=
0
){
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
}
#if VERBOSE
printf
(
"%s = %d: "
,
col
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
());
#endif
...
...
@@ -1203,12 +1210,8 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
void
*
pCheck
;
if
(
pIndexOp
)
pCheck
=
indexRow
.
attributeStore
(
a
)
=
pIndexOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
else
pCheck
=
indexRow
.
attributeStore
(
a
)
=
p
Scan
Op
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
p
I
Op
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
if
(
pCheck
==
NULL
)
{
ERR
(
pTrans1
->
getNdbError
());
...
...
@@ -1218,6 +1221,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
printf
(
"%s "
,
tab
.
getColumn
(
a
)
->
getName
());
#endif
}
}
#if VERBOSE
printf
(
"
\n
"
);
#endif
...
...
@@ -1242,6 +1246,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
/**
* Compare the two rows
*/
if
(
!
null_found
){
if
(
pScanOp
)
{
if
(
cursor
->
nextResult
()
!=
0
){
const
NdbError
err
=
pTrans1
->
getNdbError
();
...
...
@@ -1264,11 +1269,12 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
goto
close_all
;
}
}
}
return_code
=
NDBT_OK
;
goto
close_all
;
}
close_all:
close_all:
if
(
cursor
)
cursor
->
close
();
if
(
pTrans1
)
...
...
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