diff --git a/check.sh b/check.sh index e371254..50fb0fb 100755 --- a/check.sh +++ b/check.sh @@ -113,7 +113,7 @@ grep -v "CAST does not support casting from" | # random nulls # Functions returning sets: grep -v "number of columns must be a positive integer literal" | -grep -v "regex_extract requires a string literal as its first argument" | +grep -v "regexp_extract requires a string literal as its first argument" | grep -v -E "column \".*\" does not exist" | # https://github.com/MaterializeInc/materialize/issues/20533 grep -v -E "role \".*\" does not exist" | grep -v "SET clause does not support casting from interval to integer" | diff --git a/grammar.cc b/grammar.cc index 19c213b..63ddba5 100644 --- a/grammar.cc +++ b/grammar.cc @@ -334,9 +334,10 @@ query_spec::query_spec(prod *p, struct scope *s, bool lateral) : search = bool_expr::factory(this); - if (d6() > 2) { + if (d6() > 1) { ostringstream cons; - cons << "limit " << d100() + d100(); + auto expr = value_expr::factory(this, sqltype::get("int"), false); + cons << "limit coalesce(" << *expr << ", " << d100() + d100() << ")"; limit_clause = cons.str(); } }