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
e690212e
Commit
e690212e
authored
Nov 01, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed copy paste index code
improved handling of bits in last word
parent
5374ac8f
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
356 deletions
+15
-356
ndb/include/ndbapi/NdbIndexOperation.hpp
ndb/include/ndbapi/NdbIndexOperation.hpp
+0
-12
ndb/include/ndbapi/NdbOperation.hpp
ndb/include/ndbapi/NdbOperation.hpp
+6
-7
ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
+0
-2
ndb/src/ndbapi/NdbIndexOperation.cpp
ndb/src/ndbapi/NdbIndexOperation.cpp
+2
-294
ndb/src/ndbapi/NdbOperationSearch.cpp
ndb/src/ndbapi/NdbOperationSearch.cpp
+7
-41
No files found.
ndb/include/ndbapi/NdbIndexOperation.hpp
View file @
e690212e
...
...
@@ -173,29 +173,17 @@ private:
NdbIndexOperation
(
Ndb
*
aNdb
);
~
NdbIndexOperation
();
void
closeScan
();
int
receiveTCINDXREF
(
NdbApiSignal
*
aSignal
);
// Overloaded method from NdbOperation
void
setLastFlag
(
NdbApiSignal
*
signal
,
Uint32
lastFlag
);
// Overloaded methods from NdbCursorOperation
int
executeCursor
(
int
ProcessorId
);
// Overloaded methods from NdbCursorOperation
int
indxInit
(
const
class
NdbIndexImpl
*
anIndex
,
const
class
NdbTableImpl
*
aTable
,
NdbConnection
*
myConnection
);
int
equal_impl
(
const
class
NdbColumnImpl
*
,
const
char
*
aValue
,
Uint32
len
);
int
prepareSend
(
Uint32
TC_ConnectPtr
,
Uint64
TransactionId
);
// Private attributes
const
NdbIndexImpl
*
m_theIndex
;
Uint32
m_theIndexDefined
[
NDB_MAX_ATTRIBUTES_IN_INDEX
][
3
];
Uint32
m_theIndexLen
;
// Length of the index in words
Uint32
m_theNoOfIndexDefined
;
// The number of index attributes
};
#endif
ndb/include/ndbapi/NdbOperation.hpp
View file @
e690212e
...
...
@@ -821,8 +821,7 @@ protected:
int
insertKEYINFO
(
const
char
*
aValue
,
Uint32
aStartPosition
,
Uint32
aKeyLenInByte
,
Uint32
anAttrBitsInLastWord
);
Uint32
aKeyLenInByte
);
virtual
void
setErrorCode
(
int
aErrorCode
);
virtual
void
setErrorCodeAbort
(
int
aErrorCode
);
...
...
ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
View file @
e690212e
...
...
@@ -370,7 +370,6 @@ operator<<(NdbOut& out, const Dbtux::Index& index)
{
out
<<
"[Index "
<<
hex
<<
&
index
;
out
<<
" [tableId "
<<
dec
<<
index
.
m_tableId
<<
"]"
;
out
<<
" [fragOff "
<<
dec
<<
index
.
m_fragOff
<<
"]"
;
out
<<
" [numFrags "
<<
dec
<<
index
.
m_numFrags
<<
"]"
;
for
(
unsigned
i
=
0
;
i
<
index
.
m_numFrags
;
i
++
)
{
out
<<
" [frag "
<<
dec
<<
i
<<
" "
;
...
...
@@ -393,7 +392,6 @@ operator<<(NdbOut& out, const Dbtux::Frag& frag)
out
<<
"[Frag "
<<
hex
<<
&
frag
;
out
<<
" [tableId "
<<
dec
<<
frag
.
m_tableId
<<
"]"
;
out
<<
" [indexId "
<<
dec
<<
frag
.
m_indexId
<<
"]"
;
out
<<
" [fragOff "
<<
dec
<<
frag
.
m_fragOff
<<
"]"
;
out
<<
" [fragId "
<<
dec
<<
frag
.
m_fragId
<<
"]"
;
out
<<
" [descPage "
<<
hex
<<
frag
.
m_descPage
<<
"]"
;
out
<<
" [descOff "
<<
dec
<<
frag
.
m_descOff
<<
"]"
;
...
...
ndb/src/ndbapi/NdbIndexOperation.cpp
View file @
e690212e
This diff is collapsed.
Click to expand it.
ndb/src/ndbapi/NdbOperationSearch.cpp
View file @
e690212e
...
...
@@ -129,12 +129,9 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
const
int
slack
=
sizeInBytes
&
3
;
if
((((
UintPtr
)
aValue
&
3
)
!=
0
)
||
(
slack
!=
0
)){
tempData
[
attributeSize
>>
2
]
=
0
;
memcpy
(
&
tempData
[
0
],
aValue
,
attributeSize
);
aValue
=
(
char
*
)
&
tempData
[
0
];
if
(
slack
!=
0
)
{
char
*
tmp
=
(
char
*
)
&
tempData
[
0
];
memset
(
&
tmp
[
attributeSize
],
0
,
(
4
-
slack
));
}
//if
}
//if
}
const
char
*
aValueToWrite
=
aValue
;
...
...
@@ -152,9 +149,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
aValue
=
(
char
*
)
xfrmData
;
}
Uint32
bitsInLastWord
=
8
*
(
sizeInBytes
&
3
)
;
Uint32
totalSizeInWords
=
(
sizeInBytes
+
3
)
/
4
;
// Inc. bits in last word
Uint32
sizeInWords
=
sizeInBytes
/
4
;
// Exc. bits in last word
if
(
true
){
//tArraySize != 0) {
Uint32
tTupKeyLen
=
theTupKeyLen
;
...
...
@@ -195,8 +190,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
if
((
tDistrKey
!=
1
))
{
;
}
else
{
/** TODO DISTKEY */
theDistrKeyIndicator
=
1
;
//set_distribution_key(aValue, totalSizeInWords);
}
/******************************************************************************
* If the operation is an insert request and the attribute is stored then
...
...
@@ -216,21 +210,13 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
const
Uint32
sz
=
totalSizeInWords
;
AttributeHeader
::
init
(
&
ahValue
,
tAttrId
,
sz
);
insertATTRINFO
(
ahValue
);
insertATTRINFOloop
((
Uint32
*
)
aValueToWrite
,
sizeInWords
);
if
(
bitsInLastWord
!=
0
)
{
tData
=
*
(
Uint32
*
)(
aValueToWrite
+
(
sizeInWords
<<
2
));
tData
=
convertEndian
(
tData
);
tData
=
tData
&
((
1
<<
bitsInLastWord
)
-
1
);
tData
=
convertEndian
(
tData
);
insertATTRINFO
(
tData
);
}
//if
insertATTRINFOloop
((
Uint32
*
)
aValueToWrite
,
sz
);
}
//if
/***************************************************************************
* Store the Key information in the TCKEYREQ and KEYINFO signals.
**************************************************************************/
if
(
insertKEYINFO
(
aValue
,
tKeyInfoPosition
,
totalSizeInWords
,
bitsInLastWord
)
!=
-
1
)
{
if
(
insertKEYINFO
(
aValue
,
tKeyInfoPosition
,
totalSizeInWords
)
!=
-
1
)
{
/*************************************************************************
* Add one to number of tuple key attributes defined.
* If all have been defined then set the operation state to indicate
...
...
@@ -239,7 +225,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
************************************************************************/
Uint32
tNoKeysDef
=
theNoOfTupKeyDefined
;
Uint32
tErrorLine
=
theErrorLine
;
int
tNoTableKeys
=
m_
current
Table
->
m_noOfKeys
;
int
tNoTableKeys
=
m_
access
Table
->
m_noOfKeys
;
unsigned
char
tInterpretInd
=
theInterpretIndicator
;
tNoKeysDef
++
;
theNoOfTupKeyDefined
=
tNoKeysDef
;
...
...
@@ -365,8 +351,7 @@ NdbOperation::setTupleId()
int
NdbOperation
::
insertKEYINFO
(
const
char
*
aValue
,
register
Uint32
aStartPosition
,
register
Uint32
anAttrSizeInWords
,
register
Uint32
anAttrBitsInLastWord
)
register
Uint32
anAttrSizeInWords
)
{
NdbApiSignal
*
tSignal
;
NdbApiSignal
*
tCurrentKEYINFO
;
...
...
@@ -386,7 +371,7 @@ NdbOperation::insertKEYINFO(const char* aValue,
*****************************************************************************/
tEndPos
=
aStartPosition
+
anAttrSizeInWords
-
1
;
if
((
tEndPos
<
9
)
&&
(
anAttrBitsInLastWord
==
0
)
)
{
if
((
tEndPos
<
9
))
{
register
Uint32
tkeyData
=
*
(
Uint32
*
)
aValue
;
//TcKeyReq* tcKeyReq = CAST_PTR(TcKeyReq, tTCREQ->getDataPtrSend());
register
Uint32
*
tDataPtr
=
(
Uint32
*
)
aValue
;
...
...
@@ -496,25 +481,6 @@ NdbOperation::insertKEYINFO(const char* aValue,
}
while
(
1
);
LastWordLabel:
/*****************************************************************************
* There could be a last word that only contains partial data. This word*
* will contain zeroes in the rest of the bits since the index expects *
* a certain number of words and do not care for parts of words. *
*****************************************************************************/
if
(
anAttrBitsInLastWord
!=
0
)
{
tData
=
*
(
Uint32
*
)(
aValue
+
(
anAttrSizeInWords
-
1
)
*
4
);
tData
=
convertEndian
(
tData
);
tData
=
tData
&
((
1
<<
anAttrBitsInLastWord
)
-
1
);
tData
=
convertEndian
(
tData
);
if
(
tPosition
>
8
)
{
tCurrentKEYINFO
->
setData
(
tData
,
signalCounter
);
signalCounter
++
;
}
else
{
theTCREQ
->
setData
(
tData
,
(
12
+
tPosition
));
}
//if
}
//if
return
0
;
}
...
...
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