1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

feat(rbo): configfile and pron params can be used to turn off rbo rules selectively

This commit is contained in:
Leonid Fedorov
2025-08-20 11:25:03 +00:00
committed by Leonid Fedorov
parent 9cde37345e
commit 2c5043f2fe
5 changed files with 57 additions and 5 deletions

View File

@@ -552,4 +552,26 @@ std::string Config::getTempFileDir(Config::TempDirPurpose what)
return {};
}
bool parseBooleanParamValue(const std::string& s)
{
if (s.empty())
throw runtime_error("Empty value cannot be parsed");
std::string v;
v.reserve(s.size());
for (char c : s)
v.push_back(static_cast<char>(::tolower(static_cast<unsigned char>(c))));
if (v == "Y" || v == "y" || v == "1" || v == "true" || v == "on" || v == "yes" || v == "enable" ||
v == "enabled")
{
return true;
}
if (v == "N" || v == "n" || v == "0" || v == "false" || v == "off" || v == "no" || v == "disable" ||
v == "disabled")
{
return false;
}
throw runtime_error("Value " + s + " cannot be parsed as boolean");
}
} // namespace config