andrey          Wed Feb  6 11:34:44 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysqli mysqli.c mysqli_api.c mysqli_nonapi.c 
                        php_mysqli_structs.h 
    /php-src/ext/mysqli/tests   mysqli_real_connect.phpt 
                                mysqli_real_connect_pconn.phpt 
    /php-src/ext/mysqlnd        mysqlnd_result.c 
  Log:
  Pconnect working with mysqli_real_connect(). To less failing tests.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16.2.17.2.10&r2=1.72.2.16.2.17.2.11&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.10 
php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.11
--- php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.10     Mon Jan 28 18:25:49 2008
+++ php-src/ext/mysqli/mysqli.c Wed Feb  6 11:34:43 2008
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.72.2.16.2.17.2.10 2008/01/28 18:25:49 andrey Exp $ 
+  $Id: mysqli.c,v 1.72.2.16.2.17.2.11 2008/02/06 11:34:43 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -687,7 +687,7 @@
        /* for mysqli_query */
        REGISTER_LONG_CONSTANT("MYSQLI_STORE_RESULT", MYSQLI_STORE_RESULT, 
CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("MYSQLI_USE_RESULT", MYSQLI_USE_RESULT, CONST_CS 
| CONST_PERSISTENT);
-#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADING)
+#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADED)
        REGISTER_LONG_CONSTANT("MYSQLI_BG_STORE_RESULT", 
MYSQLI_BG_STORE_RESULT, CONST_CS | CONST_PERSISTENT);
 #endif
 
@@ -984,7 +984,7 @@
                case MYSQLI_USE_RESULT:
                        result = mysql_use_result(mysql->mysql);
                        break;
-#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADING)
+#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADED)
                case MYSQLI_BG_STORE_RESULT:
                        result = mysqli_bg_store_result(mysql->mysql);
                        break;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.22.2.16.2.11&r2=1.118.2.22.2.16.2.12&diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.16.2.11 
php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.16.2.12
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.16.2.11        Tue Jan  1 
18:13:14 2008
+++ php-src/ext/mysqli/mysqli_api.c     Wed Feb  6 11:34:43 2008
@@ -17,7 +17,7 @@
   |          Ulf Wendel <[EMAIL PROTECTED]>                                    
 |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_api.c,v 1.118.2.22.2.16.2.11 2008/01/01 18:13:14 hholzgra Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.22.2.16.2.12 2008/02/06 11:34:43 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1259,7 +1259,11 @@
 #if !defined(HAVE_MYSQLND)
        if (!(mysql->mysql = mysql_init(NULL)))
 #else
-       if (!(mysql->mysql = mysql_init(FALSE)))
+       /*
+         We create always persistent, as if the user want to connecto
+         to p:somehost, we can't convert the handle then
+       */
+       if (!(mysql->mysql = mysql_init(TRUE)))
 #endif
        {
                efree(mysql);
@@ -1586,83 +1590,16 @@
 }
 /* }}} */
 
+
 /* {{{ proto bool mysqli_real_connect(object link [,string hostname [,string 
username [,string passwd [,string dbname [,int port [,string socket [,int 
flags]]]]]]])
    Open a connection to a mysql server */ 
 PHP_FUNCTION(mysqli_real_connect)
 {
-       MY_MYSQL                *mysql;
-       char                    *hostname = NULL, *username=NULL, *passwd=NULL, 
*dbname=NULL, *socket=NULL;
-       unsigned int    hostname_len = 0, username_len = 0, passwd_len = 0, 
dbname_len = 0, socket_len = 0;
-       unsigned long   port=0, flags=0;
-       zval                    *mysql_link;
-
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O|sssslsl", &mysql_link, mysqli_link_class_entry,
-               &hostname, &hostname_len, &username, &username_len, &passwd, 
&passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len,
-               &flags) == FAILURE) {
-               return;
-       }
-
-       if (!socket_len) {
-               socket = NULL;
-       }
-       if (!socket) {
-               socket = MyG(default_socket);
-       }       
-       if (!passwd) {
-               passwd = MyG(default_pw);
-               passwd_len = strlen(passwd);
-       }
-       if (!username){
-               username = MyG(default_user);
-       }
-       if (!hostname) {
-               hostname = MyG(default_host);
-       }
-
-       MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", 
MYSQLI_STATUS_INITIALIZED);
-
-       /* set some required options */
-       flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */
-       /* remove some insecure options */
-       flags &= ~CLIENT_MULTI_STATEMENTS;   /* don't allow multi_queries via 
connect parameter */
-       if (PG(open_basedir) && PG(open_basedir)[0] != '\0') {
-               flags &= ~CLIENT_LOCAL_FILES;
-       }
-
-#if !defined(HAVE_MYSQLND)
-       if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname 
,port, socket ,flags) == NULL) 
-#else
-       if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, 
passwd_len, dbname, dbname_len,
-                                               port, socket, flags, 
MyG(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL)
-#endif
-       {
-               php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) 
mysql_error(mysql->mysql) TSRMLS_CC);
-               php_mysqli_throw_sql_exception((char 
*)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
-                                                                               
"%s", mysql_error(mysql->mysql));
-
-               /* change status */
-               MYSQLI_SET_STATUS(&mysql_link, MYSQLI_STATUS_INITIALIZED);
-               RETURN_FALSE;
-       }
-
-       php_mysqli_set_error(mysql_errno(mysql->mysql), (char 
*)mysql_error(mysql->mysql) TSRMLS_CC);
-
-#if !defined(HAVE_MYSQLND)
-       mysql->mysql->reconnect = MyG(reconnect);
-
-       /* set our own local_infile handler */
-       php_set_local_infile_handler_default(mysql);
-#endif
-
-       mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char 
*)&MyG(allow_local_infile));
-
-       /* change status */
-       MYSQLI_SET_STATUS(&mysql_link, MYSQLI_STATUS_VALID);
-
-       RETURN_TRUE;
+       mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE);
 }
 /* }}} */
 
