Lines Matching refs:stmt

38 static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt);
41 const MYSQLND_STMT_DATA *stmt, unsigned max_rows) in mysqlnd_stmt_send_cursor_fetch_command() argument
43 MYSQLND_CONN_DATA *conn = stmt->conn; in mysqlnd_stmt_send_cursor_fetch_command()
47 int4store(buf, stmt->stmt_id); in mysqlnd_stmt_send_cursor_fetch_command()
51 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_send_cursor_fetch_command()
57 static zend_bool mysqlnd_stmt_check_state(const MYSQLND_STMT_DATA *stmt) in mysqlnd_stmt_check_state() argument
59 const MYSQLND_CONN_DATA *conn = stmt->conn; in mysqlnd_stmt_check_state()
60 if (stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE) { in mysqlnd_stmt_check_state()
63 if (stmt->cursor_exists) { in mysqlnd_stmt_check_state()
75 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
76 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
80 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
83 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
86 if (!stmt->field_count) { in MYSQLND_METHOD()
91 if (!mysqlnd_stmt_check_state(stmt)) { in MYSQLND_METHOD()
92 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
96 stmt->default_rset_handler = s->m->store_result; in MYSQLND_METHOD()
98 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
102 if (stmt->cursor_exists) { in MYSQLND_METHOD()
103 if (mysqlnd_stmt_send_cursor_fetch_command(stmt, -1) == FAIL) { in MYSQLND_METHOD()
108 result = stmt->result; in MYSQLND_METHOD()
146 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, stmt->result->stored_data->row_count); in MYSQLND_METHOD()
148 stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED; in MYSQLND_METHOD()
151 COPY_CLIENT_ERROR(stmt->error_info, result->stored_data->error_info); in MYSQLND_METHOD()
152 stmt->result->m.free_result_contents(stmt->result); in MYSQLND_METHOD()
153 stmt->result = NULL; in MYSQLND_METHOD()
154 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
167 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
168 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
172 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
175 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
178 if (!stmt->field_count) { in MYSQLND_METHOD()
183 if (!mysqlnd_stmt_check_state(stmt)) { in MYSQLND_METHOD()
184 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
188 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
192 if (stmt->cursor_exists) { in MYSQLND_METHOD()
193 if (mysqlnd_stmt_send_cursor_fetch_command(stmt, -1) == FAIL) { in MYSQLND_METHOD()
199 result = conn->m->result_init(stmt->result->field_count); in MYSQLND_METHOD()
205 result->meta = stmt->result->meta->m->clone_metadata(result, stmt->result->meta); in MYSQLND_METHOD()
212 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, result->stored_data->row_count); in MYSQLND_METHOD()
213 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
216 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
217 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
235 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
236 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
239 …DBG_RETURN((stmt && conn && (conn->m->get_server_status(conn) & SERVER_MORE_RESULTS_EXISTS))? TRUE… in MYSQLND_METHOD()
248 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
249 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
252 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
255 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
277 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_skip_metadata() local
278 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_skip_metadata()
286 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
293 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_skip_metadata()
300 for (;i < stmt->param_count; i++) { in mysqlnd_stmt_skip_metadata()
318 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_read_prepare_response() local
319 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response()
324 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
327 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_read_prepare_response()
336 COPY_CLIENT_ERROR(stmt->error_info, prepare_resp.error_info); in mysqlnd_stmt_read_prepare_response()
341 stmt->stmt_id = prepare_resp.stmt_id; in mysqlnd_stmt_read_prepare_response()
343 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, 0); /* be like libmysql */ in mysqlnd_stmt_read_prepare_response()
344 stmt->field_count = conn->field_count = prepare_resp.field_count; in mysqlnd_stmt_read_prepare_response()
345 stmt->param_count = prepare_resp.param_count; in mysqlnd_stmt_read_prepare_response()
358 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_prepare_read_eof() local
359 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof()
364 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
367 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_prepare_read_eof()
371 if (stmt->result) { in mysqlnd_stmt_prepare_read_eof()
372 stmt->result->m.free_result_contents(stmt->result); in mysqlnd_stmt_prepare_read_eof()
378 memset(stmt, 0, sizeof(MYSQLND_STMT_DATA)); in mysqlnd_stmt_prepare_read_eof()
379 stmt->state = MYSQLND_STMT_INITTED; in mysqlnd_stmt_prepare_read_eof()
382 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, fields_eof.server_status); in mysqlnd_stmt_prepare_read_eof()
383 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, fields_eof.warning_count); in mysqlnd_stmt_prepare_read_eof()
384 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_prepare_read_eof()
396 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
397 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
400 if (!stmt || !conn) { in MYSQLND_METHOD()
403 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
406 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
409 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
412 if (stmt->state > MYSQLND_STMT_INITTED) { in MYSQLND_METHOD()
431 stmt_to_prepare = stmt; in MYSQLND_METHOD()
432 stmt = tmp_swap_data; in MYSQLND_METHOD()
443 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
452 if (stmt->param_count) { in MYSQLND_METHOD()
465 if (stmt->field_count) { in MYSQLND_METHOD()
466 MYSQLND_RES * result = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
472 stmt->result = result; in MYSQLND_METHOD()
485 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
500 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_execute_parse_response() local
501 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response()
505 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
512 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
513 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_stmt_execute_parse_response()
514 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
518 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_execute_parse_response()
519 stmt->send_types_to_server = 1; in mysqlnd_stmt_execute_parse_response()
528 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_stmt_execute_parse_response()
530 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
531 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
532 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
533 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
535 stmt->state = MYSQLND_STMT_EXECUTED; in mysqlnd_stmt_execute_parse_response()
541 stmt->result->type = MYSQLND_RES_PS_BUF; in mysqlnd_stmt_execute_parse_response()
542 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
547 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
553 if (stmt->result_bind && conn->field_count != stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
554 if (conn->field_count < stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
556 for (unsigned i = conn->field_count; i < stmt->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
557 zval_ptr_dtor(&stmt->result_bind[i].zv); in mysqlnd_stmt_execute_parse_response()
560 stmt->result_bind = in mysqlnd_stmt_execute_parse_response()
561 mnd_erealloc(stmt->result_bind, conn->field_count * sizeof(MYSQLND_RESULT_BIND)); in mysqlnd_stmt_execute_parse_response()
562 if (conn->field_count > stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
564 for (unsigned i = stmt->field_count; i < conn->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
565 ZVAL_UNDEF(&stmt->result_bind[i].zv); in mysqlnd_stmt_execute_parse_response()
566 stmt->result_bind[i].bound = false; in mysqlnd_stmt_execute_parse_response()
571 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
572 if (stmt->result->stored_data) { in mysqlnd_stmt_execute_parse_response()
573 stmt->result->stored_data->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
574 } else if (stmt->result->unbuf) { in mysqlnd_stmt_execute_parse_response()
575 stmt->result->unbuf->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
577 if (stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
578 stmt->state = MYSQLND_STMT_WAITING_USE_OR_STORE; in mysqlnd_stmt_execute_parse_response()
584 DBG_INF_FMT("server_status=%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), in mysqlnd_stmt_execute_parse_response()
585 UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS); in mysqlnd_stmt_execute_parse_response()
587 if (stmt->flags & CURSOR_TYPE_READ_ONLY) { in mysqlnd_stmt_execute_parse_response()
588 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS) { in mysqlnd_stmt_execute_parse_response()
590 stmt->cursor_exists = TRUE; in mysqlnd_stmt_execute_parse_response()
593 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
608 stmt->default_rset_handler = s->m->store_result; in mysqlnd_stmt_execute_parse_response()
614 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
620 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_PS_OUT_PARAMS) { in mysqlnd_stmt_execute_parse_response()
628 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in mysqlnd_stmt_execute_parse_response()
630 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
631 …_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status)); in mysqlnd_stmt_execute_parse_response()
659 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
660 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
667 if (!stmt || !conn) { in MYSQLND_METHOD()
670 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
672 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
675 if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) { in MYSQLND_METHOD()
683 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
685 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
686 } else if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
688 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
693 if (stmt->param_count) { in MYSQLND_METHOD()
695 if (!stmt->param_bind) { in MYSQLND_METHOD()
696 …SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, "No data supplied for pa… in MYSQLND_METHOD()
700 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
701 if (Z_ISUNDEF(stmt->param_bind[i].zv)) { in MYSQLND_METHOD()
709 SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, msg); in MYSQLND_METHOD()
723 …SET_CLIENT_ERROR(stmt->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Couldn't generate the requ… in MYSQLND_METHOD()
731 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
735 stmt->execute_count++; in MYSQLND_METHOD()
747 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_buffered() local
753 DBG_INF_FMT("stmt=%lu", stmt != NULL ? stmt->stmt_id : 0L); in mysqlnd_stmt_fetch_row_buffered()
762 if (stmt->result_bind) { in mysqlnd_stmt_fetch_row_buffered()
778 if (stmt->update_max_length) { in mysqlnd_stmt_fetch_row_buffered()
797 zval *resultzv = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_buffered()
798 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_buffered()
828 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_unbuffered() local
853 row_packet->skip_extraction = stmt && stmt->result_bind? FALSE:TRUE; in mysqlnd_stmt_fetch_row_unbuffered()
886 zval *resultzv = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_unbuffered()
887 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_unbuffered()
918 if (stmt) { in mysqlnd_stmt_fetch_row_unbuffered()
919 COPY_CLIENT_ERROR(stmt->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
958 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
959 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
963 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
966 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
968 if (!stmt->field_count || !mysqlnd_stmt_check_state(stmt)) { in MYSQLND_METHOD()
974 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
977 result = stmt->result; in MYSQLND_METHOD()
979 result->m.use_result(stmt->result, TRUE); in MYSQLND_METHOD()
980 result->unbuf->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor: in MYSQLND_METHOD()
982 stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED; in MYSQLND_METHOD()
996 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_fetch_stmt_row_cursor() local
997 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_fetch_stmt_row_cursor()
1002 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1006 DBG_INF_FMT("stmt=%lu flags=%u", stmt->stmt_id, flags); in mysqlnd_fetch_stmt_row_cursor()
1008 if (stmt->state < MYSQLND_STMT_USER_FETCHING) { in mysqlnd_fetch_stmt_row_cursor()
1018 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_fetch_stmt_row_cursor()
1022 if (mysqlnd_stmt_send_cursor_fetch_command(stmt, 1) == FAIL) { in mysqlnd_fetch_stmt_row_cursor()
1026 row_packet->skip_extraction = stmt->result_bind? FALSE:TRUE; in mysqlnd_fetch_stmt_row_cursor()
1028 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_fetch_stmt_row_cursor()
1053 zval *resultzv = &stmt->result_bind[i].zv; in mysqlnd_fetch_stmt_row_cursor()
1054 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_fetch_stmt_row_cursor()
1057 DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, &stmt->result_bind[i].zv, in mysqlnd_fetch_stmt_row_cursor()
1058 Z_TYPE_P(data), Z_REFCOUNTED(stmt->result_bind[i].zv)? in mysqlnd_fetch_stmt_row_cursor()
1059 Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in mysqlnd_fetch_stmt_row_cursor()
1096 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1099 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1104 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1107 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1123 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1124 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1127 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1130 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1132 if (!stmt->result || stmt->state < MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1133 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1136 } else if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1139 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1141 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1143 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1146 ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything); in MYSQLND_METHOD()
1157 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1158 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1161 if (!stmt || !conn) { in MYSQLND_METHOD()
1164 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1166 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1169 if (stmt->stmt_id) { in MYSQLND_METHOD()
1170 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD()
1171 if (stmt->param_bind) { in MYSQLND_METHOD()
1175 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1176 if (stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED) { in MYSQLND_METHOD()
1177 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1191 size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD()
1193 ret = stmt->conn->command->stmt_reset(stmt->conn, stmt_id); in MYSQLND_METHOD()
1195 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1198 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1211 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1212 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1215 if (!stmt || !conn) { in MYSQLND_METHOD()
1218 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1220 if (stmt->stmt_id) { in MYSQLND_METHOD()
1227 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1229 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1230 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1233 if (stmt->result) { in MYSQLND_METHOD()
1235 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
1251 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1252 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1256 if (!stmt || !conn) { in MYSQLND_METHOD()
1259 DBG_INF_FMT("stmt=%lu param_no=%u data_len=%lu", stmt->stmt_id, param_no, data_length); in MYSQLND_METHOD()
1261 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1264 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1265 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1269 if (!stmt->param_bind) { in MYSQLND_METHOD()
1270 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1274 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1275 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1279 if (stmt->param_bind[param_no].type != MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1280 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_BUFFER_USE, UNKNOWN_SQLSTATE, mysqlnd_not_bound_as_b… in MYSQLND_METHOD()
1289 stmt->param_bind[param_no].flags |= MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1291 int4store(cmd_buf, stmt->stmt_id); in MYSQLND_METHOD()
1301 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1308 SET_OOM_ERROR(stmt->error_info); in MYSQLND_METHOD()
1336 SET_CLIENT_ERROR(stmt->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
1353 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1354 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1357 if (!stmt || !conn) { in MYSQLND_METHOD()
1360 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1362 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1363 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1371 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1374 if (stmt->param_count) { in MYSQLND_METHOD()
1378 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, "Re-binding (still) … in MYSQLND_METHOD()
1381 } else if (stmt->param_bind) { in MYSQLND_METHOD()
1387 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1392 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
1394 if (stmt->param_bind != param_bind) { in MYSQLND_METHOD()
1395 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
1399 stmt->param_bind = param_bind; in MYSQLND_METHOD()
1400 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1402 DBG_INF_FMT("%u is of type %u", i, stmt->param_bind[i].type); in MYSQLND_METHOD()
1405 Z_TRY_ADDREF(stmt->param_bind[i].zv); in MYSQLND_METHOD()
1406 stmt->param_bind[i].flags = 0; in MYSQLND_METHOD()
1407 if (stmt->param_bind[i].type == MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1408 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1411 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1424 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1425 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1428 if (!stmt || !conn) { in MYSQLND_METHOD()
1431 …DBG_INF_FMT("stmt=%lu param_no=%u param_count=%u type=%u", stmt->stmt_id, param_no, stmt->param_co… in MYSQLND_METHOD()
1433 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1434 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1439 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1440 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1444 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1447 if (stmt->param_count) { in MYSQLND_METHOD()
1448 if (!stmt->param_bind) { in MYSQLND_METHOD()
1449 stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND)); in MYSQLND_METHOD()
1450 if (!stmt->param_bind) { in MYSQLND_METHOD()
1460 zval_ptr_dtor(&stmt->param_bind[param_no].zv); in MYSQLND_METHOD()
1463 stmt->param_bind[param_no].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1465 ZVAL_COPY_VALUE(&stmt->param_bind[param_no].zv, zv); in MYSQLND_METHOD()
1466 stmt->param_bind[param_no].type = type; in MYSQLND_METHOD()
1468 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1480 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1481 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1484 if (!stmt || !conn) { in MYSQLND_METHOD()
1487 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1489 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1490 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1495 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1498 if (stmt->param_count) { in MYSQLND_METHOD()
1499 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1511 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1512 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1515 if (!stmt || !conn) { in MYSQLND_METHOD()
1518 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1520 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1521 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1529 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1532 if (stmt->field_count) { in MYSQLND_METHOD()
1541 stmt->result_bind = result_bind; in MYSQLND_METHOD()
1542 for (i = 0; i < stmt->field_count; i++) { in MYSQLND_METHOD()
1544 Z_TRY_ADDREF(stmt->result_bind[i].zv); in MYSQLND_METHOD()
1546 DBG_INF_FMT("ref of %p = %u", &stmt->result_bind[i].zv, in MYSQLND_METHOD()
1547 Z_REFCOUNTED(stmt->result_bind[i].zv)? Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in MYSQLND_METHOD()
1553 stmt->result_bind[i].bound = TRUE; in MYSQLND_METHOD()
1568 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1569 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1572 if (!stmt || !conn) { in MYSQLND_METHOD()
1575 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1577 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1578 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1583 if (param_no >= stmt->field_count) { in MYSQLND_METHOD()
1584 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1589 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1592 if (stmt->field_count) { in MYSQLND_METHOD()
1593 if (!stmt->result_bind) { in MYSQLND_METHOD()
1594 stmt->result_bind = mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND)); in MYSQLND_METHOD()
1596 if (stmt->result_bind[param_no].bound) { in MYSQLND_METHOD()
1597 zval_ptr_dtor(&stmt->result_bind[param_no].zv); in MYSQLND_METHOD()
1599 ZVAL_NULL(&stmt->result_bind[param_no].zv); in MYSQLND_METHOD()
1600 stmt->result_bind[param_no].bound = TRUE; in MYSQLND_METHOD()
1612 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1613 return stmt? UPSERT_STATUS_GET_LAST_INSERT_ID(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1622 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1623 return stmt? UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1632 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1633 return stmt && stmt->result? mysqlnd_num_rows(stmt->result):0; in MYSQLND_METHOD()
1642 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1643 return stmt? UPSERT_STATUS_GET_WARNINGS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1652 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1653 return stmt? UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1662 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1663 return stmt? stmt->field_count : 0; in MYSQLND_METHOD()
1672 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1673 return stmt? stmt->param_count : 0; in MYSQLND_METHOD()
1682 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1683 return stmt? stmt->error_info->error_no : 0; in MYSQLND_METHOD()
1692 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1693 return stmt? stmt->error_info->error : 0; in MYSQLND_METHOD()
1702 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1703 return stmt && stmt->error_info->sqlstate[0] ? stmt->error_info->sqlstate:MYSQLND_SQLSTATE_NULL; in MYSQLND_METHOD()
1712 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1713 return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row) : FAIL; in MYSQLND_METHOD()
1722 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1723 if (!stmt || !stmt->param_count) { in MYSQLND_METHOD()
1735 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1736 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1740 if (!stmt || ! conn) { in MYSQLND_METHOD()
1743 DBG_INF_FMT("stmt=%u field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1745 if (!stmt->field_count || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1750 if (stmt->update_max_length && stmt->result->stored_data) { in MYSQLND_METHOD()
1752 stmt->result->stored_data->m.initialize_result_set_rest(stmt->result->stored_data, in MYSQLND_METHOD()
1753 stmt->result->meta, in MYSQLND_METHOD()
1764 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1769 result_meta->unbuf = mysqlnd_result_unbuffered_init(result_meta, stmt->field_count, TRUE); in MYSQLND_METHOD()
1774 result_meta->meta = stmt->result->meta->m->clone_metadata(result_meta, stmt->result->meta); in MYSQLND_METHOD()
1798 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1800 if (!stmt) { in MYSQLND_METHOD()
1803 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1812 stmt->update_max_length = bval? TRUE:FALSE; in MYSQLND_METHOD()
1818 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1822 stmt->flags = ival; in MYSQLND_METHOD()
1830 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1834 stmt->prefetch_rows = ival; in MYSQLND_METHOD()
1838 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1853 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1855 if (!stmt) { in MYSQLND_METHOD()
1858 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1862 *(zend_bool *) value= stmt->update_max_length; in MYSQLND_METHOD()
1865 *(unsigned long *) value= stmt->flags; in MYSQLND_METHOD()
1868 *(unsigned long *) value= stmt->prefetch_rows; in MYSQLND_METHOD()
1884 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1885 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1888 if (!stmt || !conn) { in MYSQLND_METHOD()
1891 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1893 if (!stmt->result) { in MYSQLND_METHOD()
1902 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1905 stmt->default_rset_handler = s->m->use_result; in MYSQLND_METHOD()
1906 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1909 if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1912 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
1920 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
1923 if (stmt->state > MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1925 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
1937 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_separate_result_bind() local
1941 if (!stmt) { in mysqlnd_stmt_separate_result_bind()
1944 …DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u", stmt->stmt_id, stmt->result_bind, stmt->fiel… in mysqlnd_stmt_separate_result_bind()
1946 if (!stmt->result_bind) { in mysqlnd_stmt_separate_result_bind()
1955 for (i = 0; i < stmt->field_count; i++) { in mysqlnd_stmt_separate_result_bind()
1957 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_separate_result_bind()
1958 …DBG_INF_FMT("%u has refcount=%u", i, Z_REFCOUNTED(stmt->result_bind[i].zv)? Z_REFCOUNT(stmt->resul… in mysqlnd_stmt_separate_result_bind()
1959 zval_ptr_dtor(&stmt->result_bind[i].zv); in mysqlnd_stmt_separate_result_bind()
1963 s->m->free_result_bind(s, stmt->result_bind); in mysqlnd_stmt_separate_result_bind()
1964 stmt->result_bind = NULL; in mysqlnd_stmt_separate_result_bind()
1975 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1977 if (!stmt) { in MYSQLND_METHOD()
1987 if (stmt->result) { in MYSQLND_METHOD()
1988 stmt->result->m.free_result_internal(stmt->result); in MYSQLND_METHOD()
1989 stmt->result = NULL; in MYSQLND_METHOD()
1991 zend_llist_clean(&stmt->error_info->error_list); in MYSQLND_METHOD()
2002 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2004 if (!stmt) { in MYSQLND_METHOD()
2007 …DBG_INF_FMT("stmt=%lu param_bind=%p param_count=%u", stmt->stmt_id, stmt->param_bind, stmt->param_… in MYSQLND_METHOD()
2010 if (stmt->param_bind) { in MYSQLND_METHOD()
2017 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
2022 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
2024 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
2025 stmt->param_bind = NULL; in MYSQLND_METHOD()
2038 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD_PRIVATE() local
2039 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE()
2043 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
2046 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD_PRIVATE()
2048 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD_PRIVATE()
2057 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD_PRIVATE()
2059 stmt->default_rset_handler(s); in MYSQLND_METHOD_PRIVATE()
2060 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD_PRIVATE()
2064 if (stmt->result) { in MYSQLND_METHOD_PRIVATE()
2066 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD_PRIVATE()
2073 if (stmt->stmt_id) { in MYSQLND_METHOD_PRIVATE()
2079 const size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD_PRIVATE()
2083 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2088 switch (stmt->execute_count) { in MYSQLND_METHOD_PRIVATE()
2102 if (stmt->execute_cmd_buffer.buffer) { in MYSQLND_METHOD_PRIVATE()
2103 mnd_efree(stmt->execute_cmd_buffer.buffer); in MYSQLND_METHOD_PRIVATE()
2104 stmt->execute_cmd_buffer.buffer = NULL; in MYSQLND_METHOD_PRIVATE()
2111 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2122 MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL; in MYSQLND_METHOD() local
2126 if (stmt) { in MYSQLND_METHOD()
2127 DBG_INF_FMT("stmt=%p", stmt); in MYSQLND_METHOD()
2133 mnd_efree(stmt); in MYSQLND_METHOD()
2147 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2149 if (!stmt) { in MYSQLND_METHOD()
2152 DBG_RETURN(mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND))); in MYSQLND_METHOD()
2161 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2163 if (!stmt) { in MYSQLND_METHOD()
2166 DBG_RETURN(mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND))); in MYSQLND_METHOD()
2175 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2176 if (stmt) { in MYSQLND_METHOD()
2187 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2188 if (stmt) { in MYSQLND_METHOD()