mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved postgresql sql parser support. support '@@' operator. issue #1391
This commit is contained in:
@@ -39,6 +39,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -84,6 +85,8 @@ public class Lexer {
|
||||
|
||||
protected int lines = 0;
|
||||
|
||||
protected String dbType;
|
||||
|
||||
public Lexer(String input){
|
||||
this(input, null);
|
||||
}
|
||||
@@ -984,6 +987,12 @@ public class Lexer {
|
||||
char ch;
|
||||
|
||||
if (charAt(pos + 1) == '@') {
|
||||
if (JdbcConstants.POSTGRESQL.equalsIgnoreCase(dbType)) {
|
||||
pos += 2;
|
||||
token = Token.MONKEYS_AT_AT;
|
||||
this.ch = charAt(++pos);
|
||||
return;
|
||||
}
|
||||
ch = charAt(++pos);
|
||||
|
||||
bufPos++;
|
||||
|
||||
Reference in New Issue
Block a user