strongduanmu commented on pull request #11996:
URL: https://github.com/apache/shardingsphere/pull/11996#issuecomment-905238344


   In different database dialects, the `and` operator has a higher priority 
than the `or` operator, so it should be parsed according to the priority when 
parsing.
   
   However, the parsing engine does not distinguish the priority of `and` and 
`or`, which results in incorrect parsing results of the following sentences, 
and ultimately leads to extremely complicated logic for extracting 
`AndPredicate` when using the parsing results.
   
   ```sql
   SELECT * FROM t_order WHERE a = 1 AND b = 2 OR c = 3 AND d = 4 OR e = 5 AND 
f = 6;
   ```
   
   Current parse result:
   
   
![image](https://user-images.githubusercontent.com/10829171/130741904-16d5c1aa-1274-49c0-8896-a2b89fb29b34.png)
   
   Optimized parse result:
   
   
![image](https://user-images.githubusercontent.com/10829171/130741963-4ef1e4db-5e22-4b39-8a1b-71c099903029.png)
   
   


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


Reply via email to