Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DE6CDD3C for ; Thu, 3 Jan 2013 04:08:17 +0000 (UTC) Received: (qmail 26826 invoked by uid 500); 3 Jan 2013 04:08:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 26625 invoked by uid 500); 3 Jan 2013 04:08:16 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 26571 invoked by uid 99); 3 Jan 2013 04:08:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 04:08:13 +0000 Date: Thu, 3 Jan 2013 04:08:13 +0000 (UTC) From: "Dag H. Wanvik (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DERBY-6009) Need stricter checking of ORDER BY clause in VALUES expressions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dag H. Wanvik resolved DERBY-6009. ---------------------------------- Resolution: Fixed Fix Version/s: 10.10.0.0 Issue & fix info: Repro attached (was: Patch Available,Repro attached) > 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 > Fix For: 10.10.0.0 > > Attachments: derby-6009b.diff, derby-6009b.stat, derby-6009c.diff, derby-6009c.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