Skip to content

Commit

Permalink
Revert "Backport patch for bug #71820"
Browse files Browse the repository at this point in the history
This reverts commit 1b632cf.

This fixed bug #72151, and reverts the fix for bug #71820.
See also bug #50636 and #49521 for the history.
  • Loading branch information
weltling committed May 9, 2016
1 parent 41b159f commit 1cc536a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 225 deletions.
15 changes: 1 addition & 14 deletions ext/mysqli/mysqli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,13 +1295,9 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval *retval_ptr;
zend_bool props_merged = 0;

object_and_properties_init(return_value, ce, NULL);
if (!ce->__set) {
props_merged = 1;
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);
}
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);

if (ce->constructor) {
fci.size = sizeof(fci);
Expand Down Expand Up @@ -1335,10 +1331,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags

if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
if (fci.params) {
efree(fci.params);
}
return;
} else {
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
Expand All @@ -1349,11 +1341,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
} else if (ctor_params) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
return;
}

if (!props_merged) {
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);
}
}
}
Expand Down
104 changes: 0 additions & 104 deletions ext/mysqli/tests/bug71820.phpt

This file was deleted.

15 changes: 1 addition & 14 deletions ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -2784,13 +2784,9 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval *retval_ptr;
zend_bool props_merged = 0;

object_and_properties_init(return_value, ce, NULL);
if (!ce->__set) {
props_merged = 1;
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);
}
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);

if (ce->constructor) {
fci.size = sizeof(fci);
Expand Down Expand Up @@ -2824,10 +2820,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,

if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
if (fci.params) {
efree(fci.params);
}
return;
} else {
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
Expand All @@ -2838,11 +2830,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
}
} else if (ctor_params) {
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
return;
}

if (!props_merged) {
zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC);
}
}
}
Expand Down
93 changes: 0 additions & 93 deletions ext/pgsql/tests/bug71820.phpt

This file was deleted.

0 comments on commit 1cc536a

Please sign in to comment.