Merge pull request #10627 from ClickHouse/more-check-server-version

Check if client is newer than server
This commit is contained in:
alexey-milovidov 2020-05-02 21:58:13 +03:00 committed by GitHub
commit 8c45fd6a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -620,13 +620,21 @@ private:
<< " revision " << server_revision
<< "." << std::endl << std::endl;
if (std::make_tuple(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
< std::make_tuple(server_version_major, server_version_minor, server_version_patch))
auto client_version_tuple = std::make_tuple(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
auto server_version_tuple = std::make_tuple(server_version_major, server_version_minor, server_version_patch);
if (client_version_tuple < server_version_tuple)
{
std::cout << "ClickHouse client version is older than ClickHouse server. "
<< "It may lack support for new features."
<< std::endl << std::endl;
}
else if (client_version_tuple > server_version_tuple)
{
std::cout << "ClickHouse server version is older than ClickHouse client. "
<< "It may indicate that the server is out of date and can be upgraded."
<< std::endl << std::endl;
}
}
}