mysqli_prop.c 16 KB

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