improved postgresql sql parser support. support '@@' operator. issue #1391

This commit is contained in:
wenshao
2016-09-18 21:57:13 +08:00
parent 2a64573d5d
commit c3681f1d0e
6 changed files with 94 additions and 3 deletions
@@ -23,6 +23,7 @@ import java.util.Map;
import com.alibaba.druid.sql.parser.Keywords;
import com.alibaba.druid.sql.parser.Lexer;
import com.alibaba.druid.sql.parser.Token;
import com.alibaba.druid.util.JdbcConstants;
public class PGLexer extends Lexer {
@@ -65,6 +66,7 @@ public class PGLexer extends Lexer {
map.put("ARRAY", Token.ARRAY);
map.put("IF", Token.IF);
map.put("TYPE", Token.TYPE);
map.put("ILIKE", Token.ILIKE);
DEFAULT_PG_KEYWORDS = new Keywords(map);
}
@@ -72,6 +74,7 @@ public class PGLexer extends Lexer {
public PGLexer(String input){
super(input);
super.keywods = DEFAULT_PG_KEYWORDS;
super.dbType = JdbcConstants.POSTGRESQL;
}
protected void scanString() {