#38510 [NEW]: complex query leads to truncated resultset
From: mark at opeinmailadmin dot org
Operating system: GNU/Linux
PHP version: 5.1.5
PHP Bug Type: *Database Functions
Bug description: complex query leads to truncated resultset
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 bug report at http://bugs.php.net/?id=38510&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38510&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38510&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38510&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38510&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38510&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38510&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38510&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38510&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38510&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38510&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38510&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38510&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38510&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38510&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38510&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38510&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38510&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38510&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38510&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38510&r=mysqlcfg
Thread (1 message)
- mark at opeinmailadmin dot org