321018 {
321019 auto &
root = bindings[0].get().Cast<BoundComparisonExpression>();
321020 auto &left_child = bindings[1].get().Cast<BoundCastExpression>();
321021 auto &right_child = bindings[3].get().Cast<BoundCastExpression>();
321022
321023 if (!AreMatchesPossible(left_child.child->return_type, right_child.child->return_type)) {
321024 vector<unique_ptr<Expression>> children;
321025 children.push_back(std::move(
root.left));
321026 children.push_back(std::move(
root.right));
321027 return ExpressionRewriter::ConstantOrNull(std::move(children),
Value::BOOLEAN(
false));
321028 }
321029
321030 if (!is_root || op.type != LogicalOperatorType::LOGICAL_FILTER) {
321031 return nullptr;
321032 }
321033
321034 auto cast_left_to_right =
321036 return make_uniq<BoundComparisonExpression>(
root.GetExpressionType(), std::move(cast_left_to_right),
321037 std::move(right_child.child));
321038}
static unique_ptr< Expression > AddDefaultCastToType(unique_ptr< Expression > expr, const LogicalType &target_type, bool try_cast=false)
Cast an expression to the specified SQL type, using only the built-in SQL casts.
Definition duckdb.cpp:375861
static DUCKDB_API Value BOOLEAN(bool value)
Create a boolean Value from a specified value.
Definition duckdb.cpp:132118