From: ninzya at inbox dot lv
Operating system: Any
PHP version: 5.3.0alpha2
PHP Bug Type: Feature/Change Request
Bug description: mysql_connection_reused( $link) function
Description:
------------
It would be great if we had mysql_connection_reused( $link) function,
which returned boolean value if just established connection was
reused or no.
Reproduce code:
---------------
$link =mysql_pconnect( $host .':' .$port, $user, $pass);
if( !mysql_connection_reused( $link)) {
mysql_query( 'SET NAMES utf8;');
mysql_query( 'USE mydb;');
} else {
// connection was reused, don't do any initialization queries,
// because they were already made by another request
}
Expected result:
----------------
This would allow to optimize database load on heavy loaded servers.
Actual result:
--------------
Not implemented
--
Edit bug report at http://bugs.php.net/?id=46182&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46182&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46182&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46182&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46182&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=46182&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46182&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46182&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46182&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46182&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46182&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46182&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46182&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46182&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46182&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46182&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46182&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46182&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46182&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46182&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46182&r=mysqlcfg