mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
fix errors found by Style Check
This commit is contained in:
parent
d2052dd1d4
commit
75768413ad
@ -8,7 +8,6 @@
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -41,23 +40,23 @@ String InterpreterShowTablesQuery::getRewrittenQuery()
|
||||
rewritten_query << "SELECT cluster FROM system.clusters";
|
||||
|
||||
if (!query.like.empty())
|
||||
{
|
||||
rewritten_query << " WHERE cluster " << (query.not_like ? "NOT " : "") << "LIKE " << std::quoted(query.like, '\'');
|
||||
}
|
||||
{
|
||||
rewritten_query << " WHERE cluster " << (query.not_like ? "NOT " : "") << "LIKE " << std::quoted(query.like, '\'');
|
||||
}
|
||||
|
||||
if (query.limit_length)
|
||||
if (query.limit_length)
|
||||
rewritten_query << " LIMIT " << query.limit_length;
|
||||
|
||||
return rewritten_query.str();
|
||||
return rewritten_query.str();
|
||||
}
|
||||
else if (query.cluster)
|
||||
{
|
||||
std::stringstream rewritten_query;
|
||||
rewritten_query << "SELECT * FROM system.clusters";
|
||||
rewritten_query << "SELECT * FROM system.clusters";
|
||||
|
||||
rewritten_query << " WHERE cluster = " << std::quoted(query.cluster_str, '\'');
|
||||
|
||||
return rewritten_query.str();
|
||||
return rewritten_query.str();
|
||||
}
|
||||
|
||||
if (query.temporary && !query.from.empty())
|
||||
|
@ -35,7 +35,7 @@ void ASTShowTablesQuery::formatQueryImpl(const FormatSettings & settings, Format
|
||||
else if (cluster)
|
||||
{
|
||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << "SHOW CLUSTER" << (settings.hilite ? hilite_none : "");
|
||||
settings.ostr << " " << backQuoteIfNeed(cluster_str);
|
||||
settings.ostr << " " << backQuoteIfNeed(cluster_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <Parsers/parseIdentifierOrStringLiteral.h>
|
||||
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <common/logger_useful.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
|
11
tests/queries/0_stateless/01293_show_clusters.reference
Normal file
11
tests/queries/0_stateless/01293_show_clusters.reference
Normal file
@ -0,0 +1,11 @@
|
||||
test_cluster_two_shards
|
||||
test_cluster_two_shards
|
||||
test_cluster_two_shards_localhost
|
||||
test_cluster_two_shards_localhost
|
||||
test_shard_localhost
|
||||
test_shard_localhost[1]
|
||||
test_shard_localhost_secure
|
||||
test_unavailable_shard
|
||||
test_unavailable_shard
|
||||
test_cluster_two_shards
|
||||
test_shard_localhost 1 1 1 localhost ::1 9000 1 default 0 0
|
Loading…
Reference in New Issue
Block a user