1
0
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:
Andrew Hutchings
2017-04-19 22:45:23 +01:00
parent dce4b11437
commit 785e6c91bd
2 changed files with 19 additions and 6 deletions

View File

@ -520,6 +520,7 @@ void DictStep::_projectToRG(RowGroup &rg, uint32_t col)
}
else {
uint32_t firstTmpResultCounter = tmpResultCounter;
std::map<uint32_t, string *> result;
for (i = curResultCounter; i < firstTmpResultCounter; i++) {
rg.getRow(newRidList[i].pos, &r);
// 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];
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;
uint32_t lbid_count = newRidList[i].token >> 46;
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;
issuePrimitive(false);
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->LBID = origin_lbid;
tmpResultCounter = firstTmpResultCounter;
r.setVarBinaryField((unsigned char*)result->c_str(), result->length(), col);
delete result;
r.setVarBinaryField((unsigned char*)result[i]->c_str(), result[i]->length(), col);
delete result[i];
}
else
{