We're updating the issue view to help you get more done. 

Parenthesis are interpreted in WHERE conditions when using paging and SQL Server

Description

Parenthesis are interpreted in WHERE conditions when using paging and SQL Server.

Example:

1 2 3 Query<?> query = sessionFactory.getCurrentSession().createQuery("SELECT phase.description FROM DaoPhase phase WHERE phase.description = '(AMG-0006-17 ' ORDER BY phase.id"); query.setMaxResults(1000); query.getResultList();

Execption:

1 Unmatched parenthesis in rendered SQL (1 depth): select daophase0_.Bezeichnung as col_0_0_ from arbis.PhaseView daophase0_ where daophase0_.Bezeichnung='(AMG-0006-17 ' order by daophase0_.ID

Reason:

This happens in the generateIgnoreRanges() method inside the SQLServer2005LimitHandler class which counts all parenthesis in the generated SQL ignoring which part is a string and which part is SQL.

Environment

None

Status

Assignee

Unassigned

Reporter

Former user

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.10

Priority

Critical