support clickhouse limit by, fix #4110

This commit is contained in:
高铁
2020-12-26 06:08:25 +08:00
parent f91508e36b
commit 58fa713694
3 changed files with 69 additions and 10 deletions
@@ -5711,6 +5711,21 @@ public class SQLExprParser extends SQLParser {
} else {
limit.setRowCount(temp);
}
if (lexer.token == Token.BY && dbType == DbType.clickhouse) {
lexer.nextToken();
for (;;) {
SQLExpr item = this.expr();
limit.addBy(item);
if (lexer.token == Token.COMMA) {
lexer.nextToken();
continue;
}
break;
}
}
return limit;
}