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
17990f2d44
commit
0024985016
@@ -768,6 +768,7 @@ reservedWord
|
||||
| JOIN
|
||||
| KEY
|
||||
| LAST
|
||||
| LATERAL
|
||||
| LEADING
|
||||
| LEFT
|
||||
| LIKE
|
||||
|
||||
@@ -1024,4 +1024,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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1566,6 +1566,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() {
|
||||
|
||||
|
||||
@@ -963,6 +963,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