georg Fri Nov 15 05:35:10 2002 EDT Modified files: /php4/ext/mysql php_mysql.c Log: removed restore_connection_defaults for pconnects (discussed on php-dev@) bug #19529 closed bug #12513 reopened Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.174 php4/ext/mysql/php_mysql.c:1.175 --- php4/ext/mysql/php_mysql.c:1.174 Wed Nov 13 03:54:34 2002 +++ php4/ext/mysql/php_mysql.c Fri Nov 15 05:35:10 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mysql.c,v 1.174 2002/11/13 08:54:34 derick Exp $ */ +/* $Id: php_mysql.c,v 1.175 2002/11/15 10:35:10 georg Exp $ */ /* TODO: * @@ -222,49 +222,6 @@ #define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } } -/* {{{ _restore_connection_defaults - */ -static int _restore_connection_defaults(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_mysql_conn *link; - char user[128]; - char passwd[128]; - - /* check if its a persistent link */ - if (Z_TYPE_P(rsrc) != le_plink) - return 0; - - link = (php_mysql_conn *) rsrc->ptr; - - /* Find the active result set and free it */ - if (link->active_result_id) { - int type; - MYSQL_RES *mysql_result; - - mysql_result = (MYSQL_RES *) zend_list_find(link->active_result_id, &type); - if (mysql_result && type==le_result) { - zend_list_delete(link->active_result_id); - link->active_result_id = 0; - } - } - - /* rollback possible transactions */ - mysql_query(&link->conn, "ROLLBACK"); - - /* restore session variable "autocommit" to default (1) */ - mysql_query(&link->conn, "SET AUTOCOMMIT=1"); - - /* unset the current selected db */ -#if MYSQL_VERSION_ID > 32329 - strcpy (user, (char *)(&link->conn)->user); - strcpy (passwd, (char *)(&link->conn)->passwd); - mysql_change_user(&link->conn, user, passwd, ""); -#endif - - return 0; -} -/* }}} */ - /* {{{ _free_mysql_result * This wrapper is required since mysql_free_result() returns an integer, and * thus, cannot be used directly @@ -446,8 +403,6 @@ */ PHP_RSHUTDOWN_FUNCTION(mysql) { - zend_hash_apply(&EG(persistent_list), (apply_func_t) _restore_connection_defaults TSRMLS_CC); - if (MySG(trace_mode)) { if (MySG(result_allocated)){ char tmp[128];
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php