pengxianggui opened a new issue, #23131: URL: https://github.com/apache/shardingsphere/issues/23131
## Bug Report ### Which version of ShardingSphere did you use? 5.1.1 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-JDBC ### Expected behavior The sql executes correctly ### Actual behavior org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax ### Reason analyze (If you can) sql parsing generates errors that are not actually sql errors ### Steps to reproduce the behavior, such as: SQL to execute ```sql select o.* from t_order o left join t_order_item oi on o.order_id = oi.order_id and oi.create_time >= '2022-12-01 00:00:00' and oi.create_time <= '2022-12-31 00:00:00' where o.create_time >= '2022-12-01 00:00:00' and o.create_time <= '2022-12-31 00:00:00' ``` The above sql might seem a little strange because I don't need to add a time filter to the left join. In fact, if I didn't add this condition, there would be no error. I was trying to see if I could trigger the fragment of t_order_item, but I got an error. However, this sql looks strange, but it will work fine in mysql. I don't think this error should be reported. 上面的sql可能看起来有点奇怪,因为我没必要在left join 中加上时间过滤条件。 事实上,如果我不加这个条件,确实不会报错。我本意是想尝试这样做,能否触发t_order_item的分片,没想到却报错了。 但是这个sql虽然看起来奇怪,但却能在mysql中正常执行,我认为不应该报这个错误。 -- 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]
