Using certain column names which mirror SQL function names causes "ambiguous column" SQL errors

Description

We have some columns names "floor" and "hash". This used to work fine until 3.5.0 Beta 2. This and later releases fail when a query involves a join with two tables and both each contain a column named either "floor" or "hash" with an "ambiguous column" error.

3.5.0 Beta 1 and previous releases work fine. Something must have changed in Beta 2 that is causing some kind of recognition of SQL function names, but I can't seem to pinpoint any issue related to this in the changelong.

I'm pretty sure this would also happen with other column names such as "ceil", "abs", etc. which although they might be SQL function names they are not reserved keywords, and thus they are valid column names.

Environment

Error verified with Oracle, MySQL and H2 database engines.

Activity

Show:
Sergey Vladimirov
March 9, 2010, 11:31 AM

I'm sure this is duplicate of

Josh Moore
April 6, 2010, 7:56 PM

Column "count" on PostgreSQL with 3.5.0-Final caused the same issue. Changing the column name to "\"count\"" worked around the issue:

Gail Badner
April 6, 2010, 8:37 PM

Please attach a runnable test case (Java + mapping) that reproduces this issue.

dnalos
April 8, 2010, 3:50 PM

I create a similar Jira Issus with Testcase:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-5086

Steve Ebersole
March 21, 2011, 7:09 PM

Bulk closing stale resolved issues

Duplicate

Assignee

Gail Badner

Reporter

Manuel Dominguez Sarmiento

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure