当前使用版本(必填,否则不予处理)
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
该问题是如何引起的?(确定最新版也有问题再提!!!)
框架中的sql解析器sql解析异常问题
重现步骤(如果有就写完整)
使用的是Oracle数据库 1.增加 防全表更新与删除插件
@Configuration
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
return interceptor;
}
}
- 在数据库中执行模糊删除语句 Oracle SQL语句
delete from SYS_DEPT
where DEPT_TREE_PATH like #{deptTreePath,jdbcType=VARCHAR}||'%'
报错信息
nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: delete from SYS_DEPT
where DEPT_TREE_PATH like ?||'%'
### The error may exist in file [D:\aaa\b\bbm\target\classes\mappers\SysDeptMapper.xml]
### The error may involve com.hithium.mes.system.mapper.SysDeptMapper.deleteByLikeDeptTreePath
### The error occurred while executing an update
### Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Failed to process, Error SQL: delete from SYS_DEPT
where DEPT_TREE_PATH like ?||'%'
Comment From: miemieYaho
jsqlparser 无法解析
Comment From: xiaostart977
所以这个是问题是无解的?
Comment From: xiaostart977
昨天通过断点调试,也跟到了jsqlparser,发现是这一块的问题,所有后面换成了用Oracle提供的字符串拼接的函数暂时解决
Comment From: qmdx
jsqlparser 你的异常完整 SQL 可以提交 https://github.com/JSQLParser/JSqlParser 反馈