Commit 821cd17c authored by unknown's avatar unknown

DbtupRoutines.cpp:

  Auto merged


ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  Auto merged
parents 9de8e3b0 563e5c8d
......@@ -684,6 +684,27 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
Uint32 attrDescriptorIndex = regTabPtr->tabDescriptor + (attributeId << ZAD_LOG_SIZE);
Uint32 attrDescriptor = tableDescriptor[attrDescriptorIndex].tabDescr;
Uint32 attributeOffset = tableDescriptor[attrDescriptorIndex + 1].tabDescr;
Uint32 xfrmBuffer[1 + MAX_KEY_SIZE_IN_WORDS * 1]; // strxfrm_multiply == 1
Uint32 charsetFlag = AttributeOffset::getCharsetFlag(attributeOffset);
if (charsetFlag) {
Uint32 csPos = AttributeOffset::getCharsetPos(attributeOffset);
CHARSET_INFO* cs = regTabPtr->charsetArray[csPos];
Uint32 sizeInBytes = AttributeDescriptor::getSizeInBytes(attrDescriptor);
Uint32 sizeInWords = AttributeDescriptor::getSizeInWords(attrDescriptor);
const uchar* srcPtr = (uchar*)&updateBuffer[1];
uchar* dstPtr = (uchar*)&xfrmBuffer[1];
Uint32 n =
(*cs->coll->strnxfrm)(cs, dstPtr, sizeInBytes, srcPtr, sizeInBytes);
// pad with blanks (unlikely) and zeroes to match NDB API behaviour
while (n < sizeInBytes)
dstPtr[n++] = 0x20;
while (n < 4 * sizeInWords)
dstPtr[n++] = 0;
xfrmBuffer[0] = ahIn.m_value;
updateBuffer = xfrmBuffer;
}
ReadFunction f = regTabPtr->readFunctionArray[attributeId];
AttributeHeader::init(&attributeHeader, attributeId, 0);
......@@ -691,7 +712,7 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr)
tMaxRead = MAX_KEY_SIZE_IN_WORDS;
bool tmp = tXfrmFlag;
tXfrmFlag = false;
tXfrmFlag = true;
ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset));
tXfrmFlag = tmp;
ndbrequire(tOutBufIndex == ahOut->getDataSize());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment