HQL parse error of a query with 'left' or 'right' function

Description

The following code raises exception when trying to parse HQL with 'left' (or 'right') function used in the query. It worked on 3.3.3GA with the classic query translator.

Test code

Mapping

Model

Config

Environment

None

Activity

Show:

Frédéric Delaporte September 20, 2020 at 9:33 PM

Moved here

Frédéric Delaporte August 2, 2017 at 11:02 AM

A (for now ignored and) dedicated test case has been committed.

Frédéric Delaporte July 31, 2017 at 10:59 AM

NHibernate.Test.Legacy.SQLFunctionsTest.DialectSQLFunctions demonstrates the issue, but only for Oracle because this test has an "Oracle only" part which tries using left and right functions.

Oskar Berggren November 12, 2016 at 3:48 PM

As noted workaround is to register the function under a different name. Or use substring(). Not letting this prevent release of 4.1.

Oskar Berggren November 12, 2016 at 3:30 PM

I wonder if the same problem is present in Hibernate or if they've fixed it. It appears the left/right functions aren't listed in the HQL documentation.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created August 1, 2016 at 8:28 AM
Updated September 20, 2020 at 9:33 PM
Resolved September 20, 2020 at 9:33 PM
Who's Looking?