MXS-2232: Fix version string prefix check

The prefix was always added even when the original version would've been
acceptable. For example, a version string of 5.5.40 would get converted to
5.5.5-5.5.40 which is quite confusing for older client applications.
This commit is contained in:
Markus Mäkelä 2018-12-31 14:35:55 +02:00
parent 04dd05b262
commit 8f0e4a3034
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -220,10 +220,9 @@ std::string get_version_string(SERVICE* service)
}
// Older applications don't understand versions other than 5 and cause strange problems
const char prefix[] = "5.5.5-";
if (strncmp(rval.c_str(), prefix, sizeof(prefix) - 1) != 0)
if (rval[0] != '5')
{
const char prefix[] = "5.5.5-";
rval = prefix + rval;
}