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
e5f1db69
Commit
e5f1db69
authored
Oct 05, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wl2135 test prg + bug fixes
parent
f41211f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
39 deletions
+52
-39
ndb/include/ndbapi/NdbConnection.hpp
ndb/include/ndbapi/NdbConnection.hpp
+2
-0
ndb/include/ndbapi/NdbScanOperation.hpp
ndb/include/ndbapi/NdbScanOperation.hpp
+1
-1
ndb/src/ndbapi/NdbConnection.cpp
ndb/src/ndbapi/NdbConnection.cpp
+13
-0
ndb/src/ndbapi/NdbScanOperation.cpp
ndb/src/ndbapi/NdbScanOperation.cpp
+29
-23
ndb/src/ndbapi/Ndblist.cpp
ndb/src/ndbapi/Ndblist.cpp
+2
-2
ndb/test/src/UtilTransactions.cpp
ndb/test/src/UtilTransactions.cpp
+5
-13
No files found.
ndb/include/ndbapi/NdbConnection.hpp
View file @
e5f1db69
...
@@ -673,6 +673,8 @@ private:
...
@@ -673,6 +673,8 @@ private:
void
printState
();
void
printState
();
#endif
#endif
bool
checkState_TransId
(
const
Uint32
*
transId
)
const
;
bool
checkState_TransId
(
const
Uint32
*
transId
)
const
;
void
remove_list
(
NdbOperation
*&
head
,
NdbOperation
*
);
void
define_scan_op
(
NdbIndexScanOperation
*
);
void
define_scan_op
(
NdbIndexScanOperation
*
);
};
};
...
...
ndb/include/ndbapi/NdbScanOperation.hpp
View file @
e5f1db69
...
@@ -87,7 +87,7 @@ protected:
...
@@ -87,7 +87,7 @@ protected:
CursorType
m_cursor_type
;
CursorType
m_cursor_type
;
NdbScanOperation
(
Ndb
*
aNdb
);
NdbScanOperation
(
Ndb
*
aNdb
);
~
NdbScanOperation
();
virtual
~
NdbScanOperation
();
int
nextResult
(
bool
fetchAllowed
=
true
);
int
nextResult
(
bool
fetchAllowed
=
true
);
virtual
void
release
();
virtual
void
release
();
...
...
ndb/src/ndbapi/NdbConnection.cpp
View file @
e5f1db69
...
@@ -1128,6 +1128,19 @@ NdbConnection::getNdbScanOperation(const NdbTableImpl * tab)
...
@@ -1128,6 +1128,19 @@ NdbConnection::getNdbScanOperation(const NdbTableImpl * tab)
return
NULL
;
return
NULL
;
}
//NdbConnection::getNdbScanOperation()
}
//NdbConnection::getNdbScanOperation()
void
NdbConnection
::
remove_list
(
NdbOperation
*&
list
,
NdbOperation
*
op
){
NdbOperation
*
tmp
=
list
;
if
(
tmp
==
op
)
list
=
op
->
next
();
else
{
while
(
tmp
&&
tmp
->
next
()
!=
op
)
tmp
=
tmp
->
next
();
if
(
tmp
)
tmp
->
next
(
op
->
next
());
}
op
->
next
(
NULL
);
}
void
void
NdbConnection
::
define_scan_op
(
NdbIndexScanOperation
*
tOp
){
NdbConnection
::
define_scan_op
(
NdbIndexScanOperation
*
tOp
){
// Link scan operation into list of cursor operations
// Link scan operation into list of cursor operations
...
...
ndb/src/ndbapi/NdbScanOperation.cpp
View file @
e5f1db69
...
@@ -117,6 +117,8 @@ NdbScanOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection)
...
@@ -117,6 +117,8 @@ NdbScanOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection)
theStatus
=
GetValue
;
theStatus
=
GetValue
;
theOperationType
=
OpenScanRequest
;
theOperationType
=
OpenScanRequest
;
theNdbCon
->
theMagicNumber
=
0xFE11DF
;
return
0
;
return
0
;
}
}
...
@@ -217,7 +219,10 @@ NdbResultSet* NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
...
@@ -217,7 +219,10 @@ NdbResultSet* NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
req
->
transId2
=
(
Uint32
)
(
transId
>>
32
);
req
->
transId2
=
(
Uint32
)
(
transId
>>
32
);
NdbApiSignal
*
tSignal
=
NdbApiSignal
*
tSignal
=
theFirstKEYINFO
=
theLastKEYINFO
=
theNdb
->
getSignal
();
theFirstKEYINFO
;
theFirstKEYINFO
=
(
tSignal
?
tSignal
:
tSignal
=
theNdb
->
getSignal
());
theLastKEYINFO
=
tSignal
;
tSignal
->
setSignal
(
GSN_KEYINFO
);
tSignal
->
setSignal
(
GSN_KEYINFO
);
theKEYINFOptr
=
((
KeyInfo
*
)
tSignal
->
getDataPtrSend
())
->
keyData
;
theKEYINFOptr
=
((
KeyInfo
*
)
tSignal
->
getDataPtrSend
())
->
keyData
;
...
@@ -259,18 +264,7 @@ NdbScanOperation::fix_receivers(Uint32 parallel){
...
@@ -259,18 +264,7 @@ NdbScanOperation::fix_receivers(Uint32 parallel){
m_allocated_receivers
=
parallel
;
m_allocated_receivers
=
parallel
;
}
}
for
(
Uint32
i
=
0
;
i
<
parallel
;
i
++
){
reset_receivers
(
parallel
,
0
);
m_receivers
[
i
]
->
m_list_index
=
i
;
m_prepared_receivers
[
i
]
=
m_receivers
[
i
]
->
getId
();
m_sent_receivers
[
i
]
=
m_receivers
[
i
];
m_conf_receivers
[
i
]
=
0
;
m_api_receivers
[
i
]
=
0
;
}
m_api_receivers_count
=
0
;
m_current_api_receiver
=
0
;
m_sent_receivers_count
=
parallel
;
m_conf_receivers_count
=
0
;
return
0
;
return
0
;
}
}
...
@@ -414,14 +408,22 @@ NdbScanOperation::executeCursor(int nodeId){
...
@@ -414,14 +408,22 @@ NdbScanOperation::executeCursor(int nodeId){
NdbConnection
*
tCon
=
theNdbCon
;
NdbConnection
*
tCon
=
theNdbCon
;
TransporterFacade
*
tp
=
TransporterFacade
::
instance
();
TransporterFacade
*
tp
=
TransporterFacade
::
instance
();
Guard
guard
(
tp
->
theMutexPtr
);
Guard
guard
(
tp
->
theMutexPtr
);
Uint32
magic
=
tCon
->
theMagicNumber
;
Uint32
seq
=
tCon
->
theNodeSequence
;
Uint32
seq
=
tCon
->
theNodeSequence
;
if
(
tp
->
get_node_alive
(
nodeId
)
&&
if
(
tp
->
get_node_alive
(
nodeId
)
&&
(
tp
->
getNodeSequence
(
nodeId
)
==
seq
))
{
(
tp
->
getNodeSequence
(
nodeId
)
==
seq
))
{
if
(
prepareSendScan
(
tCon
->
theTCConPtr
,
tCon
->
theTransactionId
)
==
-
1
)
return
-
1
;
/**
* Only call prepareSendScan first time (incase of restarts)
* - check with theMagicNumber
*/
tCon
->
theMagicNumber
=
0x37412619
;
tCon
->
theMagicNumber
=
0x37412619
;
if
(
magic
!=
0x37412619
&&
prepareSendScan
(
tCon
->
theTCConPtr
,
tCon
->
theTransactionId
)
==
-
1
)
return
-
1
;
if
(
doSendScan
(
nodeId
)
==
-
1
)
if
(
doSendScan
(
nodeId
)
==
-
1
)
return
-
1
;
return
-
1
;
...
@@ -718,9 +720,6 @@ int NdbScanOperation::prepareSendScan(Uint32 aTC_ConnectPtr,
...
@@ -718,9 +720,6 @@ int NdbScanOperation::prepareSendScan(Uint32 aTC_ConnectPtr,
((
NdbIndexScanOperation
*
)
this
)
->
fix_get_values
();
((
NdbIndexScanOperation
*
)
this
)
->
fix_get_values
();
}
}
const
Uint32
transId1
=
(
Uint32
)
(
aTransactionId
&
0xFFFFFFFF
);
const
Uint32
transId2
=
(
Uint32
)
(
aTransactionId
>>
32
);
theCurrentATTRINFO
->
setLength
(
theAI_LenInCurrAI
);
theCurrentATTRINFO
->
setLength
(
theAI_LenInCurrAI
);
/**
/**
...
@@ -991,13 +990,15 @@ NdbIndexScanOperation::~NdbIndexScanOperation(){
...
@@ -991,13 +990,15 @@ NdbIndexScanOperation::~NdbIndexScanOperation(){
}
}
int
int
NdbIndexScanOperation
::
setBound
(
const
char
*
anAttrName
,
int
type
,
const
void
*
aValue
,
Uint32
len
)
NdbIndexScanOperation
::
setBound
(
const
char
*
anAttrName
,
int
type
,
const
void
*
aValue
,
Uint32
len
)
{
{
return
setBound
(
m_accessTable
->
getColumn
(
anAttrName
),
type
,
aValue
,
len
);
return
setBound
(
m_accessTable
->
getColumn
(
anAttrName
),
type
,
aValue
,
len
);
}
}
int
int
NdbIndexScanOperation
::
setBound
(
Uint32
anAttrId
,
int
type
,
const
void
*
aValue
,
Uint32
len
)
NdbIndexScanOperation
::
setBound
(
Uint32
anAttrId
,
int
type
,
const
void
*
aValue
,
Uint32
len
)
{
{
return
setBound
(
m_accessTable
->
getColumn
(
anAttrId
),
type
,
aValue
,
len
);
return
setBound
(
m_accessTable
->
getColumn
(
anAttrId
),
type
,
aValue
,
len
);
}
}
...
@@ -1522,6 +1523,7 @@ NdbScanOperation::restart()
...
@@ -1522,6 +1523,7 @@ NdbScanOperation::restart()
*/
*/
reset_receivers
(
theParallelism
,
m_ordered
);
reset_receivers
(
theParallelism
,
m_ordered
);
theError
.
code
=
0
;
if
(
doSendScan
(
nodeId
)
==
-
1
)
if
(
doSendScan
(
nodeId
)
==
-
1
)
return
-
1
;
return
-
1
;
...
@@ -1540,12 +1542,16 @@ NdbIndexScanOperation::reset_bounds(){
...
@@ -1540,12 +1542,16 @@ NdbIndexScanOperation::reset_bounds(){
if
(
!
res
)
if
(
!
res
)
{
{
theError
.
code
=
0
;
reset_receivers
(
theParallelism
,
m_ordered
);
reset_receivers
(
theParallelism
,
m_ordered
);
theLastKEYINFO
=
theFirstKEYINFO
;
theLastKEYINFO
=
theFirstKEYINFO
;
theKEYINFOptr
=
((
KeyInfo
*
)
theFirstKEYINFO
->
getDataPtrSend
())
->
keyData
;
theKEYINFOptr
=
((
KeyInfo
*
)
theFirstKEYINFO
->
getDataPtrSend
())
->
keyData
;
theTotalNrOfKeyWordInSignal
=
0
;
theTupKeyLen
=
0
;
theTotalNrOfKeyWordInSignal
=
0
;
m_transConnection
->
remove_list
((
NdbOperation
*
)
m_transConnection
->
m_firstExecutedScanOp
,
this
);
m_transConnection
->
define_scan_op
(
this
);
m_transConnection
->
define_scan_op
(
this
);
return
0
;
return
0
;
}
}
...
...
ndb/src/ndbapi/Ndblist.cpp
View file @
e5f1db69
...
@@ -649,8 +649,8 @@ Remark: Always release the first item in the free list
...
@@ -649,8 +649,8 @@ Remark: Always release the first item in the free list
void
void
Ndb
::
freeScanOperation
()
Ndb
::
freeScanOperation
()
{
{
NdbScanOperation
*
tOp
=
theScanOpIdleList
;
Ndb
Index
ScanOperation
*
tOp
=
theScanOpIdleList
;
theScanOpIdleList
=
(
NdbIndexScanOperation
*
)
theScanOpIdleList
->
next
();
theScanOpIdleList
=
(
NdbIndexScanOperation
*
)
tOp
->
next
();
delete
tOp
;
delete
tOp
;
}
}
...
...
ndb/test/src/UtilTransactions.cpp
View file @
e5f1db69
...
@@ -1328,12 +1328,8 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1328,12 +1328,8 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
NdbResultSet
*
rs
;
NdbResultSet
*
if
(
transactional
){
rs
=
pOp
->
readTuples
(
NdbScanOperation
::
LM_Read
,
0
,
parallelism
);
rs
=
pOp
->
readTuples
(
NdbScanOperation
::
LM_Read
,
0
,
parallelism
);
}
else
{
rs
=
pOp
->
readTuples
(
NdbScanOperation
::
LM_CommittedRead
,
0
,
parallelism
);
}
if
(
rs
==
0
)
{
if
(
rs
==
0
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
...
@@ -1372,7 +1368,6 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1372,7 +1368,6 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
int
eof
;
int
eof
;
int
rows
=
0
;
int
rows
=
0
;
while
(
check
==
0
&&
(
eof
=
rs
->
nextResult
())
==
0
){
while
(
check
==
0
&&
(
eof
=
rs
->
nextResult
())
==
0
){
ndbout_c
(
"Row: %d"
,
rows
);
rows
++
;
rows
++
;
bool
null_found
=
false
;
bool
null_found
=
false
;
...
@@ -1397,8 +1392,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1397,8 +1392,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
if
(
!
iop
&&
(
iop
=
pTrans
->
getNdbIndexScanOperation
(
indexName
,
if
(
!
iop
&&
(
iop
=
pTrans
->
getNdbIndexScanOperation
(
indexName
,
tab
.
getName
())))
tab
.
getName
())))
{
{
cursor
=
iop
->
readTuples
(
transactional
?
NdbScanOperation
::
LM_Read
:
cursor
=
iop
->
readTuples
(
NdbScanOperation
::
LM_CommittedRead
,
NdbScanOperation
::
LM_CommittedRead
,
parallelism
);
parallelism
);
iop
->
interpret_exit_ok
();
iop
->
interpret_exit_ok
();
if
(
!
cursor
||
get_values
(
iop
,
indexRow
))
if
(
!
cursor
||
get_values
(
iop
,
indexRow
))
...
@@ -1411,11 +1405,9 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1411,11 +1405,9 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
if
(
equal
(
pIndex
,
iop
,
scanRow
))
if
(
equal
(
pIndex
,
iop
,
scanRow
))
goto
error
;
goto
error
;
else
ndbout_c
(
"equal ok"
);
}
}
check
=
pTrans
->
execute
(
Commit
);
// commit pk read
check
=
pTrans
->
execute
(
NoCommit
);
if
(
check
)
if
(
check
)
goto
error
;
goto
error
;
...
@@ -1432,6 +1424,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1432,6 +1424,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
if
((
res
=
cursor
->
nextResult
())
!=
0
){
if
((
res
=
cursor
->
nextResult
())
!=
0
){
g_err
<<
"Failed to find row using index: "
<<
res
<<
endl
;
g_err
<<
"Failed to find row using index: "
<<
res
<<
endl
;
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
...
@@ -1451,8 +1444,6 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1451,8 +1444,6 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
}
}
pTrans
->
restart
();
ndbout_c
(
"row %d ok"
,
rows
-
1
);
}
}
if
(
eof
==
-
1
||
check
==
-
1
)
{
if
(
eof
==
-
1
||
check
==
-
1
)
{
...
@@ -1461,6 +1452,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
...
@@ -1461,6 +1452,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
ERR
(
err
);
ERR
(
err
);
iop
=
0
;
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
NdbSleep_MilliSleep
(
50
);
NdbSleep_MilliSleep
(
50
);
retryAttempt
++
;
retryAttempt
++
;
...
...
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