You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/25 06:53:46 UTC
[GitHub] [shardingsphere] strongduanmu opened a new pull request #11996: optimize and or condition parse and extract logic
strongduanmu opened a new pull request #11996:
URL: https://github.com/apache/shardingsphere/pull/11996
Ref #10626, #11281
Changes proposed in this pull request:
- optimize and or condition parse
- add test case for and or operator parse
- optimize `AndPredicate` extract logic
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on pull request #11996: optimize and or condition parse and extract logic
Posted by GitBox <gi...@apache.org>.
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:

Optimized parse result:

--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero merged pull request #11996: optimize and or condition parse and extract logic
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #11996:
URL: https://github.com/apache/shardingsphere/pull/11996
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org