Fixed error with IN where left hand side is nullable #1846

This commit is contained in:
Alexey Milovidov 2018-04-06 08:12:47 +03:00
parent 2ae9e719c6
commit ac58f92a97
3 changed files with 22 additions and 0 deletions

View File

@ -729,6 +729,11 @@ public:
return std::make_shared<DataTypeUInt8>();
}
bool useDefaultImplementationForNulls() const override
{
return false;
}
void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result) override
{
/// Second argument must be ColumnSet.

View File

@ -0,0 +1,3 @@
1
100
10 10 10

View File

@ -0,0 +1,14 @@
SELECT sum(toNullable('a') IN 'a');
SELECT countIf(number, toNullable('a') IN ('a', 'b')) FROM numbers(100);
SELECT
uniqExact(x) AS u,
uniqExactIf(x, name = 'a') AS ue,
uniqExactIf(x, name IN ('a', 'b')) AS ui
FROM
(
SELECT
toNullable('a') AS name,
arrayJoin(range(10)) AS x
)
WHERE name = 'a';