Merge pull request #14876 from amosbird/ns

Get rid of query settings after initialization.
This commit is contained in:
alexey-milovidov 2020-09-17 17:49:25 +03:00 committed by GitHub
commit 84eece69ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,6 +99,12 @@ ASTPtr rewriteSelectQuery(const ASTPtr & query, const std::string & database, co
auto modified_query_ast = query->clone();
ASTSelectQuery & select_query = modified_query_ast->as<ASTSelectQuery &>();
// Get rid of the settings clause so we don't send them to remote. Thus newly non-important
// settings won't break any remote parser. It's also more reasonable since the query settings
// are written into the query context and will be sent by the query pipeline.
select_query.setExpression(ASTSelectQuery::Expression::SETTINGS, {});
if (table_function_ptr)
select_query.addTableFunction(table_function_ptr);
else