Skip to content
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

[master] Fix issue 1504 JSE test failure on Derby pt2 #1536

Merged
merged 1 commit into from Jun 13, 2022

Conversation

dazey3
Copy link
Contributor

@dazey3 dazey3 commented Jun 10, 2022

A test fix was missed in #1534

org.eclipse.persistence.jpa.test.property.TestParameterBinding.testIN_ForceBindJPQLParameters()

java.sql.SQLSyntaxErrorException: It is not allowed for both operands of 'IN' to be ? parameters.
Error Code: 30000
Call: SELECT 2 FROM GENERICENTITY WHERE (? IN (?, ?, ?))
 bind => [a, a, b, c]
Query: ReportQuery(referenceClass=GenericEntity sql="SELECT 2 FROM GENERICENTITY WHERE (? IN (?, ?, ?))")

This test was failing on Derby because the test is testing the persistence property eclipselink.jdbc.force-bind-parameters. With this property set, all parameters are bound as parameters, which is illegal on Derby. I recently changed DB2Platform.shouldBindLiterals to default to "true", making the literals in the test to now also bind as parameters. This causes a failure on Derby as it is invalid syntax. The test needs updated to respect that this test will fail on Derby

The property eclipselink.jdbc.force-bind-parameters should be deprecated really. The latest property eclipselink.jdbc.allow-partial-bind-parameters is much more comprehensive as it doesn't completely "force" parameter binding and respects platform syntax legality.

Signed-off-by: Will Dazey dazeydev.3@gmail.com

Copy link
Contributor

@rfelcman rfelcman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (except copyright year).

Signed-off-by: Will Dazey <dazeydev.3@gmail.com>
@dazey3 dazey3 merged commit e546902 into eclipse-ee4j:master Jun 13, 2022
@dazey3 dazey3 deleted the fixDerbyTests_pt_master branch June 13, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants