1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +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,7 +526,8 @@ 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();
@@ -534,8 +535,11 @@ int main(int argc, char* argv[])
{
if (strBlockPct[len-1] == 'g')
BRPBlocksPct *= 1024;
BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB
cacheInMB = true;
}
}
if (cacheInMB)
BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB
else
BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192;
#endif