Bug #21828 Wrong results when select using "into variable" with group by in stored procedur
Submitted: 25 Aug 2006 8:50 Modified: 25 Sep 2006 11:42
Reporter: j k Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.16 OS:Linux (redhat )
Assigned to: Assigned Account CPU Architecture:Any

[25 Aug 2006 8:50] j k
Description:
Wrong results when select using "into variable" with group by in stored procedure. The result shown in the SQL statement below is different.

SELECT ac, max(v) FROM A
WHERE ai = as_ai AND v like "20%" GROUP BY  ac;

SELECT ac, max(v) INTO ls_ac, ls_v FROM A
WHERE ai = as_ai AND v like "20%" GROUP BY ac;

select ls_ac, ls_v;

It should be fixed in 5.0.13 but it appears again

How to repeat:
SELECT ac, max(v) FROM A
WHERE ai = as_ai AND v like "20%" GROUP BY  ac;

SELECT ac, max(v) INTO ls_ac, ls_v FROM A
WHERE ai = as_ai AND v like "20%" GROUP BY ac;

select ls_ac, ls_v;
[25 Aug 2006 11:42] MySQL Verification Team
Thank you for the bug report. Your server version is pretty older
please try with the latest release, if still you experience the same
issue please provide the complete test case script: create tables/insert data/
procedure the expected result and the actual result you get.

Thanks in advance.
[25 Sep 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".