mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Various bug fixes (now 17 tests fails, it is 11 in trunk)
This commit is contained in:
parent
53b930475f
commit
446c60c616
@ -438,9 +438,6 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
|
||||
ZVAL_STR(&member, entry->name);
|
||||
value = mysqli_read_property(object, &member, BP_VAR_IS, 0, &rv TSRMLS_CC);
|
||||
if (value != &EG(uninitialized_zval)) {
|
||||
if (Z_REFCOUNTED_P(value)) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
zend_hash_add(retval, Z_STR(member), value);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
@ -484,7 +481,7 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type
|
||||
handlers = &mysqli_object_handlers;
|
||||
}
|
||||
|
||||
intern->zo.handlers = &mysqli_object_handlers;
|
||||
intern->zo.handlers = handlers;
|
||||
|
||||
return &intern->zo;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
|
||||
ZVAL_NULL(retval); \
|
||||
return SUCCESS; \
|
||||
return retval; \
|
||||
} \
|
||||
|
||||
#define MYSQLI_GET_MYSQL(statusval) \
|
||||
@ -43,7 +43,7 @@ MYSQL *p; \
|
||||
if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
|
||||
ZVAL_NULL(retval);\
|
||||
return SUCCESS; \
|
||||
return retval; \
|
||||
} else { \
|
||||
CHECK_STATUS(statusval);\
|
||||
p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\
|
||||
@ -54,7 +54,7 @@ MYSQL_RES *p; \
|
||||
if (!obj->ptr) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
|
||||
ZVAL_NULL(retval);\
|
||||
return SUCCESS; \
|
||||
return retval; \
|
||||
} else { \
|
||||
CHECK_STATUS(statusval);\
|
||||
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; \
|
||||
@ -66,7 +66,7 @@ MYSQL_STMT *p; \
|
||||
if (!obj->ptr) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
|
||||
ZVAL_NULL(retval);\
|
||||
return SUCCESS; \
|
||||
return retval; \
|
||||
} else { \
|
||||
CHECK_STATUS(statusval);\
|
||||
p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt;\
|
||||
|
@ -132,7 +132,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
|
||||
result = mysql->m->use_result(mysql, 0 TSRMLS_CC);
|
||||
|
||||
for (;;) {
|
||||
zval **entry;
|
||||
zval *entry;
|
||||
int errno;
|
||||
|
||||
MAKE_STD_ZVAL(row);
|
||||
@ -146,15 +146,15 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
|
||||
zend_hash_move_forward(Z_ARRVAL_P(row));
|
||||
|
||||
/* 1. Here comes the error no */
|
||||
zend_hash_get_current_data(Z_ARRVAL_P(row), (void **)&entry);
|
||||
entry = zend_hash_get_current_data(Z_ARRVAL_P(row));
|
||||
convert_to_long_ex(entry);
|
||||
errno = Z_LVAL_PP(entry);
|
||||
errno = Z_LVAL_P(entry);
|
||||
zend_hash_move_forward(Z_ARRVAL_P(row));
|
||||
|
||||
/* 2. Here comes the reason */
|
||||
zend_hash_get_current_data(Z_ARRVAL_P(row), (void **)&entry);
|
||||
entry = zend_hash_get_current_data(Z_ARRVAL_P(row));
|
||||
|
||||
w = php_new_warning(*entry, errno TSRMLS_CC);
|
||||
w = php_new_warning(entry, errno TSRMLS_CC);
|
||||
/*
|
||||
Don't destroy entry, because the row destroy will decrease
|
||||
the refcounter. Decreased twice then mysqlnd_free_result()
|
||||
@ -245,7 +245,7 @@ zval *mysqli_warning_errno(mysqli_object *obj, zval *retval TSRMLS_DC)
|
||||
}
|
||||
w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
|
||||
ZVAL_LONG(retval, w->errorno);
|
||||
return SUCCESS;
|
||||
return retval;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user