[
https://issues.apache.org/jira/browse/DERBY-6009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13541414#comment-13541414
]
Bryan Pendleton commented on DERBY-6009:
----------------------------------------
Dag, your proposal sounds fine to me; I think that would be good behavior.
Isn't it amazing how
much trouble it is to retain ancient, no-longer-wanted features of a language,
such as the ability
to reference columns by ordinal position? I wonder if the SQL standard defines
a process for
deprecating unwanted features over time. We could start to build our own list
of features we'd
be willing to deprecate, should that ever become possible...
> Need stricter checking of ORDER BY clause in VALUES expressions
> ---------------------------------------------------------------
>
> Key: DERBY-6009
> URL: https://issues.apache.org/jira/browse/DERBY-6009
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.9.1.0
> Reporter: Knut Anders Hatlen
> Assignee: Dag H. Wanvik
> Priority: Minor
> Attachments: derby-6009b.diff, derby-6009b.stat, derby-6009.diff,
> derby-6009.stat
>
>
> We only support column numbers in ORDER BY clauses in VALUES expression, as
> seen by this error message:
> ij> values 1,2 order by 1+2;
> ERROR 42878: The ORDER BY clause of a SELECT UNION statement only supports
> unqualified column references and column position numbers. Other expressions
> are not currently supported. (errorCode = 30000)
> However, the checks let some unsupported expressions through and produce
> strange results. For example:
> ij> values 1 order by 1+2;
> 1 |2
> -----------------------
> 1 |3
> 1 row selected
> It should probably have raised the same exception as the first query. And if
> not, the result should only have had one column.
> And the next example should probably have raised a syntax error too, instead
> of a NullPointerException:
> ij> values 1 order by int(1);
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'. (errorCode =
> 0)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira