[#7724] Parser should support parsing pi() function

This commit is contained in:
lukaseder 2018-08-08 09:56:05 +02:00
parent 63379a2343
commit d1b571ddd3
3 changed files with 5 additions and 1 deletions

View File

@ -684,6 +684,7 @@ term =
| 'NEXT VALUE FOR' sequenceName
| 'NEXTVAL' '(' ( name | stringLiteral ) ')'
| 'OCTET_LENGTH' '(' field ')'
| 'PI' '(' ')'
| 'POSITION' '(' field 'IN' field ')'
| 'PERCENT_RANK' ( '(' ')' over | '(' fields ')' withinGroup )
| ( 'PERCENTILE_CONT' | 'PERCENTILE_DISC' ) '(' unsignedNumericLiteral ')' withinGroup [ over ]

View File

@ -158,6 +158,7 @@ import static org.jooq.impl.DSL.partitionBy;
import static org.jooq.impl.DSL.percentRank;
import static org.jooq.impl.DSL.percentileCont;
import static org.jooq.impl.DSL.percentileDisc;
import static org.jooq.impl.DSL.pi;
import static org.jooq.impl.DSL.position;
import static org.jooq.impl.DSL.primaryKey;
import static org.jooq.impl.DSL.prior;
@ -4605,6 +4606,8 @@ final class ParserImpl implements Parser {
return field;
else if ((field = parseFieldPowerIf(ctx)) != null)
return field;
else if (parseFunctionNameIf(ctx, "PI"))
return pi();
if (parseKeywordIf(ctx, "PRIOR"))
return prior(toField(ctx, parseConcat(ctx, type)));

View File

@ -63,7 +63,7 @@ final class Pi extends AbstractFunction<BigDecimal> {
@Override
final Field<BigDecimal> getFunction0(Configuration configuration) {
switch (configuration.dialect().family()) {
switch (configuration.family()) {