true and false are not escaped in where attributes (@Where)

Description

I'm not sure we want to go that path but it worths a look.

"cool = true" works on MySQL (I tried with the mysql query browser.
However it doesn't work in @Where, as "true" gets wrongly prefixed with "projectpo1_."

Apprently the following are escaped from being prefixed:

  • string literals, for example 'hello'

  • numbers: for example 123
    But these are missing:

  • keywords: true, false

See for more info

Activity

Show:

Christian Beikov April 8, 2022 at 1:49 PM

Since no test case was provided for years, I'll close this issue as out of date. I also believe it will most probably not be an issue any more in 6.0.
If this still is an issue for you, please create a new issue with a test case that reproduces the problem.

Steve Ebersole October 28, 2015 at 3:24 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.

Steve Ebersole October 27, 2015 at 7:15 PM

This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.

For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Charles Gutjahr May 24, 2012 at 7:12 AM

I encountered this issue today, and it seems to me that problem is that Hibernate fails to register standard SQL keywords true, false and unknown as literals. If I override a Hibernate dialect to treat those as keywords, then the @Where clause works correctly. It seems to me that these keywords should be a standard part of each dialect... not including them is surely a bug?

For example:

For more detail see http://stackoverflow.com/questions/10730640/is-there-a-way-to-stop-hibernate-from-corrupting-boolean-literals-in-where-anno/10731463

Out of Date

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created August 9, 2007 at 3:39 PM
Updated April 8, 2022 at 1:49 PM
Resolved April 8, 2022 at 1:49 PM