From: Justin B. <jgb...@gm...> - 2008-07-31 23:17:01
|
On Thu, Jul 10, 2008 at 12:04 AM, Henning Thielemann <has...@he...> wrote: > > SELECT C2 C > FROM (SELECT C C2 > FROM POINTS T1 > GROUP BY C2) T1 > > > But the C2 after GROUP BY does not denote a column of a table. It may be > replaced by C or the GROUP BY may be moved to the outer SELECT statement. > I've corrected this bug in the attached patch. It occurred because the defaultSqlGroup function in Database.HaskellDB.Sql.Default did not properly filter projected columns from its group by clause. I also fixed a bug in defaultSqlProject where order by columns were not added to the group by clause if they did not appear in a projection. I added a few tests for the new cases which appear to work. Any comments welcome! Justin |