This commit is contained in:
Alexey Milovidov 2018-08-25 19:05:01 +03:00
parent 24083e3088
commit 417cc1ab4d
2 changed files with 7 additions and 6 deletions

View File

@ -1538,7 +1538,7 @@ public:
("query,q", po::value<std::string>(), "query")
("database,d", po::value<std::string>(), "database")
("pager", po::value<std::string>(), "pager")
("disable_suggestion,A", "Disable loading suggestion data. Shorthand option -A is for those who get used to mysql client.")
("disable_suggestion,A", "Disable loading suggestion data. Note that suggestion data is loaded asynchronously through a second connection to ClickHouse server. Shorthand option -A is for those who get used to mysql client.")
("suggestion_limit", po::value<int>()->default_value(10000),
"Suggestion limit for how many databases, tables and columns to fetch.")
("multiline,m", "multiline")

View File

@ -182,15 +182,16 @@ public:
connection_parameters.security);
loadImpl(connection, suggestion_limit);
std::sort(words.begin(), words.end(), [](const auto & a, const auto & b) { return Poco::icompare(a, b) < 0; } );
ready = true;
}
catch (...)
{
std::cerr << "Cannot load data for command line suggestions: " << getCurrentExceptionMessage(false, false) << "\n";
std::cerr << "Cannot load data for command line suggestions: " << getCurrentExceptionMessage(false) << "\n";
}
/// Note that keyword suggestions are available even if we cannot load data from server.
std::sort(words.begin(), words.end(), [](const auto & a, const auto & b) { return Poco::icompare(a, b) < 0; } );
ready = true;
});
}