MXS-2315: Use BRE with std::regex
The default ECMAScript syntax appears to be broken on CentOS 7 which effectively prevents its use in most cases. A more reliable alternative would be to use the bundled PCRE2 library but the basic POSIX regular expressions seem to work.
This commit is contained in:
parent
01bb267aa0
commit
5e19d1d044
@ -56,8 +56,10 @@ static std::string do_query(MXS_MONITORED_SERVER* srv, const char* query)
|
||||
// Returns a numeric version similar to mysql_get_server_version
|
||||
int get_cs_version(MXS_MONITORED_SERVER* srv)
|
||||
{
|
||||
// GCC 4.8 appears to have a broken std::regex_constants::ECMAScript that doesn't support brackets
|
||||
std::regex re("Columnstore \\([0-9]*\\)[.]\\([0-9]*\\)[.]\\([0-9]*\\)-[0-9]*",
|
||||
std::regex_constants::basic);
|
||||
std::string result = do_query(srv, "SELECT @@version_comment");
|
||||
std::regex re("Columnstore ([0-9]*)[.]([0-9]*)[.]([0-9]*)-[0-9]*");
|
||||
std::smatch match;
|
||||
int rval = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user