PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/mysqli - mysqli_prop.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 123 140 87.9 %
Date: 2014-07-21 Functions: 34 34 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 5                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 1997-2014 The PHP Group                                |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Author: Georg Richter <georg@php.net>                                |
      16             :   |         Andrey Hristov <andrey@php.net>                              |
      17             :   +----------------------------------------------------------------------+
      18             : 
      19             :   $Id$
      20             : */
      21             : 
      22             : #ifdef HAVE_CONFIG_H
      23             : #include "config.h"
      24             : #endif
      25             : 
      26             : #include <signal.h>
      27             : 
      28             : #include "php.h"
      29             : #include "php_ini.h"
      30             : #include "ext/standard/info.h"
      31             : #include "php_mysqli_structs.h"
      32             : #include "mysqli_priv.h"
      33             : 
      34             : #define CHECK_STATUS(value) \
      35             :         if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
      36             :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
      37             :                 ZVAL_NULL(*retval); \
      38             :                 return SUCCESS; \
      39             :         } \
      40             : 
      41             : #define MYSQLI_GET_MYSQL(statusval) \
      42             : MYSQL *p; \
      43             : MAKE_STD_ZVAL(*retval);\
      44             : if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
      45             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      46             :         ZVAL_NULL(*retval);\
      47             :         return SUCCESS; \
      48             : } else { \
      49             :         CHECK_STATUS(statusval);\
      50             :     p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\
      51             : }
      52             : 
      53             : #define MYSQLI_GET_RESULT(statusval) \
      54             : MYSQL_RES *p; \
      55             : MAKE_STD_ZVAL(*retval);\
      56             : if (!obj->ptr) { \
      57             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      58             :         ZVAL_NULL(*retval);\
      59             :         return SUCCESS; \
      60             : } else { \
      61             :         CHECK_STATUS(statusval);\
      62             :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; \
      63             : }
      64             : 
      65             : 
      66             : #define MYSQLI_GET_STMT(statusval) \
      67             : MYSQL_STMT *p; \
      68             : MAKE_STD_ZVAL(*retval);\
      69             : if (!obj->ptr) { \
      70             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      71             :         ZVAL_NULL(*retval);\
      72             :         return SUCCESS; \
      73             : } else { \
      74             :         CHECK_STATUS(statusval);\
      75             :         p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt;\
      76             : }
      77             : 
      78             : #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
      79             : static int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
      80             : {\
      81             :         __ret_type l;\
      82             :         __get_type;\
      83             :         if (!p) {\
      84             :                 ZVAL_NULL(*retval);\
      85             :         } else {\
      86             :                 l = (__ret_type)__int_func(p);\
      87             :                 if (l < LONG_MAX) {\
      88             :                         ZVAL_LONG(*retval, (long) l);\
      89             :                 } else { \
      90             :                         char *ret; \
      91             :                         int ret_len = spprintf(&ret, 0, __ret_type_sprint_mod, l); \
      92             :                         ZVAL_STRINGL(*retval, ret, ret_len, 0); \
      93             :                 } \
      94             :         }\
      95             :         return SUCCESS;\
      96             : }
      97             : 
      98             : #define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
      99             : static int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
     100             : {\
     101             :         char *c;\
     102             :         __get_type;\
     103             :         if (!p) {\
     104             :                 ZVAL_NULL(*retval);\
     105             :         } else {\
     106             :                 c = (char *)__int_func(p);\
     107             :                 if (!c) {\
     108             :                         ZVAL_NULL(*retval);\
     109             :                 } else {\
     110             :                         ZVAL_STRING(*retval, c, 1);\
     111             :                 }\
     112             :         }\
     113             :         return SUCCESS;\
     114             : }
     115             : 
     116             : /* {{{ property link_client_version_read */
     117          18 : static int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     118             : {
     119          18 :         MAKE_STD_ZVAL(*retval);
     120          18 :         ZVAL_LONG(*retval, MYSQL_VERSION_ID);
     121          18 :         return SUCCESS;
     122             : }
     123             : /* }}} */
     124             : 
     125             : /* {{{ property link_client_info_read */
     126          17 : static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     127             : {
     128          17 :         MAKE_STD_ZVAL(*retval);
     129          17 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     130           6 :         ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
     131           6 :         return SUCCESS;
     132             : }
     133             : /* }}} */
     134             : 
     135             : /* {{{ property link_connect_errno_read */
     136          17 : static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     137             : {
     138          17 :         MAKE_STD_ZVAL(*retval);
     139          17 :         ZVAL_LONG(*retval, (long)MyG(error_no));
     140          17 :         return SUCCESS;
     141             : }
     142             : /* }}} */
     143             : 
     144             : /* {{{ property link_connect_error_read */
     145          17 : static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     146             : {
     147          17 :         MAKE_STD_ZVAL(*retval);
     148          17 :         if (MyG(error_msg)) {
     149          10 :                 ZVAL_STRING(*retval, MyG(error_msg), 1);
     150             :         } else {
     151           7 :                 ZVAL_NULL(*retval);
     152             :         }
     153          17 :         return SUCCESS;
     154             : }
     155             : /* }}} */
     156             : 
     157             : /* {{{ property link_affected_rows_read */
     158          31 : static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     159             : {
     160             :         MY_MYSQL *mysql;
     161             :         my_ulonglong rc;
     162             : 
     163          31 :         MAKE_STD_ZVAL(*retval);
     164             : 
     165          31 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     166             : 
     167          19 :         mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     168             : 
     169          19 :         if (!mysql) {
     170           0 :                 ZVAL_NULL(*retval);
     171             :         } else {
     172          19 :                 CHECK_STATUS(MYSQLI_STATUS_VALID);
     173             : 
     174          17 :                 rc = mysql_affected_rows(mysql->mysql);
     175             : 
     176          17 :                 if (rc == (my_ulonglong) -1) {
     177           2 :                         ZVAL_LONG(*retval, -1);
     178           2 :                         return SUCCESS;
     179             :                 }
     180             : 
     181          15 :                 if (rc < LONG_MAX) {
     182          15 :                         ZVAL_LONG(*retval, (long) rc);
     183             :                 } else {
     184             :                         char *ret;
     185           0 :                         int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
     186           0 :                         ZVAL_STRINGL(*retval, ret, l, 0);
     187             :                 }
     188             :         }
     189          15 :         return SUCCESS;
     190             : }
     191             : /* }}} */
     192             : 
     193             : 
     194             : /* {{{ property link_error_list_read */
     195          10 : static int link_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     196             : {
     197             :         MY_MYSQL *mysql;
     198             : 
     199          10 :         MAKE_STD_ZVAL(*retval);
     200             : 
     201          10 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     202             : 
     203           4 :         mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     204             : 
     205           4 :         array_init(*retval);
     206           4 :         if (mysql) {
     207             : #if defined(MYSQLI_USE_MYSQLND)
     208           4 :                 if (mysql->mysql->data->error_info->error_list) {
     209             :                         MYSQLND_ERROR_LIST_ELEMENT * message;
     210             :                         zend_llist_position pos;
     211           9 :                         for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(mysql->mysql->data->error_info->error_list, &pos);
     212             :                                  message;
     213           1 :                                  message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(mysql->mysql->data->error_info->error_list, &pos)) 
     214             :                         {
     215             :                                 zval * single_error;
     216           1 :                                 MAKE_STD_ZVAL(single_error);
     217           1 :                                 array_init(single_error);
     218           1 :                                 add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
     219           1 :                                 add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
     220           1 :                                 add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
     221           1 :                                 add_next_index_zval(*retval, single_error);
     222             :                         }
     223             :                 }
     224             : #else
     225             :                 if (mysql_errno(mysql->mysql)) {
     226             :                         zval * single_error;
     227             :                         MAKE_STD_ZVAL(single_error);
     228             :                         array_init(single_error);
     229             :                         add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_errno(mysql->mysql));
     230             :                         add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_sqlstate(mysql->mysql), 1);
     231             :                         add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_error(mysql->mysql), 1);
     232             :                         add_next_index_zval(*retval, single_error);
     233             :                 }
     234             : #endif
     235             :         }
     236           4 :         return SUCCESS;
     237             : }
     238             : /* }}} */
     239             : 
     240             : 
     241             : /* link properties */
     242          39 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
     243          29 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
     244          18 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     245          17 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     246          18 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     247          33 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     248          17 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     249          18 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     250          19 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     251          18 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     252          29 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     253          21 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     254             : 
     255             : /* {{{ property link_stat_read */
     256          13 : static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     257             : {
     258             :         MY_MYSQL *mysql;
     259             : 
     260          13 :         MAKE_STD_ZVAL(*retval);
     261          13 :         ZVAL_NULL(*retval);
     262             : 
     263             : #if defined(MYSQLI_USE_MYSQLND)
     264          13 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     265             : #else
     266             :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     267             : #endif
     268             : 
     269           8 :         mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     270             : 
     271           8 :         if (mysql) {
     272             :                 char * stat_msg;
     273             : #if defined(MYSQLI_USE_MYSQLND)
     274             :                 uint stat_msg_len;
     275           8 :                 if (mysqlnd_stat(mysql->mysql, &stat_msg, &stat_msg_len) == PASS) {
     276           5 :                         ZVAL_STRINGL(*retval, stat_msg, stat_msg_len, 0);
     277             :                 }
     278             : #else
     279             :                 if ((stat_msg = (char *) mysql_stat(mysql->mysql))) {
     280             :                         ZVAL_STRING(*retval, stat_msg, 1);
     281             :                 }
     282             : #endif
     283             :         }
     284           8 :         return SUCCESS;
     285             : }
     286             : /* }}} */
     287             : 
     288             : 
     289             : /* result properties */
     290             : 
     291             : /* {{{ property result_type_read */
     292           6 : static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     293             : {
     294             :         MYSQL_RES *p;
     295             : 
     296           6 :         MAKE_STD_ZVAL(*retval);
     297           6 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     298           5 :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     299             : 
     300           5 :         if (!p) {
     301           0 :                 ZVAL_NULL(*retval);
     302             :         } else {
     303           5 :                 ZVAL_LONG(*retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT);
     304             :         }
     305           5 :         return SUCCESS;
     306             : }
     307             : /* }}} */
     308             : 
     309             : /* {{{ property result_lengths_read */
     310           9 : static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     311             : {
     312             :         MYSQL_RES *p;
     313             :         ulong *ret;
     314             :         uint field_count;
     315             : 
     316           9 :         MAKE_STD_ZVAL(*retval);
     317             : 
     318           9 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     319           7 :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     320           7 :         field_count = mysql_num_fields(p);
     321           9 :         if (!p || !field_count || !(ret = mysql_fetch_lengths(p))) {
     322           2 :                 ZVAL_NULL(*retval);
     323             :         } else {
     324             :                 ulong i;
     325             : 
     326           5 :                 array_init(*retval);
     327             : 
     328          15 :                 for (i = 0; i < field_count; i++) {
     329          10 :                         add_index_long(*retval, i, ret[i]);
     330             :                 }
     331             :         }
     332           7 :         return SUCCESS;
     333             : }
     334             : /* }}} */
     335             : 
     336             : 
     337           6 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     338          11 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     339           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     340             : 
     341             : /* statement properties */
     342             : 
     343             : /* {{{ property stmt_id_read */
     344           4 : static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     345             : {
     346             :         MY_STMT *p;
     347             : 
     348           4 :         MAKE_STD_ZVAL(*retval);
     349           4 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     350             : 
     351           4 :         p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     352             : 
     353           4 :         if (!p) {
     354           0 :                 ZVAL_NULL(*retval);
     355             :         } else {
     356           4 :                 ZVAL_LONG(*retval, mysqli_stmt_get_id(p->stmt));
     357             :         }
     358           4 :         return SUCCESS;
     359             : }
     360             : /* }}} */
     361             : 
     362             : /* {{{ property stmt_affected_rows_read */
     363           6 : static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     364             : {
     365             :         MY_STMT *p;
     366             :         my_ulonglong rc;
     367             : 
     368           6 :         MAKE_STD_ZVAL(*retval);
     369           6 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     370             : 
     371           4 :         p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     372             : 
     373           4 :         if (!p) {
     374           0 :                 ZVAL_NULL(*retval);
     375             :         } else {
     376           4 :                 rc = mysql_stmt_affected_rows(p->stmt);
     377             : 
     378           4 :                 if (rc == (my_ulonglong) -1) {
     379           0 :                         ZVAL_LONG(*retval, -1);
     380           0 :                         return SUCCESS;
     381             :                 }
     382             : 
     383           4 :                 if (rc < LONG_MAX) {
     384           4 :                         ZVAL_LONG(*retval, (long) rc);
     385             :                 } else {
     386             :                         char *ret;
     387           0 :                         int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
     388           0 :                         ZVAL_STRINGL(*retval, ret, l, 0);
     389             :                 }
     390             :         }
     391           4 :         return SUCCESS;
     392             : }
     393             : /* }}} */
     394             : 
     395             : /* {{{ property stmt_error_list_read */
     396           3 : static int stmt_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     397             : {
     398             :         MY_STMT * stmt;
     399             : 
     400           3 :         MAKE_STD_ZVAL(*retval);
     401           3 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     402             : 
     403           3 :         stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     404           3 :         array_init(*retval);
     405           3 :         if (stmt && stmt->stmt) {
     406             : #if defined(MYSQLI_USE_MYSQLND)
     407           3 :                 if (stmt->stmt->data && stmt->stmt->data->error_info->error_list) {
     408             :                         MYSQLND_ERROR_LIST_ELEMENT * message;
     409             :                         zend_llist_position pos;
     410           6 :                         for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(stmt->stmt->data->error_info->error_list, &pos);
     411             :                                  message;
     412           0 :                                  message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(stmt->stmt->data->error_info->error_list, &pos)) 
     413             :                         {
     414             :                                 zval * single_error;
     415           0 :                                 MAKE_STD_ZVAL(single_error);
     416           0 :                                 array_init(single_error);
     417           0 :                                 add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
     418           0 :                                 add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
     419           0 :                                 add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
     420           0 :                                 add_next_index_zval(*retval, single_error);
     421             :                         }
     422             :                 }
     423             : #else
     424             :                 if (mysql_stmt_errno(stmt->stmt)) {
     425             :                         zval * single_error;
     426             :                         MAKE_STD_ZVAL(single_error);
     427             :                         array_init(single_error);
     428             :                         add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_stmt_errno(stmt->stmt));
     429             :                         add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_stmt_sqlstate(stmt->stmt), 1);
     430             :                         add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_stmt_error(stmt->stmt), 1);
     431             :                         add_next_index_zval(*retval, single_error);
     432             :                 }
     433             : #endif
     434             :         }
     435           3 :         return SUCCESS;
     436             : }
     437             : /* }}} */
     438             : 
     439             : 
     440           5 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     441           3 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     442           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     443           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     444           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
     445           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     446           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     447             : 
     448             : /* }}} */
     449             : const mysqli_property_entry mysqli_link_property_entries[] = {
     450             :         {"affected_rows",     sizeof("affected_rows") - 1,  link_affected_rows_read, NULL},
     451             :         {"client_info",       sizeof("client_info") - 1,            link_client_info_read, NULL},
     452             :         {"client_version",    sizeof("client_version") - 1, link_client_version_read, NULL},
     453             :         {"connect_errno",     sizeof("connect_errno") - 1,  link_connect_errno_read, NULL},
     454             :         {"connect_error",     sizeof("connect_error") - 1,  link_connect_error_read, NULL},
     455             :         {"errno",                     sizeof("errno") - 1,                  link_errno_read, NULL},
     456             :         {"error",                     sizeof("error") - 1,                  link_error_read, NULL},
     457             :         {"error_list",                sizeof("error_list") - 1,             link_error_list_read, NULL},
     458             :         {"field_count",               sizeof("field_count") - 1,            link_field_count_read, NULL},
     459             :         {"host_info",         sizeof("host_info") - 1,              link_host_info_read, NULL},
     460             :         {"info",                      sizeof("info") - 1,                           link_info_read, NULL},
     461             :         {"insert_id",         sizeof("insert_id") - 1,              link_insert_id_read, NULL},
     462             :         {"server_info",               sizeof("server_info") - 1,            link_server_info_read, NULL},
     463             :         {"server_version",    sizeof("server_version") - 1, link_server_version_read, NULL},
     464             :         {"stat",                      sizeof("stat") - 1,                           link_stat_read, NULL},
     465             :         {"sqlstate",          sizeof("sqlstate") - 1,                       link_sqlstate_read, NULL},
     466             :         {"protocol_version",sizeof("protocol_version") - 1, link_protocol_version_read, NULL},
     467             :         {"thread_id",         sizeof("thread_id") - 1,              link_thread_id_read, NULL},
     468             :         {"warning_count",     sizeof("warning_count") - 1,  link_warning_count_read, NULL},
     469             :         {NULL, 0, NULL, NULL}
     470             : };
     471             : 
     472             : 
     473             : const zend_property_info mysqli_link_property_info_entries[] = {
     474             :         {ZEND_ACC_PUBLIC, "affected_rows",    sizeof("affected_rows") - 1,  -1, 0, NULL, 0, NULL},
     475             :         {ZEND_ACC_PUBLIC, "client_info",      sizeof("client_info") - 1,            -1, 0, NULL, 0, NULL},
     476             :         {ZEND_ACC_PUBLIC, "client_version",   sizeof("client_version") - 1, -1, 0, NULL, 0, NULL},
     477             :         {ZEND_ACC_PUBLIC, "connect_errno",    sizeof("connect_errno") - 1,  -1, 0, NULL, 0, NULL},
     478             :         {ZEND_ACC_PUBLIC, "connect_error",    sizeof("connect_error") - 1,  -1, 0, NULL, 0, NULL},
     479             :         {ZEND_ACC_PUBLIC, "errno",                    sizeof("errno") - 1,                  -1, 0, NULL, 0, NULL},
     480             :         {ZEND_ACC_PUBLIC, "error",                    sizeof("error") - 1,                  -1, 0, NULL, 0, NULL},
     481             :         {ZEND_ACC_PUBLIC, "error_list",               sizeof("error_list") - 1,             -1, 0, NULL, 0, NULL},
     482             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,            -1, 0, NULL, 0, NULL},
     483             :         {ZEND_ACC_PUBLIC, "host_info",                sizeof("host_info") - 1,              -1, 0, NULL, 0, NULL},
     484             :         {ZEND_ACC_PUBLIC, "info",                     sizeof("info") - 1,                           -1, 0, NULL, 0, NULL},
     485             :         {ZEND_ACC_PUBLIC, "insert_id",                sizeof("insert_id") - 1,              -1, 0, NULL, 0, NULL},
     486             :         {ZEND_ACC_PUBLIC, "server_info",      sizeof("server_info") - 1,            -1, 0, NULL, 0, NULL},
     487             :         {ZEND_ACC_PUBLIC, "server_version",   sizeof("server_version") - 1, -1, 0, NULL, 0, NULL},
     488             :         {ZEND_ACC_PUBLIC, "stat",                     sizeof("stat") - 1,                           -1, 0, NULL, 0, NULL},
     489             :         {ZEND_ACC_PUBLIC, "sqlstate",         sizeof("sqlstate") - 1,                       -1, 0, NULL, 0, NULL},
     490             :         {ZEND_ACC_PUBLIC, "protocol_version", sizeof("protocol_version")-1, -1, 0, NULL, 0, NULL},
     491             :         {ZEND_ACC_PUBLIC, "thread_id",                sizeof("thread_id") - 1,              -1, 0, NULL, 0, NULL},
     492             :         {ZEND_ACC_PUBLIC, "warning_count",    sizeof("warning_count") - 1,  -1, 0, NULL, 0, NULL},
     493             :         {0,                                     NULL,                   0,                                                              -1, 0, NULL, 0, NULL}
     494             : };
     495             : 
     496             : 
     497             : const mysqli_property_entry mysqli_result_property_entries[] = {
     498             :         {"current_field",sizeof("current_field")-1, result_current_field_read, NULL},
     499             :         {"field_count", sizeof("field_count") - 1,  result_field_count_read, NULL},
     500             :         {"lengths",   sizeof("lengths") - 1,                result_lengths_read, NULL},
     501             :         {"num_rows",  sizeof("num_rows") - 1,               result_num_rows_read, NULL},
     502             :         {"type",              sizeof("type") - 1,                   result_type_read, NULL},
     503             :         {NULL, 0, NULL, NULL}
     504             : };
     505             : 
     506             : const zend_property_info mysqli_result_property_info_entries[] = {
     507             :         {ZEND_ACC_PUBLIC, "current_field",    sizeof("current_field")-1,    -1, 0, NULL, 0, NULL},
     508             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,    -1, 0, NULL, 0, NULL},
     509             :         {ZEND_ACC_PUBLIC, "lengths",          sizeof("lengths") - 1,                -1, 0, NULL, 0, NULL},
     510             :         {ZEND_ACC_PUBLIC, "num_rows",         sizeof("num_rows") - 1,       -1, 0, NULL, 0, NULL},
     511             :         {ZEND_ACC_PUBLIC, "type",                     sizeof("type") - 1,           -1, 0, NULL, 0, NULL},
     512             :         {0,                                     NULL,                   0,                                                      -1, 0, NULL, 0, NULL}
     513             : };
     514             : 
     515             : const mysqli_property_entry mysqli_stmt_property_entries[] = {
     516             :         {"affected_rows", sizeof("affected_rows")-1,stmt_affected_rows_read, NULL},
     517             :         {"insert_id", sizeof("insert_id") - 1,      stmt_insert_id_read, NULL},
     518             :         {"num_rows",  sizeof("num_rows") - 1,       stmt_num_rows_read, NULL},
     519             :         {"param_count", sizeof("param_count") - 1,  stmt_param_count_read, NULL},
     520             :         {"field_count", sizeof("field_count") - 1,  stmt_field_count_read, NULL},
     521             :         {"errno",             sizeof("errno") - 1,          stmt_errno_read, NULL},
     522             :         {"error",             sizeof("error") - 1,          stmt_error_read, NULL},
     523             :         {"error_list",        sizeof("error_list") - 1,     stmt_error_list_read, NULL},
     524             :         {"sqlstate",  sizeof("sqlstate") - 1,               stmt_sqlstate_read, NULL},
     525             :         {"id",                        sizeof("id") - 1,                     stmt_id_read, NULL},
     526             :         {NULL, 0, NULL, NULL}
     527             : };
     528             : 
     529             : 
     530             : const zend_property_info mysqli_stmt_property_info_entries[] = {
     531             :         {ZEND_ACC_PUBLIC, "affected_rows", sizeof("affected_rows") - 1,     -1, 0, NULL, 0, NULL},
     532             :         {ZEND_ACC_PUBLIC, "insert_id",        sizeof("insert_id") - 1,              -1, 0, NULL, 0, NULL},
     533             :         {ZEND_ACC_PUBLIC, "num_rows", sizeof("num_rows") - 1,                       -1, 0, NULL, 0, NULL},
     534             :         {ZEND_ACC_PUBLIC, "param_count",sizeof("param_count") - 1,          -1, 0, NULL, 0, NULL},
     535             :         {ZEND_ACC_PUBLIC, "field_count",sizeof("field_count") - 1,          -1, 0, NULL, 0, NULL},
     536             :         {ZEND_ACC_PUBLIC, "errno",            sizeof("errno") - 1,                  -1, 0, NULL, 0, NULL},
     537             :         {ZEND_ACC_PUBLIC, "error",            sizeof("error") - 1,                  -1, 0, NULL, 0, NULL},
     538             :         {ZEND_ACC_PUBLIC, "error_list",       sizeof("error_list") - 1,             -1, 0, NULL, 0, NULL},
     539             :         {ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1,                       -1, 0, NULL, 0, NULL},
     540             :         {ZEND_ACC_PUBLIC, "id",                       sizeof("id") - 1,                             -1, 0, NULL, 0, NULL},
     541             :         {0,                                     NULL,                   0,                                                      -1, 0, NULL, 0, NULL}
     542             : };
     543             : 
     544             : /*
     545             :  * Local variables:
     546             :  * tab-width: 4
     547             :  * c-basic-offset: 4
     548             :  * End:
     549             :  * vim600: noet sw=4 ts=4 fdm=marker
     550             :  * vim<600: noet sw=4 ts=4
     551             :  */

Generated by: LCOV version 1.10

Generated at Tue, 22 Jul 2014 01:33:12 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.