背景 mybatis执行sql正常返回数据 但是又报了错
InteractAspect errInfo:org.springframework.jdbc.UncategorizedSQLException:
### Error querying database. Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect RPAREN, actual FOR FOR : SELECT xxx from xxx where xx=SUBSTR(XX FROM pos FOR len)'
这里的sql injection violation吓人的完全可以忽略 语法错误:语法错误,期望RPAREN实际FOR 意识是不应该有FOR
即SUBSTR(XX FROM pos FOR len) mybatis不支持这种写法 那换种写法SUBSTR(XX,pos,len) 问题解决