当前使用版本(必填,否则不予处理)

com.baomidou mybatis-plus-boot-starter 3.4.3.1

该问题是如何引起的?(确定最新版也有问题再提!!!)

我有一个关联表b,实体表a,a会用来分成a1,a2, 就是 a1-b-a2, 三张表关联,它会报a2的字段b1没有索引,b1其实是b表的字段,已经加索引了

重现步骤(如果有就写完整)

三张表

A表(A1和A2表一样)
id
B表
id, a1_id, a2_id
出错sql语句,会报 a2表的a2_id字段没有索引的错误,示例上的每一个字段都有索引
SELECT
    COUNT(*) 
FROM
    a a1
    RIGHT JOIN b  ON a1.id = b.a1_id
    LEFT JOIN a a2 ON a2.id  = b.a2_id

报错信息

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: 非法SQL,SQL未使用到索引, table:sys_user u2, columnName:origin_user_id

The error may exist in file [D:\develop\target\classes\mapping\AgentHistoryMapper.xml]

The error may involve com.parcel.mapper.AgentHistoryMapper.findPage_mpCount

The error occurred while executing a query

Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: 非法SQL,SQL未使用到索引, table:sys_user u2, columnName:origin_user_id

Comment From: foreveryang321

版本:3.4.3.1 分页插件执行的count语句也会拦截 MyBatis-Plus 【 BUG 】IllegalSQLInnerInterceptor,发现一个性能规范插件的  BUG !!!!!!!!!!!!!!!!

Comment From: qmdx

这个插件拦截的SQL如果不符合你的预期 https://baomidou.com/pages/223848/#interceptorignore 忽略该方法的拦截