strongduanmu commented on issue #14014:
URL:
https://github.com/apache/shardingsphere/issues/14014#issuecomment-989638459
@Yule-Momoko Hello, I used MySQL 5.7 and 8.x versions, and the Druid/Hikari
connection pool for testing, but this exception cannot be reproduced. The
following is the configuration I tested:
```yaml
dataSources:
write_0:
# dataSourceClassName: com.zaxxer.hikari.HikariDataSource
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
# driverClassName: com.mysql.jdbc.Driver
driverClassName: com.mysql.cj.jdbc.Driver
url:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
# jdbcUrl:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
username: root
password: 123456
maxWait: 60
maxActive: 20
read_0:
# dataSourceClassName: com.zaxxer.hikari.HikariDataSource
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
# driverClassName: com.mysql.jdbc.Driver
driverClassName: com.mysql.cj.jdbc.Driver
# jdbcUrl:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
url:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
username: root
password: 123456
maxWait: 60
maxActive: 20
read_1:
# dataSourceClassName: com.zaxxer.hikari.HikariDataSource
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
# driverClassName: com.mysql.jdbc.Driver
driverClassName: com.mysql.cj.jdbc.Driver
# jdbcUrl:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
url:
jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
username: root
password: 123456
maxWait: 60
maxActive: 20
rules:
- !READWRITE_SPLITTING
dataSources:
pr_ds:
writeDataSourceName: write_0
readDataSourceNames:
- read_0
- read_1
```
```sql
CREATE DATABASE write_0;
USE write_0;
CREATE TABLE test(id INT(1) PRIMARY KEY, content LONGBLOB);
execute(dataSource, "INSERT INTO test(id, content) VALUES(?, ?), (?, ?);",
false, Arrays.asList(1, "11", 2, "22"));
```
--
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]