Merge pull request #6706 from yandex/client-do-not-substitute-inside-query

Disable Poco::AbstractConfiguration substitutions in query in clickhouse-client
This commit is contained in:
alexey-milovidov 2019-08-28 21:04:56 +03:00 committed by GitHub
commit c72dffc591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -672,7 +672,7 @@ private:
String text;
if (config().has("query"))
text = config().getString("query");
text = config().getRawString("query"); /// Poco configuration should not process substitutions in form of ${...} inside query.
else
{
/// If 'query' parameter is not set, read a query from stdin.

View File

@ -268,7 +268,7 @@ void LocalServer::attachSystemTables()
void LocalServer::processQueries()
{
String initial_create_query = getInitialCreateTableQuery();
String queries_str = initial_create_query + config().getString("query");
String queries_str = initial_create_query + config().getRawString("query");
std::vector<String> queries;
auto parse_res = splitMultipartQuery(queries_str, queries);

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
$CLICKHOUSE_CLIENT -q "SELECT '\${}'"