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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2020 The PHP Group
All rights reserved.
Last updated: Mon Jul 13 09:01:23 2020 UTC