LucaCappelletti94 opened a new pull request, #2376: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2376
`CREATE USER <name>` parses on its own, but `CREATE USER user1; SELECT 1` fails with `Expected: end of statement, found: SELECT`. The trailing option list is parsed by `parse_key_value_options`, whose loop drives on `next_token()` and breaks on a `;` that it has already consumed. With the terminator gone, the top-level statement loop sees the next statement's first token directly and errors out. The bug is dialect independent and specific to `CREATE USER`, the only unparenthesized caller of that helper that can be followed by another statement. This puts the semicolon back with `prev_token()` before breaking, so the caller and the top-level loop still see the separator, mirroring how the existing end-keyword arm already does it. The `EOF` arm needs no rewind. A regression test parses `CREATE USER user1; SELECT 1` and asserts it yields two statements. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
