diff options
author | Andrey Hristov <andrey@php.net> | 2007-10-05 21:23:56 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2007-10-05 21:23:56 +0000 |
commit | 8b9b553aa264d3c0afe611f49499e787004983c7 (patch) | |
tree | 840ea2b1127ec97a63f36ffda689a1a1fe5fb975 /ext/mysqli/mysqli_prop.c | |
parent | 9f9495a48483aac9f6bc92ceea5841a8d243e2aa (diff) | |
download | php-git-8b9b553aa264d3c0afe611f49499e787004983c7.tar.gz |
Import mysqlnd
Patch ext/mysql and ext/mysqli to support mysqlnd
Diffstat (limited to 'ext/mysqli/mysqli_prop.c')
-rw-r--r-- | ext/mysqli/mysqli_prop.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index fd0b8a21fa..fd8281b551 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -27,7 +27,7 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" -#include "php_mysqli.h" +#include "php_mysqli_structs.h" #define CHECK_STATUS(value) \ if (((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \ @@ -221,24 +221,23 @@ static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC) static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC) { MYSQL_RES *p; + ulong *ret; ALLOC_ZVAL(*retval); CHECK_STATUS(MYSQLI_STATUS_VALID); p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - if (!p || !p->field_count) { + if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) + { ZVAL_NULL(*retval); } else { ulong i; - zval *l; array_init(*retval); for (i=0; i < p->field_count; i++) { - MAKE_STD_ZVAL(l); - ZVAL_LONG(l, p->lengths[i]); - add_index_zval(*retval, i, l); - } + add_index_long(*retval, i, ret[i]); + } } return SUCCESS; } @@ -312,7 +311,7 @@ MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_ST MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED)); /* }}} */ -mysqli_property_entry mysqli_link_property_entries[] = { +const mysqli_property_entry mysqli_link_property_entries[] = { {"affected_rows", link_affected_rows_read, NULL}, {"client_info", link_client_info_read, NULL}, {"client_version", link_client_version_read, NULL}, @@ -333,7 +332,7 @@ mysqli_property_entry mysqli_link_property_entries[] = { {NULL, NULL, NULL} }; -mysqli_property_entry mysqli_result_property_entries[] = { +const mysqli_property_entry mysqli_result_property_entries[] = { {"current_field", result_current_field_read, NULL}, {"field_count", result_field_count_read, NULL}, {"lengths", result_lengths_read, NULL}, @@ -342,7 +341,7 @@ mysqli_property_entry mysqli_result_property_entries[] = { {NULL, NULL, NULL} }; -mysqli_property_entry mysqli_stmt_property_entries[] = { +const mysqli_property_entry mysqli_stmt_property_entries[] = { {"affected_rows", stmt_affected_rows_read, NULL}, {"insert_id", stmt_insert_id_read, NULL}, {"num_rows", stmt_num_rows_read, NULL}, |