-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Question
miniob/src/observer/sql/optimizer/conjunction_simplification_rule.cpp
Lines 52 to 74 in ebe460e
| if (conjunction_expr->conjunction_type() == ConjunctionExpr::Type::AND) { | |
| if (constant_value == true) { | |
| child_exprs.erase(iter); | |
| } else { | |
| // always be false | |
| std::unique_ptr<Expression> child_expr = std::move(child_exprs.front()); | |
| child_exprs.clear(); | |
| expr = std::move(child_expr); | |
| return rc; | |
| } | |
| } else { | |
| // conjunction_type == OR | |
| if (constant_value == true) { | |
| // always be true | |
| std::unique_ptr<Expression> child_expr = std::move(child_exprs.front()); | |
| child_exprs.clear(); | |
| expr = std::move(child_expr); | |
| return rc; | |
| } else { | |
| child_exprs.erase(iter); | |
| } | |
| } | |
| } |
I wonder when one of the children in the AND conjunction expression returns false, this code snippet does not return false directly. Instead, it returns the first child expression (L57-L60). A similar case for the OR conjunction expression (L66-L69).
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested