clause.setPartitionCount(this.exprParser.expr());
}
} else if (identifierEquals("RANGE")) {
lexer.nextToken();
MySqlPartitionByRange clause = new MySqlPartitionByRange();
if (lexer.token() == Token.LPAREN) {
lexer.nextToken();
clause.setExpr(this.exprParser.expr());
accept(Token.RPAREN);
} else {
acceptIdentifier("COLUMNS");
accept(Token.LPAREN);
for (;;) {
clause.getColumns().add(this.exprParser.name());
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
}
break;
}
accept(Token.RPAREN);
}
partitionClause = clause;
if (identifierEquals("PARTITIONS")) {
lexer.nextToken();
clause.setPartitionCount(this.exprParser.expr());
}
//
} else if (identifierEquals("LIST")) {
lexer.nextToken();
MySqlPartitionByList clause = new MySqlPartitionByList();
if (lexer.token() == Token.LPAREN) {
lexer.nextToken();
clause.setExpr(this.exprParser.expr());
accept(Token.RPAREN);
} else {
acceptIdentifier("COLUMNS");
accept(Token.LPAREN);
for (;;) {
clause.getColumns().add(this.exprParser.name());
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
}
break;
}
accept(Token.RPAREN);
}
partitionClause = clause;
if (identifierEquals("PARTITIONS")) {
lexer.nextToken();
clause.setPartitionCount(this.exprParser.expr());
}
} else {
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
}