MXS-2943: Add ColumnStore-as-a-plugin support

The version of the ColumnStore that is distributed as a plugin with
MariaDB is now correctly detected.
This commit is contained in:
Markus Mäkelä 2020-03-25 15:33:15 +02:00
parent af593262f9
commit 557a108940
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -63,17 +63,31 @@ int get_cs_version(MonitorServer* srv)
std::string result = do_query(srv, "SELECT @@version_comment");
auto pos = result.find(prefix);
auto to_version = [](std::string str) {
std::istringstream os(str);
int major = 0, minor = 0, patch = 0;
char dot;
os >> major;
os >> dot;
os >> minor;
os >> dot;
os >> patch;
return major * 10000 + minor * 100 + patch;
};
if (pos != std::string::npos)
{
std::istringstream os(result.substr(pos + prefix.length()));
int major = 0, minor = 0, patch = 0;
char dot;
os >> major;
os >> dot;
os >> minor;
os >> dot;
os >> patch;
rval = major * 10000 + minor * 100 + patch;
rval = to_version(result.substr(pos + prefix.length()));
}
else
{
auto cs_version = do_query(srv, "SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_STATUS "
"WHERE VARIABLE_NAME = 'Columnstore_version'");
if (!cs_version.empty())
{
rval = to_version(result.substr(pos + prefix.length()));
}
}
return rval;