Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

#2006 with_scope & :having option bug with 2.3 RC1

#4

I think the problem is SQLite3.

If we look to the query it has some ambiguety because it is aliasing SUM(salary) to salary but the table has a salary column too. In MySQL it even outputs this message:

1052 Column 'salary' in group statement is ambiguous

Output doing the query from the sqlite console:


sqlite> SELECT SUM(salary) AS salary FROM developers GROUP BY salary HAVING SUM(salary) > 10000;
SQL error: aggregate functions are not allowed in the GROUP BY clause

Output doing the query but qualifying the field in the GROUP BY clause:


sqlite> SELECT SUM(salary) AS salary FROM developers GROUP BY developers.salary HAVING SUM(salary) > 10000;
80000
800000
150000

I think there was a change from 3.4.2 (used in ci.rubyonrails.org) to 3.6.12 (my version) where the default qualification now locks to SUM(salary) when before it locked to developers.salary

Reported by Hector E. Gomez Morales · April 9th, 2009 @ 03:10 PM

State: new
Milestone: none

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.