+
 /* {{{ proto bool mysqli_real_query(object link, string query)
    Binary-safe version of mysql_query() */
 PHP_FUNCTION(mysqli_real_query)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.54.2.7.2.5.2.5&r2=1.54.2.7.2.5.2.6&diff_format=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.5.2.5 
php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.5.2.6
--- php-src/ext/mysqli/mysqli_nonapi.c:1.54.2.7.2.5.2.5 Mon Jan 28 18:25:50 2008
+++ php-src/ext/mysqli/mysqli_nonapi.c  Wed Feb  6 11:34:43 2008
@@ -17,7 +17,7 @@
   |          Ulf Wendel <[EMAIL PROTECTED]>                                    
 |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_nonapi.c,v 1.54.2.7.2.5.2.5 2008/01/28 18:25:50 andrey Exp $ 
+  $Id: mysqli_nonapi.c,v 1.54.2.7.2.5.2.6 2008/02/06 11:34:43 andrey Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -33,10 +33,7 @@
 
 #define SAFE_STR(a) ((a)?a:"")
 
-
-/* {{{ proto object mysqli_connect([string hostname [,string username [,string 
passwd [,string dbname [,int port [,string socket]]]]]])
-   Open a connection to a mysql server */ 
-PHP_FUNCTION(mysqli_connect)
+void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool 
is_real_connect)
 {
        MY_MYSQL                        *mysql = NULL;
        MYSQLI_RESOURCE         *mysqli_resource = NULL;
@@ -44,7 +41,7 @@
        char                            *hostname = NULL, *username=NULL, 
*passwd=NULL, *dbname=NULL, *socket=NULL;
        unsigned int            hostname_len = 0, username_len = 0, passwd_len 
= 0, dbname_len = 0, socket_len = 0;
        zend_bool                       persistent = FALSE;
-       long                            port = 0;
+       long                            port = 0, flags = 0;
        uint                            hash_len;
        char                            *hash_key = NULL;
        zend_bool                       new_connection = FALSE;
@@ -56,11 +53,50 @@
        }
        hostname = username = dbname = passwd = socket = NULL;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", 
&hostname, &hostname_len, &username, &username_len, 
-               &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, 
&socket_len) == FAILURE) {
-               return;
+       if (!is_real_connect) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", 
&hostname, &hostname_len, &username, &username_len, 
+                                                                       
&passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == 
FAILURE) {
+                       return;
+               }
+
+               if (object && instanceof_function(Z_OBJCE_P(object), 
mysqli_link_class_entry TSRMLS_CC)) {
+                       mysqli_resource = ((mysqli_object *) 
zend_object_store_get_object(object TSRMLS_CC))->ptr;
+                       if (mysqli_resource && mysqli_resource->ptr &&
+                               mysqli_resource->status > 
MYSQLI_STATUS_INITIALIZED)
+                       {
+                               mysql = (MY_MYSQL*)mysqli_resource->ptr;
+                               php_clear_mysql(mysql);
+                               if (mysql->mysql) {
+                                       mysqli_close(mysql->mysql, 
MYSQLI_CLOSE_EXPLICIT);
+                                       mysql->mysql = NULL;
+                               }
+                       }
+               }
+               if (!mysql) {
+                       mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
+               }
+               flags |= CLIENT_MULTI_RESULTS; /* needed for 
mysql_multi_query() */
+
+       } else {
+               /* We have flags too */
+               if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
getThis(), "O|sssslsl", &object, mysqli_link_class_entry,
+                                                                               
&hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, 
&dbname, &dbname_len, &port, &socket, &socket_len,
+                                                                               
&flags) == FAILURE) {
+                       return;
+               }
+               mysqli_resource = ((mysqli_object *) 
zend_object_store_get_object(object TSRMLS_CC))->ptr;
+               MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &object, 
"mysqli_link", MYSQLI_STATUS_INITIALIZED);
+
+               /* set some required options */
+               flags |= CLIENT_MULTI_RESULTS; /* needed for 
mysql_multi_query() */
+               /* remove some insecure options */
+               flags &= ~CLIENT_MULTI_STATEMENTS;   /* don't allow 
multi_queries via connect parameter */
+               if (PG(open_basedir) && PG(open_basedir)[0] != '\0') {
+                       flags &= ~CLIENT_LOCAL_FILES;
+               }
        }
 
+
        if (!socket_len || !socket) {
                socket = MyG(default_socket);
        }
@@ -76,24 +112,6 @@
                hostname = MyG(default_host);
        }
 
