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
86dc9605
Commit
86dc9605
authored
Sep 14, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into poseidon.(none):/home/tomas/mysql-4.1-ndb-merge
parents
2ed29f93
1d014ceb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
79 deletions
+83
-79
ndb/src/ndbapi/NdbScanOperation.cpp
ndb/src/ndbapi/NdbScanOperation.cpp
+0
-1
ndb/test/src/UtilTransactions.cpp
ndb/test/src/UtilTransactions.cpp
+83
-78
No files found.
ndb/src/ndbapi/NdbScanOperation.cpp
View file @
86dc9605
...
@@ -674,7 +674,6 @@ void NdbScanOperation::closeScan()
...
@@ -674,7 +674,6 @@ void NdbScanOperation::closeScan()
if
(
m_api_receivers_count
+
m_conf_receivers_count
){
if
(
m_api_receivers_count
+
m_conf_receivers_count
){
// Send close scan
// Send close scan
ndbout_c
(
"sending close %d %d"
,
m_api_receivers_count
,
m_conf_receivers_count
);
send_next_scan
(
0
,
true
);
// Close scan
send_next_scan
(
0
,
true
);
// Close scan
}
}
...
...
ndb/test/src/UtilTransactions.cpp
View file @
86dc9605
...
@@ -1138,90 +1138,93 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1138,90 +1138,93 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
*/
*/
NdbIndexOperation
*
pIndexOp
=
NULL
;
NdbIndexOperation
*
pIndexOp
=
NULL
;
NdbIndexScanOperation
*
pScanOp
=
NULL
;
NdbIndexScanOperation
*
pScanOp
=
NULL
;
{
NdbOperation
*
pIOp
=
0
;
void
*
pOpCheck
=
NULL
;
if
(
indexType
==
NdbDictionary
::
Index
::
UniqueHashIndex
)
{
pOpCheck
=
pIndexOp
=
pTrans1
->
getNdbIndexOperation
(
indexName
,
tab
.
getName
());
}
else
{
pOpCheck
=
pScanOp
=
pTrans1
->
getNdbIndexScanOperation
(
indexName
,
tab
.
getName
());
}
if
(
pOpCheck
==
NULL
)
{
bool
null_found
=
false
;
ERR
(
pTrans1
->
getNdbError
());
for
(
a
=
0
;
a
<
(
int
)
pIndex
->
getNoOfColumns
();
a
++
){
goto
close_all
;
const
NdbDictionary
::
Column
*
col
=
pIndex
->
getColumn
(
a
);
if
(
row
.
attributeStore
(
col
->
getName
())
->
isNULL
())
{
null_found
=
true
;
break
;
}
}
}
}
const
char
*
tabName
=
tab
.
getName
();
if
(
!
null_found
)
{
{
bool
not_ok
;
if
(
indexType
==
NdbDictionary
::
Index
::
UniqueHashIndex
)
{
if
(
pIndexOp
)
{
pIOp
=
pIndexOp
=
pTrans1
->
getNdbIndexOperation
(
indexName
,
tabName
);
not_ok
=
pIndexOp
->
readTuple
()
==
-
1
;
}
else
{
}
else
{
not_ok
=
(
cursor
=
pScanOp
->
readTuples
())
==
0
;
pIOp
=
pScanOp
=
pTrans1
->
getNdbIndexScanOperation
(
indexName
,
tabName
)
;
}
}
if
(
not_ok
)
{
if
(
pIOp
==
NULL
)
{
ERR
(
pTrans1
->
getNdbError
());
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
goto
close_all
;
}
}
}
{
bool
not_ok
;
if
(
pIndexOp
)
{
not_ok
=
pIndexOp
->
readTuple
()
==
-
1
;
}
else
{
not_ok
=
(
cursor
=
pScanOp
->
readTuples
())
==
0
;
}
if
(
not_ok
)
{
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
}
// Define primary keys for index
// Define primary keys for index
#if VERBOSE
#if VERBOSE
printf
(
"SI: "
);
printf
(
"SI: "
);
#endif
#endif
for
(
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
;
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
()
)
{
if
(
!
row
.
attributeStore
(
col
->
getName
())
->
isNULL
()
)
{
r
=
pScanOp
->
setBound
(
col
->
getName
(),
if
(
pIOp
->
equal
(
col
->
getName
(),
NdbIndexScanOperation
::
BoundEQ
,
row
.
attributeStore
(
col
->
getName
())
->
aRef
())
!=
0
){
row
.
attributeStore
(
col
->
getName
())
->
aRef
());
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
}
}
}
if
(
r
!=
0
){
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
#if VERBOSE
#if VERBOSE
printf
(
"%s = %d: "
,
col
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
());
printf
(
"%s = %d: "
,
col
->
getName
(),
row
.
attributeStore
(
a
)
->
aRef
());
#endif
#endif
}
}
#if VERBOSE
#if VERBOSE
printf
(
"
\n
"
);
printf
(
"
\n
"
);
#endif
#endif
// Read all attributes
// Read all attributes
#if VERBOSE
#if VERBOSE
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
printf
(
"Reading %u attributes: "
,
tab
.
getNoOfColumns
());
#endif
#endif
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
for
(
a
=
0
;
a
<
tab
.
getNoOfColumns
();
a
++
){
void
*
pCheck
;
void
*
pCheck
;
if
(
pIndexOp
)
pCheck
=
indexRow
.
attributeStore
(
a
)
=
pCheck
=
indexRow
.
attributeStore
(
a
)
=
pIOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
pIndexOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
else
if
(
pCheck
==
NULL
)
{
pCheck
=
indexRow
.
attributeStore
(
a
)
=
ERR
(
pTrans1
->
getNdbError
());
pScanOp
->
getValue
(
tab
.
getColumn
(
a
)
->
getName
());
goto
close_all
;
}
if
(
pCheck
==
NULL
)
{
ERR
(
pTrans1
->
getNdbError
());
goto
close_all
;
}
#if VERBOSE
#if VERBOSE
printf
(
"%s "
,
tab
.
getColumn
(
a
)
->
getName
());
printf
(
"%s "
,
tab
.
getColumn
(
a
)
->
getName
());
#endif
#endif
}
}
}
#if VERBOSE
#if VERBOSE
printf
(
"
\n
"
);
printf
(
"
\n
"
);
#endif
#endif
check
=
pTrans1
->
execute
(
Commit
);
check
=
pTrans1
->
execute
(
Commit
);
if
(
check
==
-
1
)
{
if
(
check
==
-
1
)
{
const
NdbError
err
=
pTrans1
->
getNdbError
();
const
NdbError
err
=
pTrans1
->
getNdbError
();
...
@@ -1238,41 +1241,43 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
...
@@ -1238,41 +1241,43 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
goto
close_all
;
goto
close_all
;
}
}
/**
/**
* Compare the two rows
* Compare the two rows
*/
*/
if
(
pScanOp
)
{
if
(
!
null_found
){
if
(
cursor
->
nextResult
()
!=
0
){
if
(
pScanOp
)
{
const
NdbError
err
=
pTrans1
->
getNdbError
();
if
(
cursor
->
nextResult
()
!=
0
){
ERR
(
err
);
const
NdbError
err
=
pTrans1
->
getNdbError
();
ndbout
<<
"Error when comparing records - index op next_result missing"
<<
endl
;
ERR
(
err
);
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
ndbout
<<
"Error when comparing records - index op next_result missing"
<<
endl
;
goto
close_all
;
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
goto
close_all
;
}
}
}
}
if
(
!
(
tabRow
.
c_str
()
==
indexRow
.
c_str
())){
if
(
!
(
tabRow
.
c_str
()
==
indexRow
.
c_str
())){
ndbout
<<
"Error when comapring records"
<<
endl
;
ndbout
<<
"Error when comapring records"
<<
endl
;
ndbout
<<
" tabRow:
\n
"
<<
tabRow
.
c_str
().
c_str
()
<<
endl
;
ndbout
<<
" tabRow:
\n
"
<<
tabRow
.
c_str
().
c_str
()
<<
endl
;
ndbout
<<
" indexRow:
\n
"
<<
indexRow
.
c_str
().
c_str
()
<<
endl
;
ndbout
<<
" indexRow:
\n
"
<<
indexRow
.
c_str
().
c_str
()
<<
endl
;
goto
close_all
;
}
if
(
pScanOp
)
{
if
(
cursor
->
nextResult
()
==
0
){
ndbout
<<
"Error when comparing records - index op next_result to many"
<<
endl
;
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
goto
close_all
;
goto
close_all
;
}
}
if
(
pScanOp
)
{
if
(
cursor
->
nextResult
()
==
0
){
ndbout
<<
"Error when comparing records - index op next_result to many"
<<
endl
;
ndbout
<<
"row: "
<<
row
.
c_str
().
c_str
()
<<
endl
;
goto
close_all
;
}
}
}
}
return_code
=
NDBT_OK
;
return_code
=
NDBT_OK
;
goto
close_all
;
goto
close_all
;
}
}
close_all:
close_all:
if
(
cursor
)
if
(
cursor
)
cursor
->
close
();
cursor
->
close
();
if
(
pTrans1
)
if
(
pTrans1
)
pNdb
->
closeTransaction
(
pTrans1
);
pNdb
->
closeTransaction
(
pTrans1
);
return
return_code
;
return
return_code
;
}
}
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