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:
@ -63,17 +63,31 @@ int get_cs_version(MonitorServer* srv)
|
|||||||
std::string result = do_query(srv, "SELECT @@version_comment");
|
std::string result = do_query(srv, "SELECT @@version_comment");
|
||||||
auto pos = result.find(prefix);
|
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)
|
if (pos != std::string::npos)
|
||||||
{
|
{
|
||||||
std::istringstream os(result.substr(pos + prefix.length()));
|
rval = to_version(result.substr(pos + prefix.length()));
|
||||||
int major = 0, minor = 0, patch = 0;
|
}
|
||||||
char dot;
|
else
|
||||||
os >> major;
|
{
|
||||||
os >> dot;
|
auto cs_version = do_query(srv, "SELECT VARIABLE_VALUE FROM information_schema.GLOBAL_STATUS "
|
||||||
os >> minor;
|
"WHERE VARIABLE_NAME = 'Columnstore_version'");
|
||||||
os >> dot;
|
|
||||||
os >> patch;
|
if (!cs_version.empty())
|
||||||
rval = major * 10000 + minor * 100 + patch;
|
{
|
||||||
|
rval = to_version(result.substr(pos + prefix.length()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
|
|||||||
Reference in New Issue
Block a user