summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2005-10-08 15:08:07 +0000
committerGeorg Richter <georg@php.net>2005-10-08 15:08:07 +0000
commit7357ac0b968bb338bddfc47ae6ffe51e012f41e7 (patch)
tree6467e00983bf9f80e15871065e3d3c23f591b0af /ext/mysqli/mysqli.c
parente3c8bd51ded8f5116b880e3589fd6cf1e5ffd89a (diff)
downloadphp-git-7357ac0b968bb338bddfc47ae6ffe51e012f41e7.tar.gz
fix for bug 34785:
added support for parent::__construct (mysqli_statement and mysqli_resultset) fixed failed testcases when sql_mode is in effect
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index ce7b12dcd5..436cc3ccef 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -143,25 +143,23 @@ static void mysqli_objects_destroy_object(void *object, zend_object_handle handl
if (instanceof_function(intern->zo.ce, mysqli_link_class_entry TSRMLS_CC)) {
if (my_res && my_res->ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
-
if (mysql->mysql) {
mysql_close(mysql->mysql);
}
-
php_clear_mysql(mysql);
efree(mysql);
-
my_res->ptr = NULL;
}
- } else if (intern->zo.ce == mysqli_stmt_class_entry) { /* stmt object */
+ } else if (instanceof_function(intern->zo.ce, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
if (my_res && my_res->ptr) {
- php_clear_stmt_bind((MY_STMT *)my_res->ptr);
+ MY_STMT *stmt = (MY_STMT *)my_res->ptr;
+ php_clear_stmt_bind(stmt);
}
- } else if (intern->zo.ce == mysqli_result_class_entry) { /* result object */
+ } else if (instanceof_function(intern->zo.ce, mysqli_result_class_entry TSRMLS_CC)) { /* stmt object */
if (my_res && my_res->ptr) {
mysql_free_result(my_res->ptr);
}
- } else if (intern->zo.ce == mysqli_warning_class_entry) { /* warning object */
+ } else if (instanceof_function(intern->zo.ce, mysqli_warning_class_entry TSRMLS_CC)) { /* stmt object */
if (my_res && my_res->ptr) {
php_clear_warnings((MYSQLI_WARNING *)my_res->info);
}