From 1ba566389e516d55f72843125e628084af32f6ae Mon Sep 17 00:00:00 2001 From: adofsauron Date: Fri, 5 May 2023 16:38:50 +0800 Subject: [PATCH] fix(tianmu): fix query input variables wrong result (#1647) --- storage/tianmu/vc/expr_column.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/storage/tianmu/vc/expr_column.cpp b/storage/tianmu/vc/expr_column.cpp index cf6e6183e..5b717ef69 100644 --- a/storage/tianmu/vc/expr_column.cpp +++ b/storage/tianmu/vc/expr_column.cpp @@ -111,6 +111,14 @@ bool ExpressionColumn::FeedArguments(const core::MIIterator &mit) { for (auto &val_it : cache->second) *(val_it.second) = val_it.first = v; } first_eval_ = false; + + { + Item *item = expr_->GetItem(); + if (item && (Item::FUNC_ITEM == item->type()) && (dynamic_cast(item))) { + return true; + } + } + return (diff || !deterministic_); } @@ -123,6 +131,13 @@ int64_t ExpressionColumn::GetValueInt64Impl(const core::MIIterator &mit) { } bool ExpressionColumn::IsNullImpl(const core::MIIterator &mit) { + { + Item *item = expr_->GetItem(); + if (item && (Item::FUNC_ITEM == item->type()) && (dynamic_cast(item))) { + return false; + } + } + if (FeedArguments(mit)) last_val_ = expr_->Evaluate(); return last_val_->IsNull();