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 2019/12/11 01:47:13 UTC

[GitHub] [incubator-shardingsphere] quicksandznzn opened a new issue #3711: insert select dual

quicksandznzn opened a new issue #3711: insert select dual
URL: https://github.com/apache/incubator-shardingsphere/issues/3711
 
 
   version:
   <dependency>
               <groupId>io.shardingsphere</groupId>
               <artifactId>sharding-jdbc-core</artifactId>
               <version>3.0.0.M4</version>
           </dependency>
   
   when i execute this sql 
   insert into table (a,b,c) select 1,2,3 from dual WHERE not exists (select a from table  where a=1);  
   error:
   ### Cause: java.lang.UnsupportedOperationException: Cannot INSERT SELECT
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
   	... 51 more
   Caused by: java.lang.UnsupportedOperationException: Cannot INSERT SELECT
   	at io.shardingsphere.core.parsing.parser.sql.dml.insert.AbstractInsertParser.parse(AbstractInsertParser.java:69)
   	at io.shardingsphere.core.parsing.parser.sql.dml.insert.AbstractInsertParser.parse(AbstractInsertParser.java:41)
   	at io.shardingsphere.core.parsing.SQLParsingEngine.parse(SQLParsingEngine.java:60)
   	at io.shardingsphere.core.routing.router.sharding.ParsingSQLRouter.parse(ParsingSQLRouter.java:91)
   	at io.shardingsphere.core.routing.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:64)
   	at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.sqlRoute(ShardingPreparedStatement.java:229)
   	at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:137)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
   	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
   	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   	at com.sun.proxy.$Proxy115.update(Unknown Source)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
   	... 57 more

----------------------------------------------------------------
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


With regards,
Apache Git Services