Skip to content

Commit

Permalink
[#5955] PostgreSQL cast operator ::
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Apr 17, 2017
1 parent 56f66b3 commit c088255
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jOOQ/src/main/java/org/jooq/impl/ParserImpl.java
Expand Up @@ -2352,19 +2352,19 @@ else if (parseIf(ctx, '%'))
} }


private static final FieldOrRow parseExp(ParserContext ctx, Type type) { private static final FieldOrRow parseExp(ParserContext ctx, Type type) {
FieldOrRow r = parseSigned(ctx, type); FieldOrRow r = parseUnaryOps(ctx, type);


if (N.is(type) && r instanceof Field) if (N.is(type) && r instanceof Field)
for (;;) for (;;)
if (parseIf(ctx, '^')) if (parseIf(ctx, '^'))
r = ((Field) r).pow(toField(ctx, parseSigned(ctx, type))); r = ((Field) r).pow(toField(ctx, parseUnaryOps(ctx, type)));
else else
break; break;


return r; return r;
} }


private static final FieldOrRow parseSigned(ParserContext ctx, Type type) { private static final FieldOrRow parseUnaryOps(ParserContext ctx, Type type) {
Integer sign = null; Integer sign = null;
FieldOrRow r; FieldOrRow r;


Expand All @@ -2383,6 +2383,9 @@ else if (sign == 1)
else if ((r = parseFieldUnsignedNumericLiteralIf(ctx, true)) == null) else if ((r = parseFieldUnsignedNumericLiteralIf(ctx, true)) == null)
r = toField(ctx, parseTerm(ctx, type)).neg(); r = toField(ctx, parseTerm(ctx, type)).neg();


while (parseIf(ctx, "::"))
r = cast(toField(ctx, r), parseDataType(ctx));

return r; return r;
} }


Expand Down

0 comments on commit c088255

Please sign in to comment.