Skip to content

Signed numeric literals should not have spaces after the sign. #3343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ public List<JpaQueryParsingToken> visitSignedNumericLiteral(HqlParser.SignedNume

List<JpaQueryParsingToken> tokens = new ArrayList<>();

tokens.add(new JpaQueryParsingToken(ctx.op));
tokens.add(new JpaQueryParsingToken(ctx.op, false));
tokens.addAll(visit(ctx.numericLiteral()));

return tokens;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1635,4 +1635,9 @@ select extract(epoch from departureTime) AS epoch
group by extract(epoch from departureTime)
""");
}

@Test
void queryWithSignedNumericLiteralShouldWork() {
assertQuery("select -1");
}
}