W-Mark Kubacki wrote:
> I've come across a bug in PHP 5.1.4 in conjunction with MySQL, which
> leads to not every resultset of a SQL query being fetched.

Bug has been reported as: http://bugs.php.net/bug.php?id=38510
(Issue still exists with 5.1.5.)

Actually, if you added a LIMIT clause another bug, this time in MySQL, comes
into play: http://bugs.mysql.com/bug.php?id=21705
(See attachment for the workaround.)

I believe these bugs do not depend on each other.


Gruß,

W-Mark Kubacki
Index: inc/lib/openmailadmin.php
===================================================================
--- inc/lib/openmailadmin.php   (revision 542)
+++ inc/lib/openmailadmin.php   (working copy)
@@ -744,7 +744,7 @@
                        $where_clause = ' WHERE 
pate='.$this->db->qstr($this->current_user->mbox);
                }
 
-               $result = $this->db->SelectLimit('SELECT mbox, person, 
canonical, pate, max_alias, max_regexp, usr.active, last_login AS lastlogin, 
a_super, a_admin_domains, a_admin_user, '
+               $result = $this->db->SelectLimit('SELECT SQL_CALC_FOUND_ROWS 
mbox, person, canonical, pate, max_alias, max_regexp, usr.active, last_login AS 
lastlogin, a_super, a_admin_domains, a_admin_user, '
                                                .'COUNT(DISTINCT virt.address) 
AS num_alias, '
                                                .'COUNT(DISTINCT rexp.ID) AS 
num_regexp '
                                        .'FROM '.$this->tablenames['user'].' 
usr '

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to