Bug #21720 | SELECT <group func> INTO @var .. GROUP BY gives wrong result | ||
---|---|---|---|
Submitted: | 18 Aug 2006 12:33 | Modified: | 14 Sep 2006 20:07 |
Reporter: | [ name withheld ] (Basic Quality Contributor) | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.24 | OS: | Windows (WinXP sp2) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[18 Aug 2006 12:33]
[ name withheld ]
[18 Aug 2006 14:08]
Tonci Grgin
Hello and thanks for your bug report. Verified as described by reporter on Win XP SP2 >mysqld-max-nt.exe --standalone --console --log 060818 15:21:50 InnoDB: Started; log sequence number 0 45775 060818 15:21:50 [Note] mysqld-max-nt.exe: ready for connections. Version: '5.0.24-log' socket: '' port: 3306 Source distribution
[7 Sep 2006 16:55]
Tomash Brechko
Changing bug title, as the bug has nothing to do with stored procedures, as "the strangest part" of "how to repeat" section above suggests. The minimal example would be (and the same with AVG(), SUM(), ...): DROP TABLE IF EXISTS t1; CREATE TABLE t1 (i INT); INSERT INTO t1 VALUES (1), (1); SELECT COUNT(i) FROM t1 GROUP BY i; #+----------+ #| COUNT(i) | #+----------+ #| 2 | <= Correct #+----------+ SELECT COUNT(i) INTO @count FROM t1 GROUP BY i; SELECT @count; #+--------+ #| @count | #+--------+ #| 0 | <= Wrong #+--------+ DROP TABLE t1;
[14 Sep 2006 20:07]
Iggy Galarza
This is a duplicate of bug#20836 which has a Patch submitted for approval.