Fix nullable prewhere column type.

This commit is contained in:
Nikolai Kochetov 2020-06-11 19:34:36 +03:00
parent a93ae46ac1
commit 7b8c1657a5

View File

@ -905,7 +905,9 @@ void MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(ReadResult & r
if (prewhere->remove_prewhere_column)
result.columns.erase(result.columns.begin() + prewhere_column_pos);
else
result.columns[prewhere_column_pos] = DataTypeUInt8().createColumnConst(result.num_rows, 1u)->convertToFullColumnIfConst();
result.columns[prewhere_column_pos] =
result.block_before_prewhere.getByPosition(prewhere_column_pos).type->
createColumnConst(result.num_rows, 1u)->convertToFullColumnIfConst();
}
}
/// Filter in WHERE instead