bug fixed for sql parser. for issue #1737 #1762

This commit is contained in:
wenshao
2017-06-25 20:30:03 +08:00
parent 54e9620dc3
commit ce4b4287ee
6 changed files with 219 additions and 2 deletions
@@ -463,7 +463,12 @@ public class Lexer {
token = Token.QUESQUES;
} else if (ch == '|' && JdbcConstants.POSTGRESQL.equals(dbType)) {
scanChar();
token = Token.QUESBAR;
if (ch == '|') {
unscan();
token = Token.QUES;
} else {
token = Token.QUESBAR;
}
} else if (ch == '&' && JdbcConstants.POSTGRESQL.equals(dbType)) {
scanChar();
token = Token.QUESAMP;
@@ -43,7 +43,7 @@ public class SQLParserUtils {
public static SQLStatementParser createSQLStatementParser(String sql, String dbType) {
boolean keepComments;
if (JdbcConstants.ODPS.equals(dbType)) {
if (JdbcConstants.ODPS.equals(dbType) || JdbcConstants.MYSQL.equals(dbType)) {
keepComments = true;
} else {
keepComments = false;