bug fixed for sql wall.

This commit is contained in:
wenshao
2017-10-26 23:32:40 +08:00
parent 3445a3a3f2
commit 798beed7a8
3 changed files with 6 additions and 3 deletions
@@ -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
);
}