mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
clickhouse-client: add echoOn/echoOff hints
This commit is contained in:
parent
1c595c127f
commit
69cf881947
@ -1110,8 +1110,7 @@ private:
|
||||
|
||||
// Echo all queries if asked; makes for a more readable reference
|
||||
// file.
|
||||
if (test_hint.echoQueries())
|
||||
echo_queries_ = true;
|
||||
echo_queries_ = test_hint.echoQueries().value_or(echo_queries_);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -59,13 +59,13 @@ public:
|
||||
|
||||
int serverError() const { return server_error; }
|
||||
int clientError() const { return client_error; }
|
||||
bool echoQueries() const { return echo; }
|
||||
std::optional<bool> echoQueries() const { return echo; }
|
||||
|
||||
private:
|
||||
const String & query;
|
||||
int server_error = 0;
|
||||
int client_error = 0;
|
||||
bool echo = false;
|
||||
std::optional<bool> echo;
|
||||
|
||||
void parse(const String & hint, bool is_leading_hint)
|
||||
{
|
||||
@ -88,7 +88,11 @@ private:
|
||||
}
|
||||
|
||||
if (item == "echo")
|
||||
echo = true;
|
||||
echo.emplace(true);
|
||||
if (item == "echoOn")
|
||||
echo.emplace(true);
|
||||
if (item == "echoOff")
|
||||
echo.emplace(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,3 +2,7 @@
|
||||
-- { echo }
|
||||
select 1;
|
||||
1
|
||||
2
|
||||
-- { echoOn }
|
||||
select 2;
|
||||
2
|
||||
|
@ -1,3 +1,7 @@
|
||||
select 1;
|
||||
-- { echo }
|
||||
select 1;
|
||||
-- { echoOff }
|
||||
select 2;
|
||||
-- { echoOn }
|
||||
select 2;
|
||||
|
Loading…
Reference in New Issue
Block a user