improved opds sql support

This commit is contained in:
shaojin.wensj
2022-08-10 10:56:13 +08:00
parent 4e79691110
commit 7e6857313b
2 changed files with 13 additions and 2 deletions
@@ -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();