Simple cleanup: context ptr usage in interpreters

This commit is contained in:
Igor Nikonov 2022-07-05 22:47:00 +00:00
parent d276d9ef8b
commit 059c5c0f0a
3 changed files with 16 additions and 16 deletions

View File

@ -12,12 +12,12 @@ namespace DB
class IInterpreterUnionOrSelectQuery : public IInterpreter class IInterpreterUnionOrSelectQuery : public IInterpreter
{ {
public: public:
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, ContextPtr context_, const SelectQueryOptions & options_) IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, const ContextPtr & context_, const SelectQueryOptions & options_)
: IInterpreterUnionOrSelectQuery(query_ptr_, Context::createCopy(context_), options_) : IInterpreterUnionOrSelectQuery(query_ptr_, Context::createCopy(context_), options_)
{ {
} }
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, ContextMutablePtr context_, const SelectQueryOptions & options_) IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, const ContextMutablePtr & context_, const SelectQueryOptions & options_)
: query_ptr(query_ptr_) : query_ptr(query_ptr_)
, context(context_) , context(context_)
, options(options_) , options(options_)

View File

@ -159,7 +159,7 @@ String InterpreterSelectQuery::generateFilterActions(ActionsDAGPtr & actions, co
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const SelectQueryOptions & options_, const SelectQueryOptions & options_,
const Names & required_result_column_names_) const Names & required_result_column_names_)
: InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_) : InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_)
@ -167,7 +167,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextMutablePtr context_, const ContextMutablePtr & context_,
const SelectQueryOptions & options_, const SelectQueryOptions & options_,
const Names & required_result_column_names_) const Names & required_result_column_names_)
: InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_) : InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_)
@ -175,7 +175,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
Pipe input_pipe_, Pipe input_pipe_,
const SelectQueryOptions & options_) const SelectQueryOptions & options_)
: InterpreterSelectQuery(query_ptr_, context_, std::move(input_pipe_), nullptr, options_.copy().noSubquery()) : InterpreterSelectQuery(query_ptr_, context_, std::move(input_pipe_), nullptr, options_.copy().noSubquery())
@ -183,7 +183,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const StoragePtr & storage_, const StoragePtr & storage_,
const StorageMetadataPtr & metadata_snapshot_, const StorageMetadataPtr & metadata_snapshot_,
const SelectQueryOptions & options_) const SelectQueryOptions & options_)
@ -192,7 +192,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const SelectQueryOptions & options_, const SelectQueryOptions & options_,
SubqueriesForSets subquery_for_sets_, SubqueriesForSets subquery_for_sets_,
PreparedSets prepared_sets_) PreparedSets prepared_sets_)
@ -282,7 +282,7 @@ static bool shouldIgnoreQuotaAndLimits(const StorageID & table_id)
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
std::optional<Pipe> input_pipe_, std::optional<Pipe> input_pipe_,
const StoragePtr & storage_, const StoragePtr & storage_,
const SelectQueryOptions & options_, const SelectQueryOptions & options_,
@ -304,7 +304,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery( InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextMutablePtr context_, const ContextMutablePtr & context_,
std::optional<Pipe> input_pipe_, std::optional<Pipe> input_pipe_,
const StoragePtr & storage_, const StoragePtr & storage_,
const SelectQueryOptions & options_, const SelectQueryOptions & options_,

View File

@ -52,27 +52,27 @@ public:
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const SelectQueryOptions &, const SelectQueryOptions &,
const Names & required_result_column_names_ = Names{}); const Names & required_result_column_names_ = Names{});
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextMutablePtr context_, const ContextMutablePtr & context_,
const SelectQueryOptions &, const SelectQueryOptions &,
const Names & required_result_column_names_ = Names{}); const Names & required_result_column_names_ = Names{});
/// Read data not from the table specified in the query, but from the prepared pipe `input`. /// Read data not from the table specified in the query, but from the prepared pipe `input`.
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
Pipe input_pipe_, Pipe input_pipe_,
const SelectQueryOptions & = {}); const SelectQueryOptions & = {});
/// Read data not from the table specified in the query, but from the specified `storage_`. /// Read data not from the table specified in the query, but from the specified `storage_`.
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const StoragePtr & storage_, const StoragePtr & storage_,
const StorageMetadataPtr & metadata_snapshot_ = nullptr, const StorageMetadataPtr & metadata_snapshot_ = nullptr,
const SelectQueryOptions & = {}); const SelectQueryOptions & = {});
@ -81,7 +81,7 @@ public:
/// TODO: Find a general way of sharing sets among different interpreters, such as subqueries. /// TODO: Find a general way of sharing sets among different interpreters, such as subqueries.
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
const SelectQueryOptions &, const SelectQueryOptions &,
SubqueriesForSets subquery_for_sets_, SubqueriesForSets subquery_for_sets_,
PreparedSets prepared_sets_); PreparedSets prepared_sets_);
@ -134,7 +134,7 @@ public:
private: private:
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextPtr context_, const ContextPtr & context_,
std::optional<Pipe> input_pipe, std::optional<Pipe> input_pipe,
const StoragePtr & storage_, const StoragePtr & storage_,
const SelectQueryOptions &, const SelectQueryOptions &,
@ -145,7 +145,7 @@ private:
InterpreterSelectQuery( InterpreterSelectQuery(
const ASTPtr & query_ptr_, const ASTPtr & query_ptr_,
ContextMutablePtr context_, const ContextMutablePtr & context_,
std::optional<Pipe> input_pipe, std::optional<Pipe> input_pipe,
const StoragePtr & storage_, const StoragePtr & storage_,
const SelectQueryOptions &, const SelectQueryOptions &,