admin管理员组

文章数量:1599408

项目场景:

前几天在写项目中的Mapper的时候,遇到了这种报错,在这里记录一下。免得以后忘记。


问题描述

在项目中的Mapper使用了如下的写法。

where xx.isDeleted = #{isDeleted} and 1=1 and ..

出现了如下的错误

sql injection violation, part alway true condition not allow


原因分析:

1=1  不能永真条件

ql injection violation, part alway true condition not allow

解决方案:

  将SQL永真(1=1类似的)的条件放到第一位 或者 去掉

引用

【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案-CSDN博客文章浏览阅读1.6k次。【问题】druid报异常sql injection violation, part alway true condition not allow_sql injection violation, part alway true condition not allowhttps://blog.csdn/G971005287W/article/details/125575231

本文标签: 异常解决方案InjectionsqlPart