mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for msyql parser. issue #1359
This commit is contained in:
@@ -254,6 +254,12 @@ public class MySqlLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
|
||||
if (!isIdentifierChar(ch)) {
|
||||
if (ch == '-' && pos < text.length() - 1) {
|
||||
char next_char = text.charAt(pos + 1);
|
||||
if (isIdentifierChar(next_char)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (last_ch == '-' && charAt(pos-2) != '-') {
|
||||
ch = last_ch;
|
||||
bufPos--;
|
||||
@@ -419,7 +425,7 @@ public class MySqlLexer extends Lexer {
|
||||
}
|
||||
// identifierFlags['`'] = true;
|
||||
identifierFlags['_'] = true;
|
||||
identifierFlags['-'] = true; // mysql
|
||||
//identifierFlags['-'] = true; // mysql
|
||||
}
|
||||
|
||||
public static boolean isIdentifierChar(char c) {
|
||||
|
||||
Reference in New Issue
Block a user