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

   Several recent PRs, mine and other contributors', showed that the expression 
tree is often built with wrong operator priorities. I hit the same problem 
writing a semantic expression evaluator, which kept disagreeing with the engine 
because of wrong ASTs.
   
   The existing oracle targets only check that sqlparser accepts what 
PostgreSQL and SQLite accept. `fuzz_postgres_expr` and `fuzz_sqlite_expr` also 
check the tree: they print it fully parenthesized and fail when the engine 
reads that text differently from the original (`pg_query` parse trees for 
PostgreSQL, `EXPLAIN` bytecode for SQLite).
   
   The inputs are operator chains built from a small hand-written `Grammar` of 
tokens per dialect, so nearly every input is valid SQL and the fuzzing goes 
into grouping. The flip side is that only those tokens, only `SELECT <expr> 
FROM t` and only four levels of nesting are covered. We will expand it over 
time, given this is already quite enough for now.
   
   This already found many AST errors, so I will open a tracking issue for 
them, populated automatically with Opus, and plan the fixes once the fuzzer 
converges.


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