StackOverflowException on a HQL with too many "or".

Description

Hi.

I generated with Hades following HQL statement:

"DELETE FROM Foo x WHERE x = ?1 OR x = ?2 OR x = ?n"

If i try to delete a list with over 18,000 elements, Hades generates a statement with 17,999 "OR".
This throws following Exception:

{{Caused by: java.lang.StackOverflowError
at java.util.HashMap.get(HashMap.java:300)
at org.hibernate.hql.ast.util.ASTPrinter.getTokenTypeName(ASTPrinter.java:139)
at org.hibernate.hql.ast.HqlSqlWalker.buildTraceNodeName(HqlSqlWalker.java:191)
at org.hibernate.hql.ast.HqlSqlWalker.traceIn(HqlSqlWalker.java:186)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1811)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1859)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1859)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1859)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1859)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1859)
[...]}}

I've posted this bug in the bugtracker of Hades, too. But it seems to be a hibernate bug.
http://redmine.synyx.org/issues/414

Regards
Björn

Environment

  • Hibernate Core 3.5.5

  • Hades 2.0.0

  • MySQL

Out of Date

Assignee

Unassigned

Reporter

Björn Schmitz

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure