HQL SQLFunction replacement not occuring when HQL text has no parenthesis

Description

Test Case: ComponentTest#testComponentQueries

Hibernate query "from Employee e where e.person = ('steve', current_timestamp)" should have translated "current_timestamp" to "getdate()" [1]:

14:49:11,087 DEBUG SQL:424 - select employee0_.ID as ID1_, employee0_.HIRE_DATE as HIRE2_1_, employee0_.name as name1_, employee0_.dob as dob1_, employee0_.value1 as value5_1_, employee0_.value2 as value6_1_ from T_EMP employee0_ where employee0_.name='steve' and employee0_.dob=current_timestamp
14:49:11,535 WARN JDBCExceptionReporter:77 - SQL Error: 207, SQLState: ZZZZZ
14:49:11,536 ERROR JDBCExceptionReporter:78 - Invalid column name 'current_timestamp'.

[1] SybaseDialect, line 58: registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );

Environment

Branch_3_2_4_SP1_CP and Sybase 15

Activity

Show:
Steve Ebersole
October 1, 2008, 11:26 PM

Grr... Unfortunately the fix I considered causes a ambiguity. I'll have to think through this some more.

Gail Badner
May 19, 2009, 12:48 AM

I changed the following test to skip the query for SybaseASE15Dialect:
org.hibernate.test.component.basic.ComponentTest.testComponentQueries()

I also added a "FailureExpected" test that reproduces this issue:
org.hibernate.test.component.basic.ComponentTest.testComponentQueryMethodNoParensFailureExpected()

I've committed these changes to trunk, Branch_3_3, Branch_3_2, and Branch_3_2_4_SP1_CP.

When this issue is fixed, the check for SybaseASE15Dialect should be removed from ComponentTest.testComponentQueries() and ComponentTest.testComponentQueryMethodNoParensFailureExpected() should be deleted.

Stephen Hookings
September 21, 2010, 11:29 AM

I see from ANSI SQL CURRENT_TIMESTAMP(prec) and CURRENT_TIMESTAMP ie without parenthesis exists. I am adding just the CURRENT_TIMESTAMP into a future ASE release so that this will work without need for Hibernate changes. Why? Just about every other vendor supplies this function.

Steve Ebersole
October 27, 2015, 7:16 PM

This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.

For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Steve Ebersole
October 28, 2015, 3:26 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.

Assignee

Steve Ebersole

Reporter

Juraci Paixão Kröhling

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure