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 5D4C4E36C for ; Sun, 30 Dec 2012 02:46:14 +0000 (UTC) Received: (qmail 54672 invoked by uid 500); 30 Dec 2012 02:46:13 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54404 invoked by uid 500); 30 Dec 2012 02:46:13 -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 54383 invoked by uid 99); 30 Dec 2012 02:46:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Dec 2012 02:46:12 +0000 Date: Sun, 30 Dec 2012 02:46:12 +0000 (UTC) From: "Dag H. Wanvik (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6027) ORDER BY a cast expression gives NPE 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-6027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dag H. Wanvik updated DERBY-6027: --------------------------------- Affects Version/s: 10.9.1.0 > ORDER BY a cast expression gives NPE > ------------------------------------ > > Key: DERBY-6027 > URL: https://issues.apache.org/jira/browse/DERBY-6027 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.9.1.0 > Reporter: Dag H. Wanvik > Priority: Minor > > The following gives a NPE: > ij> values 1,2 order by int(1); > or > ij> select * from sysibm.sysdummy1 order by int(1); > The NPE happens when pulling up the order by expression seemingly due to a compiler phase problem: > Caused by: java.lang.NullPointerException > at org.apache.derby.impl.sql.compile.CastNode.getConstantValueAsObject(CastNode.java:851) > at org.apache.derby.impl.sql.compile.OrderByColumn.isReferedColByNum(OrderByColumn.java:466) > at org.apache.derby.impl.sql.compile.OrderByColumn.pullUpOrderByColumn(OrderByColumn.java:403) > at org.apache.derby.impl.sql.compile.OrderByList.pullUpOrderByColumns(OrderByList.java:195) > at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(CursorNode.java:254) > The variable sourceCTI is (still) null; being set by CastNode# bindCastNodeOnly, which presumably hasn't yet been run. -- 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