sandynz opened a new issue #6729:
URL: https://github.com/apache/shardingsphere/issues/6729
## Bug Report
### Which version of ShardingSphere did you use?
5.0.0-RC1-SNAPSHOT . Commit: acc64bdf0b9b994ca465c2a63a06e6db8221935c
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC, and part of ShardingSphere-Proxy
### Expected behavior
Insert data without exception, insert once.
### Actual behavior
Exception got:
```
2020-08-08 21:35:26 [INFO] [main] [ShardingSphere-SQL][73] Actual SQL: ds
::: insert into varchar_tc_0 (id, real_name) values ((?, ?))
2020-08-08 21:35:26 [INFO] [main] [ShardingSphere-SQL][73] Actual SQL: ds
::: insert into varchar_tc_1 (id, real_name) values ((?, ?))
Exception in thread "main" org.postgresql.util.PSQLException: 未设定参数值 1 的内容。
at
org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:270)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:296)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369)
at
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153)
at
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:119)
at
com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at
org.apache.shardingsphere.driver.executor.PreparedStatementExecutor$2.executeSQL(PreparedStatementExecutor.java:117)
at
org.apache.shardingsphere.driver.executor.PreparedStatementExecutor$2.executeSQL(PreparedStatementExecutor.java:113)
at
org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.impl.DefaultSQLExecutorCallback.execute0(DefaultSQLExecutorCallback.java:75)
at
org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.impl.DefaultSQLExecutorCallback.execute(DefaultSQLExecutorCallback.java:57)
at
org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel.syncExecute(ExecutorKernel.java:99)
at
org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel.parallelExecute(ExecutorKernel.java:95)
at
org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel.execute(ExecutorKernel.java:78)
at
org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.SQLExecutor.execute(SQLExecutor.java:66)
at
org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.SQLExecutor.execute(SQLExecutor.java:50)
at
org.apache.shardingsphere.driver.executor.PreparedStatementExecutor.executeUpdate(PreparedStatementExecutor.java:105)
at
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeUpdate(ShardingSpherePreparedStatement.java:179)
at
test.shardingsphere.sharding.pg.varchar.PgVarcharTcDao.insert(PgVarcharTcDao.java:41)
at
test.shardingsphere.sharding.pg.varchar.ShardingPgVarcharJdbcTest.main(ShardingPgVarcharJdbcTest.java:25)
```
Three problems from log and debugging:
1. sql parameters not set
2. sql route to 2 physics tables, but not one
3. rewritten sql with wrong values clause "((?, ?))", it cause syntax error,
it should be "(?, ?)"
### Reason analyze (If you can)
PostgreSQL grammar parsing. Details see following comments
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
Run following example, `ShardingPgVarcharJdbcTest` /
`ShardingPgVarcharProxyTest`
### Example codes for reproduce this issue (such as a github link).
https://github.com/sandynz/shardingsphere-test
----------------------------------------------------------------
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]