Hmm, it was rather lame of me not to write this test case. Thanks for catching it.
I have added a new SQLState and added the error message for english. Should I submit the new patch and then create another jira issue to translate the new error message? m --- "Yip Ng (JIRA)" <derby-dev@db.apache.org> wrote: > [ > http://issues.apache.org/jira/browse/DERBY-883?page=comments#action_12424010 > ] > > Yip Ng commented on DERBY-883: > ------------------------------ > > Hi Manish: > > I am also reviewing your DERBY-883 patch. Since > the group by clause has been relaxed to allow > expressions now, we'll need to return a proper > SQLSTATE for invalid aggregate functions use in > group by clause. i.e.: The following test is > throwing a NPE: > > ij> create table t1 (c1 int, c2 varchar(10)); > 0 rows inserted/updated/deleted > ij> insert into t1 values (1, 'data1'), (2, > 'data1'), (3, 'data2'); > 3 rows inserted/updated/deleted > ij> select sum(c1), 1 from t1 group by sum(c1); > ERROR XJ001: Java exception: ': > java.lang.NullPointerException'. > ij> select * from t1; > ERROR 40XT0: An internal error was identified by > RawStore module. > > I'll post additional comments after I have review > all the changes. > > > > Enhance GROUP BY clause to support expressions > instead of just column references. > > > --------------------------------------------------------------------------------- > > > > Key: DERBY-883 > > URL: > http://issues.apache.org/jira/browse/DERBY-883 > > Project: Derby > > Issue Type: New Feature > > Components: SQL > > Affects Versions: 10.1.2.1 > > Environment: JDK 1.5.0_05 > > Reporter: Lluis Turro > > Assigned To: Manish Khettry > > Attachments: 883.patch.txt, > 883.patch3.txt, 883.patch4.txt > > > > > > This select would return an error syntax on > finding "(" after month if group by clause: > > select idissue, month(creation), year(creation), > count(distinct idissue) > > where > > .... > > group by idissue, month(creation), year(creation) > > -- > 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 > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com