mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser
This commit is contained in:
@@ -55,7 +55,7 @@ public class SQLWithSubqueryClause extends SQLObjectImpl {
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected SQLIdentifierExpr name;
|
||||
protected final List<SQLName> columns = new ArrayList<SQLName>();
|
||||
protected SQLSelectQuery subQuery;
|
||||
protected SQLSelect subQuery;
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
@@ -75,11 +75,11 @@ public class SQLWithSubqueryClause extends SQLObjectImpl {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public SQLSelectQuery getSubQuery() {
|
||||
public SQLSelect getSubQuery() {
|
||||
return subQuery;
|
||||
}
|
||||
|
||||
public void setSubQuery(SQLSelectQuery subQuery) {
|
||||
public void setSubQuery(SQLSelect subQuery) {
|
||||
this.subQuery = subQuery;
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ public class OracleSelectParser extends SQLSelectParser {
|
||||
|
||||
accept(Token.AS);
|
||||
accept(Token.LPAREN);
|
||||
entry.setSubQuery(query());
|
||||
entry.setSubQuery(select());
|
||||
accept(Token.RPAREN);
|
||||
|
||||
if (identifierEquals("SEARCH")) {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class SQLParser {
|
||||
} else {
|
||||
setErrorEndPos(lexer.pos());
|
||||
throw new SQLParseException("syntax error, expect " + token + ", actual " + lexer.token() + " "
|
||||
+ lexer.stringVal());
|
||||
+ lexer.stringVal() + ", pos " + this.lexer.pos());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ public class SQLSelectParser extends SQLParser {
|
||||
|
||||
accept(Token.AS);
|
||||
accept(Token.LPAREN);
|
||||
entry.setSubQuery(query());
|
||||
entry.setSubQuery(select());
|
||||
accept(Token.RPAREN);
|
||||
|
||||
withQueryClause.getEntries().add(entry);
|
||||
|
||||
Reference in New Issue
Block a user