bug fixed for sql parser

This commit is contained in:
wenshao
2013-02-25 18:34:01 +08:00
parent 6a36004991
commit 2d0023f80e
7 changed files with 179 additions and 6 deletions
@@ -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);