summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2008-02-12 20:43:28 +0000
committerJohannes Schlüter <johannes@php.net>2008-02-12 20:43:28 +0000
commite55831f370b67ecc640a710d9084ad52a1cf77e4 (patch)
tree82aa910c8c65aa7fa017e12951c9cfcc88fd50e2 /ext/mysql
parent35bfb9028f63d8707ac1931f06057af95c90af45 (diff)
downloadphp-git-e55831f370b67ecc640a710d9084ad52a1cf77e4.tar.gz
- Make clear what's going on and avoid overwriting parameters
Diffstat (limited to 'ext/mysql')
-rw-r--r--ext/mysql/php_mysql.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 8f01118ba3..31d645effc 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -642,16 +642,20 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
host_and_port = MySG(default_host);
user = MySG(default_user);
passwd = MySG(default_password);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&bl", &host_and_port, &host_len, UG(utf8_conv),
+
+ /* mysql_pconnect does not support new_link parameter */
+ if (persistent) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&l", &host_and_port, &host_len, UG(utf8_conv),
+ &user, &user_len, UG(utf8_conv), &passwd, &passwd_len, UG(utf8_conv),
+ &client_flags)==FAILURE) {
+ return;
+ }
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&bl", &host_and_port, &host_len, UG(utf8_conv),
&user, &user_len, UG(utf8_conv), &passwd, &passwd_len, UG(utf8_conv),
&new_link, &client_flags)==FAILURE) {
- return;
- }
-
- /* mysql_pconnect does not support new_link parameter */
- if (persistent) {
- client_flags= new_link;
+ return;
+ }
}
/* disable local infile option for open_basedir */