negation of EXISTS in hql query does not work

Description

Hello!

I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.

It is in the methtod:

public AST negateNode(AST x)

The switch lacks the node type: EXISTS.

The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.

I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.

Regards,
Marton

Attachments

3

Activity

Show:

Brett Meyer March 7, 2014 at 10:08 PM

Bulk closing tickets resolved in released versions

Strong Liu August 20, 2011 at 3:13 AM

Strong Liu July 28, 2011 at 12:13 PM

patch applied, nice work Igor, thanks

IgorI December 4, 2009 at 3:06 AM

attaching a working fix.

note: the sibling-relinking code should probably be pushed into basehqlparaser#invertnode

IgorI December 4, 2009 at 12:58 AM

the fix is not quiet there yet, needs a bit more work...

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created May 24, 2006 at 8:22 PM
Updated March 7, 2014 at 10:08 PM
Resolved July 28, 2011 at 12:13 PM