shuvamk opened a new pull request, #2422:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2422

   ```sql
   SELECT INTERVAL INTERVAL INTERVAL ... 1   -- 600 repetitions, ~5 KB
   ```
   
   This aborts the process with `fatal runtime error: stack overflow` on a 2 
MiB stack
   (the default for a spawned thread) instead of returning 
`RecursionLimitExceeded`.
   
   For dialects where `require_interval_qualifier()` is false, `parse_interval` 
calls
   `parse_prefix` directly rather than `parse_expr`, so it never passes through 
the
   recursion counter that lives in `parse_subexpr`. `parse_prefix` re-enters
   `parse_interval` on the next INTERVAL keyword, leaving that cycle unguarded.
   Reproduced on generic, duckdb, snowflake and postgres.
   
   The fix applies the same two guards #2199 used for the parenthesis gap; the 
600-level
   input then returns `Err(RecursionLimitExceeded)`.
   
   Test added beside the existing recursion-limit tests in 
`tests/sqlparser_common.rs`.
   Without the parser change it fails as a stack-overflow abort. Same defect 
class as
   #2411, on a different path.
   


-- 
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]

Reply via email to