Fix query parsing error for properties using reserved lateral keyword.
Add tests for existing parsers and fix the HQL one. Closes #3496 Original pull request #3497
This commit is contained in:
committed by
Jens Schauder
parent
92f1fe1a8e
commit
86e3cdc34b
@@ -768,6 +768,7 @@ reservedWord
|
||||
| JOIN
|
||||
| KEY
|
||||
| LAST
|
||||
| LATERAL
|
||||
| LEADING
|
||||
| LEFT
|
||||
| LIKE
|
||||
|
||||
@@ -1026,4 +1026,11 @@ class EqlQueryRendererTests {
|
||||
String source = "select new com.company.%s.thing.stuff.ClassName(e.id) from Experience e".formatted(reservedWord);
|
||||
assertQuery(source);
|
||||
}
|
||||
|
||||
@Test // GH-3496
|
||||
void lateralShouldBeAValidParameter() {
|
||||
|
||||
assertQuery("select e from Employee e where e.lateral = :_lateral");
|
||||
assertQuery("select te from TestEntity te where te.lateral = :lateral");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1568,6 +1568,13 @@ class HqlQueryRendererTests {
|
||||
assertQuery("select te from TestEntity te where te.type = :type");
|
||||
}
|
||||
|
||||
@Test // GH-3496
|
||||
void lateralShouldBeAValidParameter() {
|
||||
|
||||
assertQuery("select e from Employee e where e.lateral = :_lateral");
|
||||
assertQuery("select te from TestEntity te where te.lateral = :lateral");
|
||||
}
|
||||
|
||||
@Test // GH-3099
|
||||
void functionNamesShouldSupportSchemaScoping() {
|
||||
|
||||
|
||||
@@ -965,6 +965,13 @@ class JpqlQueryRendererTests {
|
||||
assertQuery("select te from TestEntity te where te.type = :type");
|
||||
}
|
||||
|
||||
@Test // GH-3496
|
||||
void lateralShouldBeAValidParameter() {
|
||||
|
||||
assertQuery("select e from Employee e where e.lateral = :_lateral");
|
||||
assertQuery("select te from TestEntity te where te.lateral = :lateral");
|
||||
}
|
||||
|
||||
@Test // GH-3061
|
||||
void alternateNotEqualsOperatorShouldWork() {
|
||||
assertQuery("select e from Employee e where e.firstName != :name");
|
||||
|
||||
Reference in New Issue
Block a user