fix query failed and add stateless test

This commit is contained in:
Neng Liu 2021-03-29 16:12:02 +08:00
parent 40a99b7431
commit 0d78427fbf
3 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,7 @@ MergeTreeWhereOptimizer::MergeTreeWhereOptimizer(
, queried_columns{queried_columns_}
, sorting_key_names{NameSet(
metadata_snapshot->getSortingKey().column_names.begin(), metadata_snapshot->getSortingKey().column_names.end())}
, block_with_constants{KeyCondition::getBlockWithConstants(query_info.query, query_info.syntax_analyzer_result, context)}
, block_with_constants{KeyCondition::getBlockWithConstants(query_info.query->clone(), query_info.syntax_analyzer_result, context)}
, log{log_}
, column_sizes{std::move(column_sizes_)}
{

View File

@ -0,0 +1,5 @@
DROP TABLE IF EXISTS ttt01778;
CREATE TABLE ttt01778 (`1` String, `2` INT) ENGINE = MergeTree() ORDER BY tuple();
INSERT INTO ttt01778 values('1',1),('2',2),('3',3);
select * from ttt01778 where 1=2; -- no server error
DROP TABLE ttt01778;