summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2007-06-28 19:22:52 +0000
committerIlia Alshanetsky <iliaa@php.net>2007-06-28 19:22:52 +0000
commitd34bfe5c37e45e80bae7eeb35a4ca1175636c6e9 (patch)
tree428506fbf11ca9e14404bb81a735efcc3de4f993
parentdd44c6a09387ddf4e0bda6df9a8736e7f137c6d1 (diff)
downloadphp-git-d34bfe5c37e45e80bae7eeb35a4ca1175636c6e9.tar.gz
When working with persistent connections re-initialize options on each
connection. Flags like error reporting may differ.
-rwxr-xr-xext/pdo/pdo_dbh.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 6550b060fa..cffc9863dd 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -364,6 +364,20 @@ static PHP_METHOD(PDO, dbh_constructor)
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 @@ static PHP_METHOD(PDO, dbh_constructor)
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;
}