Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 63630 invoked from network); 29 Oct 2006 14:59:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2006 14:59:24 -0000 Received: (qmail 60478 invoked by uid 500); 29 Oct 2006 14:59:35 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 60265 invoked by uid 500); 29 Oct 2006 14:59:34 -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 60256 invoked by uid 99); 29 Oct 2006 14:59:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 06:59:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 06:59:22 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 846157142CD for ; Sun, 29 Oct 2006 06:58:16 -0800 (PST) Message-ID: <27286511.1162133896533.JavaMail.root@brutus> Date: Sun, 29 Oct 2006 06:58:16 -0800 (PST) From: "Christian d'Heureuse (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-2016) ArrayIndexOutOfBoundsException for COALESCE with aggregate functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ArrayIndexOutOfBoundsException for COALESCE with aggregate functions -------------------------------------------------------------------- Key: DERBY-2016 URL: http://issues.apache.org/jira/browse/DERBY-2016 Project: Derby Issue Type: Bug Components: SQL Affects Versions: 10.2.1.6 Environment: 1.5.0_06-b05 Reporter: Christian d'Heureuse The following statements produce an ArrayIndexOutOfBoundsException: CREATE TABLE t1 ( f1 INTEGER); SELECT COALESCE(MAX(f1),0) FROM t1; Workaround: VALUES COALESCE( (SELECT MAX(f1) FROM t1), 0); Stack trace: ---------------------------------------------------------------- 2006-10-29 14:52:53.765 GMT: Booting Derby version The Apache Software Foundation - Apache Derby - 10.2.1.6 - (452058): instance c013800d-010e-948f-0faa-00000012f418 on database directory C:\temp_sys\temp_Derby_TestErr_db Database Class Loader started - derby.database.classpath='' 2006-10-29 14:53:02.906 GMT Thread[main,5,main] (XID = 122), (SESSIONID = 0), (DATABASE = c:\temp_sys\temp_Derby_TestErr_db), (DRDAID = null), Cleanup action starting 2006-10-29 14:53:02.906 GMT Thread[main,5,main] (XID = 122), (SESSIONID = 0), (DATABASE = c:\temp_sys\temp_Derby_TestErr_db), (DRDAID = null), Failed Statement is: SELECT COALESCE(MAX(f1),0) FROM t1 java.lang.ArrayIndexOutOfBoundsException: -1 at org.apache.derby.impl.services.bytecode.BCMethod.popStack(Unknown Source) at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(Unknown Source) at org.apache.derby.impl.sql.compile.ResultColumnList.generateCore(Unknown Source) at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(Unknown Source) at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(Unknown Source) at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(Unknown Source) at org.apache.derby.impl.sql.compile.CursorNode.generate(Unknown Source) at org.apache.derby.impl.sql.compile.StatementNode.generate(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source) at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source) at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source) at org.apache.derby.impl.tools.ij.Main.go(Unknown Source) at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source) at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source) at org.apache.derby.tools.ij.main(Unknown Source) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira