You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/08/25 14:13:15 UTC
[jira] Resolved: (DERBY-4371) Non-selected columns for SELECT
DISTINCT allowed in ORDER BY clause if ordered by expression
[ https://issues.apache.org/jira/browse/DERBY-4371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen resolved DERBY-4371.
---------------------------------------
Issue & fix info: [Repro attached] (was: [Repro attached, Patch Available])
Fix Version/s: 10.7.0.0
Resolution: Fixed
Thank you, Nirmal! The #7 patch looks good to me. I've checked it in along with the new test cases.
Committed revision 989048.
> 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
> Fix For: 10.7.0.0
>
> Attachments: DERBY-4371-2.diff, DERBY-4371-3.diff, DERBY-4371-4.diff, derby-4371-5.diff, derby-4371-6.diff, derby-4371-7.diff, derby-4371-tests.diff, 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.