MXS-1929: Fix handling of version_string

The parameter was set to 5.5.5- if it wasn't defined.
This commit is contained in:
Markus Mäkelä 2018-08-03 13:57:39 +03:00
parent 356c607907
commit 0777de348b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -136,9 +136,12 @@ static std::string get_version_string(MXS_CONFIG_PARAMETER* params)
std::string version_string = config_get_string(params, CN_VERSION_STRING);
if (version_string.empty() && config_get_global_options()->version_string)
if (version_string.empty())
{
version_string = config_get_global_options()->version_string;
if (config_get_global_options()->version_string)
{
version_string = config_get_global_options()->version_string;
}
}
else if (version_string[0] != '5')
{
@ -1813,12 +1816,12 @@ bool Service::dump_config(const char *filename) const
if (!m_version_string.empty())
{
dprintf(file, "%s=%s\n", CN_VERSION_STRING, version_string);
dprintf(file, "%s=%s\n", CN_VERSION_STRING, m_version_string.c_str());
}
if (!m_weightby.empty())
{
dprintf(file, "%s=%s\n", CN_WEIGHTBY, weightby);
dprintf(file, "%s=%s\n", CN_WEIGHTBY, m_weightby.c_str());
}
if (dbref)