Lines Matching refs:stmt
40 static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt);
41 static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, const unsigned int par…
48 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
49 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
53 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
56 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
59 if (!stmt->field_count) { in MYSQLND_METHOD()
63 if (stmt->cursor_exists) { in MYSQLND_METHOD()
69 …if (GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA || stmt->state != MYSQLND_STMT_WAITIN… in MYSQLND_METHOD()
75 stmt->default_rset_handler = s->m->store_result; in MYSQLND_METHOD()
77 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
81 result = stmt->result; in MYSQLND_METHOD()
119 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, stmt->result->stored_data->row_count); in MYSQLND_METHOD()
121 stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED; in MYSQLND_METHOD()
124 stmt->result->m.free_result_contents(stmt->result); in MYSQLND_METHOD()
125 mysqlnd_mempool_destroy(stmt->result->memory_pool); in MYSQLND_METHOD()
126 stmt->result = NULL; in MYSQLND_METHOD()
127 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
139 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
140 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
144 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
147 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
150 if (!stmt->field_count) { in MYSQLND_METHOD()
154 if (stmt->cursor_exists) { in MYSQLND_METHOD()
160 …if (GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA || stmt->state != MYSQLND_STMT_WAITIN… in MYSQLND_METHOD()
165 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
170 result = conn->m->result_init(stmt->result->field_count); in MYSQLND_METHOD()
176 result->meta = stmt->result->meta->m->clone_metadata(result, stmt->result->meta); in MYSQLND_METHOD()
183 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, result->stored_data->row_count); in MYSQLND_METHOD()
184 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
187 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
188 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
206 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
207 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
210 …DBG_RETURN((stmt && conn && (conn->m->get_server_status(conn) & SERVER_MORE_RESULTS_EXISTS))? TRUE… in MYSQLND_METHOD()
219 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
220 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
223 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
226 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
248 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_skip_metadata() local
249 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_skip_metadata()
257 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
264 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_skip_metadata()
271 for (;i < stmt->param_count; i++) { in mysqlnd_stmt_skip_metadata()
289 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_read_prepare_response() local
290 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response()
295 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
298 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_read_prepare_response()
307 COPY_CLIENT_ERROR(stmt->error_info, prepare_resp.error_info); in mysqlnd_stmt_read_prepare_response()
312 stmt->stmt_id = prepare_resp.stmt_id; in mysqlnd_stmt_read_prepare_response()
314 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, 0); /* be like libmysql */ in mysqlnd_stmt_read_prepare_response()
315 stmt->field_count = conn->field_count = prepare_resp.field_count; in mysqlnd_stmt_read_prepare_response()
316 stmt->param_count = prepare_resp.param_count; in mysqlnd_stmt_read_prepare_response()
329 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_prepare_read_eof() local
330 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof()
335 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
338 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_prepare_read_eof()
342 if (stmt->result) { in mysqlnd_stmt_prepare_read_eof()
343 stmt->result->m.free_result_contents(stmt->result); in mysqlnd_stmt_prepare_read_eof()
344 mnd_efree(stmt->result); in mysqlnd_stmt_prepare_read_eof()
350 memset(stmt, 0, sizeof(MYSQLND_STMT_DATA)); in mysqlnd_stmt_prepare_read_eof()
351 stmt->state = MYSQLND_STMT_INITTED; in mysqlnd_stmt_prepare_read_eof()
354 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, fields_eof.server_status); in mysqlnd_stmt_prepare_read_eof()
355 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, fields_eof.warning_count); in mysqlnd_stmt_prepare_read_eof()
356 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_prepare_read_eof()
368 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
369 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
371 MYSQLND_STMT_DATA * stmt_to_prepare = stmt; in MYSQLND_METHOD()
374 if (!stmt || !conn) { in MYSQLND_METHOD()
377 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
380 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
383 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
386 if (stmt->state > MYSQLND_STMT_INITTED) { in MYSQLND_METHOD()
388 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
390 stmt->default_rset_handler = s->m->use_result; in MYSQLND_METHOD()
391 stmt->default_rset_handler(s); in MYSQLND_METHOD()
394 if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE && stmt->result) { in MYSQLND_METHOD()
395 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
455 if (stmt_to_prepare != stmt) { in MYSQLND_METHOD()
465 stmt_to_prepare = stmt; in MYSQLND_METHOD()
466 stmt = tmp_swap_data; in MYSQLND_METHOD()
470 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
475 if (stmt_to_prepare != stmt && s_to_prepare) { in MYSQLND_METHOD()
478 stmt->state = MYSQLND_STMT_INITTED; in MYSQLND_METHOD()
490 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_execute_parse_response() local
491 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response()
495 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
502 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
503 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_stmt_execute_parse_response()
504 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
508 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_execute_parse_response()
509 stmt->send_types_to_server = 1; in mysqlnd_stmt_execute_parse_response()
518 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_stmt_execute_parse_response()
520 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
521 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
522 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
523 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
525 stmt->state = MYSQLND_STMT_EXECUTED; in mysqlnd_stmt_execute_parse_response()
531 stmt->result->type = MYSQLND_RES_PS_BUF; in mysqlnd_stmt_execute_parse_response()
532 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
537 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
541 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
542 if (stmt->result->stored_data) { in mysqlnd_stmt_execute_parse_response()
543 stmt->result->stored_data->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
544 } else if (stmt->result->unbuf) { in mysqlnd_stmt_execute_parse_response()
545 stmt->result->unbuf->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
547 if (stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
548 stmt->state = MYSQLND_STMT_WAITING_USE_OR_STORE; in mysqlnd_stmt_execute_parse_response()
554 DBG_INF_FMT("server_status=%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), in mysqlnd_stmt_execute_parse_response()
555 UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS); in mysqlnd_stmt_execute_parse_response()
557 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS) { in mysqlnd_stmt_execute_parse_response()
559 stmt->cursor_exists = TRUE; in mysqlnd_stmt_execute_parse_response()
562 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
564 } else if (stmt->flags & CURSOR_TYPE_READ_ONLY) { in mysqlnd_stmt_execute_parse_response()
577 stmt->default_rset_handler = s->m->store_result; in mysqlnd_stmt_execute_parse_response()
582 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
588 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_PS_OUT_PARAMS) { in mysqlnd_stmt_execute_parse_response()
596 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in mysqlnd_stmt_execute_parse_response()
598 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
599 …_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status)); in mysqlnd_stmt_execute_parse_response()
627 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
628 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
635 if (!stmt || !conn) { in MYSQLND_METHOD()
638 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
640 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
643 if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) { in MYSQLND_METHOD()
650 if (stmt->result_bind && in MYSQLND_METHOD()
651 stmt->result_zvals_separated_once == TRUE && in MYSQLND_METHOD()
652 stmt->state >= MYSQLND_STMT_USER_FETCHING) in MYSQLND_METHOD()
667 for (i = 0; i < stmt->field_count; i++) { in MYSQLND_METHOD()
668 if (stmt->result_bind[i].bound == TRUE) { in MYSQLND_METHOD()
669 zval *result = &stmt->result_bind[i].zv; in MYSQLND_METHOD()
684 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
686 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
687 } else if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
689 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
694 if (stmt->param_count) { in MYSQLND_METHOD()
696 if (!stmt->param_bind) { in MYSQLND_METHOD()
697 …SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, "No data supplied for pa… in MYSQLND_METHOD()
701 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
702 if (Z_ISUNDEF(stmt->param_bind[i].zv)) { in MYSQLND_METHOD()
710 SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, msg); in MYSQLND_METHOD()
724 …SET_CLIENT_ERROR(stmt->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Couldn't generate the requ… in MYSQLND_METHOD()
732 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
736 stmt->execute_count++; in MYSQLND_METHOD()
748 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_buffered() local
754 DBG_INF_FMT("stmt=%lu", stmt != NULL ? stmt->stmt_id : 0L); in mysqlnd_stmt_fetch_row_buffered()
763 if (stmt->result_bind) { in mysqlnd_stmt_fetch_row_buffered()
779 if (stmt->update_max_length) { in mysqlnd_stmt_fetch_row_buffered()
797 zval *result = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_buffered()
805 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_buffered()
850 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_unbuffered() local
875 row_packet->skip_extraction = stmt && stmt->result_bind? FALSE:TRUE; in mysqlnd_stmt_fetch_row_unbuffered()
908 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_unbuffered()
910 zval *result = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_unbuffered()
951 COPY_CLIENT_ERROR(stmt->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
987 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
988 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
992 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
995 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
997 if (!stmt->field_count || in MYSQLND_METHOD()
998 (!stmt->cursor_exists && GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA) || in MYSQLND_METHOD()
999 (stmt->cursor_exists && GET_CONNECTION_STATE(&conn->state) != CONN_READY) || in MYSQLND_METHOD()
1000 (stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE)) in MYSQLND_METHOD()
1007 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1010 result = stmt->result; in MYSQLND_METHOD()
1012 result->m.use_result(stmt->result, TRUE); in MYSQLND_METHOD()
1013 result->unbuf->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor: in MYSQLND_METHOD()
1015 stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED; in MYSQLND_METHOD()
1029 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_fetch_stmt_row_cursor() local
1030 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_fetch_stmt_row_cursor()
1036 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1040 DBG_INF_FMT("stmt=%lu flags=%u", stmt->stmt_id, flags); in mysqlnd_fetch_stmt_row_cursor()
1042 if (stmt->state < MYSQLND_STMT_USER_FETCHING) { in mysqlnd_fetch_stmt_row_cursor()
1052 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_fetch_stmt_row_cursor()
1055 int4store(buf, stmt->stmt_id); in mysqlnd_fetch_stmt_row_cursor()
1063 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1069 row_packet->skip_extraction = stmt->result_bind? FALSE:TRUE; in mysqlnd_fetch_stmt_row_cursor()
1071 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_fetch_stmt_row_cursor()
1096 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_fetch_stmt_row_cursor()
1098 zval *result = &stmt->result_bind[i].zv; in mysqlnd_fetch_stmt_row_cursor()
1108 DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, &stmt->result_bind[i].zv, in mysqlnd_fetch_stmt_row_cursor()
1109 Z_TYPE_P(data), Z_REFCOUNTED(stmt->result_bind[i].zv)? in mysqlnd_fetch_stmt_row_cursor()
1110 Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in mysqlnd_fetch_stmt_row_cursor()
1150 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1153 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1158 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1161 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1177 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1178 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1181 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1184 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1186 if (!stmt->result || stmt->state < MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1187 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1190 } else if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1193 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1195 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1197 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1200 …DBG_INF_FMT("result_bind=%p separated_once=%u", &stmt->result_bind, stmt->result_zvals_separated_o… in MYSQLND_METHOD()
1205 if (stmt->result_bind && !stmt->result_zvals_separated_once) { in MYSQLND_METHOD()
1211 for (i = 0; i < stmt->result->field_count; i++) { in MYSQLND_METHOD()
1212 if (stmt->result_bind[i].bound == TRUE) { in MYSQLND_METHOD()
1213 zval *result = &stmt->result_bind[i].zv; in MYSQLND_METHOD()
1219 stmt->result_zvals_separated_once = TRUE; in MYSQLND_METHOD()
1222 ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything); in MYSQLND_METHOD()
1233 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1234 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1237 if (!stmt || !conn) { in MYSQLND_METHOD()
1240 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1242 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1245 if (stmt->stmt_id) { in MYSQLND_METHOD()
1246 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD()
1247 if (stmt->param_bind) { in MYSQLND_METHOD()
1251 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1252 if (stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED) { in MYSQLND_METHOD()
1253 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1267 size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD()
1269 ret = stmt->conn->run_command(COM_STMT_RESET, stmt->conn, stmt_id); in MYSQLND_METHOD()
1271 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1274 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1287 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1288 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1291 if (!stmt || !conn) { in MYSQLND_METHOD()
1294 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1296 if (stmt->stmt_id) { in MYSQLND_METHOD()
1303 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1305 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1306 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1309 if (stmt->result) { in MYSQLND_METHOD()
1311 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
1327 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1328 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1332 if (!stmt || !conn) { in MYSQLND_METHOD()
1335 DBG_INF_FMT("stmt=%lu param_no=%u data_len=%lu", stmt->stmt_id, param_no, data_length); in MYSQLND_METHOD()
1337 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1340 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1341 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1345 if (!stmt->param_bind) { in MYSQLND_METHOD()
1346 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1350 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1351 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1355 if (stmt->param_bind[param_no].type != MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1356 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_BUFFER_USE, UNKNOWN_SQLSTATE, mysqlnd_not_bound_as_b… in MYSQLND_METHOD()
1365 stmt->param_bind[param_no].flags |= MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1367 int4store(cmd_buf, stmt->stmt_id); in MYSQLND_METHOD()
1377 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1384 SET_OOM_ERROR(stmt->error_info); in MYSQLND_METHOD()
1412 SET_CLIENT_ERROR(stmt->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
1429 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1430 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1433 if (!stmt || !conn) { in MYSQLND_METHOD()
1436 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1438 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1439 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1447 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1450 if (stmt->param_count) { in MYSQLND_METHOD()
1454 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, "Re-binding (still) … in MYSQLND_METHOD()
1457 } else if (stmt->param_bind) { in MYSQLND_METHOD()
1463 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1468 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
1470 if (stmt->param_bind != param_bind) { in MYSQLND_METHOD()
1471 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
1475 stmt->param_bind = param_bind; in MYSQLND_METHOD()
1476 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1478 DBG_INF_FMT("%u is of type %u", i, stmt->param_bind[i].type); in MYSQLND_METHOD()
1481 Z_TRY_ADDREF(stmt->param_bind[i].zv); in MYSQLND_METHOD()
1482 stmt->param_bind[i].flags = 0; in MYSQLND_METHOD()
1483 if (stmt->param_bind[i].type == MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1484 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1487 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1500 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1501 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1504 if (!stmt || !conn) { in MYSQLND_METHOD()
1507 …DBG_INF_FMT("stmt=%lu param_no=%u param_count=%u type=%u", stmt->stmt_id, param_no, stmt->param_co… in MYSQLND_METHOD()
1509 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1510 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1515 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1516 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1520 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1523 if (stmt->param_count) { in MYSQLND_METHOD()
1524 if (!stmt->param_bind) { in MYSQLND_METHOD()
1525 stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND)); in MYSQLND_METHOD()
1526 if (!stmt->param_bind) { in MYSQLND_METHOD()
1536 zval_ptr_dtor(&stmt->param_bind[param_no].zv); in MYSQLND_METHOD()
1539 stmt->param_bind[param_no].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1541 ZVAL_COPY_VALUE(&stmt->param_bind[param_no].zv, zv); in MYSQLND_METHOD()
1542 stmt->param_bind[param_no].type = type; in MYSQLND_METHOD()
1544 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1556 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1557 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1560 if (!stmt || !conn) { in MYSQLND_METHOD()
1563 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1565 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1566 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1571 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1574 if (stmt->param_count) { in MYSQLND_METHOD()
1575 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1587 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1588 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1591 if (!stmt || !conn) { in MYSQLND_METHOD()
1594 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1596 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1597 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1605 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1608 if (stmt->field_count) { in MYSQLND_METHOD()
1617 stmt->result_zvals_separated_once = FALSE; in MYSQLND_METHOD()
1618 stmt->result_bind = result_bind; in MYSQLND_METHOD()
1619 for (i = 0; i < stmt->field_count; i++) { in MYSQLND_METHOD()
1621 Z_TRY_ADDREF(stmt->result_bind[i].zv); in MYSQLND_METHOD()
1623 DBG_INF_FMT("ref of %p = %u", &stmt->result_bind[i].zv, in MYSQLND_METHOD()
1624 Z_REFCOUNTED(stmt->result_bind[i].zv)? Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in MYSQLND_METHOD()
1630 stmt->result_bind[i].bound = TRUE; in MYSQLND_METHOD()
1645 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1646 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1649 if (!stmt || !conn) { in MYSQLND_METHOD()
1652 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1654 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1655 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1660 if (param_no >= stmt->field_count) { in MYSQLND_METHOD()
1661 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1666 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1669 if (stmt->field_count) { in MYSQLND_METHOD()
1672 if (!stmt->result_bind) { in MYSQLND_METHOD()
1673 stmt->result_bind = mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND)); in MYSQLND_METHOD()
1675 …stmt->result_bind = mnd_erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND… in MYSQLND_METHOD()
1677 if (!stmt->result_bind) { in MYSQLND_METHOD()
1680 ZVAL_NULL(&stmt->result_bind[param_no].zv); in MYSQLND_METHOD()
1686 stmt->result_bind[param_no].bound = TRUE; in MYSQLND_METHOD()
1698 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1699 return stmt? UPSERT_STATUS_GET_LAST_INSERT_ID(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1708 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1709 return stmt? UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1718 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1719 return stmt && stmt->result? mysqlnd_num_rows(stmt->result):0; in MYSQLND_METHOD()
1728 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1729 return stmt? UPSERT_STATUS_GET_WARNINGS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1738 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1739 return stmt? UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1748 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1749 return stmt? stmt->field_count : 0; in MYSQLND_METHOD()
1758 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1759 return stmt? stmt->param_count : 0; in MYSQLND_METHOD()
1768 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1769 return stmt? stmt->error_info->error_no : 0; in MYSQLND_METHOD()
1778 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1779 return stmt? stmt->error_info->error : 0; in MYSQLND_METHOD()
1788 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1789 return stmt && stmt->error_info->sqlstate[0] ? stmt->error_info->sqlstate:MYSQLND_SQLSTATE_NULL; in MYSQLND_METHOD()
1798 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1799 return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row) : FAIL; in MYSQLND_METHOD()
1808 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1809 if (!stmt || !stmt->param_count) { in MYSQLND_METHOD()
1821 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1822 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1826 if (!stmt || ! conn) { in MYSQLND_METHOD()
1829 DBG_INF_FMT("stmt=%u field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1831 if (!stmt->field_count || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1836 if (stmt->update_max_length && stmt->result->stored_data) { in MYSQLND_METHOD()
1838 stmt->result->stored_data->m.initialize_result_set_rest(stmt->result->stored_data, in MYSQLND_METHOD()
1839 stmt->result->meta, in MYSQLND_METHOD()
1850 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1855 result_meta->unbuf = mysqlnd_result_unbuffered_init(result_meta, stmt->field_count, TRUE); in MYSQLND_METHOD()
1860 result_meta->meta = stmt->result->meta->m->clone_metadata(result_meta, stmt->result->meta); in MYSQLND_METHOD()
1884 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1886 if (!stmt) { in MYSQLND_METHOD()
1889 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1898 stmt->update_max_length = bval? TRUE:FALSE; in MYSQLND_METHOD()
1904 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1908 stmt->flags = ival; in MYSQLND_METHOD()
1916 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1920 stmt->prefetch_rows = ival; in MYSQLND_METHOD()
1924 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1939 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1941 if (!stmt) { in MYSQLND_METHOD()
1944 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1948 *(zend_bool *) value= stmt->update_max_length; in MYSQLND_METHOD()
1951 *(unsigned long *) value= stmt->flags; in MYSQLND_METHOD()
1954 *(unsigned long *) value= stmt->prefetch_rows; in MYSQLND_METHOD()
1970 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1971 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1974 if (!stmt || !conn) { in MYSQLND_METHOD()
1977 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1979 if (!stmt->result) { in MYSQLND_METHOD()
1988 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1991 stmt->default_rset_handler = s->m->use_result; in MYSQLND_METHOD()
1992 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1995 if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1998 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
2006 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
2009 if (stmt->state > MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
2011 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
2027 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_separate_result_bind() local
2031 if (!stmt) { in mysqlnd_stmt_separate_result_bind()
2034 …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()
2036 if (!stmt->result_bind) { in mysqlnd_stmt_separate_result_bind()
2045 for (i = 0; i < stmt->field_count; i++) { in mysqlnd_stmt_separate_result_bind()
2047 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_separate_result_bind()
2048 …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()
2049 zval_ptr_dtor(&stmt->result_bind[i].zv); in mysqlnd_stmt_separate_result_bind()
2053 s->m->free_result_bind(s, stmt->result_bind); in mysqlnd_stmt_separate_result_bind()
2054 stmt->result_bind = NULL; in mysqlnd_stmt_separate_result_bind()
2065 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_separate_one_result_bind() local
2067 if (!stmt) { in mysqlnd_stmt_separate_one_result_bind()
2070 …MT("stmt=%lu result_bind=%p field_count=%u param_no=%u", stmt->stmt_id, stmt->result_bind, stmt->f… in mysqlnd_stmt_separate_one_result_bind()
2072 if (!stmt->result_bind) { in mysqlnd_stmt_separate_one_result_bind()
2082 if (stmt->result_bind[param_no].bound == TRUE) { in mysqlnd_stmt_separate_one_result_bind()
2083 …NF_FMT("%u has refcount=%u", param_no, Z_REFCOUNTED(stmt->result_bind[param_no].zv)? Z_REFCOUNT(st… in mysqlnd_stmt_separate_one_result_bind()
2084 zval_ptr_dtor(&stmt->result_bind[param_no].zv); in mysqlnd_stmt_separate_one_result_bind()
2096 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2098 if (!stmt) { in MYSQLND_METHOD()
2108 if (stmt->result) { in MYSQLND_METHOD()
2109 stmt->result->m.free_result_internal(stmt->result); in MYSQLND_METHOD()
2110 stmt->result = NULL; in MYSQLND_METHOD()
2112 zend_llist_clean(&stmt->error_info->error_list); in MYSQLND_METHOD()
2123 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2125 if (!stmt) { in MYSQLND_METHOD()
2128 …DBG_INF_FMT("stmt=%lu param_bind=%p param_count=%u", stmt->stmt_id, stmt->param_bind, stmt->param_… in MYSQLND_METHOD()
2131 if (stmt->param_bind) { in MYSQLND_METHOD()
2138 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
2143 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
2145 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
2146 stmt->param_bind = NULL; in MYSQLND_METHOD()
2159 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD_PRIVATE() local
2160 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE()
2164 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
2167 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD_PRIVATE()
2169 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD_PRIVATE()
2178 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD_PRIVATE()
2180 stmt->default_rset_handler(s); in MYSQLND_METHOD_PRIVATE()
2181 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD_PRIVATE()
2185 if (stmt->result) { in MYSQLND_METHOD_PRIVATE()
2187 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD_PRIVATE()
2194 if (stmt->stmt_id) { in MYSQLND_METHOD_PRIVATE()
2200 size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD_PRIVATE()
2204 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2209 switch (stmt->execute_count) { in MYSQLND_METHOD_PRIVATE()
2223 if (stmt->execute_cmd_buffer.buffer) { in MYSQLND_METHOD_PRIVATE()
2224 mnd_efree(stmt->execute_cmd_buffer.buffer); in MYSQLND_METHOD_PRIVATE()
2225 stmt->execute_cmd_buffer.buffer = NULL; in MYSQLND_METHOD_PRIVATE()
2232 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2243 MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL; in MYSQLND_METHOD() local
2247 if (stmt) { in MYSQLND_METHOD()
2248 DBG_INF_FMT("stmt=%p", stmt); in MYSQLND_METHOD()
2254 mnd_efree(stmt); in MYSQLND_METHOD()
2268 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2270 if (!stmt) { in MYSQLND_METHOD()
2273 DBG_RETURN(mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND))); in MYSQLND_METHOD()
2282 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2284 if (!stmt) { in MYSQLND_METHOD()
2287 DBG_RETURN(mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND))); in MYSQLND_METHOD()
2296 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2297 if (stmt) { in MYSQLND_METHOD()
2308 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2309 if (stmt) { in MYSQLND_METHOD()