Lucas-307 opened a new issue #8650:
URL: https://github.com/apache/shardingsphere/issues/8650
## Bug Report
### Which version of ShardingSphere did you use?
5.0.0-RC1-SNAPSHOT
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
I want execute some batch delete by proxy, but it failed.
```java
private void executeBatchDelete(final Connection connection, final
List<DataRecord> dataRecords) throws SQLException {
PreparedStatement ps = connection.prepareStatement(deleteSQL);
ps.setQueryTimeout(30);
for (DataRecord each : dataRecords) {
conditionColumns = RecordUtil.extractConditionColumns(each,
importerConfig.getShardingColumnsMap().get(each.getTableName()));
for (int i = 0; i < conditionColumns.size(); i++) {
ps.setObject(i + 1, conditionColumns.get(i).getValue());
}
ps.addBatch();
}
ps.executeBatch(); // throw a SQLException
}
```
### Actual behavior
```
java.sql.SQLException: 1Unsupported command: [COM_SET_OPTION]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.disableMultiQueries(MysqlIO.java:3670)
at
com.mysql.jdbc.PreparedStatement.executePreparedBatchAsMultiStatement(PreparedStatement.java:1492)
at
com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1303)
at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:970)
at
com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:131)
at
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at
org.apache.shardingsphere.scaling.core.execute.executor.importer.AbstractJDBCImporter.executeBatchDelete(AbstractJDBCImporter.java:205)
```
----------------------------------------------------------------
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]