You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "yvkm (via GitHub)" <gi...@apache.org> on 2023/06/29 04:29:55 UTC
[GitHub] [shardingsphere] yvkm opened a new issue, #26685: Fail to reset ResultSet cursor. can not get primary key value
yvkm opened a new issue, #26685:
URL: https://github.com/apache/shardingsphere/issues/26685
## Bug Report
When I insert a SQL statement without primary key, an SQL syntax error occurs.
DDL :
`CREATE TABLE `config` (
`config_id` int(11) NOT NULL AUTO_INCREMENT ,
`type` tinyint(2) NULL DEFAULT NULL ,
`date` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`value` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`updator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`config_id`) USING BTREE,
INDEX `date`(`date`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 832 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; `
log:
> INFO Actual SQL: master ::: INSERT INTO config (`type`, `date`, `value`, `create_time`, `update_time`, `creator`, `updator`) VALUES (?, ?, ?, ?, ?, ?, ?) ::: [0, 2023-06-27, 100, 2023-06-27 18:34:22.752, 2023-06-27 18:34:22.765, axi, axi] ShardingSphere-SQL.log(SQLLogger.java:74)
>
> INFO load KeywordChecker[mysql] extension by class[io.seata.rm.datasource.undo.mysql.keyword.MySQLKeywordChecker] i.s.c.l.EnhancedServiceLoader.loadFile(EnhancedServiceLoader.java:247)
>
> INFO load TableMetaCache[mysql] extension by class[io.seata.rm.datasource.sql.struct.cache.MysqlTableMetaCache] i.s.c.l.EnhancedServiceLoader.loadFile(EnhancedServiceLoader.java:247)
>
> INFO Logic SQL: SELECT * FROM config LIMIT 1 ShardingSphere-SQL.log(SQLLogger.java:74)
>
> NFO SQLStatement: MySQLSelectStatement(table=Optional.empty, limit=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment@5721aed5], lock=Optional.empty, window=Optional.empty) ShardingSphere-SQL.log(SQLLogger.java:74)
>
> INFO Actual SQL: master ::: SELECT * FROM config LIMIT 1 ShardingSphere-SQL.log(SQLLogger.java:74)
>
> WARN **Fail to reset ResultSet cursor. can not get primary key value i.s.r.d.e.InsertExecutor.defaultByAuto(InsertExecutor.java:317)**
>
> ERROR org.springframework.jdbc.UncategorizedSQLException:
>
> ### Error flushing statements. Cause: java.sql.SQLException: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
>
> ### Cause: java.sql.SQLException: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
>
> ; uncategorized SQLException; SQL state [null]; error code [0]; org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax; nested exception is java.sql.SQLException: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
>
> at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
>
> at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
>
> at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
>
> at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:88)
>
> at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.executeBatch(ServiceImpl.java:232)
>
> at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.executeBatch(ServiceImpl.java:252)
>
> at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.saveBatch(ServiceImpl.java:127)
>
> at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl$$FastClassBySpringCGLIB$$76535273.invoke(<generated>)
>
> at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
>
> at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
>
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
>
> at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
>
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
>
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
>
> at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
### Which version of ShardingSphere did you use?
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>5.1.2</version>
</dependency>
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
Should insert the SQL with primary key, because primary key is auto-increament.
### Actual behavior
no primary key lead to fail.
### Reason analyze (If you can)
After I insert this SQL with primary key, It works fine.
--
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #26685: Fail to reset ResultSet cursor. can not get primary key value
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #26685:
URL: https://github.com/apache/shardingsphere/issues/26685#issuecomment-1656865775
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org