1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

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
parent 5b86a8bad1
commit ab79599a5e
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());