From e34e7454664cf33b5fb46c952a8ae1d09ec78ec7 Mon Sep 17 00:00:00 2001 From: akazz Date: Thu, 18 Jul 2019 13:14:12 +0300 Subject: [PATCH] Fix for consts --- dbms/src/Functions/FunctionsLogical.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbms/src/Functions/FunctionsLogical.cpp b/dbms/src/Functions/FunctionsLogical.cpp index 3f517ec294e..41a42fdce44 100644 --- a/dbms/src/Functions/FunctionsLogical.cpp +++ b/dbms/src/Functions/FunctionsLogical.cpp @@ -340,8 +340,13 @@ static void executeForTernaryLogicImpl(ColumnRawPtrs arguments, ColumnWithTypeAn } const auto result_column = ColumnUInt8::create(input_rows_count); + MutableColumnPtr const_column_holder; + if (has_consts) + { + const_column_holder = convertFromTernaryData(UInt8Container({const_3v_value}), const_3v_value == Ternary::Null); + arguments.push_back(const_column_holder.get()); + } - /// TODO: WARNING! This code is faulty for the case of constant OperationApplier::apply(arguments, result_column); result_info.column = convertFromTernaryData(result_column->getData(), result_info.type->isNullable());