ReyYang commented on issue #8650:
URL:
https://github.com/apache/shardingsphere/issues/8650#issuecomment-1021960655
ShardingSphere master batch
MySQL 5.7
Zookeeper 3.7
Case 1: Execute batch delete using proxy
Result: No issues found
```groovy
import java.sql.Connection
import java.sql.Driver
import java.sql.PreparedStatement
Class clazz = Class.forName("com.mysql.jdbc.Driver");
Driver driver = clazz.newInstance() as Driver;
String url =
"jdbc:mysql://127.0.0.1:3307/sharding_db?rewriteBatchedStatements=false&allowMultiQueries=false";
Properties info = new Properties();
info.setProperty("user", "root");
info.setProperty("password", "root");
Connection conn = driver.connect(url, info);
String delSQL = "delete from t_order where order_id = ?;"
PreparedStatement ps = conn.prepareStatement(delSQL)
for (i in 0..<5) {
ps.setObject(1, i);
ps.addBatch();
}
def batch = ps.executeBatch()
println batch
```
Case2:Execute batch delete during incremental data import phase of migration
Result: No issues found
```groovy
import java.sql.Connection
import java.sql.Driver
import java.sql.PreparedStatement
Class clazz = Class.forName("com.mysql.jdbc.Driver");
Driver driver = clazz.newInstance() as Driver;
String url =
"jdbc:mysql://127.0.0.1:3307/sharding_db?rewriteBatchedStatements=false&allowMultiQueries=false";
Properties info = new Properties();
info.setProperty("user", "root");
info.setProperty("password", "root");
Connection conn = driver.connect(url, info);
String delSQL = "delete from t_order where order_id = ?;"
PreparedStatement ps = conn.prepareStatement(delSQL)
for (i in 0..<5) {
ps.setObject(1, i);
ps.addBatch();
}
def batch = ps.executeBatch()
println batch
```
Case3:Execute batch delete during incremental data import phase of migration
Result: No issues found
```shell
mysql> delete from t_order where order_id = 1;
Query OK, 1 row affected (0.18 sec)
mysql> delete from t_order where order_id = 2;
Query OK, 1 row affected (0.02 sec)
mysql> delete from t_order where order_id = 3;
Query OK, 1 row affected (0.02 sec)
```
No problem was found in any of the above three cases
--
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]