mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fixed error; added test from Alexander Zaitsev [#CLICKHOUSE-2]
This commit is contained in:
parent
bbb12e89f0
commit
590feb02b5
@ -27,6 +27,7 @@ public:
|
|||||||
bool supportsPrewhere() const override { return getTargetTable()->supportsPrewhere(); }
|
bool supportsPrewhere() const override { return getTargetTable()->supportsPrewhere(); }
|
||||||
bool supportsFinal() const override { return getTargetTable()->supportsFinal(); }
|
bool supportsFinal() const override { return getTargetTable()->supportsFinal(); }
|
||||||
bool supportsIndexForIn() const override { return getTargetTable()->supportsIndexForIn(); }
|
bool supportsIndexForIn() const override { return getTargetTable()->supportsIndexForIn(); }
|
||||||
|
bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand) const override { return getTargetTable()->mayBenefitFromIndexForIn(left_in_operand); }
|
||||||
|
|
||||||
BlockOutputStreamPtr write(const ASTPtr & query, const Settings & settings) override;
|
BlockOutputStreamPtr write(const ASTPtr & query, const Settings & settings) override;
|
||||||
void drop() override;
|
void drop() override;
|
||||||
|
@ -32,9 +32,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string getTableName() const override { return table_name; }
|
std::string getTableName() const override { return table_name; }
|
||||||
|
|
||||||
bool supportsSampling() const override { return data.supportsSampling(); }
|
bool supportsSampling() const override { return data.supportsSampling(); }
|
||||||
bool supportsFinal() const override { return data.supportsFinal(); }
|
|
||||||
bool supportsPrewhere() const override { return data.supportsPrewhere(); }
|
bool supportsPrewhere() const override { return data.supportsPrewhere(); }
|
||||||
|
bool supportsFinal() const override { return data.supportsFinal(); }
|
||||||
|
bool supportsIndexForIn() const override { return true; }
|
||||||
|
bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand) const override { return data.mayBenefitFromIndexForIn(left_in_operand); }
|
||||||
|
|
||||||
const ColumnsDescription & getColumns() const override { return data.getColumns(); }
|
const ColumnsDescription & getColumns() const override { return data.getColumns(); }
|
||||||
void setColumns(ColumnsDescription columns_) override { return data.setColumns(std::move(columns_)); }
|
void setColumns(ColumnsDescription columns_) override { return data.setColumns(std::move(columns_)); }
|
||||||
@ -74,9 +77,6 @@ public:
|
|||||||
|
|
||||||
void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override;
|
void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override;
|
||||||
|
|
||||||
bool supportsIndexForIn() const override { return true; }
|
|
||||||
bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand) const override { return data.mayBenefitFromIndexForIn(left_in_operand); }
|
|
||||||
|
|
||||||
bool checkTableCanBeDropped() const override;
|
bool checkTableCanBeDropped() const override;
|
||||||
|
|
||||||
MergeTreeData & getData() { return data; }
|
MergeTreeData & getData() { return data; }
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
1 2000-01-01
|
||||||
|
1 2000-01-01
|
||||||
|
1 2000-01-01
|
16
dbms/tests/queries/0_stateless/00609_mv_index_in_in.sql
Normal file
16
dbms/tests/queries/0_stateless/00609_mv_index_in_in.sql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
USE test;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS test;
|
||||||
|
DROP TABLE IF EXISTS test_mv;
|
||||||
|
|
||||||
|
create table test (a Int8) engine=Memory;
|
||||||
|
|
||||||
|
insert into test values (1);
|
||||||
|
create materialized view test_mv Engine=MergeTree(date, (a), 8192) populate as select a, toDate('2000-01-01') date from test;
|
||||||
|
|
||||||
|
select * from test_mv; -- OK
|
||||||
|
select * from test_mv where a in (select a from test_mv); -- EMPTY (bug)
|
||||||
|
select * from ".inner.test_mv" where a in (select a from test_mv); -- OK
|
||||||
|
|
||||||
|
DROP TABLE test;
|
||||||
|
DROP TABLE test_mv;
|
Loading…
Reference in New Issue
Block a user