mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser. for issue #1637
This commit is contained in:
@@ -1220,6 +1220,19 @@ public class SQLExprParser extends SQLParser {
|
||||
item.setType(SQLOrderingSpecification.DESC);
|
||||
}
|
||||
|
||||
if (identifierEquals("NULLS")) {
|
||||
lexer.nextToken();
|
||||
if (identifierEquals("FIRST")) {
|
||||
lexer.nextToken();
|
||||
item.setNullsOrderType(SQLSelectOrderByItem.NullsOrderType.NullsFirst);
|
||||
} else if (identifierEquals("LAST")) {
|
||||
lexer.nextToken();
|
||||
item.setNullsOrderType(SQLSelectOrderByItem.NullsOrderType.NullsLast);
|
||||
} else {
|
||||
throw new ParserException("TODO " + lexer.token());
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user