druid 1.1.16/1.1.18 在mysql中select * from table t where t.name like ${name} 报错,无法解析${}
Open
- Dominant language
- Java
- Stars
- 28.2k
- Forks
- 8.6k
- PR merge metrics
- No merged PRs in 30d
Description
@Override
public List> query(String name) {
Map params = new HashMap();
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正常
Contributor guide
Research direction
Start with the reported baseDao.query call and the SQL parser path handling the ${name} expression, comparing behavior with version 1.0.15 and 1.1.16/1.1.18. Reproduce the MySQL query, identify the parser regression, and add coverage showing that the expression is accepted without the reported ParserException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mysql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100