当前使用版本(必填,否则不予处理)
mybatis-plus-extension 3.5.3.1
该问题是如何引起的?(确定最新版也有问题再提!!!)
使用租户处理器后,由于com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler#ignoreInsert方法没有考虑Column带反引号的情况,导致没有正确ignore已经包含tenant_id的insert语句
重现步骤(如果有就写完整)
配置租户处理器
model中定义private String tenantId;,不使用注解指定名称
调用mapper.insert
报错信息
### Cause: java.sql.SQLSyntaxErrorException: (conn=12286723) Column 'tenant_id' specified twice\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: (conn=12286723) Column 'tenant_id' specified twice