mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql wall.
This commit is contained in:
@@ -2956,7 +2956,7 @@ public class SQLExprParser extends SQLParser {
|
||||
}
|
||||
|
||||
SQLSelectItem selectItem = new SQLSelectItem(expr, alias, connectByRoot);
|
||||
if (lexer.token == Token.HINT) {
|
||||
if (lexer.token == Token.HINT && !lexer.isEnabled(SQLParserFeature.StrictForWall)) {
|
||||
String comment = "/*" + lexer.stringVal() + "*/";
|
||||
selectItem.addAfterComment(comment);
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -21,7 +21,8 @@ public enum SQLParserFeature {
|
||||
EnableSQLBinaryOpExprGroup,
|
||||
OptimizedForParameterized,
|
||||
KeepComments,
|
||||
SkipComments
|
||||
SkipComments,
|
||||
StrictForWall
|
||||
;
|
||||
|
||||
private SQLParserFeature(){
|
||||
|
||||
@@ -39,7 +39,9 @@ public class MySqlWallProvider extends WallProvider {
|
||||
|
||||
@Override
|
||||
public SQLStatementParser createParser(String sql) {
|
||||
return new MySqlStatementParser(sql, SQLParserFeature.EnableSQLBinaryOpExprGroup
|
||||
return new MySqlStatementParser(sql
|
||||
, SQLParserFeature.EnableSQLBinaryOpExprGroup
|
||||
, SQLParserFeature.StrictForWall
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user