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-858 Preserve NULs in StringStore deserialize
The fix for MCOL-838 broke VARBINARY as it truncated on the first NUL on StringStore deserialize. This fix uses append() to force a copy instead whilst preserving length. This fixes test012
This commit is contained in:
@ -136,7 +136,10 @@ void StringStore::deserialize(ByteStream &bs)
|
|||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
//cout << "deserializing " << size << " bytes\n";
|
//cout << "deserializing " << size << " bytes\n";
|
||||||
bs >> buf;
|
bs >> buf;
|
||||||
shared_ptr<std::string> newString(new std::string(buf.c_str()));
|
// We do this to avoid pre-C++11 zero copy hell but need to
|
||||||
|
// preserve all data including NULs so using c_str() is out.
|
||||||
|
shared_ptr<std::string> newString(new std::string());
|
||||||
|
newString->append(buf);
|
||||||
mem.push_back(newString);
|
mem.push_back(newString);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user