[teiid-issues] [JBoss JIRA] (TEIID-4347) ORDER BY fails with a subselect containing UNION ALL

Salvatore R (JIRA) issues at jboss.org
Wed Jul 20 12:58:00 EDT 2016


    [ https://issues.jboss.org/browse/TEIID-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268338#comment-13268338 ] 

Salvatore R commented on TEIID-4347:
------------------------------------

Great, thanks a lot.

> ORDER BY fails with a subselect containing UNION ALL
> ----------------------------------------------------
>
>                 Key: TEIID-4347
>                 URL: https://issues.jboss.org/browse/TEIID-4347
>             Project: Teiid
>          Issue Type: Bug
>            Reporter: Salvatore R
>            Assignee: Steven Hawkins
>
> Running the following query:
> {code:sql}
> select s from
> (
> 	select 1 as o, 'a' as s
> 	union all 
> 	select 0 as o, 'b' as s
> )f order by f.o
> {code}
> throws java.lang.ArrayIndexOutOfBoundsException.
> It looks like the bug occurs only if the element used in the order by clause is not projected in the SELECT. In fact, this query works correctly:
> {code:sql}
> select s from
> (
> 	select 1 as o, 'a' as s
> 	union all 
> 	select 0 as o, 'b' as s
> )f order by f.s
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list