moshap-firebolt opened a new pull request, #3057:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3057

   `parse_subexpr` parses a chain such as `1 + 1 + ... + 1` in a loop, so the 
whole chain costs one level of the recursion limit, yet the resulting `Expr` 
nests one level per operator. Dropping or serializing it recurses that deep: a 
million-term chain overflows a 64 MiB stack in serde's `Serialize`.
   
   `Parser::with_infix_chain_depth(true)` charges each operator of the chain to 
the recursion counter, so the limit bounds the depth of the tree that is built. 
It is off by default, since `visitor::tests::overflow` expects a 1,000-term 
`OR` chain to parse under the default limit of 50.
   
   Test: `parse_infix_chain_with_chain_depth_hits_recursion_limits`.
   
   This PR was prepared with AI assistance (Claude).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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