Merge pull request #11869 from ClickHouse/fix-nullable-prewhere-type-2

Fix nullable prewhere type 2
This commit is contained in:
alexey-milovidov 2020-06-23 02:48:59 +03:00 committed by GitHub
commit a7b224a578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 1 deletions

View File

@ -320,7 +320,6 @@ void MergeTreeBaseSelectProcessor::executePrewhereActions(Block & block, const P
else
{
auto & ctn = block.getByName(prewhere_info->prewhere_column_name);
ctn.type = std::make_shared<DataTypeUInt8>();
ctn.column = ctn.type->createColumnConst(block.rows(), 1u)->convertToFullColumnIfConst();
}

View File

@ -1,2 +1,3 @@
43
1
Nullable(UInt8) Nullable(Int32)

View File

@ -12,6 +12,7 @@ CREATE TABLE test_prewhere_column_type (`a` LowCardinality(String), `x` Nullable
INSERT INTO test_prewhere_column_type VALUES ('', 2);
SELECT a, y FROM test_prewhere_column_type prewhere (x = 2) AS y;
SELECT a, toTypeName(x = 2), toTypeName(x) FROM test_prewhere_column_type where (x = 2) AS y;
DROP TABLE test_prewhere_default_column;
DROP TABLE test_prewhere_column_type;