mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved opds sql support
This commit is contained in:
@@ -2255,7 +2255,7 @@ public class Lexer {
|
||||
boolean ident = false;
|
||||
for (; ; ) {
|
||||
ch = charAt(++pos);
|
||||
if (isEOF()) {
|
||||
if (isEOF() || ch == ';' || ch == ';') {
|
||||
pos--;
|
||||
bufPos--;
|
||||
break;
|
||||
@@ -2287,7 +2287,7 @@ public class Lexer {
|
||||
this.ch = charAt(pos);
|
||||
|
||||
if (dbType == DbType.odps) {
|
||||
while (isIdentifierChar(this.ch)) {
|
||||
while (isIdentifierChar(this.ch) && ch != ';') {
|
||||
++pos;
|
||||
bufPos++;
|
||||
this.ch = charAt(pos);
|
||||
|
||||
@@ -517,6 +517,17 @@ public class SQLParserUtils {
|
||||
if (lexer.identifierEquals("pai") || lexer.identifierEquals("jar")) {
|
||||
return Collections.singletonList(sql);
|
||||
}
|
||||
|
||||
if (dbType == DbType.odps) {
|
||||
switch (lexer.token) {
|
||||
case IF:
|
||||
case VARIANT:
|
||||
case WHILE:
|
||||
return Collections.singletonList(sql);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List list = new ArrayList();
|
||||
|
||||
Reference in New Issue
Block a user