@@ -230,7 +230,89 @@ impl ScalarExpression {
230
230
expr. constant_calculation ( ) ?;
231
231
}
232
232
}
233
- _ => ( ) ,
233
+ ScalarExpression :: In { expr, args, .. } => {
234
+ expr. constant_calculation ( ) ?;
235
+ for arg in args {
236
+ arg. constant_calculation ( ) ?;
237
+ }
238
+ }
239
+ ScalarExpression :: Between {
240
+ expr,
241
+ left_expr,
242
+ right_expr,
243
+ ..
244
+ } => {
245
+ expr. constant_calculation ( ) ?;
246
+ left_expr. constant_calculation ( ) ?;
247
+ right_expr. constant_calculation ( ) ?;
248
+ }
249
+ ScalarExpression :: SubString {
250
+ expr,
251
+ from_expr,
252
+ for_expr,
253
+ } => {
254
+ expr. constant_calculation ( ) ?;
255
+ if let Some ( from_expr) = from_expr {
256
+ from_expr. constant_calculation ( ) ?;
257
+ }
258
+ if let Some ( for_expr) = for_expr {
259
+ for_expr. constant_calculation ( ) ?;
260
+ }
261
+ }
262
+ ScalarExpression :: Position { expr, in_expr } => {
263
+ expr. constant_calculation ( ) ?;
264
+ in_expr. constant_calculation ( ) ?;
265
+ }
266
+ ScalarExpression :: Tuple ( exprs) | ScalarExpression :: Coalesce { exprs, .. } => {
267
+ for expr in exprs {
268
+ expr. constant_calculation ( ) ?;
269
+ }
270
+ }
271
+ ScalarExpression :: If {
272
+ condition,
273
+ left_expr,
274
+ right_expr,
275
+ ..
276
+ } => {
277
+ condition. constant_calculation ( ) ?;
278
+ left_expr. constant_calculation ( ) ?;
279
+ right_expr. constant_calculation ( ) ?;
280
+ }
281
+ ScalarExpression :: IfNull {
282
+ left_expr,
283
+ right_expr,
284
+ ..
285
+ }
286
+ | ScalarExpression :: NullIf {
287
+ left_expr,
288
+ right_expr,
289
+ ..
290
+ } => {
291
+ left_expr. constant_calculation ( ) ?;
292
+ right_expr. constant_calculation ( ) ?;
293
+ }
294
+ ScalarExpression :: CaseWhen {
295
+ operand_expr,
296
+ expr_pairs,
297
+ else_expr,
298
+ ..
299
+ } => {
300
+ if let Some ( operand_expr) = operand_expr {
301
+ operand_expr. constant_calculation ( ) ?;
302
+ }
303
+ for ( left_expr, right_expr) in expr_pairs {
304
+ left_expr. constant_calculation ( ) ?;
305
+ right_expr. constant_calculation ( ) ?;
306
+ }
307
+ if let Some ( else_expr) = else_expr {
308
+ else_expr. constant_calculation ( ) ?;
309
+ }
310
+ }
311
+ ScalarExpression :: Constant ( _)
312
+ | ScalarExpression :: ColumnRef ( _)
313
+ | ScalarExpression :: Empty
314
+ | ScalarExpression :: Reference { .. }
315
+ | ScalarExpression :: Function ( _) => ( ) ,
234
316
}
235
317
236
318
Ok ( ( ) )
0 commit comments