iliaa Thu Jun 28 19:22:52 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo pdo_dbh.c Log: When working with persistent connections re-initialize options on each connection. Flags like error reporting may differ. http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.13&r2=1.82.2.31.2.14&diff_format=u Index: php-src/ext/pdo/pdo_dbh.c diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.13 php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.14 --- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.13 Thu Jun 28 03:13:29 2007 +++ php-src/ext/pdo/pdo_dbh.c Thu Jun 28 19:22:52 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_dbh.c,v 1.82.2.31.2.13 2007/06/28 03:13:29 iliaa Exp $ */ +/* $Id: pdo_dbh.c,v 1.82.2.31.2.14 2007/06/28 19:22:52 iliaa Exp $ */ /* The PDO Database Handle Class */ @@ -364,6 +364,20 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory"); } + if (options) { + zval **attr_value; + char *str_key; + long long_key; + + zend_hash_internal_pointer_reset(Z_ARRVAL_P(options)); + while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(options), (void**)&attr_value) + && HASH_KEY_IS_LONG == zend_hash_get_current_key(Z_ARRVAL_P(options), &str_key, &long_key, 0)) { + + pdo_dbh_attribute_set(dbh, long_key, *attr_value TSRMLS_CC); + zend_hash_move_forward(Z_ARRVAL_P(options)); + } + } + if (!call_factory) { /* we got a persistent guy from our cache */ return; @@ -391,20 +405,6 @@ dbh->driver = driver; - if (options) { - zval **attr_value; - char *str_key; - long long_key; - - zend_hash_internal_pointer_reset(Z_ARRVAL_P(options)); - while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(options), (void**)&attr_value) - && HASH_KEY_IS_LONG == zend_hash_get_current_key(Z_ARRVAL_P(options), &str_key, &long_key, 0)) { - - pdo_dbh_attribute_set(dbh, long_key, *attr_value TSRMLS_CC); - zend_hash_move_forward(Z_ARRVAL_P(options)); - } - } - return; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php