You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/09/01 16:22:38 UTC

[GitHub] [shardingsphere] sandynz opened a new issue #7207: INSERT...RETURING statement failed in PostgreSQL DML integration test

sandynz opened a new issue #7207:
URL: https://github.com/apache/shardingsphere/issues/7207


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch, 5.0.0-RC1-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   Test case pass
   
   ### Actual behavior
   Exception thrown.
   `GeneralDMLIT.assertExecuteUpdate`:
   ```
   /dataset/db/insert_for_order_1.xml, sql=INSERT /*+ index(field1) */ INTO t_order (order_id, user_id, status) VALUES (1, 1, 'insert') RETURNING order_id, ex.msg=传回预期之外的结果。
   
   org.postgresql.util.PSQLException: 传回预期之外的结果。
   
   	at org.postgresql.jdbc.PgStatement.getNoResultUpdateCount(PgStatement.java:254)
   	at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:245)
   	at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)
   	at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
   	at org.apache.shardingsphere.driver.executor.StatementExecutor$2.executeSQL(StatementExecutor.java:146)
   	at org.apache.shardingsphere.driver.executor.StatementExecutor$2.executeSQL(StatementExecutor.java:142)
   	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.StatementExecutor.executeUpdate(StatementExecutor.java:149)
   	at org.apache.shardingsphere.driver.executor.StatementExecutor.executeUpdate(StatementExecutor.java:97)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.executeUpdate(ShardingSphereStatement.java:147)
   	at org.apache.shardingsphere.dbtest.engine.dml.GeneralDMLIT.executeUpdateForStatement(GeneralDMLIT.java:80)
   	at org.apache.shardingsphere.dbtest.engine.dml.GeneralDMLIT.assertExecuteUpdate(GeneralDMLIT.java:70)
   ```
   
   `GeneralDMLIT.assertExecute`:
   ```
   INSERT /*+ index(field1) */ INTO t_order (order_id, user_id, status) VALUES (1, 1, 'insert') RETURNING order_id
   
   java.lang.AssertionError: Not a DML statement.
   
   	at org.junit.Assert.fail(Assert.java:88)
   	at org.junit.Assert.assertTrue(Assert.java:41)
   	at org.junit.Assert.assertFalse(Assert.java:64)
   	at org.apache.shardingsphere.dbtest.engine.dml.GeneralDMLIT.executeForStatement(GeneralDMLIT.java:115)
   	at org.apache.shardingsphere.dbtest.engine.dml.GeneralDMLIT.assertExecute(GeneralDMLIT.java:105)
   ```
   
   ### Reason analyze (If you can)
   INSERT...RETURNING need special code to operate.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1, env.properties:
   rule.types=db
   databases=PostgreSQL
   postgresql.host=127.0.0.1
   postgresql.password=test
   
   2, Run GeneralDMLIT in IDEA
   
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 closed issue #7207: INSERT...RETURING statement failed in PostgreSQL DML integration test

Posted by GitBox <gi...@apache.org>.
tuohai666 closed issue #7207:
URL: https://github.com/apache/shardingsphere/issues/7207


   


----------------------------------------------------------------
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:
users@infra.apache.org