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
c61d23e0
Commit
c61d23e0
authored
Jul 06, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2f24eec4
96c4a9c6
Changes
18
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
233 additions
and
153 deletions
+233
-153
ndb/include/ndbapi/NdbIndexScanOperation.hpp
ndb/include/ndbapi/NdbIndexScanOperation.hpp
+1
-0
ndb/include/ndbapi/NdbReceiver.hpp
ndb/include/ndbapi/NdbReceiver.hpp
+1
-1
ndb/include/ndbapi/NdbScanOperation.hpp
ndb/include/ndbapi/NdbScanOperation.hpp
+2
-2
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+45
-3
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
+1
-1
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+2
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+12
-8
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+1
-0
ndb/src/ndbapi/NdbIndexOperation.cpp
ndb/src/ndbapi/NdbIndexOperation.cpp
+1
-3
ndb/src/ndbapi/NdbOperation.cpp
ndb/src/ndbapi/NdbOperation.cpp
+3
-2
ndb/src/ndbapi/NdbOperationDefine.cpp
ndb/src/ndbapi/NdbOperationDefine.cpp
+2
-2
ndb/src/ndbapi/NdbOperationInt.cpp
ndb/src/ndbapi/NdbOperationInt.cpp
+2
-2
ndb/src/ndbapi/NdbReceiver.cpp
ndb/src/ndbapi/NdbReceiver.cpp
+23
-16
ndb/src/ndbapi/NdbScanOperation.cpp
ndb/src/ndbapi/NdbScanOperation.cpp
+121
-95
ndb/test/include/NdbRestarter.hpp
ndb/test/include/NdbRestarter.hpp
+3
-2
ndb/test/src/NdbBackup.cpp
ndb/test/src/NdbBackup.cpp
+2
-2
ndb/test/src/NdbRestarter.cpp
ndb/test/src/NdbRestarter.cpp
+9
-11
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+2
-2
No files found.
ndb/include/ndbapi/NdbIndexScanOperation.hpp
View file @
c61d23e0
...
@@ -125,6 +125,7 @@ private:
...
@@ -125,6 +125,7 @@ private:
virtual
~
NdbIndexScanOperation
();
virtual
~
NdbIndexScanOperation
();
int
setBound
(
const
NdbColumnImpl
*
,
int
type
,
const
void
*
aValue
,
Uint32
len
);
int
setBound
(
const
NdbColumnImpl
*
,
int
type
,
const
void
*
aValue
,
Uint32
len
);
int
saveBoundATTRINFO
();
virtual
int
equal_impl
(
const
NdbColumnImpl
*
,
const
char
*
,
Uint32
);
virtual
int
equal_impl
(
const
NdbColumnImpl
*
,
const
char
*
,
Uint32
);
virtual
NdbRecAttr
*
getValue_impl
(
const
NdbColumnImpl
*
,
char
*
);
virtual
NdbRecAttr
*
getValue_impl
(
const
NdbColumnImpl
*
,
char
*
);
...
...
ndb/include/ndbapi/NdbReceiver.hpp
View file @
c61d23e0
...
@@ -37,7 +37,7 @@ public:
...
@@ -37,7 +37,7 @@ public:
};
};
NdbReceiver
(
Ndb
*
aNdb
);
NdbReceiver
(
Ndb
*
aNdb
);
void
init
(
ReceiverType
type
,
void
*
owner
,
bool
keyInfo
);
void
init
(
ReceiverType
type
,
void
*
owner
);
void
release
();
void
release
();
~
NdbReceiver
();
~
NdbReceiver
();
...
...
ndb/include/ndbapi/NdbScanOperation.hpp
View file @
c61d23e0
...
@@ -128,11 +128,11 @@ protected:
...
@@ -128,11 +128,11 @@ protected:
NdbApiSignal
*
theSCAN_TABREQ
;
NdbApiSignal
*
theSCAN_TABREQ
;
int
getFirstATTRINFOScan
();
int
getFirstATTRINFOScan
();
int
saveBoundATTRINFO
();
int
doSendScan
(
int
ProcessorId
);
int
doSendScan
(
int
ProcessorId
);
int
prepareSendScan
(
Uint32
TC_ConnectPtr
,
Uint64
TransactionId
);
int
prepareSendScan
(
Uint32
TC_ConnectPtr
,
Uint64
TransactionId
);
int
fix_receivers
(
Uint32
parallel
,
bool
keyInfo
);
int
fix_receivers
(
Uint32
parallel
);
Uint32
*
m_array
;
// containing all arrays below
Uint32
m_allocated_receivers
;
Uint32
m_allocated_receivers
;
NdbReceiver
**
m_receivers
;
// All receivers
NdbReceiver
**
m_receivers
;
// All receivers
...
...
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
View file @
c61d23e0
...
@@ -60,6 +60,48 @@
...
@@ -60,6 +60,48 @@
// seen only when we debug the product
// seen only when we debug the product
#ifdef VM_TRACE
#ifdef VM_TRACE
#define DEBUG(x) ndbout << "DBLQH: "<< x << endl;
#define DEBUG(x) ndbout << "DBLQH: "<< x << endl;
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
TcConnectionrec
::
TransactionState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
TcConnectionrec
::
LogWriteState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
TcConnectionrec
::
ListState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
TcConnectionrec
::
AbortState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
ScanRecord
::
ScanState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
LogFileOperationRecord
::
LfoState
state
){
out
<<
(
int
)
state
;
return
out
;
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
Dblqh
::
ScanRecord
::
ScanType
state
){
out
<<
(
int
)
state
;
return
out
;
}
#else
#else
#define DEBUG(x)
#define DEBUG(x)
#endif
#endif
...
@@ -7177,7 +7219,7 @@ void Dblqh::execSCAN_FRAGREQ(Signal* signal)
...
@@ -7177,7 +7219,7 @@ void Dblqh::execSCAN_FRAGREQ(Signal* signal)
ScanFragRef
*
ref
;
ScanFragRef
*
ref
;
const
Uint32
transid1
=
scanFragReq
->
transId1
;
const
Uint32
transid1
=
scanFragReq
->
transId1
;
const
Uint32
transid2
=
scanFragReq
->
transId2
;
const
Uint32
transid2
=
scanFragReq
->
transId2
;
Uint32
errorCode
;
Uint32
errorCode
=
0
;
Uint32
senderData
;
Uint32
senderData
;
Uint32
hashIndex
;
Uint32
hashIndex
;
TcConnectionrecPtr
nextHashptr
;
TcConnectionrecPtr
nextHashptr
;
...
@@ -8466,7 +8508,7 @@ void Dblqh::sendKeyinfo20(Signal* signal,
...
@@ -8466,7 +8508,7 @@ void Dblqh::sendKeyinfo20(Signal* signal,
const
Uint32
type
=
getNodeInfo
(
nodeId
).
m_type
;
const
Uint32
type
=
getNodeInfo
(
nodeId
).
m_type
;
const
bool
is_api
=
(
type
>=
NodeInfo
::
API
&&
type
<=
NodeInfo
::
REP
);
const
bool
is_api
=
(
type
>=
NodeInfo
::
API
&&
type
<=
NodeInfo
::
REP
);
const
bool
old_dest
=
(
getNodeInfo
(
nodeId
).
m_version
<
MAKE_VERSION
(
3
,
5
,
0
));
const
bool
old_dest
=
(
getNodeInfo
(
nodeId
).
m_version
<
MAKE_VERSION
(
3
,
5
,
0
));
const
bool
longable
=
is_api
&&
!
old_dest
;
const
bool
longable
=
true
;
// TODO
is_api && !old_dest;
Uint32
*
dst
=
keyInfo
->
keyData
;
Uint32
*
dst
=
keyInfo
->
keyData
;
dst
+=
nodeId
==
getOwnNodeId
()
?
0
:
KeyInfo20
::
DataLength
;
dst
+=
nodeId
==
getOwnNodeId
()
?
0
:
KeyInfo20
::
DataLength
;
...
@@ -15736,7 +15778,7 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType)
...
@@ -15736,7 +15778,7 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType)
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
void
Dblqh
::
deleteFragrec
(
Uint32
fragId
)
void
Dblqh
::
deleteFragrec
(
Uint32
fragId
)
{
{
Uint32
indexFound
;
Uint32
indexFound
=
RNIL
;
fragptr
.
i
=
RNIL
;
fragptr
.
i
=
RNIL
;
for
(
Uint32
i
=
(
NO_OF_FRAG_PER_NODE
-
1
);
(
Uint32
)
~
i
;
i
--
)
{
for
(
Uint32
i
=
(
NO_OF_FRAG_PER_NODE
-
1
);
(
Uint32
)
~
i
;
i
--
)
{
jam
();
jam
();
...
...
ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp
View file @
c61d23e0
...
@@ -220,7 +220,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal,
...
@@ -220,7 +220,7 @@ void Dbtup::sendReadAttrinfo(Signal* signal,
*/
*/
Uint32
routeBlockref
=
regOperPtr
->
coordinatorTC
;
Uint32
routeBlockref
=
regOperPtr
->
coordinatorTC
;
if
(
is_api
&&
!
old_dest
){
if
(
true
){
// TODO
is_api && !old_dest){
ljam
();
ljam
();
transIdAI
->
attrData
[
0
]
=
recBlockref
;
transIdAI
->
attrData
[
0
]
=
recBlockref
;
LinearSectionPtr
ptr
[
3
];
LinearSectionPtr
ptr
[
3
];
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
c61d23e0
...
@@ -1498,6 +1498,7 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
...
@@ -1498,6 +1498,7 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
break
;
break
;
}
}
delete
prop
;
return
(
ndb_mgm_configuration
*
)
cvf
.
m_cfg
;
return
(
ndb_mgm_configuration
*
)
cvf
.
m_cfg
;
}
while
(
0
);
}
while
(
0
);
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
c61d23e0
...
@@ -230,10 +230,6 @@ NdbColumnImpl::assign(const NdbColumnImpl& org)
...
@@ -230,10 +230,6 @@ NdbColumnImpl::assign(const NdbColumnImpl& org)
NdbTableImpl
::
NdbTableImpl
()
NdbTableImpl
::
NdbTableImpl
()
:
NdbDictionary
::
Table
(
*
this
),
m_facade
(
this
)
:
NdbDictionary
::
Table
(
*
this
),
m_facade
(
this
)
{
{
m_noOfKeys
=
0
;
m_sizeOfKeysInWords
=
0
;
m_noOfBlobs
=
0
;
m_index
=
0
;
init
();
init
();
}
}
...
@@ -1149,7 +1145,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
...
@@ -1149,7 +1145,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
Uint32
keyInfoPos
=
0
;
Uint32
keyInfoPos
=
0
;
Uint32
keyCount
=
0
;
Uint32
keyCount
=
0
;
Uint32
blobCount
;
Uint32
blobCount
=
0
;
for
(
Uint32
i
=
0
;
i
<
tableDesc
.
NoOfAttributes
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
tableDesc
.
NoOfAttributes
;
i
++
)
{
DictTabInfo
::
Attribute
attrDesc
;
attrDesc
.
init
();
DictTabInfo
::
Attribute
attrDesc
;
attrDesc
.
init
();
...
@@ -1737,8 +1733,8 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
...
@@ -1737,8 +1733,8 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
return
0
;
return
0
;
}
}
NdbTableImpl
*
prim
Tab
=
getTable
(
tab
->
m_primaryTable
.
c_str
());
NdbTableImpl
*
prim
=
getTable
(
tab
->
m_primaryTable
.
c_str
());
if
(
prim
Tab
==
0
){
if
(
prim
==
0
){
m_error
.
code
=
4243
;
m_error
.
code
=
4243
;
return
0
;
return
0
;
}
}
...
@@ -1752,7 +1748,7 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
...
@@ -1752,7 +1748,7 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
idx
->
m_indexId
=
tab
->
m_tableId
;
idx
->
m_indexId
=
tab
->
m_tableId
;
idx
->
m_internalName
.
assign
(
internalName
);
idx
->
m_internalName
.
assign
(
internalName
);
idx
->
m_externalName
.
assign
(
externalName
);
idx
->
m_externalName
.
assign
(
externalName
);
idx
->
m_tableName
.
assign
(
prim
Tab
->
m_externalName
);
idx
->
m_tableName
.
assign
(
prim
->
m_externalName
);
idx
->
m_type
=
tab
->
m_indexType
;
idx
->
m_type
=
tab
->
m_indexType
;
// skip last attribute (NDB$PK or NDB$TNODE)
// skip last attribute (NDB$PK or NDB$TNODE)
for
(
unsigned
i
=
0
;
i
+
1
<
tab
->
m_columns
.
size
();
i
++
){
for
(
unsigned
i
=
0
;
i
+
1
<
tab
->
m_columns
.
size
();
i
++
){
...
@@ -1760,6 +1756,14 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
...
@@ -1760,6 +1756,14 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
// Copy column definition
// Copy column definition
*
col
=
*
tab
->
m_columns
[
i
];
*
col
=
*
tab
->
m_columns
[
i
];
idx
->
m_columns
.
push_back
(
col
);
idx
->
m_columns
.
push_back
(
col
);
/**
* reverse map
*/
int
key_id
=
prim
->
getColumn
(
col
->
getName
())
->
getColumnNo
();
int
fill
=
-
1
;
idx
->
m_key_ids
.
fill
(
key_id
,
fill
);
idx
->
m_key_ids
[
key_id
]
=
i
;
col
->
m_keyInfoPos
=
key_id
;
}
}
idx
->
m_table
=
tab
;
idx
->
m_table
=
tab
;
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
c61d23e0
...
@@ -176,6 +176,7 @@ public:
...
@@ -176,6 +176,7 @@ public:
BaseString
m_externalName
;
BaseString
m_externalName
;
BaseString
m_tableName
;
BaseString
m_tableName
;
Vector
<
NdbColumnImpl
*>
m_columns
;
Vector
<
NdbColumnImpl
*>
m_columns
;
Vector
<
int
>
m_key_ids
;
NdbDictionary
::
Index
::
Type
m_type
;
NdbDictionary
::
Index
::
Type
m_type
;
bool
m_logging
;
bool
m_logging
;
...
...
ndb/src/ndbapi/NdbIndexOperation.cpp
View file @
c61d23e0
...
@@ -37,8 +37,6 @@
...
@@ -37,8 +37,6 @@
#include <signaldata/IndxKeyInfo.hpp>
#include <signaldata/IndxKeyInfo.hpp>
#include <signaldata/IndxAttrInfo.hpp>
#include <signaldata/IndxAttrInfo.hpp>
#define CHECK_NULL(v) assert(v == NULL); v = NULL;
NdbIndexOperation
::
NdbIndexOperation
(
Ndb
*
aNdb
)
:
NdbIndexOperation
::
NdbIndexOperation
(
Ndb
*
aNdb
)
:
NdbOperation
(
aNdb
),
NdbOperation
(
aNdb
),
m_theIndex
(
NULL
),
m_theIndex
(
NULL
),
...
@@ -52,7 +50,7 @@ NdbIndexOperation::NdbIndexOperation(Ndb* aNdb) :
...
@@ -52,7 +50,7 @@ NdbIndexOperation::NdbIndexOperation(Ndb* aNdb) :
/**
/**
* Change receiver type
* Change receiver type
*/
*/
theReceiver
.
init
(
NdbReceiver
::
NDB_INDEX_OPERATION
,
this
,
false
);
theReceiver
.
init
(
NdbReceiver
::
NDB_INDEX_OPERATION
,
this
);
}
}
NdbIndexOperation
::~
NdbIndexOperation
()
NdbIndexOperation
::~
NdbIndexOperation
()
...
...
ndb/src/ndbapi/NdbOperation.cpp
View file @
c61d23e0
...
@@ -92,7 +92,7 @@ NdbOperation::NdbOperation(Ndb* aNdb) :
...
@@ -92,7 +92,7 @@ NdbOperation::NdbOperation(Ndb* aNdb) :
theBoundATTRINFO
(
NULL
),
theBoundATTRINFO
(
NULL
),
theBlobList
(
NULL
)
theBlobList
(
NULL
)
{
{
theReceiver
.
init
(
NdbReceiver
::
NDB_OPERATION
,
this
,
false
);
theReceiver
.
init
(
NdbReceiver
::
NDB_OPERATION
,
this
);
theError
.
code
=
0
;
theError
.
code
=
0
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -195,7 +195,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){
...
@@ -195,7 +195,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){
tcKeyReq
->
scanInfo
=
0
;
tcKeyReq
->
scanInfo
=
0
;
theKEYINFOptr
=
&
tcKeyReq
->
keyInfo
[
0
];
theKEYINFOptr
=
&
tcKeyReq
->
keyInfo
[
0
];
theATTRINFOptr
=
&
tcKeyReq
->
attrInfo
[
0
];
theATTRINFOptr
=
&
tcKeyReq
->
attrInfo
[
0
];
theReceiver
.
init
(
NdbReceiver
::
NDB_OPERATION
,
this
,
false
);
theReceiver
.
init
(
NdbReceiver
::
NDB_OPERATION
,
this
);
return
0
;
return
0
;
}
}
...
@@ -291,6 +291,7 @@ NdbOperation::release()
...
@@ -291,6 +291,7 @@ NdbOperation::release()
theNdb
->
releaseNdbBlob
(
tSaveBlob
);
theNdb
->
releaseNdbBlob
(
tSaveBlob
);
}
}
theBlobList
=
NULL
;
theBlobList
=
NULL
;
theReceiver
.
release
();
}
}
NdbRecAttr
*
NdbRecAttr
*
...
...
ndb/src/ndbapi/NdbOperationDefine.cpp
View file @
c61d23e0
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include "NdbUtil.hpp"
#include "NdbUtil.hpp"
#include "NdbOut.hpp"
#include "NdbOut.hpp"
#include "NdbImpl.hpp"
#include "NdbImpl.hpp"
#include <NdbScanOperation.hpp>
#include <Ndb
Index
ScanOperation.hpp>
#include "NdbBlob.hpp"
#include "NdbBlob.hpp"
#include <Interpreter.hpp>
#include <Interpreter.hpp>
...
@@ -317,7 +317,7 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue)
...
@@ -317,7 +317,7 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue)
(
!
tAttrInfo
->
m_indexOnly
)
&&
(
!
tAttrInfo
->
m_indexOnly
)
&&
(
theStatus
!=
Init
)){
(
theStatus
!=
Init
)){
if
(
theStatus
==
SetBound
)
{
if
(
theStatus
==
SetBound
)
{
((
NdbScanOperation
*
)
this
)
->
saveBoundATTRINFO
();
((
Ndb
Index
ScanOperation
*
)
this
)
->
saveBoundATTRINFO
();
theStatus
=
GetValue
;
theStatus
=
GetValue
;
}
}
if
(
theStatus
!=
GetValue
)
{
if
(
theStatus
!=
GetValue
)
{
...
...
ndb/src/ndbapi/NdbOperationInt.cpp
View file @
c61d23e0
...
@@ -33,7 +33,7 @@ Adjust: 991029 UABRONM First version.
...
@@ -33,7 +33,7 @@ Adjust: 991029 UABRONM First version.
#include "NdbRecAttr.hpp"
#include "NdbRecAttr.hpp"
#include "NdbUtil.hpp"
#include "NdbUtil.hpp"
#include "Interpreter.hpp"
#include "Interpreter.hpp"
#include <NdbScanOperation.hpp>
#include <Ndb
Index
ScanOperation.hpp>
#ifdef VM_TRACE
#ifdef VM_TRACE
#include <NdbEnv.h>
#include <NdbEnv.h>
...
@@ -217,7 +217,7 @@ NdbOperation::initial_interpreterCheck()
...
@@ -217,7 +217,7 @@ NdbOperation::initial_interpreterCheck()
{
{
if
((
theInterpretIndicator
==
1
))
{
if
((
theInterpretIndicator
==
1
))
{
if
(
theStatus
==
SetBound
)
{
if
(
theStatus
==
SetBound
)
{
((
NdbScanOperation
*
)
this
)
->
saveBoundATTRINFO
();
((
Ndb
Index
ScanOperation
*
)
this
)
->
saveBoundATTRINFO
();
theStatus
=
GetValue
;
theStatus
=
GetValue
;
}
}
if
(
theStatus
==
ExecInterpretedValue
)
{
if
(
theStatus
==
ExecInterpretedValue
)
{
...
...
ndb/src/ndbapi/NdbReceiver.cpp
View file @
c61d23e0
...
@@ -29,10 +29,20 @@ NdbReceiver::NdbReceiver(Ndb *aNdb) :
...
@@ -29,10 +29,20 @@ NdbReceiver::NdbReceiver(Ndb *aNdb) :
m_owner
(
0
)
m_owner
(
0
)
{
{
theCurrentRecAttr
=
theFirstRecAttr
=
0
;
theCurrentRecAttr
=
theFirstRecAttr
=
0
;
m_defined_rows
=
0
;
m_rows
=
new
NdbRecAttr
*
[
0
];
}
NdbReceiver
::~
NdbReceiver
()
{
if
(
m_id
!=
NdbObjectIdMap
::
InvalidId
)
{
m_ndb
->
theNdbObjectIdMap
->
unmap
(
m_id
,
this
);
}
delete
[]
m_rows
;
}
}
void
void
NdbReceiver
::
init
(
ReceiverType
type
,
void
*
owner
,
bool
keyInfo
)
NdbReceiver
::
init
(
ReceiverType
type
,
void
*
owner
)
{
{
theMagicNumber
=
0x11223344
;
theMagicNumber
=
0x11223344
;
m_type
=
type
;
m_type
=
type
;
...
@@ -44,8 +54,6 @@ NdbReceiver::init(ReceiverType type, void* owner, bool keyInfo)
...
@@ -44,8 +54,6 @@ NdbReceiver::init(ReceiverType type, void* owner, bool keyInfo)
theFirstRecAttr
=
NULL
;
theFirstRecAttr
=
NULL
;
theCurrentRecAttr
=
NULL
;
theCurrentRecAttr
=
NULL
;
m_key_info
=
(
keyInfo
?
1
:
0
);
m_defined_rows
=
0
;
}
}
void
void
...
@@ -61,13 +69,6 @@ NdbReceiver::release(){
...
@@ -61,13 +69,6 @@ NdbReceiver::release(){
theCurrentRecAttr
=
NULL
;
theCurrentRecAttr
=
NULL
;
}
}
NdbReceiver
::~
NdbReceiver
()
{
if
(
m_id
!=
NdbObjectIdMap
::
InvalidId
)
{
m_ndb
->
theNdbObjectIdMap
->
unmap
(
m_id
,
this
);
}
}
NdbRecAttr
*
NdbRecAttr
*
NdbReceiver
::
getValue
(
const
NdbColumnImpl
*
tAttrInfo
,
char
*
user_dst_ptr
){
NdbReceiver
::
getValue
(
const
NdbColumnImpl
*
tAttrInfo
,
char
*
user_dst_ptr
){
NdbRecAttr
*
tRecAttr
=
m_ndb
->
getRecAttr
();
NdbRecAttr
*
tRecAttr
=
m_ndb
->
getRecAttr
();
...
@@ -90,8 +91,12 @@ NdbReceiver::getValue(const NdbColumnImpl* tAttrInfo, char * user_dst_ptr){
...
@@ -90,8 +91,12 @@ NdbReceiver::getValue(const NdbColumnImpl* tAttrInfo, char * user_dst_ptr){
void
void
NdbReceiver
::
do_get_value
(
NdbReceiver
*
org
,
Uint32
rows
,
Uint32
key_size
){
NdbReceiver
::
do_get_value
(
NdbReceiver
*
org
,
Uint32
rows
,
Uint32
key_size
){
if
(
rows
>
m_defined_rows
){
delete
[]
m_rows
;
m_defined_rows
=
rows
;
m_defined_rows
=
rows
;
m_rows
=
new
NdbRecAttr
*
[
rows
+
1
];
m_rows
[
rows
]
=
0
;
m_rows
=
new
NdbRecAttr
*
[
rows
+
1
];
}
m_rows
[
rows
]
=
0
;
NdbColumnImpl
key
;
NdbColumnImpl
key
;
if
(
key_size
){
if
(
key_size
){
...
@@ -159,7 +164,6 @@ NdbReceiver::execTRANSID_AI(const Uint32* aDataPtr, Uint32 aLength)
...
@@ -159,7 +164,6 @@ NdbReceiver::execTRANSID_AI(const Uint32* aDataPtr, Uint32 aLength)
{
{
bool
ok
=
true
;
bool
ok
=
true
;
NdbRecAttr
*
currRecAttr
=
theCurrentRecAttr
;
NdbRecAttr
*
currRecAttr
=
theCurrentRecAttr
;
NdbRecAttr
*
prevRecAttr
=
currRecAttr
;
for
(
Uint32
used
=
0
;
used
<
aLength
;
used
++
){
for
(
Uint32
used
=
0
;
used
<
aLength
;
used
++
){
AttributeHeader
ah
(
*
aDataPtr
++
);
AttributeHeader
ah
(
*
aDataPtr
++
);
...
@@ -171,18 +175,21 @@ NdbReceiver::execTRANSID_AI(const Uint32* aDataPtr, Uint32 aLength)
...
@@ -171,18 +175,21 @@ NdbReceiver::execTRANSID_AI(const Uint32* aDataPtr, Uint32 aLength)
*/
*/
while
(
currRecAttr
&&
currRecAttr
->
attrId
()
!=
tAttrId
){
while
(
currRecAttr
&&
currRecAttr
->
attrId
()
!=
tAttrId
){
ok
&=
currRecAttr
->
setNULL
();
ok
&=
currRecAttr
->
setNULL
();
prevRecAttr
=
currRecAttr
;
currRecAttr
=
currRecAttr
->
next
();
currRecAttr
=
currRecAttr
->
next
();
}
}
if
(
ok
&&
currRecAttr
&&
currRecAttr
->
receive_data
(
aDataPtr
,
tAttrSize
)){
if
(
ok
&&
currRecAttr
&&
currRecAttr
->
receive_data
(
aDataPtr
,
tAttrSize
)){
used
+=
tAttrSize
;
used
+=
tAttrSize
;
aDataPtr
+=
tAttrSize
;
aDataPtr
+=
tAttrSize
;
prevRecAttr
=
currRecAttr
;
currRecAttr
=
currRecAttr
->
next
();
currRecAttr
=
currRecAttr
->
next
();
}
else
{
}
else
{
ndbout_c
(
"%p: ok: %d tAttrId: %d currRecAttr: %p"
,
ndbout_c
(
"%p: ok: %d tAttrId: %d currRecAttr: %p"
,
this
,
ok
,
tAttrId
,
currRecAttr
);
this
,
ok
,
tAttrId
,
currRecAttr
);
currRecAttr
=
theCurrentRecAttr
;
while
(
currRecAttr
!=
0
){
ndbout_c
(
"%d "
,
currRecAttr
->
attrId
());
currRecAttr
=
currRecAttr
->
next
();
}
abort
();
abort
();
return
-
1
;
return
-
1
;
}
}
...
...
ndb/src/ndbapi/NdbScanOperation.cpp
View file @
c61d23e0
This diff is collapsed.
Click to expand it.
ndb/test/include/NdbRestarter.hpp
View file @
c61d23e0
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <mgmapi.h>
#include <mgmapi.h>
#include <Vector.hpp>
#include <Vector.hpp>
#include <BaseString.hpp>
class
NdbRestarter
{
class
NdbRestarter
{
public:
public:
...
@@ -85,8 +86,8 @@ protected:
...
@@ -85,8 +86,8 @@ protected:
Vector
<
ndb_mgm_node_state
>
apiNodes
;
Vector
<
ndb_mgm_node_state
>
apiNodes
;
bool
connected
;
bool
connected
;
const
char
*
addr
;
BaseString
addr
;
const
char
*
host
;
BaseString
host
;
int
port
;
int
port
;
NdbMgmHandle
handle
;
NdbMgmHandle
handle
;
ndb_mgm_configuration
*
m_config
;
ndb_mgm_configuration
*
m_config
;
...
...
ndb/test/src/NdbBackup.cpp
View file @
c61d23e0
...
@@ -71,7 +71,7 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
...
@@ -71,7 +71,7 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
*/
*/
ConfigRetriever
cr
;
ConfigRetriever
cr
;
ndb_mgm_configuration
*
p
=
cr
.
getConfig
(
host
,
port
,
0
,
NODE_TYPE_API
);
ndb_mgm_configuration
*
p
=
cr
.
getConfig
(
host
.
c_str
()
,
port
,
0
,
NODE_TYPE_API
);
if
(
p
==
0
){
if
(
p
==
0
){
const
char
*
s
=
cr
.
getErrorString
();
const
char
*
s
=
cr
.
getErrorString
();
if
(
s
==
0
)
if
(
s
==
0
)
...
@@ -156,7 +156,7 @@ NdbBackup::execRestore(bool _restore_data,
...
@@ -156,7 +156,7 @@ NdbBackup::execRestore(bool _restore_data,
snprintf
(
buf
,
255
,
"valgrind --leak-check=yes -v ndb_restore -c
\"
nodeid=%d;host=%s
\"
-n %d -b %d %s %s ."
,
snprintf
(
buf
,
255
,
"valgrind --leak-check=yes -v ndb_restore -c
\"
nodeid=%d;host=%s
\"
-n %d -b %d %s %s ."
,
ownNodeId
,
ownNodeId
,
addr
,
addr
.
c_str
()
,
_node_id
,
_node_id
,
_backup_id
,
_backup_id
,
_restore_data
?
"-r"
:
""
,
_restore_data
?
"-r"
:
""
,
...
...
ndb/test/src/NdbRestarter.cpp
View file @
c61d23e0
...
@@ -33,13 +33,11 @@
...
@@ -33,13 +33,11 @@
NdbRestarter
::
NdbRestarter
(
const
char
*
_addr
)
:
NdbRestarter
::
NdbRestarter
(
const
char
*
_addr
)
:
connected
(
false
),
connected
(
false
),
addr
(
_addr
),
host
(
NULL
),
port
(
-
1
),
port
(
-
1
),
handle
(
NULL
),
handle
(
NULL
),
m_config
(
0
)
m_config
(
0
)
{
{
if
(
addr
==
NULL
){
if
(
_
addr
==
NULL
){
LocalConfig
lcfg
;
LocalConfig
lcfg
;
if
(
!
lcfg
.
init
()){
if
(
!
lcfg
.
init
()){
lcfg
.
printError
();
lcfg
.
printError
();
...
@@ -60,20 +58,20 @@ NdbRestarter::NdbRestarter(const char* _addr):
...
@@ -60,20 +58,20 @@ NdbRestarter::NdbRestarter(const char* _addr):
case
MgmId_TCP
:
case
MgmId_TCP
:
char
buf
[
255
];
char
buf
[
255
];
snprintf
(
buf
,
255
,
"%s:%d"
,
m
->
data
.
tcp
.
remoteHost
,
m
->
data
.
tcp
.
port
);
snprintf
(
buf
,
255
,
"%s:%d"
,
m
->
data
.
tcp
.
remoteHost
,
m
->
data
.
tcp
.
port
);
addr
=
strdup
(
buf
);
addr
.
assign
(
buf
);
host
=
strdup
(
m
->
data
.
tcp
.
remoteHost
);
host
.
assign
(
m
->
data
.
tcp
.
remoteHost
);
port
=
m
->
data
.
tcp
.
port
;
port
=
m
->
data
.
tcp
.
port
;
return
;
break
;
break
;
case
MgmId_File
:
case
MgmId_File
:
break
;
break
;
default:
default:
break
;
break
;
}
}
if
(
addr
!=
NULL
)
break
;
}
}
}
else
{
addr
.
assign
(
_addr
);
}
}
}
}
NdbRestarter
::~
NdbRestarter
(){
NdbRestarter
::~
NdbRestarter
(){
...
@@ -398,10 +396,10 @@ NdbRestarter::connect(){
...
@@ -398,10 +396,10 @@ NdbRestarter::connect(){
g_err
<<
"handle == NULL"
<<
endl
;
g_err
<<
"handle == NULL"
<<
endl
;
return
-
1
;
return
-
1
;
}
}
g_info
<<
"Connecting to mgmsrv at "
<<
addr
<<
endl
;
g_info
<<
"Connecting to mgmsrv at "
<<
addr
.
c_str
()
<<
endl
;
if
(
ndb_mgm_connect
(
handle
,
addr
)
==
-
1
)
{
if
(
ndb_mgm_connect
(
handle
,
addr
.
c_str
()
)
==
-
1
)
{
MGMERR
(
handle
);
MGMERR
(
handle
);
g_err
<<
"Connection to "
<<
addr
<<
" failed"
<<
endl
;
g_err
<<
"Connection to "
<<
addr
.
c_str
()
<<
" failed"
<<
endl
;
return
-
1
;
return
-
1
;
}
}
...
...
sql/ha_ndbcluster.cc
View file @
c61d23e0
...
@@ -867,7 +867,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
...
@@ -867,7 +867,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
if
(
!
(
op
=
trans
->
getNdbIndexScanOperation
(
index_name
,
m_tabname
)))
if
(
!
(
op
=
trans
->
getNdbIndexScanOperation
(
index_name
,
m_tabname
)))
ERR_RETURN
(
trans
->
getNdbError
());
ERR_RETURN
(
trans
->
getNdbError
());
if
(
!
(
cursor
=
op
->
readTuples
(
get_ndb_lock_type
(
m_lock
.
type
),
0
,
if
(
!
(
cursor
=
op
->
readTuples
(
get_ndb_lock_type
(
m_lock
.
type
),
0
,
parallelism
)))
//, sorted))) // Bug
parallelism
,
sorted
)))
ERR_RETURN
(
trans
->
getNdbError
());
ERR_RETURN
(
trans
->
getNdbError
());
m_active_cursor
=
cursor
;
m_active_cursor
=
cursor
;
...
...
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