1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

LibSQL: Report a syntax error for unsupported LIMIT clause syntax

Rather than aborting when a LIMIT clause of the form 'LIMIT expr, expr'
is encountered, fail the parser with a syntax error. This will be nicer
for the user and fixes the following fuzzer bug:
https://crbug.com/oss-fuzz/34837
This commit is contained in:
Timothy Flynn 2021-06-02 21:23:40 -04:00 committed by Andreas Kling
parent 0ff09d4f74
commit a870eac0eb
2 changed files with 3 additions and 2 deletions

View file

@ -547,6 +547,7 @@ TEST_CASE(select)
EXPECT(parse("SELECT * FROM table LIMIT 12").is_error());
EXPECT(parse("SELECT * FROM table LIMIT 12 OFFSET;").is_error());
EXPECT(parse("SELECT * FROM table LIMIT 12 OFFSET 15").is_error());
EXPECT(parse("SELECT * FROM table LIMIT 15, 16;").is_error());
struct Type {
SQL::ResultType type;