[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6914) SQL Server: Query with limit fails for HQL with ORDER BY over select clause alias

Gail Badner (JIRA) noreply at atlassian.com
Tue Jan 24 18:42:09 EST 2012


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

Gail Badner commented on HHH-6914:
----------------------------------

Please create a pull request (preferable) or attach a patch with your fix and an update to org.hibernate.test.pagination.PaginationTest that reproduces your issue.

Thanks,
Gail

> SQL Server: Query with limit fails for HQL with ORDER BY over select clause alias
> ---------------------------------------------------------------------------------
>
>                 Key: HHH-6914
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6914
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.6.7
>         Environment: MS SQL Server 2008
>            Reporter: Piotr Findeisen
>              Labels: sqlserver
>
> If the HQL like:
> {code}
> SELECT u.id AS id, u.login AS login FROM User u
> {code}
> is executed with limit and offset, then {{SQLServer2008Dialect}} produces SQL like
> {code}
> WITH query AS (select ROW_NUMBER() OVER (order by col_1) as __hibernate_row_nr__, user.id as col_0, user.login as col_1 from users user ) SELECT * FROM query WHERE __hibernate_row_nr__ BETWEEN ? AND ?
> {code}
> This fails, as one select clause expression {{(select ROW_NUMBER() OVER (order by col_1) as __hibernate_row_nr__}} refers to another useing {{col_1}} alias.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list