Merge branch '2.3' into develop
This commit is contained in:
@ -1458,9 +1458,16 @@ std::string get_canonical(GWBUF* querybuf)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (is_space(*it) && (i == 0 || is_space(rval[i - 1])))
|
||||
else if (is_space(*it))
|
||||
{
|
||||
// Repeating space, skip it
|
||||
if (i == 0 || is_space(rval[i - 1]))
|
||||
{
|
||||
// Leading or repeating whitespace, skip it
|
||||
}
|
||||
else
|
||||
{
|
||||
rval[i++] = ' ';
|
||||
}
|
||||
}
|
||||
else if (*it == '/' && is_next(it, buf.end(), "/*"))
|
||||
{
|
||||
@ -1564,6 +1571,12 @@ std::string get_canonical(GWBUF* querybuf)
|
||||
mxb_assert(it != buf.end());
|
||||
}
|
||||
|
||||
// Remove trailing whitespace
|
||||
while (i > 0 && is_space(rval[i - 1]))
|
||||
{
|
||||
--i;
|
||||
}
|
||||
|
||||
// Shrink the buffer so that the internal bookkeeping of std::string remains up to date
|
||||
rval.resize(i);
|
||||
|
||||
|
Reference in New Issue
Block a user