-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Recognize LEFT, RIGHT, INNER, OUTER, and FULL as reserved words #2874
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
Conversation
@@ -700,7 +700,7 @@ reservedWord | |||
| FOR | |||
| FORMAT | |||
| FROM | |||
// | FULL | |||
| FULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the JPQL grammar about FULL
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've copied the test cases I used to expose this issue in HQL into the JPQL-based tests. Looks like "RIGHT" is okay, but we need to add support for "LEFT", "INNER", and "OUTER".
@@ -674,6 +674,121 @@ void orderByShouldWorkWithSubSelectStatements() { | |||
+ "GROUP BY i2.field.id, i2.version)", sort)).endsWith("order by i.age desc"); | |||
} | |||
|
|||
@Test // GH-2864 | |||
void usingRightAsARelationshipNameShouldWork() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These repetitive tests would shape up better as @ParametrizedTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use @ParametrizedTest
instead of duplicating tests with different inputs.
RIGHT, LEFT, OUTER, INNER, and FULL are HQL tokens. This means they also need to be recognized as potential reserved words and thus possibly identifiers. This can show up if someone, for example, uses "right" as the name of a relationship in a JPA entity. Resolves #2864.
Last commit tweaks things to use @ParameterizedTest. All the other commits are due to me rebasing the branch to pick up recent changes to |
RIGHT, LEFT, OUTER, INNER, and FULL are HQL tokens. This means they also need to be recognized as potential reserved words and thus possibly identifiers. This can show up if someone, for example, uses "right" as the name of a relationship in a JPA entity. Resolves #2864. Original pull request: #2874.
That's rebased, merged and polished now. |
No description provided.