Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2, 10.8.2.2, 10.9.1.0
-
Repro attached
Description
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)
Attachments
Attachments
Issue Links
- is related to
-
DERBY-6027 ORDER BY a cast expression gives NPE
- Closed