|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47050 mysqli_poll() modifies improper variables
Submitted: 2009-01-09 13:06 UTC Modified: 2009-01-12 14:05 UTC
From: Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3.0alpha4-dev OS: Windows
Private report: No CVE-ID: None
 [2009-01-09 13:06 UTC]
mysqli_poll() modifies the variable which was assigned to variables passed to mysqli_poll().

The reason probably is that mysqli_poll() doesn't copy zvals on write as it should.

Reproduce code:
$link1 = mysqli_connect();
$link1->query("SELECT 'test'", MYSQLI_ASYNC);
$all_links = array($link1);
$links = $errors = $reject = $all_links;
mysqli_poll($links, $errors, $reject, 1);

Expected result:
    [0] => mysqli Object

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-11 00:14 UTC]
It's looks expected, Jakub.

See the prototype:
public int mysqli::poll ( array &$read , array &$error , array &$reject , int $sec [, int $usec ] )
int mysqli_poll ( array &$read , array &$error , array &$reject , int $sec [, int $usec ] )
 [2009-01-12 09:32 UTC]
The modification of $links is not the problem, it works as expected. The problem is in modification of $all_links which was not passed to mysqli_poll() at all.
 [2009-01-12 10:53 UTC]
mysqli_poll is missing arginfo telling it needs a reference so the engine can't properly separate the zvals. Will fix that when done with my current fix.
 [2009-01-12 14:05 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 20:01:30 2024 UTC