php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38510 complex query leads to truncated resultset
Submitted: 2006-08-19 11:15 UTC Modified: 2006-08-19 16:24 UTC
From: mark at opeinmailadmin dot org Assigned:
Status: Not a bug Package: *Database Functions
PHP Version: 5.1.5 OS: GNU/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mark at opeinmailadmin dot org
New email:
PHP Version: OS:

 

 [2006-08-19 11:15 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-19 16:24 UTC] mark at opeinmailadmin dot org
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 02:01:30 2024 UTC