Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhseh committed Feb 12, 2024
1 parent 74f0548 commit 9806564
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/frontend/src/binder/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use risingwave_common::util::iter_util::zip_eq_fast;
use risingwave_common::{bail_not_implemented, not_implemented};
use risingwave_pb::plan_common::{AdditionalColumn, ColumnDescVersion};
use risingwave_sqlparser::ast::{
Array, BinaryOperator, DataType as AstDataType, Expr, Function, JsonPredicateType, ObjectName, Query, StructField, TrimWhereField, UnaryOperator
Array, BinaryOperator, DataType as AstDataType, Expr, Function, JsonPredicateType, ObjectName,
Query, StructField, TrimWhereField, UnaryOperator,
};

use crate::binder::expr::function::SYS_FUNCTION_WITHOUT_ARGS;
Expand Down Expand Up @@ -606,11 +607,21 @@ impl Binder {
return false;
}
if let Expr::Identifier(_) = *(left.clone()) {
if !self.try_extract_simple_form(*left, *right, &mut column_expr, constant_lookup_inputs) {
if !self.try_extract_simple_form(
*left,
*right,
&mut column_expr,
constant_lookup_inputs,
) {
return false;
}
} else {
if !self.try_extract_simple_form(*right, *left, &mut column_expr, constant_lookup_inputs) {
if !self.try_extract_simple_form(
*right,
*left,
&mut column_expr,
constant_lookup_inputs,
) {
return false;
}
}
Expand Down Expand Up @@ -673,7 +684,8 @@ impl Binder {
conditions,
results_expr,
fallback,
constant_lookup_inputs);
constant_lookup_inputs,
);
}

for (condition, result) in zip_eq_fast(conditions, results_expr) {
Expand Down

0 comments on commit 9806564

Please sign in to comment.