mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
+2
-2
@@ -306,7 +306,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
} else if (lexer.token() == Token.VALUES) {
|
||||
query = this.parseSelect();
|
||||
} else {
|
||||
throw new ParserException("syntax error, support token '" + lexer.token() + "'");
|
||||
throw new ParserException("syntax error, support token '" + lexer.token() + "', " + lexer.info());
|
||||
}
|
||||
withQuery.setQuery(query);
|
||||
|
||||
@@ -347,7 +347,7 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
stmt.setWith(with);
|
||||
return stmt;
|
||||
}
|
||||
throw new ParserException("TODO");
|
||||
throw new ParserException("TODO. " + lexer.info());
|
||||
}
|
||||
|
||||
protected SQLAlterTableAlterColumn parseAlterColumn() {
|
||||
|
||||
@@ -197,7 +197,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
} else if (lexer.token() == Token.NEXT) {
|
||||
fetch.setOption(PGSelectQueryBlock.FetchClause.Option.NEXT);
|
||||
} else {
|
||||
throw new ParserException("expect 'FIRST' or 'NEXT'");
|
||||
throw new ParserException("expect 'FIRST' or 'NEXT'. " + lexer.info());
|
||||
}
|
||||
|
||||
SQLExpr count = expr();
|
||||
@@ -206,13 +206,13 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
if (lexer.token() == Token.ROW || lexer.token() == Token.ROWS) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("expect 'ROW' or 'ROWS'");
|
||||
throw new ParserException("expect 'ROW' or 'ROWS'. " + lexer.info());
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.ONLY) {
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("expect 'ONLY'");
|
||||
throw new ParserException("expect 'ONLY'. " + lexer.info());
|
||||
}
|
||||
|
||||
queryBlock.setFetch(fetch);
|
||||
@@ -230,7 +230,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
forClause.setOption(PGSelectQueryBlock.ForClause.Option.SHARE);
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("expect 'FIRST' or 'NEXT'");
|
||||
throw new ParserException("expect 'FIRST' or 'NEXT'. " + lexer.info());
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.OF) {
|
||||
|
||||
Reference in New Issue
Block a user