Annotation of embedaddon/php/ext/mysqli/mysqli_prop.c, revision 1.1.1.2
1.1 misho 1: /*
2: +----------------------------------------------------------------------+
3: | PHP Version 5 |
4: +----------------------------------------------------------------------+
5: | Copyright (c) 1997-2012 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> |
1.1.1.2 ! misho 16: | Andrey Hristov <andrey@php.net> |
1.1 misho 17: +----------------------------------------------------------------------+
18:
1.1.1.2 ! misho 19: $Id$
1.1 misho 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: static int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
118: {
119: MAKE_STD_ZVAL(*retval);
120: ZVAL_LONG(*retval, MYSQL_VERSION_ID);
121: return SUCCESS;
122: }
123: /* }}} */
124:
125: /* {{{ property link_client_info_read */
126: static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
127: {
128: MAKE_STD_ZVAL(*retval);
129: CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
130: ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
131: return SUCCESS;
132: }
133: /* }}} */
134:
135: /* {{{ property link_connect_errno_read */
136: static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
137: {
138: MAKE_STD_ZVAL(*retval);
139: ZVAL_LONG(*retval, (long)MyG(error_no));
140: return SUCCESS;
141: }
142: /* }}} */
143:
144: /* {{{ property link_connect_error_read */
145: static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
146: {
147: MAKE_STD_ZVAL(*retval);
148: if (MyG(error_msg)) {
149: ZVAL_STRING(*retval, MyG(error_msg), 1);
150: } else {
151: ZVAL_NULL(*retval);
152: }
153: return SUCCESS;
154: }
155: /* }}} */
156:
157: /* {{{ property link_affected_rows_read */
158: static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
159: {
160: MY_MYSQL *mysql;
161: my_ulonglong rc;
162:
163: MAKE_STD_ZVAL(*retval);
164:
165: CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
166:
167: mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
168:
169: if (!mysql) {
170: ZVAL_NULL(*retval);
171: } else {
172: CHECK_STATUS(MYSQLI_STATUS_VALID);
173:
174: rc = mysql_affected_rows(mysql->mysql);
175:
176: if (rc == (my_ulonglong) -1) {
177: ZVAL_LONG(*retval, -1);
178: return SUCCESS;
179: }
180:
181: if (rc < LONG_MAX) {
182: ZVAL_LONG(*retval, (long) rc);
183: } else {
184: char *ret;
185: int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
186: ZVAL_STRINGL(*retval, ret, l, 0);
187: }
188: }
189: return SUCCESS;
190: }
191: /* }}} */
192:
1.1.1.2 ! misho 193:
! 194: /* {{{ property link_error_list_read */
! 195: static int link_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
! 196: {
! 197: MY_MYSQL *mysql;
! 198:
! 199: MAKE_STD_ZVAL(*retval);
! 200:
! 201: CHECK_STATUS(MYSQLI_STATUS_VALID);
! 202:
! 203: mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
! 204:
! 205: array_init(*retval);
! 206: if (mysql) {
! 207: #if defined(MYSQLI_USE_MYSQLND)
! 208: if (mysql->mysql->data->error_info->error_list) {
! 209: MYSQLND_ERROR_LIST_ELEMENT * message;
! 210: zend_llist_position pos;
! 211: for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(mysql->mysql->data->error_info->error_list, &pos);
! 212: message;
! 213: message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(mysql->mysql->data->error_info->error_list, &pos))
! 214: {
! 215: zval * single_error;
! 216: MAKE_STD_ZVAL(single_error);
! 217: array_init(single_error);
! 218: add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
! 219: add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
! 220: add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
! 221: 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: return SUCCESS;
! 237: }
! 238: /* }}} */
! 239:
! 240:
1.1 misho 241: /* link properties */
242: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
243: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
244: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
245: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
246: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
247: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
248: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
249: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
250: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
251: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
252: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
253: 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: static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)\
257: {\
258: MY_MYSQL *mysql;
259:
260: MAKE_STD_ZVAL(*retval);
261: ZVAL_NULL(*retval);
262:
1.1.1.2 ! misho 263: #if defined(MYSQLI_USE_MYSQLND)
1.1 misho 264: CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
1.1.1.2 ! misho 265: #else
! 266: CHECK_STATUS(MYSQLI_STATUS_VALID);
! 267: #endif
1.1 misho 268:
269: mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
270:
271: if (mysql) {
272: char * stat_msg;
273: #if defined(MYSQLI_USE_MYSQLND)
274: uint stat_msg_len;
275: if (mysqlnd_stat(mysql->mysql, &stat_msg, &stat_msg_len) == PASS) {
276: 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: return SUCCESS;
285: }
286: /* }}} */
287:
1.1.1.2 ! misho 288:
1.1 misho 289: /* result properties */
290:
291: /* {{{ property result_type_read */
292: static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
293: {
294: MYSQL_RES *p;
295:
296: MAKE_STD_ZVAL(*retval);
297: CHECK_STATUS(MYSQLI_STATUS_VALID);
298: p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
299:
300: if (!p) {
301: ZVAL_NULL(*retval);
302: } else {
303: ZVAL_LONG(*retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT);
304: }
305: return SUCCESS;
306: }
307: /* }}} */
308:
309: /* {{{ property result_lengths_read */
310: static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
311: {
312: MYSQL_RES *p;
313: ulong *ret;
314:
315: MAKE_STD_ZVAL(*retval);
316:
317: CHECK_STATUS(MYSQLI_STATUS_VALID);
318: p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
319: if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) {
320: ZVAL_NULL(*retval);
321: } else {
322: ulong i;
323:
324: array_init(*retval);
325:
326: for (i = 0; i < p->field_count; i++) {
327: add_index_long(*retval, i, ret[i]);
328: }
329: }
330: return SUCCESS;
331: }
332: /* }}} */
333:
334:
335: MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
336: MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
337: 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: static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
343: {
344: MY_STMT *p;
345:
346: MAKE_STD_ZVAL(*retval);
347: CHECK_STATUS(MYSQLI_STATUS_VALID);
348:
349: p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
350:
351: if (!p) {
352: ZVAL_NULL(*retval);
353: } else {
354: ZVAL_LONG(*retval, mysqli_stmt_get_id(p->stmt));
355: }
356: return SUCCESS;
357: }
358: /* }}} */
359:
360: /* {{{ property stmt_affected_rows_read */
361: static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
362: {
363: MY_STMT *p;
364: my_ulonglong rc;
365:
366: MAKE_STD_ZVAL(*retval);
367: CHECK_STATUS(MYSQLI_STATUS_VALID);
368:
369: p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
370:
371: if (!p) {
372: ZVAL_NULL(*retval);
373: } else {
374: rc = mysql_stmt_affected_rows(p->stmt);
375:
376: if (rc == (my_ulonglong) -1) {
377: ZVAL_LONG(*retval, -1);
378: return SUCCESS;
379: }
380:
381: if (rc < LONG_MAX) {
382: ZVAL_LONG(*retval, (long) rc);
383: } else {
384: char *ret;
385: int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
386: ZVAL_STRINGL(*retval, ret, l, 0);
387: }
388: }
389: return SUCCESS;
390: }
391: /* }}} */
392:
1.1.1.2 ! misho 393: /* {{{ property stmt_error_list_read */
! 394: static int stmt_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
! 395: {
! 396: MY_STMT * stmt;
! 397:
! 398: MAKE_STD_ZVAL(*retval);
! 399: CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
! 400:
! 401: stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
! 402: array_init(*retval);
! 403: if (stmt && stmt->stmt) {
! 404: #if defined(MYSQLI_USE_MYSQLND)
! 405: if (stmt->stmt->data && stmt->stmt->data->error_info->error_list) {
! 406: MYSQLND_ERROR_LIST_ELEMENT * message;
! 407: zend_llist_position pos;
! 408: for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(stmt->stmt->data->error_info->error_list, &pos);
! 409: message;
! 410: message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(stmt->stmt->data->error_info->error_list, &pos))
! 411: {
! 412: zval * single_error;
! 413: MAKE_STD_ZVAL(single_error);
! 414: array_init(single_error);
! 415: add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
! 416: add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
! 417: add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
! 418: 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: return SUCCESS;
! 434: }
! 435: /* }}} */
! 436:
! 437:
1.1 misho 438: 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: 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: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
441: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
442: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
443: MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
444: 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},
1.1.1.2 ! misho 455: {"error_list", sizeof("error_list") - 1, link_error_list_read, NULL},
1.1 misho 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:
1.1.1.2 ! misho 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}
1.1 misho 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:
1.1.1.2 ! misho 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}
1.1 misho 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},
1.1.1.2 ! misho 521: {"error_list", sizeof("error_list") - 1, stmt_error_list_read, NULL},
1.1 misho 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:
1.1.1.2 ! misho 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}
1.1 misho 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: */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>