@OverRide
public List<Map<String, Object>> query(String name) {
Map<String,Object> params = new HashMap<String,Object>();
params.put("name", name);
return baseDao.query("select * from t_demo d where d.c_name like ${name}", params);
}
com.alibaba.druid.sql.parser.ParserException: syntax error, expect CALL, actual IDENTIFIER
把依赖换成1.0.15正常
1条答案
按热度按时间r8xiu3jd1#
源码中lexer解析了select 后 直接找到了{,并且进了如CALL的逻辑
if (lexer.token == Token.LBRACE || lexer.identifierEquals("CALL")) {
SQLCallStatement stmt = parseCall();
statementList.add(stmt);
continue;
}
在parseCall 里会进入这个逻辑
protected void acceptIdentifier(String text) {
if (lexer.identifierEquals(text)) {
lexer.nextToken();
} else {
setErrorEndPos(lexer.pos());
throw new ParserException("syntax error, expect " + text + ", actual " + lexer.token + ", " + lexer.info());
}
}
感觉lexer解析变量有问题