1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +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:
Andrew Hutchings
2017-08-07 19:56:52 +01:00
parent 0406a52e71
commit 16ecfb9d6c

View File

@ -136,7 +136,10 @@ void StringStore::deserialize(ByteStream &bs)
for (i = 0; i < count; i++) {
//cout << "deserializing " << size << " bytes\n";
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);
}
return;