odyssey1816 opened a new issue #9080:
URL: https://github.com/apache/shardingsphere/issues/9080
## Question
sharding-jdbc is in the process of upgrading from 4.0.1 to 4.1.1,parameter
misalignment occurs when executing `case when` in prepareStatement
### SQL
```sql
UPDATE product_sku
SET seller_id = ( ( CASE WHEN sku_seq =? THEN ? END ) )
WHERE
app_id = ?
AND product_seq = ?
AND sku_seq IN ( ? )
```
### test program
```sql
String sql = "UPDATE product_sku\n" +
" set seller_id =((case when sku_seq=? then ? end))" +
" where\n" +
" app_id = ?\n" +
" and product_seq = ?\n" +
" and sku_seq in\n" +
" ( \n" +
" ?\n" +
" )";
try (
Connection conn = dataSource.getConnection();
PreparedStatement statement = conn.prepareStatement(sql)) {
statement.setString(1, "seller_id1");
statement.setString(2, "seller_id2");
statement.setString(3, "SL201");
statement.setString(4, "123456");
statement.setString(5, "1234567");
int i = statement.executeUpdate();
System.out.println("");
} catch (Exception e) {
e.printStackTrace();
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]