mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Add ignoring exception for system.warnings, while connecting
This commit is contained in:
parent
d377c069cb
commit
ed9d3be1cc
@ -488,6 +488,7 @@ private:
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Make query to get all server warnings
|
||||
void loadWarningMessages(std::vector<String>& messages)
|
||||
{
|
||||
connection->sendQuery(connection_parameters.timeouts, "SELECT message FROM system.warnings", "" /* query_id */, QueryProcessingStage::Complete);
|
||||
@ -612,14 +613,21 @@ private:
|
||||
/// Load Warnings at the begining of connection
|
||||
{
|
||||
std::vector<String> messages;
|
||||
loadWarningMessages(messages);
|
||||
if (!messages.empty())
|
||||
try
|
||||
{
|
||||
std::cout << "Warnings:" << std::endl;
|
||||
for (const auto & message : messages)
|
||||
std::cout << " * " << message << std::endl;
|
||||
loadWarningMessages(messages);
|
||||
if (!messages.empty())
|
||||
{
|
||||
std::cout << "Warnings:" << std::endl;
|
||||
for (const auto & message : messages)
|
||||
std::cout << " * " << message << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
/// Ignore exception
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
/// Load command history if present.
|
||||
|
Loading…
Reference in New Issue
Block a user