Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 52465 invoked from network); 20 Feb 2008 04:25:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 04:25:23 -0000 Received: (qmail 56856 invoked by uid 500); 20 Feb 2008 04:25:12 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 56826 invoked by uid 500); 20 Feb 2008 04:25:12 -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 56817 invoked by uid 99); 20 Feb 2008 04:25:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 20:25:11 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 04:24:47 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C72AB234C050 for ; Tue, 19 Feb 2008 20:24:43 -0800 (PST) Message-ID: <645349894.1203481483814.JavaMail.jira@brutus> Date: Tue, 19 Feb 2008 20:24:43 -0800 (PST) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3094) Grouping of expressions causes NullPointerException In-Reply-To: <17254827.1191312770742.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3094?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1257= 0569#action_12570569 ]=20 Bryan Pendleton commented on DERBY-3094: ---------------------------------------- It seems like there might be a similar problem with the HAVING clause. Cons= ider: ij> select c1+c2, sum(c3) from test group by c1+c2; 1 |2 ----------------------- 11 |100 12 |200 13 |202 3 rows selected ij> select c1+c2, sum(c3) from test group by c1,c1+c2; 1 |2 ----------------------- 11 |100 12 |100 12 |100 13 |202 4 rows selected ij> select c1+c2, sum(c3) from test group by c1+c2 having c1+c2 > 11; 1 |2 ----------------------- 12 |200 13 |202 2 rows selected ij> select c1+c2, sum(c3) from test group by c1, c1+c2 having c1+c2 > 11; ERROR 42X24: Column C2 is referenced in the HAVING clause but is not in the= GROUP BY list. I think that the proper results for that last query should have been: 1 |2 ----------------------- 12 |100 12 |100 13 |202 3 rows selected We could either investigate HAVING behaviors as part of this JIRA, or we co= uld open a new one. > Grouping of expressions causes NullPointerException > --------------------------------------------------- > > Key: DERBY-3094 > URL: https://issues.apache.org/jira/browse/DERBY-3094 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.1.4 > Environment: Windows XP, Eclipse 3.2.2, java 1.5.0.11 > Reporter: Peter Balon > Assignee: Bryan Pendleton > Priority: Critical > Attachments: modifyVisitorDoesntWork.diff, twoPass.diff, TwoPassV= isitor.diff > > > Following steps to reproduce the bug: > create table xx (a double, b double); > insert into xx values (2, 3); > select a, a*(b/100.000000), count(*) from xx group by a, a*(b/100.000000= ); > Starting run > select a, a*(b/100.000000), count(*) from xx=20 > group by a, a*(b/100.000000) > Run successful > SQL State =3D 38000 SQL Code =3D 20000 SQL Message =3D Bei der Auswertung= eines Ausdrucks wurde die Ausnahme 'java.lang.NullPointerException' ausgel= =C3=B6st. Exception message =3D java.sql.SQLException: Bei der Auswertung e= ines Ausdrucks wurde die Ausnahme 'java.lang.NullPointerException' ausgel= =C3=B6st. > Work around: > select a, a*(b/100.000000), count(*) from xx group by a, b, a*(b/100.0000= 00)=20 > Stack trace from application: > java.sql.SQLException: Bei der Auswertung eines Ausdrucks wurde die Ausna= hme 'java.lang.NullPointerException' ausgel=C3=B6st. > =09at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unkn= own Source) > =09at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source= ) > =09at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source) > =09at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLExcepti= on(Unknown Source) > =09at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(= Unknown Source) > =09at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown = Source) > =09at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown = Source) > =09at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(U= nknown Source) > =09at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Sour= ce) > =09at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source) > =09at de.arcor.billy.report.views.designer.ReportViewerView.setInput(Repo= rtViewerView.java:255) > =09at de.arcor.billy.report.views.designer.ReportViewerView.createPartCon= trol(ReportViewerView.java:113) > =09at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReferenc= e.java:332) > =09at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java= :197) > =09at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPar= tReference.java:566) > =09at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1675) > =09at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.ja= va:987) > =09at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPage.java:= 968) > =09at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:351= 4) > =09at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:6= 7) > =09at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3= 511) > =09at de.arcor.billy.report.data.ReportDataAdvisor$2.perspectiveChanged(R= eportDataAdvisor.java:268) > =09at de.arcor.billy.system.actions.AbstractOpenPerspectiveActionDelegate= $1.run(AbstractOpenPerspectiveActionDelegate.java:66) > =09at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) > =09at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.= java:123) > =09at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325) > =09at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971) > =09at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930) > =09at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894) > =09at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.j= ava:422) > =09at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149= ) > =09at de.arcor.billy.product.Billy.run(Billy.java:15) > =09at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformA= ctivator.java:78) > =09at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApp= lication(EclipseAppLauncher.java:92) > =09at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(= EclipseAppLauncher.java:68) > =09at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.= java:400) > =09at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.= java:177) > =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =09at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > =09at java.lang.reflect.Method.invoke(Unknown Source) > =09at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) > =09at org.eclipse.core.launcher.Main.basicRun(Main.java:280) > =09at org.eclipse.core.launcher.Main.run(Main.java:977) > =09at org.eclipse.core.launcher.Main.main(Main.java:952) > Caused by: java.sql.SQLException: Java-Ausnahme: ': java.lang.NullPointer= Exception'. > =09at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unkn= own Source) > =09at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source= ) > =09at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source) > =09at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLExcepti= on(Unknown Source) > =09... 42 more > Caused by: java.lang.NullPointerException > =09at org.apache.derby.exe.ac9b638174x0115x5f93x1332x0000046fd8a01b.e10(U= nknown Source) > =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =09at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > =09at java.lang.reflect.Method.invoke(Unknown Source) > =09at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown= Source) > =09at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.doProjec= tion(Unknown Source) > =09at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextR= owCore(Unknown Source) > =09at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNex= tRowFromSource(Unknown Source) > =09at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNex= tRowCore(Unknown Source) > =09at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRo= w(Unknown Source) > =09... 37 more --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.