[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4053) Incorrect SQL with substring for Firebird

Ali Tekin (JIRA) noreply at atlassian.com
Tue Jun 8 13:50:10 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37361#action_37361 ] 

Ali Tekin commented on HHH-4053:
--------------------------------

The problem is that in the Dialect.java line 210 it reads as:
...
registerFunction( "substring", new SQLFunctionTemplate( Hibernate.STRING, "substring(?1, ?2, ?3)" ) ); 
...

This line should be overwritten in FirebirdDialect.java as:
...
registerFunction("substring", new SQLFunctionTemplate(new StringType(), "substring(?1 from ?2 for ?3)"));
...

I have created a CustomFirebirdDialect class and tested it, it worked charmly.


> Incorrect SQL with substring for Firebird
> -----------------------------------------
>
>                 Key: HHH-4053
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4053
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.3.1
>            Reporter: Vlad Tsepelev
>
> HQL query substring function generate incorrect SQL query for Firebird.
> In Firebird SQL query with substring has follow syntax: substring(str from 1 for 3).
> Generated ин Hibernate query looks like: substring(str, 1, 3).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list