>>>>> "Patrick" == Patrick Michael Kane <modus@stripped> writes:
Patrick> Thanks for the patch. Unfortunately there are still problems with left
Patrick> joins and count. Try this:
<cut>
Patrick> select a.id, count(rtg_importance) from a
Patrick> left join b on a.id = b.cmt_id group by a.id;
Patrick> returns:
Patrick> +----+-----------------------+
Patrick> | id | count(rtg_importance) |
Patrick> +----+-----------------------+
Patrick> | 1 | 1 |
Patrick> +----+-----------------------+
Patrick> 1 row in set (0.01 sec)
Patrick> Which is clearly incorrect, since the situation is identical to above.
Patrick> I have not been able to figure out what about the structure of table 'b' is
Patrick> making this fail. I have run the tests against 3.23 and 3.22 + enclosed
> patch
Patrick> and get the same results.
Hi!
The above bug manifests when you do a count(*) on a left join on a
column that may have null values but is declared NOT NULL.
Here is a patch for this to MySQL 3.22
Regards,
Monty