Bug #21810 parser bug perhaps?
Submitted: 24 Aug 2006 12:29 Modified: 24 Aug 2006 21:58
Reporter: d di (Basic Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.22 OS:
Assigned to: CPU Architecture:Any

[24 Aug 2006 12:29] d di
Description:
MySQL uses original column in GROUP BY instead of the alias specified in the SELECT.

I don't know.  Seems like a bug to me.

How to repeat:
Run this query:

===============
SELECT CASE WHEN Parent IS NULL THEN Id ELSE Parent END AS Id
FROM (
   SELECT 1 AS Id, NULL AS Parent UNION
   SELECT 2 AS Id, 1 AS Parent UNION
   SELECT 3 AS Id, 1 AS Parent
) AS DuplicateData
GROUP BY Id
===============

Notice the duplicate "Id" entries in spite of "GROUP BY Id".
[24 Aug 2006 12:41] Sergei Golubchik
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of bug#15643
[24 Aug 2006 12:57] d di
> Duplicate of bug#15643

I used your 'find duplicate' function and went through all the bugs that it told about.  #15643 was not among them.  So I like to think that MySQL's bug tracking system is to blame, not me :-).

> Please do not submit the same bug more than once.

Fix your issue tracker.
Or even better, start fixing your bugs.

Bug #15643 was created 9 Dec 2005, so it's "only" nearing a year of age, but I've seen this repeatedly.  Bugs lie around for years and years, picking up tons of duplicates.

Fix your bugs faster --> less duplicates.

> Thank you for your interest in MySQL.

Thanks for finding the duplicate for me (sorry).
[24 Aug 2006 13:28] d di
> Please do not submit the same bug more than once.

It may seem to you that bug reporters are a bunch of critters with nothing better to do than submit duplicates.

I hope you consider that when your users submit a bug report, they've taken precious time to make sure the description is as concise as possible and that the test case is of high quality.

(Notice the original brevity of this case - the original description is 1 line, the test case doesn't require your to create tables or compile executables, just execute a query, appropriate data is created inline, and you're done with it.)

It takes us a lot of time to create good bug reports, so it's not only your effort which is wasted by all the stale bugs - it's ours too...
[24 Aug 2006 14:01] Sergei Golubchik
Your reaction suggests that we need to change the canned answer that the system automatically uses for "duplicate bug" status :)
We'll try to find something better...
[24 Aug 2006 21:58] d di
Humn :)