Bug #28950 | Using EXISTS and a GROUP BY incorrectly yields no results | ||
---|---|---|---|
Submitted: | 7 Jun 2007 15:22 | Modified: | 7 Jun 2007 18:11 |
Reporter: | Arjen lastname | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0.40, 5.0.41 | OS: | Linux (x86, x86-64) |
Assigned to: | CPU Architecture: | Any |
[7 Jun 2007 15:22]
Arjen lastname
[7 Jun 2007 18:11]
Valeriy Kravchuk
Thank you for a problem report. I was not able to repeat it, though, with latest 5.0.44-BK: mysql> SELECT SQL_CALC_FOUND_ROWS pr.ID, pr.Naam, pr.InfoID, pr.productCatId, -> COUNT(prel.ProduktID) AS Count, MAX(m.Time) AS Time, pc.Naam AS -> Category -> FROM -> testprod AS pr -> JOIN testprel AS prel ON prel.Tabel = 'm' -> AND prel.ProduktID = pr.ID -> JOIN testmeuk AS m ON m.ID = prel.TabelID -> JOIN testprodcat AS pc ON pc.ID = pr.productCatId -> WHERE pr.productCatId IN (326, 509, 604, 510, 511) -> AND pr.Meuk = 1 -> AND m.Embargo = 'N' -> AND EXISTS (SELECT 1 FROM testicc AS c -> WHERE c.item_type = 'm' -> AND c.item_id = m.ID -> AND c.category_id IN (1) -> ) -> GROUP BY pr.ID -> ORDER BY pr.Naam ASC -> LIMIT 0,100 -> ; +--------+----------------------------------------------------------------+----- ---+--------------+-------+------+------------------+ | ID | Naam | Info ID | productCatId | Count | Time | Category | +--------+----------------------------------------------------------------+----- ---+--------------+-------+------+------------------+ | 116852 | AOpen XC Cube EX18 (Socket A, nForce2-GT, AGP, Zilver) | 0 | 509 | 1 | 0 | (HT)PC Barebones | ... | 111025 | Tyan Transport TA26 B2882T26U8H-R (2U, 2x S940, 16GB, 8x U320) | 0 | 510 | 2 | 0 | Server Barebones | +--------+----------------------------------------------------------------+----- ---+--------------+-------+------+------------------+ 27 rows in set (0.09 sec) mysql> select version(); +-----------+ | version() | +-----------+ | 5.0.44 | +-----------+ 1 row in set (0.00 sec)