Skip to content

Commit

Permalink
fix(tianmu): fix query input variables wrong result (#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
adofsauron authored and mergify[bot] committed May 5, 2023
1 parent 57e3497 commit 1ba5663
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions storage/tianmu/vc/expr_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_func_if *>(item))) {
return true;
}
}

return (diff || !deterministic_);
}

Expand All @@ -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_func_if *>(item))) {
return false;
}
}

if (FeedArguments(mit))
last_val_ = expr_->Evaluate();
return last_val_->IsNull();
Expand Down

0 comments on commit 1ba5663

Please sign in to comment.