eclipse-ee4j / eclipselink

Eclipselink project
https://eclipse.dev/eclipselink/
Other
198 stars 168 forks source link

EclipseLink Snapshot 5.0.0.20240807 failed in Regression Test with Jakarta Data #2235

Closed ajaypaul-ibm closed 1 month ago

ajaypaul-ibm commented 1 month ago

We have identified a regression caused by the recent snapshot update. This regression specifically affects the more JPQL query, and it is currently blocking our ability to integrate the snapshot into Open Liberty. Consequently, we are unable to proceed with testing other critical fixes.

Please refer the logs:

Exception [EclipseLink-0] (Eclipse Persistence Services - 5.0.0.v202408071314-43356e84b79e71022b1656a5462b0a72d70787a4): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing [ FROM Product WHERE (:rate * price <= :max AND :rate * price >= :min) ORDER BY name]. 
[40, 45] The right expression is not an arithmetic expression. (SELECT this FROM Product WHERE (:rate *  [ :rate * price ] ...
[66, 71] The right expression is not an arithmetic expression. (SELECT this FROM Product WHERE (:rate * price <= :max AND :rate *  [ :rate * price ] ...
    at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:175)
    at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:351)
    at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:298)
    at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:180)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:144)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:120)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:107)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:91)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1846)
    ... 126 more
ajaypaul-ibm commented 1 month ago

I was able to reproduce this issue in Open Liberty. Steps/resources to reproduce the behaviour. EclipseLink Snapshot version: 5.0.0.20240807

at componenttest.topology.utils.FATServletClient.assertTestResponse(FATServletClient.java:106) at componenttest.topology.utils.FATServletClient.runTest(FATServletClient.java:91) at componenttest.custom.junit.runner.SyntheticServletTest.invokeExplosively(SyntheticServletTest.java:49) at componenttest.custom.junit.runner.FATRunner$1.evaluate(FATRunner.java:204) at componenttest.custom.junit.runner.FATRunner$2.evaluate(FATRunner.java:364) at componenttest.custom.junit.runner.FATRunner.run(FATRunner.java:178) at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29) at componenttest.rules.repeater.RepeatTests$CompositeRepeatTestActionStatement.evaluate(RepeatTests.java:145)

rfelcman commented 1 month ago

Sorry, but I see issue in Your query. FROM Product WHERE (:rate * price <= :max AND :rate * price >= :min) ORDER BY name should be FROM Product WHERE :rate * price <= :max AND :rate * price >= :min ORDER BY name - no braces in where.

See attached testcase com.oracle.jpa.bugtest.TestNoAliasJPQL#queryTestThisWhere02 JakartaPersistence32POC.tar.gz

rfelcman commented 1 month ago

See Jakarta Persistence 3.2 Specification - 4.5. WHERE Clause chapter

rfelcman commented 1 month ago

About missing braces There is Jakarta Persistence 3.2 TCK test result against EclipseLink - 5.0.0.v202408081554-efbce400392c65c9440641ceae74889e157173fd https://ci.eclipse.org/eclipselink/job/TCK_JakartaEE11_JPA_run/39/artifact/SUMMARY_JDK21.TXT/*view*/ as You can see latest snapshot passed thru tests.

pzygielo commented 1 month ago

See Jakarta Persistence 3.2 Specification - 4.5. WHERE Clause chapter

Strange, what about 4.6.1?

ajaypaul-ibm commented 1 month ago

@rfelcman This test is still failing in the latest Snapshot version (5.0.0-20240808) . Please check

rfelcman commented 1 month ago

Nighty build with mentioned PR #2240 passed. You can try latest snapshot 5.0.0-20240820.093222-62.