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: 99 107 92.5 %
Date: 2014-07-27 Functions: 32 32 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 5                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 1997-2013 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             :   +----------------------------------------------------------------------+
      17             : 
      18             :   $Id$
      19             : */
      20             : 
      21             : #ifdef HAVE_CONFIG_H
      22             : #include "config.h"
      23             : #endif
      24             : 
      25             : #include <signal.h>
      26             : 
      27             : #include "php.h"
      28             : #include "php_ini.h"
      29             : #include "ext/standard/info.h"
      30             : #include "php_mysqli_structs.h"
      31             : #include "mysqli_priv.h"
      32             : 
      33             : #define CHECK_STATUS(value) \
      34             :         if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
      35             :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
      36             :                 ZVAL_NULL(*retval); \
      37             :                 return SUCCESS; \
      38             :         } \
      39             : 
      40             : #define MYSQLI_GET_MYSQL(statusval) \
      41             : MYSQL *p; \
      42             : MAKE_STD_ZVAL(*retval);\
      43             : if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
      44             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      45             :         ZVAL_NULL(*retval);\
      46             :         return SUCCESS; \
      47             : } else { \
      48             :         CHECK_STATUS(statusval);\
      49             :     p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\
      50             : }
      51             : 
      52             : #define MYSQLI_GET_RESULT(statusval) \
      53             : MYSQL_RES *p; \
      54             : MAKE_STD_ZVAL(*retval);\
      55             : if (!obj->ptr) { \
      56             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      57             :         ZVAL_NULL(*retval);\
      58             :         return SUCCESS; \
      59             : } else { \
      60             :         CHECK_STATUS(statusval);\
      61             :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; \
      62             : }
      63             : 
      64             : 
      65             : #define MYSQLI_GET_STMT(statusval) \
      66             : MYSQL_STMT *p; \
      67             : MAKE_STD_ZVAL(*retval);\
      68             : if (!obj->ptr) { \
      69             :         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
      70             :         ZVAL_NULL(*retval);\
      71             :         return SUCCESS; \
      72             : } else { \
      73             :         CHECK_STATUS(statusval);\
      74             :         p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt;\
      75             : }
      76             : 
      77             : #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
      78             : static int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
      79             : {\
      80             :         __ret_type l;\
      81             :         __get_type;\
      82             :         if (!p) {\
      83             :                 ZVAL_NULL(*retval);\
      84             :         } else {\
      85             :                 l = (__ret_type)__int_func(p);\
      86             :                 if (l < LONG_MAX) {\
      87             :                         ZVAL_LONG(*retval, (long) l);\
      88             :                 } else { \
      89             :                         char *ret; \
      90             :                         int ret_len = spprintf(&ret, 0, __ret_type_sprint_mod, l); \
      91             :                         ZVAL_STRINGL(*retval, ret, ret_len, 0); \
      92             :                 } \
      93             :         }\
      94             :         return SUCCESS;\
      95             : }
      96             : 
      97             : #define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
      98             : static int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
      99             : {\
     100             :         char *c;\
     101             :         __get_type;\
     102             :         if (!p) {\
     103             :                 ZVAL_NULL(*retval);\
     104             :         } else {\
     105             :                 c = (char *)__int_func(p);\
     106             :                 if (!c) {\
     107             :                         ZVAL_NULL(*retval);\
     108             :                 } else {\
     109             :                         ZVAL_STRING(*retval, c, 1);\
     110             :                 }\
     111             :         }\
     112             :         return SUCCESS;\
     113             : }
     114             : 
     115             : /* {{{ property link_client_version_read */
     116          18 : static int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     117             : {
     118          18 :         MAKE_STD_ZVAL(*retval);
     119          18 :         ZVAL_LONG(*retval, MYSQL_VERSION_ID);
     120          18 :         return SUCCESS;
     121             : }
     122             : /* }}} */
     123             : 
     124             : /* {{{ property link_client_info_read */
     125          17 : static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     126             : {
     127          17 :         MAKE_STD_ZVAL(*retval);
     128          17 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     129           6 :         ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
     130           6 :         return SUCCESS;
     131             : }
     132             : /* }}} */
     133             : 
     134             : /* {{{ property link_connect_errno_read */
     135          17 : static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     136             : {
     137          17 :         MAKE_STD_ZVAL(*retval);
     138          17 :         ZVAL_LONG(*retval, (long)MyG(error_no));
     139          17 :         return SUCCESS;
     140             : }
     141             : /* }}} */
     142             : 
     143             : /* {{{ property link_connect_error_read */
     144          17 : static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     145             : {
     146          17 :         MAKE_STD_ZVAL(*retval);
     147          17 :         if (MyG(error_msg)) {
     148          10 :                 ZVAL_STRING(*retval, MyG(error_msg), 1);
     149             :         } else {
     150           7 :                 ZVAL_NULL(*retval);
     151             :         }
     152          17 :         return SUCCESS;
     153             : }
     154             : /* }}} */
     155             : 
     156             : /* {{{ property link_affected_rows_read */
     157          31 : static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     158             : {
     159             :         MY_MYSQL *mysql;
     160             :         my_ulonglong rc;
     161             : 
     162          31 :         MAKE_STD_ZVAL(*retval);
     163             : 
     164          31 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     165             : 
     166          19 :         mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     167             : 
     168          19 :         if (!mysql) {
     169           0 :                 ZVAL_NULL(*retval);
     170             :         } else {
     171          19 :                 CHECK_STATUS(MYSQLI_STATUS_VALID);
     172             : 
     173          17 :                 rc = mysql_affected_rows(mysql->mysql);
     174             : 
     175          17 :                 if (rc == (my_ulonglong) -1) {
     176           2 :                         ZVAL_LONG(*retval, -1);
     177           2 :                         return SUCCESS;
     178             :                 }
     179             : 
     180          15 :                 if (rc < LONG_MAX) {
     181          15 :                         ZVAL_LONG(*retval, (long) rc);
     182             :                 } else {
     183             :                         char *ret;
     184           0 :                         int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
     185           0 :                         ZVAL_STRINGL(*retval, ret, l, 0);
     186             :                 }
     187             :         }
     188          15 :         return SUCCESS;
     189             : }
     190             : /* }}} */
     191             : 
     192             : /* link properties */
     193          38 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
     194          29 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
     195          18 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     196          17 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     197          18 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     198          33 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     199          17 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     200          17 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     201          18 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     202          18 : MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
     203          29 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     204          21 : MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
     205             : 
     206             : /* {{{ property link_stat_read */
     207          17 : static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)\
     208             : {\
     209             :         MY_MYSQL *mysql;
     210             : 
     211          17 :         MAKE_STD_ZVAL(*retval);
     212          17 :         ZVAL_NULL(*retval);
     213             : 
     214             : #if defined(MYSQLI_USE_MYSQLND)
     215          17 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     216             : #else
     217             :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     218             : #endif
     219             : 
     220           8 :         mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     221             : 
     222           8 :         if (mysql) {
     223             :                 char * stat_msg;
     224             : #if defined(MYSQLI_USE_MYSQLND)
     225             :                 uint stat_msg_len;
     226           8 :                 if (mysqlnd_stat(mysql->mysql, &stat_msg, &stat_msg_len) == PASS) {
     227           5 :                         ZVAL_STRINGL(*retval, stat_msg, stat_msg_len, 0);
     228             :                 }
     229             : #else
     230             :                 if ((stat_msg = (char *) mysql_stat(mysql->mysql))) {
     231             :                         ZVAL_STRING(*retval, stat_msg, 1);
     232             :                 }
     233             : #endif
     234             :         }
     235           8 :         return SUCCESS;
     236             : }
     237             : /* }}} */
     238             : 
     239             : /* result properties */
     240             : 
     241             : /* {{{ property result_type_read */
     242           6 : static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     243             : {
     244             :         MYSQL_RES *p;
     245             : 
     246           6 :         MAKE_STD_ZVAL(*retval);
     247           6 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     248           5 :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     249             : 
     250           5 :         if (!p) {
     251           0 :                 ZVAL_NULL(*retval);
     252             :         } else {
     253           5 :                 ZVAL_LONG(*retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT);
     254             :         }
     255           5 :         return SUCCESS;
     256             : }
     257             : /* }}} */
     258             : 
     259             : /* {{{ property result_lengths_read */
     260           9 : static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     261             : {
     262             :         MYSQL_RES *p;
     263             :         ulong *ret;
     264             : 
     265           9 :         MAKE_STD_ZVAL(*retval);
     266             : 
     267           9 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     268           7 :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     269           9 :         if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) {
     270           2 :                 ZVAL_NULL(*retval);
     271             :         } else {
     272             :                 ulong i;
     273             : 
     274           5 :                 array_init(*retval);
     275             : 
     276          15 :                 for (i = 0; i < p->field_count; i++) {
     277          10 :                         add_index_long(*retval, i, ret[i]);
     278             :                 }
     279             :         }
     280           7 :         return SUCCESS;
     281             : }
     282             : /* }}} */
     283             : 
     284             : 
     285           6 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     286          11 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     287           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     288             : 
     289             : /* statement properties */
     290             : 
     291             : /* {{{ property stmt_id_read */
     292           4 : static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     293             : {
     294             :         MY_STMT *p;
     295             : 
     296           4 :         MAKE_STD_ZVAL(*retval);
     297           4 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     298             : 
     299           4 :         p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     300             : 
     301           4 :         if (!p) {
     302           0 :                 ZVAL_NULL(*retval);
     303             :         } else {
     304           4 :                 ZVAL_LONG(*retval, mysqli_stmt_get_id(p->stmt));
     305             :         }
     306           4 :         return SUCCESS;
     307             : }
     308             : /* }}} */
     309             : 
     310             : /* {{{ property stmt_affected_rows_read */
     311           6 : static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     312             : {
     313             :         MY_STMT *p;
     314             :         my_ulonglong rc;
     315             : 
     316           6 :         MAKE_STD_ZVAL(*retval);
     317           6 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     318             : 
     319           4 :         p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     320             : 
     321           4 :         if (!p) {
     322           0 :                 ZVAL_NULL(*retval);
     323             :         } else {
     324           4 :                 rc = mysql_stmt_affected_rows(p->stmt);
     325             : 
     326           4 :                 if (rc == (my_ulonglong) -1) {
     327           2 :                         ZVAL_LONG(*retval, -1);
     328           2 :                         return SUCCESS;
     329             :                 }
     330             : 
     331           2 :                 if (rc < LONG_MAX) {
     332           2 :                         ZVAL_LONG(*retval, (long) rc);
     333             :                 } else {
     334             :                         char *ret;
     335           0 :                         int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
     336           0 :                         ZVAL_STRINGL(*retval, ret, l, 0);
     337             :                 }
     338             :         }
     339           2 :         return SUCCESS;
     340             : }
     341             : /* }}} */
     342             : 
     343           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     344           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)
     345           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     346           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     347           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
     348           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     349           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     350             : 
     351             : /* }}} */
     352             : const mysqli_property_entry mysqli_link_property_entries[] = {
     353             :         {"affected_rows",     sizeof("affected_rows") - 1,  link_affected_rows_read, NULL},
     354             :         {"client_info",       sizeof("client_info") - 1,            link_client_info_read, NULL},
     355             :         {"client_version",    sizeof("client_version") - 1, link_client_version_read, NULL},
     356             :         {"connect_errno",     sizeof("connect_errno") - 1,  link_connect_errno_read, NULL},
     357             :         {"connect_error",     sizeof("connect_error") - 1,  link_connect_error_read, NULL},
     358             :         {"errno",                     sizeof("errno") - 1,                  link_errno_read, NULL},
     359             :         {"error",                     sizeof("error") - 1,                  link_error_read, NULL},
     360             :         {"field_count",               sizeof("field_count") - 1,            link_field_count_read, NULL},
     361             :         {"host_info",         sizeof("host_info") - 1,              link_host_info_read, NULL},
     362             :         {"info",                      sizeof("info") - 1,                           link_info_read, NULL},
     363             :         {"insert_id",         sizeof("insert_id") - 1,              link_insert_id_read, NULL},
     364             :         {"server_info",               sizeof("server_info") - 1,            link_server_info_read, NULL},
     365             :         {"server_version",    sizeof("server_version") - 1, link_server_version_read, NULL},
     366             :         {"stat",                      sizeof("stat") - 1,                           link_stat_read, NULL},
     367             :         {"sqlstate",          sizeof("sqlstate") - 1,                       link_sqlstate_read, NULL},
     368             :         {"protocol_version",sizeof("protocol_version") - 1, link_protocol_version_read, NULL},
     369             :         {"thread_id",         sizeof("thread_id") - 1,              link_thread_id_read, NULL},
     370             :         {"warning_count",     sizeof("warning_count") - 1,  link_warning_count_read, NULL},
     371             :         {NULL, 0, NULL, NULL}
     372             : };
     373             : 
     374             : /* should not be const, as it is patched during runtime */
     375             : zend_property_info mysqli_link_property_info_entries[] = {
     376             :         {ZEND_ACC_PUBLIC, "affected_rows",    sizeof("affected_rows") - 1,  0, NULL, 0, NULL},
     377             :         {ZEND_ACC_PUBLIC, "client_info",      sizeof("client_info") - 1,            0, NULL, 0, NULL},
     378             :         {ZEND_ACC_PUBLIC, "client_version",   sizeof("client_version") - 1, 0, NULL, 0, NULL},
     379             :         {ZEND_ACC_PUBLIC, "connect_errno",    sizeof("connect_errno") - 1,  0, NULL, 0, NULL},
     380             :         {ZEND_ACC_PUBLIC, "connect_error",    sizeof("connect_error") - 1,  0, NULL, 0, NULL},
     381             :         {ZEND_ACC_PUBLIC, "errno",                    sizeof("errno") - 1,                  0, NULL, 0, NULL},
     382             :         {ZEND_ACC_PUBLIC, "error",                    sizeof("error") - 1,                  0, NULL, 0, NULL},
     383             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,            0, NULL, 0, NULL},
     384             :         {ZEND_ACC_PUBLIC, "host_info",                sizeof("host_info") - 1,              0, NULL, 0, NULL},
     385             :         {ZEND_ACC_PUBLIC, "info",                     sizeof("info") - 1,                           0, NULL, 0, NULL},
     386             :         {ZEND_ACC_PUBLIC, "insert_id",                sizeof("insert_id") - 1,              0, NULL, 0, NULL},
     387             :         {ZEND_ACC_PUBLIC, "server_info",      sizeof("server_info") - 1,            0, NULL, 0, NULL},
     388             :         {ZEND_ACC_PUBLIC, "server_version",   sizeof("server_version") - 1, 0, NULL, 0, NULL},
     389             :         {ZEND_ACC_PUBLIC, "stat",                     sizeof("stat") - 1,                           0, NULL, 0, NULL},
     390             :         {ZEND_ACC_PUBLIC, "sqlstate",         sizeof("sqlstate") - 1,                       0, NULL, 0, NULL},
     391             :         {ZEND_ACC_PUBLIC, "protocol_version", sizeof("protocol_version")-1, 0, NULL, 0, NULL},
     392             :         {ZEND_ACC_PUBLIC, "thread_id",                sizeof("thread_id") - 1,              0, NULL, 0, NULL},
     393             :         {ZEND_ACC_PUBLIC, "warning_count",    sizeof("warning_count") - 1,  0, NULL, 0, NULL},
     394             :         {0,                                     NULL,                   0,                                                              0, NULL, 0, NULL}
     395             : };
     396             : 
     397             : 
     398             : const mysqli_property_entry mysqli_result_property_entries[] = {
     399             :         {"current_field",sizeof("current_field")-1, result_current_field_read, NULL},
     400             :         {"field_count", sizeof("field_count") - 1,  result_field_count_read, NULL},
     401             :         {"lengths",   sizeof("lengths") - 1,                result_lengths_read, NULL},
     402             :         {"num_rows",  sizeof("num_rows") - 1,               result_num_rows_read, NULL},
     403             :         {"type",              sizeof("type") - 1,                   result_type_read, NULL},
     404             :         {NULL, 0, NULL, NULL}
     405             : };
     406             : 
     407             : zend_property_info mysqli_result_property_info_entries[] = {
     408             :         {ZEND_ACC_PUBLIC, "current_field",    sizeof("current_field")-1,    0, NULL, 0, NULL},
     409             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,    0, NULL, 0, NULL},
     410             :         {ZEND_ACC_PUBLIC, "lengths",          sizeof("lengths") - 1,                0, NULL, 0, NULL},
     411             :         {ZEND_ACC_PUBLIC, "num_rows",         sizeof("num_rows") - 1,       0, NULL, 0, NULL},
     412             :         {ZEND_ACC_PUBLIC, "type",                     sizeof("type") - 1,           0, NULL, 0, NULL},
     413             :         {0,                                     NULL,                   0,                                                      0, NULL, 0, NULL}
     414             : };
     415             : 
     416             : const mysqli_property_entry mysqli_stmt_property_entries[] = {
     417             :         {"affected_rows", sizeof("affected_rows")-1,stmt_affected_rows_read, NULL},
     418             :         {"insert_id", sizeof("insert_id") - 1,      stmt_insert_id_read, NULL},
     419             :         {"num_rows",  sizeof("num_rows") - 1,       stmt_num_rows_read, NULL},
     420             :         {"param_count", sizeof("param_count") - 1,  stmt_param_count_read, NULL},
     421             :         {"field_count", sizeof("field_count") - 1,  stmt_field_count_read, NULL},
     422             :         {"errno",             sizeof("errno") - 1,          stmt_errno_read, NULL},
     423             :         {"error",             sizeof("error") - 1,          stmt_error_read, NULL},
     424             :         {"sqlstate",  sizeof("sqlstate") - 1,               stmt_sqlstate_read, NULL},
     425             :         {"id",                        sizeof("id") - 1,                     stmt_id_read, NULL},
     426             :         {NULL, 0, NULL, NULL}
     427             : };
     428             : 
     429             : 
     430             : zend_property_info mysqli_stmt_property_info_entries[] = {
     431             :         {ZEND_ACC_PUBLIC, "affected_rows", sizeof("affected_rows") - 1,     0, NULL, 0, NULL},
     432             :         {ZEND_ACC_PUBLIC, "insert_id",        sizeof("insert_id") - 1,              0, NULL, 0, NULL},
     433             :         {ZEND_ACC_PUBLIC, "num_rows", sizeof("num_rows") - 1,                       0, NULL, 0, NULL},
     434             :         {ZEND_ACC_PUBLIC, "param_count",sizeof("param_count") - 1,          0, NULL, 0, NULL},
     435             :         {ZEND_ACC_PUBLIC, "field_count",sizeof("field_count") - 1,          0, NULL, 0, NULL},
     436             :         {ZEND_ACC_PUBLIC, "errno",            sizeof("errno") - 1,                  0, NULL, 0, NULL},
     437             :         {ZEND_ACC_PUBLIC, "error",            sizeof("error") - 1,                  0, NULL, 0, NULL},
     438             :         {ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1,                       0, NULL, 0, NULL},
     439             :         {ZEND_ACC_PUBLIC, "id",                       sizeof("id") - 1,                             0, NULL, 0, NULL},
     440             :         {0,                                     NULL,                   0,                                                      0, NULL, 0, NULL}
     441             : };
     442             : 
     443             : /*
     444             :  * Local variables:
     445             :  * tab-width: 4
     446             :  * c-basic-offset: 4
     447             :  * End:
     448             :  * vim600: noet sw=4 ts=4 fdm=marker
     449             :  * vim<600: noet sw=4 ts=4
     450             :  */

Generated by: LCOV version 1.10

Generated at Sun, 27 Jul 2014 12:58:31 +0000 (5 days ago)

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