1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-1826 Fix race in FLOAT/DOUBLE to string

In the FLOAT/DOUBLE to string conversions a class global string was used
to store the result. Unfortunately it is possible for an instance of
this class to be used by multiple threads of PrimProc simultaneously.
This would cause a race and data corruption or more likely a crash.

This fix passes a string object from the caller to use instead.
This commit is contained in:
Andrew Hutchings
2018-10-22 17:56:49 +01:00
parent 8eeb58b819
commit 65287a0613
7 changed files with 28 additions and 16 deletions

View File

@ -86,12 +86,14 @@ std::string Func_insert::getStrVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType&)
{
const string& tstr = stringValue(fp[0], row, isNull);
{
string tstr;
stringValue(fp[0], row, isNull, tstr);
if (isNull)
return "";
const string& tnewstr = stringValue(fp[3], row, isNull);
string tnewstr;
stringValue(fp[3], row, isNull, tnewstr);
if (isNull)
return "";