1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-1847. Made the field parsing a little more paranoid.

This commit is contained in:
Patrick LeBlanc
2018-11-20 13:00:36 -06:00
parent 9363504dd4
commit de9dc56f21

View File

@ -526,16 +526,20 @@ int main(int argc, char* argv[])
}
#else
if (temp > 0)
bool cacheInMB = false;
if (temp > 0) {
BRPBlocksPct = temp;
/* MCOL-1847. Did the user specify this in MB or GB? */
int len = strBlockPct.length();
if (strBlockPct[len-1] == 'g' || strBlockPct[len-1] == 'm')
{
if (strBlockPct[len-1] == 'g')
BRPBlocksPct *= 1024;
BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB
/* MCOL-1847. Did the user specify this in MB or GB? */
int len = strBlockPct.length();
if (strBlockPct[len-1] == 'g' || strBlockPct[len-1] == 'm')
{
if (strBlockPct[len-1] == 'g')
BRPBlocksPct *= 1024;
cacheInMB = true;
}
}
if (cacheInMB)
BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB
else
BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192;
#endif