1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #154 from mariadb-corporation/MCOL-670

MCOL-670 Fix UPDATE with BLOB/TEXT
This commit is contained in:
dhall-InfiniDB
2017-04-19 16:56:06 -05:00
committed by GitHub
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
{

View File

@ -1374,7 +1374,9 @@ int Dctnry::updateDctnry(unsigned char* sigValue, int& sigSize,
sig.size = sigSize;
// 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;
found = getTokenFromArray(sig);
@ -1389,7 +1391,9 @@ int Dctnry::updateDctnry(unsigned char* sigValue, int& sigSize,
rc = insertDctnry(sigSize, sigValue, token);
//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;
sig.size = sigSize;