RedThreeStone opened a new issue, #28009:
URL: https://github.com/apache/shardingsphere/issues/28009
## Bug Report
### Which version of ShardingSphere did you use?
4.1.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
SQL can be routed correctly
### Actual behavior
In the SQL server database, SQL with 'with (nolock)‘ cannot be routed
### Reason analyze (If you can)
org.apache.shardingsphere.sql.parser.SQLParserEngine#parse0 return an error
SQLStatement, The value of the attribute 'where' in it is null
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
### Example codes for reproduce this issue (such as a github link).
@PostMapping("withNoLockTest2")
public void withNoLockTest2(){
FulfillOrder fulfillOrder =
fulfillOrderMapper.selectByUserId2("123456");
System.out.println(JSON.toJSONString(fulfillOrder));
}
<select id="selectByUserId2" resultMap="BaseResultMap">
select user_id from fulfill_order with(nolock) where
user_id=#{userId}
</select>
--
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]