druid lexer解析如下sql语句时出错:
select * from test where id='1' WAITFOR DELAY '0:0:5'--'
该语句在mysql中可正常执行
exception信息:
Exception in thread "main" com.alibaba.druid.sql.parser.ParserException: syntax error at end of input.
at com.alibaba.druid.sql.parser.Lexer.scanSingleLineComment(Lexer.java:863)
at com.alibaba.druid.sql.parser.Lexer.scanComment(Lexer.java:790)
at com.alibaba.druid.sql.parser.Lexer.nextToken(Lexer.java:451)
解析代码如下:
Lexer lexer = new Lexer(sql);
for (;;) {
lexer.nextToken();
Token tok = lexer.token();
......
}
1条答案
按热度按时间6psbrbz91#
sql中缺省的转义不是',而是''