pbottine opened a new issue, #2692:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2692

   ## Reproduction
   
   With `datafusion==55.0.0`:
   
   ```python
   from datafusion import SessionConfig, SessionContext
   
   config = SessionConfig().set("datafusion.sql_parser.dialect", "MySQL")
   batches = SessionContext(config).sql("SELECT 2 ^ 3 * 4").collect()
   print(batches[0].column(0).to_pylist())
   ```
   
   Observed on 2026-10-19: `[14]`. [MySQL's precedence 
table](https://dev.mysql.com/doc/refman/8.4/en/operator-precedence.html) ranks 
bitwise `^` above `*`, so the expression groups as `(2 ^ 3) * 4` and yields 
`4`. The observed result corresponds to `2 ^ (3 * 4)`.
   
   The [generic precedence 
table](https://github.com/apache/datafusion-sqlparser-rs/blob/f1854e47e463bbe8cd2f7c08fb008b7ced268598/src/dialect/mod.rs#L862-L992)
 gives `Caret` a lower value than `MulDivModOp`, and the [MySQL 
dialect](https://github.com/apache/datafusion-sqlparser-rs/blob/main/src/dialect/mysql.rs)
 does not override caret precedence. The same relative tiers remain on the 
default branch as of 2026-10-19. This is a MySQL-dialect parser discrepancy 
with an observed downstream query-result difference in DataFusion.
   


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