|
|
@ -432,23 +432,32 @@ impl<'a> PlanBuilder<'a> { |
|
|
|
Box::new(self.build_for_expression(b, variables, graph_name)?), |
|
|
|
Box::new(self.build_for_expression(b, variables, graph_name)?), |
|
|
|
), |
|
|
|
), |
|
|
|
Expression::In(e, l) => { |
|
|
|
Expression::In(e, l) => { |
|
|
|
|
|
|
|
let e = self.build_for_expression(e, variables, graph_name)?; |
|
|
|
if l.is_empty() { |
|
|
|
if l.is_empty() { |
|
|
|
return Ok(PlanExpression::Literal(PlanTerm { |
|
|
|
// False except on error
|
|
|
|
encoded: false.into(), |
|
|
|
PlanExpression::If( |
|
|
|
plain: false.into(), |
|
|
|
Box::new(e), |
|
|
|
})); |
|
|
|
Box::new(PlanExpression::Literal(PlanTerm { |
|
|
|
|
|
|
|
encoded: false.into(), |
|
|
|
|
|
|
|
plain: false.into(), |
|
|
|
|
|
|
|
})), |
|
|
|
|
|
|
|
Box::new(PlanExpression::Literal(PlanTerm { |
|
|
|
|
|
|
|
encoded: false.into(), |
|
|
|
|
|
|
|
plain: false.into(), |
|
|
|
|
|
|
|
})), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
PlanExpression::Or( |
|
|
|
|
|
|
|
l.iter() |
|
|
|
|
|
|
|
.map(|v| { |
|
|
|
|
|
|
|
Ok(PlanExpression::Equal( |
|
|
|
|
|
|
|
Box::new(e.clone()), |
|
|
|
|
|
|
|
Box::new(self.build_for_expression(v, variables, graph_name)?), |
|
|
|
|
|
|
|
)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.collect::<Result<_, EvaluationError>>()?, |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
let e = self.build_for_expression(e, variables, graph_name)?; |
|
|
|
|
|
|
|
PlanExpression::Or( |
|
|
|
|
|
|
|
l.iter() |
|
|
|
|
|
|
|
.map(|v| { |
|
|
|
|
|
|
|
Ok(PlanExpression::Equal( |
|
|
|
|
|
|
|
Box::new(e.clone()), |
|
|
|
|
|
|
|
Box::new(self.build_for_expression(v, variables, graph_name)?), |
|
|
|
|
|
|
|
)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.collect::<Result<_, EvaluationError>>()?, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Expression::Add(a, b) => PlanExpression::Add( |
|
|
|
Expression::Add(a, b) => PlanExpression::Add( |
|
|
|
Box::new(self.build_for_expression(a, variables, graph_name)?), |
|
|
|
Box::new(self.build_for_expression(a, variables, graph_name)?), |
|
|
|