mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved mysql parser support. issue #1420
This commit is contained in:
@@ -801,7 +801,15 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
|
||||
accept(Token.LPAREN);
|
||||
for (;;) {
|
||||
unique.addColumn(this.expr());
|
||||
SQLExpr column = this.expr();
|
||||
if (lexer.token() == Token.ASC) {
|
||||
column = new MySqlOrderingExpr(column, SQLOrderingSpecification.ASC);
|
||||
lexer.nextToken();
|
||||
} else if (lexer.token() == Token.DESC) {
|
||||
column = new MySqlOrderingExpr(column, SQLOrderingSpecification.DESC);
|
||||
lexer.nextToken();
|
||||
}
|
||||
unique.addColumn(column);
|
||||
if (!(lexer.token() == (Token.COMMA))) {
|
||||
break;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user