Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #3993 parameter new_link isn't a valid parameter for mysql_pconnect
Submitted: 2005-03-29 13:11 UTC
From: yoghoyogho at fastmail dot fm Assigned: danielc
Status: Closed Package: DB
PHP Version: Irrelevant OS: Linux FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2005-03-29 13:11 UTC] yoghoyogho at fastmail dot fm
Description: ------------ in lines 216-222 in mysql.php it says: ------------------------------------------ if (isset($dsn['new_link']) && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true)) { $params[] = true; } else { $params[] = false; } ------------------------------------------ The new_link parameter became available in PHP 4.2.0 for mysql_connect. But it isn't a parameter that is available for mysql_pconnect. I suggest this code fix: ------------------------------------------ if (!$persistent && version_compare(phpversion(), $this->features['new_link'], '>=')) { if (isset($dsn['new_link']) && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true)) { $params[] = true; } else { $params[] = false; } } ------------------------------------------ For reference compare http://www.php.net/mysql_pconnect with http://www.php.net/mysql_connect and search for new_link

Comments

 [2005-03-29 13:22 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-29 13:23 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-29 13:30 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-29 14:53 UTC] yoghoyogho at fastmail dot fm
Thanks for your quick response, danielc. Unfortunately, the fix you've added in the CVS doesn't resolve this bug. The way it's coded now, there will be a parameter added to $params, regardless of it's value (either true or false). What I was argumenting for was that this parameter shouldn't be added if mysql_pconnect is used. So AROUND the if-branch should be a check that ensures that mysql_connect is used. My suggestion is to remove !$persistent from the inner if-branch and make it an outer if-branch like so: if (!$persistent) { if (isset($dsn['new_link']) && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true)) { $params[] = true; } else { $params[] = false; } } This way the parameter doesn't end up in mysql_pconnect, thus shifting the value of client_flags out of reach. I also added the version_compare because in the $features array (in line 76) the item 'new_link'=>'4.2.0' was available. So if that value is there, why not use it? :-) So that's were my first code fix suggestion came from.
 [2005-03-29 15:01 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-29 15:26 UTC] yoghoyogho at fastmail dot fm
thanks danielc