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: 124 139 89.2 %
Date: 2014-10-24 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          38 : 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             : 
     315           9 :         MAKE_STD_ZVAL(*retval);
     316             : 
     317           9 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     318           7 :         p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     319           9 :         if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) {
     320           2 :                 ZVAL_NULL(*retval);
     321             :         } else {
     322             :                 ulong i;
     323             : 
     324           5 :                 array_init(*retval);
     325             : 
     326          15 :                 for (i = 0; i < p->field_count; i++) {
     327          10 :                         add_index_long(*retval, i, ret[i]);
     328             :                 }
     329             :         }
     330           7 :         return SUCCESS;
     331             : }
     332             : /* }}} */
     333             : 
     334             : 
     335           6 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     336          11 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
     337           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
     338             : 
     339             : /* statement properties */
     340             : 
     341             : /* {{{ property stmt_id_read */
     342           4 : static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     343             : {
     344             :         MY_STMT *p;
     345             : 
     346           4 :         MAKE_STD_ZVAL(*retval);
     347           4 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     348             : 
     349           4 :         p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     350             : 
     351           4 :         if (!p) {
     352           0 :                 ZVAL_NULL(*retval);
     353             :         } else {
     354           4 :                 ZVAL_LONG(*retval, mysqli_stmt_get_id(p->stmt));
     355             :         }
     356           4 :         return SUCCESS;
     357             : }
     358             : /* }}} */
     359             : 
     360             : /* {{{ property stmt_affected_rows_read */
     361           6 : static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     362             : {
     363             :         MY_STMT *p;
     364             :         my_ulonglong rc;
     365             : 
     366           6 :         MAKE_STD_ZVAL(*retval);
     367           6 :         CHECK_STATUS(MYSQLI_STATUS_VALID);
     368             : 
     369           4 :         p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     370             : 
     371           4 :         if (!p) {
     372           0 :                 ZVAL_NULL(*retval);
     373             :         } else {
     374           4 :                 rc = mysql_stmt_affected_rows(p->stmt);
     375             : 
     376           4 :                 if (rc == (my_ulonglong) -1) {
     377           2 :                         ZVAL_LONG(*retval, -1);
     378           2 :                         return SUCCESS;
     379             :                 }
     380             : 
     381           2 :                 if (rc < LONG_MAX) {
     382           2 :                         ZVAL_LONG(*retval, (long) rc);
     383             :                 } else {
     384             :                         char *ret;
     385           0 :                         int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
     386           0 :                         ZVAL_STRINGL(*retval, ret, l, 0);
     387             :                 }
     388             :         }
     389           2 :         return SUCCESS;
     390             : }
     391             : /* }}} */
     392             : 
     393             : /* {{{ property stmt_error_list_read */
     394           3 : static int stmt_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
     395             : {
     396             :         MY_STMT * stmt;
     397             : 
     398           3 :         MAKE_STD_ZVAL(*retval);
     399           3 :         CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
     400             : 
     401           3 :         stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
     402           3 :         array_init(*retval);
     403           3 :         if (stmt && stmt->stmt) {
     404             : #if defined(MYSQLI_USE_MYSQLND)
     405           3 :                 if (stmt->stmt->data && stmt->stmt->data->error_info->error_list) {
     406             :                         MYSQLND_ERROR_LIST_ELEMENT * message;
     407             :                         zend_llist_position pos;
     408           6 :                         for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(stmt->stmt->data->error_info->error_list, &pos);
     409             :                                  message;
     410           0 :                                  message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(stmt->stmt->data->error_info->error_list, &pos)) 
     411             :                         {
     412             :                                 zval * single_error;
     413           0 :                                 MAKE_STD_ZVAL(single_error);
     414           0 :                                 array_init(single_error);
     415           0 :                                 add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
     416           0 :                                 add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
     417           0 :                                 add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
     418           0 :                                 add_next_index_zval(*retval, single_error);
     419             :                         }
     420             :                 }
     421             : #else
     422             :                 if (mysql_stmt_errno(stmt->stmt)) {
     423             :                         zval * single_error;
     424             :                         MAKE_STD_ZVAL(single_error);
     425             :                         array_init(single_error);
     426             :                         add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_stmt_errno(stmt->stmt));
     427             :                         add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_stmt_sqlstate(stmt->stmt), 1);
     428             :                         add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_stmt_error(stmt->stmt), 1);
     429             :                         add_next_index_zval(*retval, single_error);
     430             :                 }
     431             : #endif
     432             :         }
     433           3 :         return SUCCESS;
     434             : }
     435             : /* }}} */
     436             : 
     437             : 
     438           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)
     439           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)
     440           9 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     441           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
     442           4 : MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
     443           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     444           3 : MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
     445             : 
     446             : /* }}} */
     447             : const mysqli_property_entry mysqli_link_property_entries[] = {
     448             :         {"affected_rows",     sizeof("affected_rows") - 1,  link_affected_rows_read, NULL},
     449             :         {"client_info",       sizeof("client_info") - 1,            link_client_info_read, NULL},
     450             :         {"client_version",    sizeof("client_version") - 1, link_client_version_read, NULL},
     451             :         {"connect_errno",     sizeof("connect_errno") - 1,  link_connect_errno_read, NULL},
     452             :         {"connect_error",     sizeof("connect_error") - 1,  link_connect_error_read, NULL},
     453             :         {"errno",                     sizeof("errno") - 1,                  link_errno_read, NULL},
     454             :         {"error",                     sizeof("error") - 1,                  link_error_read, NULL},
     455             :         {"error_list",                sizeof("error_list") - 1,             link_error_list_read, NULL},
     456             :         {"field_count",               sizeof("field_count") - 1,            link_field_count_read, NULL},
     457             :         {"host_info",         sizeof("host_info") - 1,              link_host_info_read, NULL},
     458             :         {"info",                      sizeof("info") - 1,                           link_info_read, NULL},
     459             :         {"insert_id",         sizeof("insert_id") - 1,              link_insert_id_read, NULL},
     460             :         {"server_info",               sizeof("server_info") - 1,            link_server_info_read, NULL},
     461             :         {"server_version",    sizeof("server_version") - 1, link_server_version_read, NULL},
     462             :         {"stat",                      sizeof("stat") - 1,                           link_stat_read, NULL},
     463             :         {"sqlstate",          sizeof("sqlstate") - 1,                       link_sqlstate_read, NULL},
     464             :         {"protocol_version",sizeof("protocol_version") - 1, link_protocol_version_read, NULL},
     465             :         {"thread_id",         sizeof("thread_id") - 1,              link_thread_id_read, NULL},
     466             :         {"warning_count",     sizeof("warning_count") - 1,  link_warning_count_read, NULL},
     467             :         {NULL, 0, NULL, NULL}
     468             : };
     469             : 
     470             : 
     471             : const zend_property_info mysqli_link_property_info_entries[] = {
     472             :         {ZEND_ACC_PUBLIC, "affected_rows",    sizeof("affected_rows") - 1,  -1, 0, NULL, 0, NULL},
     473             :         {ZEND_ACC_PUBLIC, "client_info",      sizeof("client_info") - 1,            -1, 0, NULL, 0, NULL},
     474             :         {ZEND_ACC_PUBLIC, "client_version",   sizeof("client_version") - 1, -1, 0, NULL, 0, NULL},
     475             :         {ZEND_ACC_PUBLIC, "connect_errno",    sizeof("connect_errno") - 1,  -1, 0, NULL, 0, NULL},
     476             :         {ZEND_ACC_PUBLIC, "connect_error",    sizeof("connect_error") - 1,  -1, 0, NULL, 0, NULL},
     477             :         {ZEND_ACC_PUBLIC, "errno",                    sizeof("errno") - 1,                  -1, 0, NULL, 0, NULL},
     478             :         {ZEND_ACC_PUBLIC, "error",                    sizeof("error") - 1,                  -1, 0, NULL, 0, NULL},
     479             :         {ZEND_ACC_PUBLIC, "error_list",               sizeof("error_list") - 1,             -1, 0, NULL, 0, NULL},
     480             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,            -1, 0, NULL, 0, NULL},
     481             :         {ZEND_ACC_PUBLIC, "host_info",                sizeof("host_info") - 1,              -1, 0, NULL, 0, NULL},
     482             :         {ZEND_ACC_PUBLIC, "info",                     sizeof("info") - 1,                           -1, 0, NULL, 0, NULL},
     483             :         {ZEND_ACC_PUBLIC, "insert_id",                sizeof("insert_id") - 1,              -1, 0, NULL, 0, NULL},
     484             :         {ZEND_ACC_PUBLIC, "server_info",      sizeof("server_info") - 1,            -1, 0, NULL, 0, NULL},
     485             :         {ZEND_ACC_PUBLIC, "server_version",   sizeof("server_version") - 1, -1, 0, NULL, 0, NULL},
     486             :         {ZEND_ACC_PUBLIC, "stat",                     sizeof("stat") - 1,                           -1, 0, NULL, 0, NULL},
     487             :         {ZEND_ACC_PUBLIC, "sqlstate",         sizeof("sqlstate") - 1,                       -1, 0, NULL, 0, NULL},
     488             :         {ZEND_ACC_PUBLIC, "protocol_version", sizeof("protocol_version")-1, -1, 0, NULL, 0, NULL},
     489             :         {ZEND_ACC_PUBLIC, "thread_id",                sizeof("thread_id") - 1,              -1, 0, NULL, 0, NULL},
     490             :         {ZEND_ACC_PUBLIC, "warning_count",    sizeof("warning_count") - 1,  -1, 0, NULL, 0, NULL},
     491             :         {0,                                     NULL,                   0,                                                              -1, 0, NULL, 0, NULL}
     492             : };
     493             : 
     494             : 
     495             : const mysqli_property_entry mysqli_result_property_entries[] = {
     496             :         {"current_field",sizeof("current_field")-1, result_current_field_read, NULL},
     497             :         {"field_count", sizeof("field_count") - 1,  result_field_count_read, NULL},
     498             :         {"lengths",   sizeof("lengths") - 1,                result_lengths_read, NULL},
     499             :         {"num_rows",  sizeof("num_rows") - 1,               result_num_rows_read, NULL},
     500             :         {"type",              sizeof("type") - 1,                   result_type_read, NULL},
     501             :         {NULL, 0, NULL, NULL}
     502             : };
     503             : 
     504             : const zend_property_info mysqli_result_property_info_entries[] = {
     505             :         {ZEND_ACC_PUBLIC, "current_field",    sizeof("current_field")-1,    -1, 0, NULL, 0, NULL},
     506             :         {ZEND_ACC_PUBLIC, "field_count",      sizeof("field_count") - 1,    -1, 0, NULL, 0, NULL},
     507             :         {ZEND_ACC_PUBLIC, "lengths",          sizeof("lengths") - 1,                -1, 0, NULL, 0, NULL},
     508             :         {ZEND_ACC_PUBLIC, "num_rows",         sizeof("num_rows") - 1,       -1, 0, NULL, 0, NULL},
     509             :         {ZEND_ACC_PUBLIC, "type",                     sizeof("type") - 1,           -1, 0, NULL, 0, NULL},
     510             :         {0,                                     NULL,                   0,                                                      -1, 0, NULL, 0, NULL}
     511             : };
     512             : 
     513             : const mysqli_property_entry mysqli_stmt_property_entries[] = {
     514             :         {"affected_rows", sizeof("affected_rows")-1,stmt_affected_rows_read, NULL},
     515             :         {"insert_id", sizeof("insert_id") - 1,      stmt_insert_id_read, NULL},
     516             :         {"num_rows",  sizeof("num_rows") - 1,       stmt_num_rows_read, NULL},
     517             :         {"param_count", sizeof("param_count") - 1,  stmt_param_count_read, NULL},
     518             :         {"field_count", sizeof("field_count") - 1,  stmt_field_count_read, NULL},
     519             :         {"errno",             sizeof("errno") - 1,          stmt_errno_read, NULL},
     520             :         {"error",             sizeof("error") - 1,          stmt_error_read, NULL},
     521             :         {"error_list",        sizeof("error_list") - 1,     stmt_error_list_read, NULL},
     522             :         {"sqlstate",  sizeof("sqlstate") - 1,               stmt_sqlstate_read, NULL},
     523             :         {"id",                        sizeof("id") - 1,                     stmt_id_read, NULL},
     524             :         {NULL, 0, NULL, NULL}
     525             : };
     526             : 
     527             : 
     528             : const zend_property_info mysqli_stmt_property_info_entries[] = {
     529             :         {ZEND_ACC_PUBLIC, "affected_rows", sizeof("affected_rows") - 1,     -1, 0, NULL, 0, NULL},
     530             :         {ZEND_ACC_PUBLIC, "insert_id",        sizeof("insert_id") - 1,              -1, 0, NULL, 0, NULL},
     531             :         {ZEND_ACC_PUBLIC, "num_rows", sizeof("num_rows") - 1,                       -1, 0, NULL, 0, NULL},
     532             :         {ZEND_ACC_PUBLIC, "param_count",sizeof("param_count") - 1,          -1, 0, NULL, 0, NULL},
     533             :         {ZEND_ACC_PUBLIC, "field_count",sizeof("field_count") - 1,          -1, 0, NULL, 0, NULL},
     534             :         {ZEND_ACC_PUBLIC, "errno",            sizeof("errno") - 1,                  -1, 0, NULL, 0, NULL},
     535             :         {ZEND_ACC_PUBLIC, "error",            sizeof("error") - 1,                  -1, 0, NULL, 0, NULL},
     536             :         {ZEND_ACC_PUBLIC, "error_list",       sizeof("error_list") - 1,             -1, 0, NULL, 0, NULL},
     537             :         {ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1,                       -1, 0, NULL, 0, NULL},
     538             :         {ZEND_ACC_PUBLIC, "id",                       sizeof("id") - 1,                             -1, 0, NULL, 0, NULL},
     539             :         {0,                                     NULL,                   0,                                                      -1, 0, NULL, 0, NULL}
     540             : };
     541             : 
     542             : /*
     543             :  * Local variables:
     544             :  * tab-width: 4
     545             :  * c-basic-offset: 4
     546             :  * End:
     547             :  * vim600: noet sw=4 ts=4 fdm=marker
     548             :  * vim<600: noet sw=4 ts=4
     549             :  */

Generated by: LCOV version 1.10

Generated at Fri, 24 Oct 2014 05:21:49 +0000 (7 days ago)

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