qq279973895 opened a new issue #11162: URL: https://github.com/apache/shardingsphere/issues/11162
my mysql table :  CREATE TABLE `t_testpaper_question` ( `id` bigint(20) unsigned NOT NULL, `paperId` bigint(20) DEFAULT NULL, `questionId` bigint(20) NOT NULL, `innerOrder` int(11) DEFAULT NULL, `status` int(11) NOT NULL DEFAULT '1' COMMENT '0禁用,1启用', PRIMARY KEY (`id`), KEY `tq_paperId` (`paperId`), KEY `t_testpaper_question_questionId_index` (`questionId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC pom version:  When I use spring boot excute sql : "SELECT ttq.*,(@rowNum :=@rowNum + 1) AS num FROM t_testpaper_question ttq,(SELECT @rowNum := 0) temp WHERE paperId = 160 AND STATUS = 1 ORDER BY innerOrder",my idea throw IndexOutOfBoundsException. The following is idea console info: 2021-07-05 18:11:13.889 ERROR 15476 --- [ XNIO-1 task-1] c.q.p.qlib.exception.ExcptionAdvice : occur unhandle exception: org.mybatis.spring.MyBatisSystemException, errorMsg: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IndexOutOfBoundsException: Index: 0 ### The error may exist in file [D:\webroot\onesmart-qlib-service\target\classes\mapper\TestPaperMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select ttq.*,(@rowNum :=@rowNum + 1) AS num from t_testpaper_question ttq,(SELECT @rowNum := 0) temp where paperId = ? and status = 1 order by innerOrder ### Cause: java.lang.IndexOutOfBoundsException: Index: 0  -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
