Slightly better

This commit is contained in:
Alexey Milovidov 2020-08-01 22:10:59 +03:00
parent 435164cfbb
commit 1238456599
3 changed files with 10 additions and 2 deletions

View File

@ -98,10 +98,15 @@ static bool extractConstColumns(ColumnRawPtrs & in, UInt8 & res, Func && func)
for (int i = static_cast<int>(in.size()) - 1; i >= 0; --i)
{
if (!isColumnConst(*in[i]))
UInt8 x;
if (in[i]->onlyNull())
x = func(Null());
else if (isColumnConst(*in[i]))
x = func((*in[i])[0]);
else
continue;
UInt8 x = func((*in[i])[0]);
if (has_res)
{
res = Op::apply(res, x);

View File

@ -4,3 +4,5 @@ SELECT materialize(NULL) AND 1;
SELECT materialize(NULL) OR 1;
SELECT arrayJoin([NULL]) AND 1;
SELECT arrayJoin([NULL]) OR 1;
SELECT isConstant(arrayJoin([NULL]) AND 1);