From 99ffb71a49c5973fb3a5edf00b86973380fdb082 Mon Sep 17 00:00:00 2001 From: Noel Kwan <47273164+kwannoel@users.noreply.github.com> Date: Thu, 2 Feb 2023 23:59:02 +0800 Subject: [PATCH] fix(sqlsmith): generation of ambiguous `IN` `list` expression (#7672) Generate `InList` expression with parenthesis in the prefix argument to avoid ambiguity. Approved-By: lmatz --- src/tests/sqlsmith/src/sql_gen/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/sqlsmith/src/sql_gen/expr.rs b/src/tests/sqlsmith/src/sql_gen/expr.rs index 671291bdfb0fc..19ab43463f378 100644 --- a/src/tests/sqlsmith/src/sql_gen/expr.rs +++ b/src/tests/sqlsmith/src/sql_gen/expr.rs @@ -58,7 +58,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> { let (ty, expr) = self.gen_arbitrary_expr(context); let n = self.rng.gen_range(1..=10); Expr::InList { - expr: Box::new(expr), + expr: Box::new(Expr::Nested(Box::new(expr))), list: self.gen_n_exprs_with_type(n, &ty, context), negated: self.flip_coin(), }