You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-670 Fix UPDATE with BLOB/TEXT
* Don't cache > 8000 bytes during update * Fix PrimProc case where token is used more than once
This commit is contained in:
@ -520,6 +520,7 @@ void DictStep::_projectToRG(RowGroup &rg, uint32_t col)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint32_t firstTmpResultCounter = tmpResultCounter;
|
uint32_t firstTmpResultCounter = tmpResultCounter;
|
||||||
|
std::map<uint32_t, string *> result;
|
||||||
for (i = curResultCounter; i < firstTmpResultCounter; i++) {
|
for (i = curResultCounter; i < firstTmpResultCounter; i++) {
|
||||||
rg.getRow(newRidList[i].pos, &r);
|
rg.getRow(newRidList[i].pos, &r);
|
||||||
// If this is a multi-block blob, get all the blocks
|
// If this is a multi-block blob, get all the blocks
|
||||||
@ -530,7 +531,14 @@ void DictStep::_projectToRG(RowGroup &rg, uint32_t col)
|
|||||||
{
|
{
|
||||||
StringPtr multi_part[1];
|
StringPtr multi_part[1];
|
||||||
uint16_t old_offset = primMsg->tokens[0].offset;
|
uint16_t old_offset = primMsg->tokens[0].offset;
|
||||||
string *result = new string((char*)tmpStrings[i].ptr, tmpStrings[i].len);
|
if (result.empty())
|
||||||
|
{
|
||||||
|
// String copy here because tmpStrings pointers will be blown away below
|
||||||
|
for (uint32_t x = curResultCounter; x < firstTmpResultCounter; x++)
|
||||||
|
{
|
||||||
|
result[x] = new string((char*)tmpStrings[x].ptr, tmpStrings[x].len);
|
||||||
|
}
|
||||||
|
}
|
||||||
uint64_t origin_lbid = primMsg->LBID;
|
uint64_t origin_lbid = primMsg->LBID;
|
||||||
uint32_t lbid_count = newRidList[i].token >> 46;
|
uint32_t lbid_count = newRidList[i].token >> 46;
|
||||||
primMsg->tokens[0].offset = 1; // first offset of a sig
|
primMsg->tokens[0].offset = 1; // first offset of a sig
|
||||||
@ -542,12 +550,13 @@ void DictStep::_projectToRG(RowGroup &rg, uint32_t col)
|
|||||||
primMsg->tokens[0].LBID = origin_lbid + j;
|
primMsg->tokens[0].LBID = origin_lbid + j;
|
||||||
issuePrimitive(false);
|
issuePrimitive(false);
|
||||||
projectResult(multi_part);
|
projectResult(multi_part);
|
||||||
result->append((char*)multi_part[0].ptr, multi_part[0].len);
|
result[i]->append((char*)multi_part[0].ptr, multi_part[0].len);
|
||||||
}
|
}
|
||||||
primMsg->tokens[0].offset = old_offset;
|
primMsg->tokens[0].offset = old_offset;
|
||||||
|
primMsg->LBID = origin_lbid;
|
||||||
tmpResultCounter = firstTmpResultCounter;
|
tmpResultCounter = firstTmpResultCounter;
|
||||||
r.setVarBinaryField((unsigned char*)result->c_str(), result->length(), col);
|
r.setVarBinaryField((unsigned char*)result[i]->c_str(), result[i]->length(), col);
|
||||||
delete result;
|
delete result[i];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1374,7 +1374,9 @@ int Dctnry::updateDctnry(unsigned char* sigValue, int& sigSize,
|
|||||||
sig.size = sigSize;
|
sig.size = sigSize;
|
||||||
|
|
||||||
// Look for string in cache
|
// Look for string in cache
|
||||||
if (m_arraySize < MAX_STRING_CACHE_SIZE)
|
// As long as the string <= 8000 bytes
|
||||||
|
if ((m_arraySize < MAX_STRING_CACHE_SIZE) &&
|
||||||
|
(sigSize <= MAX_SIGNATURE_SIZE))
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
found = getTokenFromArray(sig);
|
found = getTokenFromArray(sig);
|
||||||
@ -1389,7 +1391,9 @@ int Dctnry::updateDctnry(unsigned char* sigValue, int& sigSize,
|
|||||||
rc = insertDctnry(sigSize, sigValue, token);
|
rc = insertDctnry(sigSize, sigValue, token);
|
||||||
|
|
||||||
//Add the new signature and token into cache
|
//Add the new signature and token into cache
|
||||||
if (m_arraySize < MAX_STRING_CACHE_SIZE)
|
//As long as the string is <= 8000 bytes
|
||||||
|
if ((m_arraySize < MAX_STRING_CACHE_SIZE) &&
|
||||||
|
(sigSize <= MAX_SIGNATURE_SIZE))
|
||||||
{
|
{
|
||||||
Signature sig;
|
Signature sig;
|
||||||
sig.size = sigSize;
|
sig.size = sigSize;
|
||||||
|
Reference in New Issue
Block a user