-
-       if (object && instanceof_function(Z_OBJCE_P(object), 
mysqli_link_class_entry TSRMLS_CC)) {
-               mysqli_resource = ((mysqli_object *) 
zend_object_store_get_object(object TSRMLS_CC))->ptr;
-               if (mysqli_resource && mysqli_resource->ptr &&
-                       mysqli_resource->status >= MYSQLI_STATUS_INITIALIZED)
-               {
-                       mysql = (MY_MYSQL*)mysqli_resource->ptr;
-                       php_clear_mysql(mysql);
-                       if (mysql->mysql) {
-                               mysqli_close(mysql->mysql, 
MYSQLI_CLOSE_EXPLICIT);
-                               mysql->mysql = NULL;
-                       }
-               }
-       }
-       if (!mysql) {
-               mysql = (MY_MYSQL *) ecalloc(1, sizeof(MY_MYSQL));
-       }
-
        if (strlen(SAFE_STR(hostname)) > 2 && !strncasecmp(hostname, "p:", 2)) {
                hostname += 2;
                if (!MyG(allow_persistent)) {
@@ -101,11 +119,7 @@
                } else {
                        mysql->persistent = persistent = TRUE;
 
-                       if (!strlen(hostname)) {
-                               hostname = MyG(default_host);
-                       }
-
-                       hash_len = spprintf(&hash_key, 0, "mysqli_%s%ld%s%s%s", 
SAFE_STR(hostname), 
+                       hash_len = spprintf(&hash_key, 0, 
"mysqli_%s_%s%ld%s%s%s", SAFE_STR(hostname), SAFE_STR(socket), 
                                                                port, 
SAFE_STR(username), SAFE_STR(dbname), 
                                                                
SAFE_STR(passwd));
 
@@ -118,6 +132,15 @@
 
                                        do {
                                                if 
(zend_ptr_stack_num_elements(&plist->free_links)) {
+                                                       if (is_real_connect) {
+                                                               /*
+                                                                 Gotcha! If 
there are some options set on the handle with mysqli_options()
+                                                                 they will be 
lost. We will fetch other handle with other options. This could
+                                                                 be a source 
of bug reports of people complaining but...nothing else could be
+                                                                 done, if they 
want PCONN!
+                                                               */
+                                                               
mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
+                                                       }
                                                        mysql->mysql = 
zend_ptr_stack_pop(&plist->free_links);
 
                                                        
MyG(num_inactive_persistent)--;
@@ -165,15 +188,16 @@
                                                                
MyG(num_active_persistent) + MyG(num_inactive_persistent));
                goto err;
        }
-
+       if (!is_real_connect) {
 #if !defined(HAVE_MYSQLND)
-       if (!(mysql->mysql = mysql_init(NULL))) {
+               if (!(mysql->mysql = mysql_init(NULL))) {
 #else
-       if (!(mysql->mysql = mysqlnd_init(persistent))) {
+               if (!(mysql->mysql = mysqlnd_init(persistent))) {
 #endif
-               goto err;
+                       goto err;
+               }
+               new_connection = TRUE;
        }
-       new_connection = TRUE;
 
 #ifdef HAVE_EMBEDDED_MYSQLI
        if (hostname_len) {
@@ -188,16 +212,17 @@
        if (mysql_real_connect(mysql->mysql, hostname, username, passwd, 
dbname, port, socket, CLIENT_MULTI_RESULTS) == NULL)
 #else
        if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, 
passwd_len, dbname, dbname_len,
-                                               port, socket, 
CLIENT_MULTI_RESULTS, MyG(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL)
+                                               port, socket, flags, 
MyG(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL)
 #endif
        {
                /* Save error messages */
                php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) 
mysql_error(mysql->mysql) TSRMLS_CC);
                php_mysqli_throw_sql_exception((char 
*)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
                                                                                
"%s", mysql_error(mysql->mysql));
-
-               /* free mysql structure */
-               mysqli_close(mysql->mysql, MYSQLI_CLOSE_DISCONNECTED);
+               if (!is_real_connect) {
+                       /* free mysql structure */
+                       mysqli_close(mysql->mysql, MYSQLI_CLOSE_DISCONNECTED);
+               }
                goto err;
        }
 
@@ -221,7 +246,7 @@
        mysqli_resource->status = MYSQLI_STATUS_VALID;
 
        /* store persistent connection */
-       if (persistent && new_connection) {
+       if (persistent && (new_connection || is_real_connect)) {
                MyG(num_active_persistent)++;
        }
 
@@ -233,21 +258,35 @@
        mysql->multi_query = 1;
 #endif
 
-
        if (!object || !instanceof_function(Z_OBJCE_P(object), 
mysqli_link_class_entry TSRMLS_CC)) {
                MYSQLI_RETURN_RESOURCE(mysqli_resource, 
mysqli_link_class_entry);       
        } else {
                ((mysqli_object *) zend_object_store_get_object(object 
TSRMLS_CC))->ptr = mysqli_resource;
        }
-       return;
+       if (!is_real_connect) {
+               return;
+       } else {
+               RETURN_TRUE;
+       }
 
 err:
-       efree(mysql);
-       if (hash_key) {
-               efree(hash_key);
+       if (mysql->hash_key) {
+               efree(mysql->hash_key);
+               mysql->hash_key = NULL;
+       }
+       if (!is_real_connect) {
+               efree(mysql);
        }
        RETVAL_FALSE;
 }
+
+
+/* {{{ proto object mysqli_connect([string hostname [,string username [,string 
passwd [,string dbname [,int port [,string socket]]]]]])
+   Open a connection to a mysql server */ 
+PHP_FUNCTION(mysqli_connect)
+{
+       mysqli_common_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE);
+}
 /* }}} */
 
 
@@ -460,7 +499,7 @@
                RETURN_FALSE;
        }
        if (resultmode != MYSQLI_USE_RESULT && resultmode != MYSQLI_STORE_RESULT
-#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADING)
+#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADED)
                && resultmode != MYSQLI_BG_STORE_RESULT
 #endif
        ) {
@@ -493,7 +532,7 @@
                case MYSQLI_USE_RESULT:
                        result = mysql_use_result(mysql->mysql);
                        break;
-#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADING)
+#if defined(HAVE_MYSQLND) && defined(MYSQLND_THREADED)
                case MYSQLI_BG_STORE_RESULT:
                        result = mysqli_bg_store_result(mysql->mysql);
                        break;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/php_mysqli_structs.h?r1=1.4.2.8&r2=1.4.2.9&diff_format=u
Index: php-src/ext/mysqli/php_mysqli_structs.h
diff -u php-src/ext/mysqli/php_mysqli_structs.h:1.4.2.8 
php-src/ext/mysqli/php_mysqli_structs.h:1.4.2.9
--- php-src/ext/mysqli/php_mysqli_structs.h:1.4.2.8     Wed Jan 30 09:41:12 2008
+++ php-src/ext/mysqli/php_mysqli_structs.h     Wed Feb  6 11:34:43 2008
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli_structs.h,v 1.4.2.8 2008/01/30 09:41:12 dmitry Exp $ 
+  $Id: php_mysqli_structs.h,v 1.4.2.9 2008/02/06 11:34:43 andrey Exp $ 
 */
 
 #ifndef PHP_MYSQLI_STRUCTS_H
@@ -344,6 +344,9 @@
 PHP_MYSQLI_API void mysqli_register_result(zval *return_value, void *result 
TSRMLS_DC);
 PHP_MYSQLI_API void php_mysqli_set_error(long mysql_errno, char *mysql_err 
TSRMLS_DC);
 
+void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool 
is_real_connect);
+
+
 ZEND_BEGIN_MODULE_GLOBALS(mysqli)
        long                    default_link;
        long                    num_links;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_real_connect.phpt?r1=1.3.2.2&r2=1.3.2.3&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_real_connect.phpt
diff -u php-src/ext/mysqli/tests/mysqli_real_connect.phpt:1.3.2.2 
php-src/ext/mysqli/tests/mysqli_real_connect.phpt:1.3.2.3
--- php-src/ext/mysqli/tests/mysqli_real_connect.phpt:1.3.2.2   Wed Oct 10 
10:18:29 2007
+++ php-src/ext/mysqli/tests/mysqli_real_connect.phpt   Wed Feb  6 11:34:44 2008
@@ -157,17 +157,21 @@
 
                ini_set('mysqli.default_host', 'p:');
                $link = mysqli_init();
-               if (@mysqli_real_sconnect($link)) {
+               if (@mysqli_real_connect($link)) {
                        printf("[025] Usage of mysqli.default_host=p: did not 
fail\n") ;
                        mysqli_close($link);
                }
        }
 
-       if (NULL !== ($tmp = mysqli_real_connect($link, $host, $user, $passwd, 
$db, $port, $socket)))
-               printf("[026] Expecting NULL, got %s/%s\n", gettype($tmp), 
$tmp);
+       var_dump($link);
+
+       if (NULL === ($tmp = mysqli_real_connect($link, $host, $user, $passwd, 
$db, $port, $socket)))
+               printf("[026] Expecting not NULL, got %s/%s\n", gettype($tmp), 
$tmp);
 
        print "done!";
 ?>
 --EXPECTF--
 Warning: mysqli_real_connect(): (%d/%d): Access denied for user '%s'@'%s' 
(using password: YES) in %s on line %d
-done!
\ No newline at end of file
+object(mysqli)#%d (%d) {
+}
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt
diff -u php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt:1.1.2.1 
php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt:1.1.2.2
--- php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt:1.1.2.1     Wed Oct 
10 10:18:29 2007
+++ php-src/ext/mysqli/tests/mysqli_real_connect_pconn.phpt     Wed Feb  6 
11:34:44 2008
@@ -117,7 +117,6 @@
        mysqli_close($link);
 
        if ($IS_MYSQLND) {
-               ini_set('mysqli.default_host', 'p:' . $host);
                $link = mysqli_init();
                if ([EMAIL PROTECTED]($link)) {
                        printf("[022] Usage of mysqli.default_host=p:%s 
(persistent) failed\n", $host) ;
@@ -136,17 +135,17 @@
 
                ini_set('mysqli.default_host', 'p:');
                $link = mysqli_init();
-               if (@mysqli_real_sconnect($link)) {
+               if (@mysqli_real_connect($link)) {
                        printf("[025] Usage of mysqli.default_host=p: did not 
fail\n") ;
                        mysqli_close($link);
                }
        }
 
-       if (NULL !== ($tmp = mysqli_real_connect($link, $host, $user, $passwd, 
$db, $port, $socket)))
-               printf("[026] Expecting NULL, got %s/%s\n", gettype($tmp), 
$tmp);
+       if (NULL === ($tmp = mysqli_real_connect($link, $host, $user, $passwd, 
$db, $port, $socket)))
+               printf("[026] Expecting not NULL, got %s/%s\n", gettype($tmp), 
$tmp);
 
        print "done!";
 ?>
 --EXPECTF--
 Warning: mysqli_real_connect(): (%d/%d): Access denied for user '%s'@'%s' 
(using password: YES) in %s on line %d
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.4.2.12&r2=1.4.2.13&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_result.c
diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.12 
php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.13
--- php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.12       Mon Feb  4 17:33:46 2008
+++ php-src/ext/mysqlnd/mysqlnd_result.c        Wed Feb  6 11:34:44 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_result.c,v 1.4.2.12 2008/02/04 17:33:46 andrey Exp $ */
+/* $Id: mysqlnd_result.c,v 1.4.2.13 2008/02/06 11:34:44 andrey Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_wireprotocol.h"
@@ -372,7 +372,6 @@
 void mysqlnd_internal_free_result(MYSQLND_RES *result TSRMLS_DC)
 {
        DBG_ENTER("mysqlnd_internal_free_result");
-
        result->m.free_result_contents(result TSRMLS_CC);
 
        if (result->conn) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to