db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C.S. Nirmal J. Fernando (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4371) Non-selected columns for SELECT DISTINCT allowed in ORDER BY clause if ordered by expression
Date Mon, 26 Apr 2010 17:35:34 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12861009#action_12861009
] 

C.S. Nirmal J. Fernando commented on DERBY-4371:
------------------------------------------------

Hi Bryan,

Thank you very much for reviewing the patch.

1) I added this simply because queries like select distinct i*2 from order by i are already
giving that error. But I think removing this will not affect anything instead we will able
to handle queries like select distinct i from order by random() such that it shows the error.
Thanks for pointing it.

2) I ran just the derbyall suite, I will run suites.all now.

3) This will probably the next thing I like to learn. I will read up on Junit tests.

4) Whoops, thanks Bryan, it was a mistake, and I corrected that, and I modified the patch
too, please find the new attachment.

Thanks Again.

> Non-selected columns for SELECT DISTINCT allowed in ORDER BY clause if ordered by expression
> --------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4371
>                 URL: https://issues.apache.org/jira/browse/DERBY-4371
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Bernt M. Johnsen
>            Assignee: C.S. Nirmal J. Fernando
>            Priority: Critical
>         Attachments: DERBY-4371.diff
>
>
> How to repeat:
> ij> create table t (i integer, j integer);;
> 0 rows inserted/updated/deleted
> ij> insert into t values (1,2),(1,3);
> 2 rows inserted/updated/deleted
> ij> select distinct i from t order by j;
> ERROR 42879: The ORDER BY clause may not contain column 'J', since the query specifies
DISTINCT and that column does not appear in the query result.
> ij> select distinct i from t order by j*2;
> I          
> -----------
> 1          
> 1          
> 2 rows selected

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message