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/11/19 10:38:52 UTC

[GitHub] [shardingsphere] booingdu opened a new issue #8226: MYSQL replace语法无法解析

booingdu opened a new issue #8226:
URL: https://github.com/apache/shardingsphere/issues/8226


   SQL语句如下:
   replace into t_activity(userId, date)values(#{userId},#{date})  
   
   2020-11-19 18:31:29.876 ERROR[http-nio-10024-exec-5] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement.  Cause: java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement cannot be cast to org.apache.shardingsphere.sql.parser.sql.statement.dml.ReplaceStatement] with root cause
   java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement cannot be cast to org.apache.shardingsphere.sql.parser.sql.statement.dml.ReplaceStatement
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitReplace(MySQLDMLVisitor.java:163) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitReplace(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ReplaceContext.accept(MySQLStatementParser.java:1471) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80) ~[shardingsphere-sql-parser-engine-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61) ~[shardingsphere-sql-parser-engine-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.<init>(MasterSlavePreparedStatement.java:65) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.<init>(MasterSlavePreparedStatement.java:53) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.MasterSlaveConnection.prepareStatement(MasterSlaveConnection.java:79) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
   	at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source) ~[?:?]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
   	at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:55) ~[mybatis-3.4.4.jar:3.4.4]
   	at com.sun.proxy.$Proxy256.prepareStatement(Unknown Source) ~[?:?]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:85) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.4.jar:3.4.4]
   	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.4.jar:3.4.4]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.4.jar:3.4.4]
   	at com.sun.proxy.$Proxy255.update(Unknown Source) ~[?:?]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.4.jar:3.4.4]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.1.jar:1.3.1]
   	at com.sun.proxy.$Proxy128.update(Unknown Source) ~[?:?]
   	at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) ~[mybatis-spring-1.3.1.jar:1.3.1]
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) ~[mybatis-3.4.4.jar:3.4.4]


----------------------------------------------------------------
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] booingdu commented on issue #8226: MYSQL “replace”Syntax cannot parse

Posted by GitBox <gi...@apache.org>.
booingdu commented on issue #8226:
URL: https://github.com/apache/shardingsphere/issues/8226#issuecomment-730819036


   The 5.0.0-alpha read/write split documentation is not very comprehensive.The read-write separation configuration is not the same as before. @strongduanmu 


----------------------------------------------------------------
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] terrymanu commented on issue #8226: MYSQL “replace”Syntax cannot parse

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #8226:
URL: https://github.com/apache/shardingsphere/issues/8226#issuecomment-731915864


   We are talking about replace syntax supported. The answer is yes and supported in version 5.0.0-alpha.
   Please open new issue for other discussion.


----------------------------------------------------------------
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] terrymanu closed issue #8226: MYSQL “replace”Syntax cannot parse

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


   


----------------------------------------------------------------
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] strongduanmu commented on issue #8226: MYSQL “replace”Syntax cannot parse

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #8226:
URL: https://github.com/apache/shardingsphere/issues/8226#issuecomment-730384503


   @booingdu Can you try the `5.0.0-alpha` version? The new version already supports the `Replace Statement`.


----------------------------------------------------------------
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] trydofor commented on issue #8226: MYSQL “replace”Syntax cannot parse

Posted by GitBox <gi...@apache.org>.
trydofor commented on issue #8226:
URL: https://github.com/apache/shardingsphere/issues/8226#issuecomment-731569190


   > @booingdu Can you try the `5.0.0-alpha` version? The new version already supports the `Replace Statement`.
   
   BYW, when do the 5.0.0 release in the schedule?


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