LibSQL: Return an error for empty common table expression lists

SQL::CommonTableExpressionList is required to be non-empty. Return an
error if zero common table expressions were parsed.

Fixes #7627
This commit is contained in:
Timothy Flynn 2021-06-01 08:34:51 -04:00 committed by Ali Mohammad Pur
commit ab79599a5e
Notes: sideshowbarker 2024-07-18 17:02:47 +09:00
3 changed files with 12 additions and 2 deletions

View file

@ -682,6 +682,8 @@ TEST_CASE(select)
TEST_CASE(common_table_expression)
{
EXPECT(parse("WITH").is_error());
EXPECT(parse("WITH;").is_error());
EXPECT(parse("WITH DELETE FROM table;").is_error());
EXPECT(parse("WITH table DELETE FROM table;").is_error());
EXPECT(parse("WITH table AS DELETE FROM table;").is_error());