fix errors found by Style Check

This commit is contained in:
hexiaoting 2020-06-08 10:23:57 +08:00
parent d2052dd1d4
commit 75768413ad
5 changed files with 19 additions and 10 deletions

View File

@ -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())

View File

@ -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
{

View File

@ -9,7 +9,6 @@
#include <Parsers/parseIdentifierOrStringLiteral.h>
#include <Common/typeid_cast.h>
#include <common/logger_useful.h>
namespace DB

View 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