|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41159 mysql_pconnect() to check flags param, too
Submitted: 2007-04-22 04:09 UTC Modified: 2007-04-22 15:19 UTC
From: zizka at seznam dot cz Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.2.1 OS: All
Private report: No CVE-ID:
 [2007-04-22 04:09 UTC] zizka at seznam dot cz
mysql_pconnect() tries to reuse an exisiting connection with 
the same host/port/username/password from connection pool.

This causes PHP programmers wonder why their application do not behave as they should after changing the flags in their code (like here:
). The actual solution is to restart PHP's container or MySQL or KILL the PHP's threads in MySQL - all of it sometimes unavailable (commercial hosting).

So I believe mysql_pconnect() should check flags parameter, too.

Reproduce code:
$resA = mysql_pconnect('localhost','test','test');
$resB = mysql_pconnect('localhost','test','test', 131072);

echo "A: $resA   B: $resB";

Expected result:
Different connections.

Actual result:
Same pooled connection.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-22 15:19 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-2015 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 21:01:32 2015 UTC