xiangtao123 opened a new issue #6544: URL: https://github.com/apache/shardingsphere/issues/6544
## Bug Report **For English only**, other languages will not accept. Before report a bug, make sure you have: - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues). - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview). Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will **close it**. Please answer these questions before submitting your issue. Thanks! ### Which version of ShardingSphere did you use? 4.1.1 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ### Expected behavior work on. ### Actual behavior 2020-07-31 11:27:08.538 ERROR 27 --- [pool-8-thread-2] c.k.m.s.s.impl.ScheduleServiceImpl : 添加日程[repeat schedule demo20200731(2)]-异常 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.lang.NullPointerException ### The error may exist in com/**/mapper/ParticipateMapper.xml ### The error may involve com.kuaibao.module.schedule.mapper.ParticipateMapper.batchInsertParticipatesForRepeatSchedule-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO t_participant (id, template_id, schedule_id, user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_outside_id, user_type) SELECT REPLACE(UUID(), '-', ''), template_id, 'e429fb7df74c4b99885a7673e8e15e34', user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_outside_id, user_type FROM t_participant WHERE schedule_id = 'f97b92e141284b099812b2c12e44d094' ### Cause: java.lang.NullPointerException at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy151.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:58) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:62) at com.sun.proxy.$Proxy165.batchInsertParticipatesForRepeatSchedule(Unknown Source) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy166.batchInsertParticipatesForRepeatSchedule(Unknown Source) at com.**.service.impl.ScheduleServiceImpl.addInstanceRepeatSchedule(ScheduleServiceImpl.java:4194) at com.**.service.impl.ScheduleServiceImpl$2.run(ScheduleServiceImpl.java:419) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.lang.NullPointerException ### The error may exist in com/**/mapper/ParticipateMapper.xml ### The error may involve com**.mapper.ParticipateMapper.batchInsertParticipatesForRepeatSchedule-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO t_participant (id, template_id, schedule_id, user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_outside_id, user_type) SELECT REPLACE(UUID(), '-', ''), template_id, 'e429fb7df74c4b99885a7673e8e15e34', user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_outside_id, user_type FROM t_participant WHERE schedule_id = 'f97b92e141284b099812b2c12e44d094' ### Cause: java.lang.NullPointerException at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) 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) ... 23 common frames omitted Caused by: java.lang.NullPointerException: null at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitInsert(MySQLDMLVisitor.java:147) at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitInsert(MySQLDMLVisitor.java:127) at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$InsertContext.accept(MySQLStatementParser.java:1090) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80) at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61) at org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97) at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89) at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76) at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54) at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96) at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83) at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.prepare(ShardingPreparedStatement.java:183) at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:143) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) 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.$Proxy418.update(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doUpdate(MybatisSimpleExecutor.java:54) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ... 29 common frames omitted ### Reason analyze (If you can) insert into select sql parse. ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. INSERT INTO t_participant (id, template_id, schedule_id, user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_outside_id, user_type) SELECT REPLACE(UUID(), '-', ''), template_id, 'e429fb7df74c4b99885a7673e8e15e34', user_id, agent_code, phone, wechat_num, name, is_employee, type, notice_flag, state, refusal_reasons, refusal_time, invitation_is_limit, invitation_is_without, invitation_state, invitation_remarks, invitation_time, schedule_owner_operate, schedule_owner_refusal_reasons, schedule_owner_refusal_time, sign_in_state, sign_time, late_time, create_time, is_delete, is_finish, is_look, customer_id, origin_source, origin_o utside_id, user_type FROM t_participant WHERE schedule_id = 'f97b92e141284b099812b2c12e44d094' ; ### 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: [email protected]
