#38510 [Opn->Bgs]: complex query leads to truncated resultset
| From: | mark at opeinmailadmin dot org | Date: | Sat, 19 Aug 2006 16:24:30 +0000 |
| Subject: | #38510 [Opn->Bgs]: complex query leads to truncated resultset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100932@lists.php.net to get a copy of this message | ||
ID: 38510
User updated by: mark at opeinmailadmin dot org
Reported By: mark at opeinmailadmin dot org
-Status: Open
+Status: Bogus
Bug Type: *Database Functions
Operating System: GNU/Linux
PHP Version: 5.1.5
New Comment:
My tools (phpMyAdmin) have silently added LIMIT clauses to that query.
So this might be a duplicate of http://bugs.mysql.com/bug.php?id=21705.
Previous Comments:
------------------------------------------------------------------------
[2006-08-19 11:15:13] mark at opeinmailadmin dot org
Description:
------------
Following query actually yields four lines in MySQL's command line
interface (which is correct), but in PHP only one line is fetched
(which is definitely wrong) and no errors appear.
MySQL version is 5.0.24, connected through socket on localhost.
No difference with MySQL or MySQLi interfaces.
Reproduce code:
---------------
The query:
SELECT mbox, pate, COUNT( DISTINCT virt.address ) AS num_alias, COUNT(
DISTINCT rexp.ID ) AS num_regexp
FROM user usr
LEFT OUTER JOIN virtual virt ON ( usr.mbox = virt.owner )
LEFT OUTER JOIN virtual_regexp rexp ON ( usr.mbox = rexp.owner )
WHERE pate = 'aaaa'
GROUP BY mbox, pate
... and the common CONNECT, QUERY, MYSQL_FETCH...
Expected result:
----------------
+--------+------+-----------+------------+
| mbox | pate | num_alias | num_regexp |
+--------+------+-----------+------------+
| aaaa | aaaa | 24 | 2 |
| pppppp | aaaa | 7 | 1 |
| rrrrr | aaaa | 1 | 0 |
| ssssss | aaaa | 2 | 0 |
+--------+------+-----------+------------+
Actual result:
--------------
Only one line, the first one.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38510&edit=1