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 mnd_pefree(stmt->result, stmt->result->persistent); 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, stmt->persistent); in MYSQLND_METHOD()
176 result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE); 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()
256 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
259 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_skip_metadata()
263 SET_OOM_ERROR(stmt->error_info); in mysqlnd_stmt_skip_metadata()
268 for (;i < stmt->param_count; i++) { in mysqlnd_stmt_skip_metadata()
286 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_read_prepare_response() local
287 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response()
292 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
295 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_read_prepare_response()
299 SET_OOM_ERROR(stmt->error_info); in mysqlnd_stmt_read_prepare_response()
309 COPY_CLIENT_ERROR(stmt->error_info, prepare_resp->error_info); in mysqlnd_stmt_read_prepare_response()
314 stmt->stmt_id = prepare_resp->stmt_id; in mysqlnd_stmt_read_prepare_response()
316 UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, 0); /* be like libmysql */ in mysqlnd_stmt_read_prepare_response()
317 stmt->field_count = conn->field_count = prepare_resp->field_count; in mysqlnd_stmt_read_prepare_response()
318 stmt->param_count = prepare_resp->param_count; in mysqlnd_stmt_read_prepare_response()
331 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_prepare_read_eof() local
332 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof()
337 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
340 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in mysqlnd_stmt_prepare_read_eof()
344 SET_OOM_ERROR(stmt->error_info); in mysqlnd_stmt_prepare_read_eof()
348 if (stmt->result) { in mysqlnd_stmt_prepare_read_eof()
349 stmt->result->m.free_result_contents(stmt->result); in mysqlnd_stmt_prepare_read_eof()
350 mnd_pefree(stmt->result, stmt->result->persistent); in mysqlnd_stmt_prepare_read_eof()
356 memset(stmt, 0, sizeof(MYSQLND_STMT_DATA)); in mysqlnd_stmt_prepare_read_eof()
357 stmt->state = MYSQLND_STMT_INITTED; in mysqlnd_stmt_prepare_read_eof()
360 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, fields_eof->server_status); in mysqlnd_stmt_prepare_read_eof()
361 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, fields_eof->warning_count); in mysqlnd_stmt_prepare_read_eof()
362 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_prepare_read_eof()
376 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
377 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
379 MYSQLND_STMT_DATA * stmt_to_prepare = stmt; in MYSQLND_METHOD()
382 if (!stmt || !conn) { in MYSQLND_METHOD()
385 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
388 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
391 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
394 if (stmt->state > MYSQLND_STMT_INITTED) { in MYSQLND_METHOD()
396 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
398 stmt->default_rset_handler = s->m->use_result; in MYSQLND_METHOD()
399 stmt->default_rset_handler(s); in MYSQLND_METHOD()
402 if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE && stmt->result) { in MYSQLND_METHOD()
403 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
466 if (stmt_to_prepare != stmt) { in MYSQLND_METHOD()
476 stmt_to_prepare = stmt; in MYSQLND_METHOD()
477 stmt = tmp_swap_data; in MYSQLND_METHOD()
481 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
486 if (stmt_to_prepare != stmt && s_to_prepare) { in MYSQLND_METHOD()
489 stmt->state = MYSQLND_STMT_INITTED; in MYSQLND_METHOD()
501 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_execute_parse_response() local
502 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response()
506 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
513 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
514 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_stmt_execute_parse_response()
515 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
519 stmt->state = MYSQLND_STMT_PREPARED; in mysqlnd_stmt_execute_parse_response()
520 stmt->send_types_to_server = 1; in mysqlnd_stmt_execute_parse_response()
529 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_stmt_execute_parse_response()
531 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
532 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
533 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
534 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
536 stmt->state = MYSQLND_STMT_EXECUTED; in mysqlnd_stmt_execute_parse_response()
542 stmt->result->type = MYSQLND_RES_PS_BUF; in mysqlnd_stmt_execute_parse_response()
543 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
548 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
552 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
553 if (stmt->result->stored_data) { in mysqlnd_stmt_execute_parse_response()
554 stmt->result->stored_data->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
555 } else if (stmt->result->unbuf) { in mysqlnd_stmt_execute_parse_response()
556 stmt->result->unbuf->lengths = NULL; in mysqlnd_stmt_execute_parse_response()
558 if (stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
559 stmt->state = MYSQLND_STMT_WAITING_USE_OR_STORE; in mysqlnd_stmt_execute_parse_response()
565 DBG_INF_FMT("server_status=%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), in mysqlnd_stmt_execute_parse_response()
566 UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS); in mysqlnd_stmt_execute_parse_response()
568 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_STATUS_CURSOR_EXISTS) { in mysqlnd_stmt_execute_parse_response()
570 stmt->cursor_exists = TRUE; in mysqlnd_stmt_execute_parse_response()
573 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
575 } else if (stmt->flags & CURSOR_TYPE_READ_ONLY) { in mysqlnd_stmt_execute_parse_response()
588 stmt->default_rset_handler = s->m->store_result; in mysqlnd_stmt_execute_parse_response()
593 stmt->default_rset_handler = s->m->use_result; in mysqlnd_stmt_execute_parse_response()
599 if (UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) & SERVER_PS_OUT_PARAMS) { in mysqlnd_stmt_execute_parse_response()
607 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in mysqlnd_stmt_execute_parse_response()
609 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
610 …_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status)); in mysqlnd_stmt_execute_parse_response()
638 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
639 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
646 if (!stmt || !conn) { in MYSQLND_METHOD()
649 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
651 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(stmt->upsert_status); in MYSQLND_METHOD()
654 if (stmt->result && stmt->state >= MYSQLND_STMT_PREPARED && stmt->field_count) { in MYSQLND_METHOD()
661 if (stmt->result_bind && in MYSQLND_METHOD()
662 stmt->result_zvals_separated_once == TRUE && in MYSQLND_METHOD()
663 stmt->state >= MYSQLND_STMT_USER_FETCHING) in MYSQLND_METHOD()
678 for (i = 0; i < stmt->field_count; i++) { in MYSQLND_METHOD()
679 if (stmt->result_bind[i].bound == TRUE) { in MYSQLND_METHOD()
680 zval *result = &stmt->result_bind[i].zv; in MYSQLND_METHOD()
695 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
697 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
698 } else if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
700 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
705 if (stmt->param_count) { in MYSQLND_METHOD()
707 if (!stmt->param_bind) { in MYSQLND_METHOD()
708 …SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, "No data supplied for pa… in MYSQLND_METHOD()
712 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
713 if (Z_ISUNDEF(stmt->param_bind[i].zv)) { in MYSQLND_METHOD()
721 SET_CLIENT_ERROR(stmt->error_info, CR_PARAMS_NOT_BOUND, UNKNOWN_SQLSTATE, msg); in MYSQLND_METHOD()
739 …SET_CLIENT_ERROR(stmt->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Couldn't generate the requ… in MYSQLND_METHOD()
747 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
751 stmt->execute_count++; in MYSQLND_METHOD()
763 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_buffered() local
769 DBG_INF_FMT("stmt=%lu", stmt != NULL ? stmt->stmt_id : 0L); in mysqlnd_stmt_fetch_row_buffered()
778 if (stmt->result_bind) { in mysqlnd_stmt_fetch_row_buffered()
794 if (stmt->update_max_length) { in mysqlnd_stmt_fetch_row_buffered()
812 zval *result = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_buffered()
820 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_buffered()
865 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_fetch_row_unbuffered() local
889 row_packet->skip_extraction = stmt && stmt->result_bind? FALSE:TRUE; in mysqlnd_stmt_fetch_row_unbuffered()
917 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_fetch_row_unbuffered()
919 zval *result = &stmt->result_bind[i].zv; in mysqlnd_stmt_fetch_row_unbuffered()
960 COPY_CLIENT_ERROR(stmt->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
993 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
994 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
998 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
1001 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1003 if (!stmt->field_count || in MYSQLND_METHOD()
1004 (!stmt->cursor_exists && GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA) || in MYSQLND_METHOD()
1005 (stmt->cursor_exists && GET_CONNECTION_STATE(&conn->state) != CONN_READY) || in MYSQLND_METHOD()
1006 (stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE)) in MYSQLND_METHOD()
1013 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1016 result = stmt->result; in MYSQLND_METHOD()
1018 result->m.use_result(stmt->result, TRUE); in MYSQLND_METHOD()
1019 result->unbuf->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor: in MYSQLND_METHOD()
1021 stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED; in MYSQLND_METHOD()
1035 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_fetch_stmt_row_cursor() local
1036 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_fetch_stmt_row_cursor()
1042 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1046 DBG_INF_FMT("stmt=%lu flags=%u", stmt->stmt_id, flags); in mysqlnd_fetch_stmt_row_cursor()
1048 if (stmt->state < MYSQLND_STMT_USER_FETCHING) { in mysqlnd_fetch_stmt_row_cursor()
1058 SET_EMPTY_ERROR(stmt->error_info); in mysqlnd_fetch_stmt_row_cursor()
1061 int4store(buf, stmt->stmt_id); in mysqlnd_fetch_stmt_row_cursor()
1072 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1081 row_packet->skip_extraction = stmt->result_bind? FALSE:TRUE; in mysqlnd_fetch_stmt_row_cursor()
1083 UPSERT_STATUS_RESET(stmt->upsert_status); in mysqlnd_fetch_stmt_row_cursor()
1108 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_fetch_stmt_row_cursor()
1110 zval *result = &stmt->result_bind[i].zv; in mysqlnd_fetch_stmt_row_cursor()
1120 DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, &stmt->result_bind[i].zv, in mysqlnd_fetch_stmt_row_cursor()
1121 Z_TYPE_P(data), Z_REFCOUNTED(stmt->result_bind[i].zv)? in mysqlnd_fetch_stmt_row_cursor()
1122 Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in mysqlnd_fetch_stmt_row_cursor()
1162 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1165 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1170 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1173 UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1189 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1190 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1193 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1196 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1198 if (!stmt->result || stmt->state < MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1199 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1202 } else if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1205 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1207 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1209 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1212 …DBG_INF_FMT("result_bind=%p separated_once=%u", &stmt->result_bind, stmt->result_zvals_separated_o… in MYSQLND_METHOD()
1217 if (stmt->result_bind && !stmt->result_zvals_separated_once) { in MYSQLND_METHOD()
1223 for (i = 0; i < stmt->result->field_count; i++) { in MYSQLND_METHOD()
1224 if (stmt->result_bind[i].bound == TRUE) { in MYSQLND_METHOD()
1225 zval *result = &stmt->result_bind[i].zv; in MYSQLND_METHOD()
1231 stmt->result_zvals_separated_once = TRUE; in MYSQLND_METHOD()
1234 ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything); in MYSQLND_METHOD()
1245 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1246 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1249 if (!stmt || !conn) { in MYSQLND_METHOD()
1252 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1254 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1257 if (stmt->stmt_id) { in MYSQLND_METHOD()
1258 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD()
1259 if (stmt->param_bind) { in MYSQLND_METHOD()
1263 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1264 if (stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED) { in MYSQLND_METHOD()
1265 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1279 size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD()
1280 …struct st_mysqlnd_protocol_command * command = stmt->conn->command_factory(COM_STMT_RESET, stmt->c… in MYSQLND_METHOD()
1287 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1291 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1304 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1305 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1308 if (!stmt || !conn) { in MYSQLND_METHOD()
1311 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
1313 if (stmt->stmt_id) { in MYSQLND_METHOD()
1320 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
1322 stmt->default_rset_handler(s); in MYSQLND_METHOD()
1323 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD()
1326 if (stmt->result) { in MYSQLND_METHOD()
1328 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
1344 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1345 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1349 if (!stmt || !conn) { in MYSQLND_METHOD()
1352 DBG_INF_FMT("stmt=%lu param_no=%u data_len=%lu", stmt->stmt_id, param_no, data_length); in MYSQLND_METHOD()
1354 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1357 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1358 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1362 if (!stmt->param_bind) { in MYSQLND_METHOD()
1363 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
1367 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1368 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1372 if (stmt->param_bind[param_no].type != MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1373 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_BUFFER_USE, UNKNOWN_SQLSTATE, mysqlnd_not_bound_as_b… in MYSQLND_METHOD()
1382 stmt->param_bind[param_no].flags |= MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1384 int4store(cmd_buf, stmt->stmt_id); in MYSQLND_METHOD()
1397 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1405 SET_OOM_ERROR(stmt->error_info); in MYSQLND_METHOD()
1433 SET_CLIENT_ERROR(stmt->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
1450 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1451 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1454 if (!stmt || !conn) { in MYSQLND_METHOD()
1457 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1459 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1460 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1468 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1471 if (stmt->param_count) { in MYSQLND_METHOD()
1475 …SET_CLIENT_ERROR(stmt->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, "Re-binding (still) … in MYSQLND_METHOD()
1478 } else if (stmt->param_bind) { in MYSQLND_METHOD()
1484 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1489 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
1491 if (stmt->param_bind != param_bind) { in MYSQLND_METHOD()
1492 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
1496 stmt->param_bind = param_bind; in MYSQLND_METHOD()
1497 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
1499 DBG_INF_FMT("%u is of type %u", i, stmt->param_bind[i].type); in MYSQLND_METHOD()
1502 Z_TRY_ADDREF(stmt->param_bind[i].zv); in MYSQLND_METHOD()
1503 stmt->param_bind[i].flags = 0; in MYSQLND_METHOD()
1504 if (stmt->param_bind[i].type == MYSQL_TYPE_LONG_BLOB) { in MYSQLND_METHOD()
1505 stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1508 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1521 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1522 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1525 if (!stmt || !conn) { in MYSQLND_METHOD()
1528 …DBG_INF_FMT("stmt=%lu param_no=%u param_count=%u type=%u", stmt->stmt_id, param_no, stmt->param_co… in MYSQLND_METHOD()
1530 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1531 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1536 if (param_no >= stmt->param_count) { in MYSQLND_METHOD()
1537 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1541 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1544 if (stmt->param_count) { in MYSQLND_METHOD()
1545 if (!stmt->param_bind) { in MYSQLND_METHOD()
1546 stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent); in MYSQLND_METHOD()
1547 if (!stmt->param_bind) { in MYSQLND_METHOD()
1557 zval_ptr_dtor(&stmt->param_bind[param_no].zv); in MYSQLND_METHOD()
1560 stmt->param_bind[param_no].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED; in MYSQLND_METHOD()
1562 ZVAL_COPY_VALUE(&stmt->param_bind[param_no].zv, zv); in MYSQLND_METHOD()
1563 stmt->param_bind[param_no].type = type; in MYSQLND_METHOD()
1565 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1577 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1578 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1581 if (!stmt || !conn) { in MYSQLND_METHOD()
1584 DBG_INF_FMT("stmt=%lu param_count=%u", stmt->stmt_id, stmt->param_count); in MYSQLND_METHOD()
1586 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1587 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1592 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1595 if (stmt->param_count) { in MYSQLND_METHOD()
1596 stmt->send_types_to_server = 1; in MYSQLND_METHOD()
1608 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1609 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1612 if (!stmt || !conn) { in MYSQLND_METHOD()
1615 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1617 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1618 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1626 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1629 if (stmt->field_count) { in MYSQLND_METHOD()
1638 stmt->result_zvals_separated_once = FALSE; in MYSQLND_METHOD()
1639 stmt->result_bind = result_bind; in MYSQLND_METHOD()
1640 for (i = 0; i < stmt->field_count; i++) { in MYSQLND_METHOD()
1642 Z_TRY_ADDREF(stmt->result_bind[i].zv); in MYSQLND_METHOD()
1644 DBG_INF_FMT("ref of %p = %u", &stmt->result_bind[i].zv, in MYSQLND_METHOD()
1645 Z_REFCOUNTED(stmt->result_bind[i].zv)? Z_REFCOUNT(stmt->result_bind[i].zv) : 0); in MYSQLND_METHOD()
1651 stmt->result_bind[i].bound = TRUE; in MYSQLND_METHOD()
1666 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1667 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1670 if (!stmt || !conn) { in MYSQLND_METHOD()
1673 DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1675 if (stmt->state < MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
1676 …SET_CLIENT_ERROR(stmt->error_info, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared… in MYSQLND_METHOD()
1681 if (param_no >= stmt->field_count) { in MYSQLND_METHOD()
1682 …SET_CLIENT_ERROR(stmt->error_info, CR_INVALID_PARAMETER_NO, UNKNOWN_SQLSTATE, "Invalid parameter n… in MYSQLND_METHOD()
1687 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD()
1690 if (stmt->field_count) { in MYSQLND_METHOD()
1693 if (!stmt->result_bind) { in MYSQLND_METHOD()
1694stmt->result_bind = mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent); in MYSQLND_METHOD()
1696stmt->result_bind = mnd_perealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIN… in MYSQLND_METHOD()
1698 if (!stmt->result_bind) { in MYSQLND_METHOD()
1701 ZVAL_NULL(&stmt->result_bind[param_no].zv); in MYSQLND_METHOD()
1707 stmt->result_bind[param_no].bound = TRUE; in MYSQLND_METHOD()
1719 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1720 return stmt? UPSERT_STATUS_GET_LAST_INSERT_ID(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1729 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1730 return stmt? UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1739 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1740 return stmt && stmt->result? mysqlnd_num_rows(stmt->result):0; in MYSQLND_METHOD()
1749 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1750 return stmt? UPSERT_STATUS_GET_WARNINGS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1759 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1760 return stmt? UPSERT_STATUS_GET_SERVER_STATUS(stmt->upsert_status) : 0; in MYSQLND_METHOD()
1769 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1770 return stmt? stmt->field_count : 0; in MYSQLND_METHOD()
1779 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1780 return stmt? stmt->param_count : 0; in MYSQLND_METHOD()
1789 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1790 return stmt? stmt->error_info->error_no : 0; in MYSQLND_METHOD()
1799 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1800 return stmt? stmt->error_info->error : 0; in MYSQLND_METHOD()
1809 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1810 return stmt && stmt->error_info->sqlstate[0] ? stmt->error_info->sqlstate:MYSQLND_SQLSTATE_NULL; in MYSQLND_METHOD()
1819 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1820 return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row) : FAIL; in MYSQLND_METHOD()
1829 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1830 if (!stmt || !stmt->param_count) { in MYSQLND_METHOD()
1842 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1843 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1847 if (!stmt || ! conn) { in MYSQLND_METHOD()
1850 DBG_INF_FMT("stmt=%u field_count=%u", stmt->stmt_id, stmt->field_count); in MYSQLND_METHOD()
1852 if (!stmt->field_count || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1857 if (stmt->update_max_length && stmt->result->stored_data) { in MYSQLND_METHOD()
1859 stmt->result->stored_data->m.initialize_result_set_rest(stmt->result->stored_data, in MYSQLND_METHOD()
1860 stmt->result->meta, in MYSQLND_METHOD()
1871 result_meta = conn->m->result_init(stmt->field_count, stmt->persistent); in MYSQLND_METHOD()
1876 …result_meta->unbuf = mysqlnd_result_unbuffered_init(stmt->field_count, TRUE, result_meta->persiste… in MYSQLND_METHOD()
1881 result_meta->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE); in MYSQLND_METHOD()
1905 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1907 if (!stmt) { in MYSQLND_METHOD()
1910 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1919 stmt->update_max_length = bval? TRUE:FALSE; in MYSQLND_METHOD()
1925 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1929 stmt->flags = ival; in MYSQLND_METHOD()
1937 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1941 stmt->prefetch_rows = ival; in MYSQLND_METHOD()
1945 SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented"); in MYSQLND_METHOD()
1960 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1962 if (!stmt) { in MYSQLND_METHOD()
1965 DBG_INF_FMT("stmt=%lu attr_type=%u", stmt->stmt_id, attr_type); in MYSQLND_METHOD()
1969 *(zend_bool *) value= stmt->update_max_length; in MYSQLND_METHOD()
1972 *(zend_ulong *) value= stmt->flags; in MYSQLND_METHOD()
1975 *(zend_ulong *) value= stmt->prefetch_rows; in MYSQLND_METHOD()
1991 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
1992 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD()
1995 if (!stmt || !conn) { in MYSQLND_METHOD()
1998 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD()
2000 if (!stmt->result) { in MYSQLND_METHOD()
2009 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
2012 stmt->default_rset_handler = s->m->use_result; in MYSQLND_METHOD()
2013 stmt->default_rset_handler(s); in MYSQLND_METHOD()
2016 if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD()
2019 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD()
2027 stmt->result->m.free_result_buffers(stmt->result); in MYSQLND_METHOD()
2030 if (stmt->state > MYSQLND_STMT_PREPARED) { in MYSQLND_METHOD()
2032 stmt->state = MYSQLND_STMT_PREPARED; in MYSQLND_METHOD()
2048 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_separate_result_bind() local
2052 if (!stmt) { in mysqlnd_stmt_separate_result_bind()
2055 …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()
2057 if (!stmt->result_bind) { in mysqlnd_stmt_separate_result_bind()
2066 for (i = 0; i < stmt->field_count; i++) { in mysqlnd_stmt_separate_result_bind()
2068 if (stmt->result_bind[i].bound == TRUE) { in mysqlnd_stmt_separate_result_bind()
2069 …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()
2070 zval_ptr_dtor(&stmt->result_bind[i].zv); in mysqlnd_stmt_separate_result_bind()
2074 s->m->free_result_bind(s, stmt->result_bind); in mysqlnd_stmt_separate_result_bind()
2075 stmt->result_bind = NULL; in mysqlnd_stmt_separate_result_bind()
2086 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in mysqlnd_stmt_separate_one_result_bind() local
2088 if (!stmt) { in mysqlnd_stmt_separate_one_result_bind()
2091 …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()
2093 if (!stmt->result_bind) { in mysqlnd_stmt_separate_one_result_bind()
2103 if (stmt->result_bind[param_no].bound == TRUE) { in mysqlnd_stmt_separate_one_result_bind()
2104 …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()
2105 zval_ptr_dtor(&stmt->result_bind[param_no].zv); in mysqlnd_stmt_separate_one_result_bind()
2117 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2119 if (!stmt) { in MYSQLND_METHOD()
2129 if (stmt->result) { in MYSQLND_METHOD()
2130 stmt->result->m.free_result_internal(stmt->result); in MYSQLND_METHOD()
2131 stmt->result = NULL; in MYSQLND_METHOD()
2133 if (stmt->error_info->error_list) { in MYSQLND_METHOD()
2134 zend_llist_clean(stmt->error_info->error_list); in MYSQLND_METHOD()
2135 mnd_pefree(stmt->error_info->error_list, s->persistent); in MYSQLND_METHOD()
2136 stmt->error_info->error_list = NULL; in MYSQLND_METHOD()
2148 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2150 if (!stmt) { in MYSQLND_METHOD()
2153 …DBG_INF_FMT("stmt=%lu param_bind=%p param_count=%u", stmt->stmt_id, stmt->param_bind, stmt->param_… in MYSQLND_METHOD()
2156 if (stmt->param_bind) { in MYSQLND_METHOD()
2163 for (i = 0; i < stmt->param_count; i++) { in MYSQLND_METHOD()
2168 zval_ptr_dtor(&stmt->param_bind[i].zv); in MYSQLND_METHOD()
2170 s->m->free_parameter_bind(s, stmt->param_bind); in MYSQLND_METHOD()
2171 stmt->param_bind = NULL; in MYSQLND_METHOD()
2184 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD_PRIVATE() local
2185 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE()
2189 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
2192 DBG_INF_FMT("stmt=%lu", stmt->stmt_id); in MYSQLND_METHOD_PRIVATE()
2194 SET_EMPTY_ERROR(stmt->error_info); in MYSQLND_METHOD_PRIVATE()
2203 if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) { in MYSQLND_METHOD_PRIVATE()
2205 stmt->default_rset_handler(s); in MYSQLND_METHOD_PRIVATE()
2206 stmt->state = MYSQLND_STMT_USER_FETCHING; in MYSQLND_METHOD_PRIVATE()
2210 if (stmt->result) { in MYSQLND_METHOD_PRIVATE()
2212 stmt->result->m.skip_result(stmt->result); in MYSQLND_METHOD_PRIVATE()
2219 if (stmt->stmt_id) { in MYSQLND_METHOD_PRIVATE()
2225 size_t stmt_id = stmt->stmt_id; in MYSQLND_METHOD_PRIVATE()
2232 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2240 switch (stmt->execute_count) { in MYSQLND_METHOD_PRIVATE()
2254 if (stmt->execute_cmd_buffer.buffer) { in MYSQLND_METHOD_PRIVATE()
2255 mnd_pefree(stmt->execute_cmd_buffer.buffer, stmt->persistent); in MYSQLND_METHOD_PRIVATE()
2256 stmt->execute_cmd_buffer.buffer = NULL; in MYSQLND_METHOD_PRIVATE()
2263 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2274 MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL; in MYSQLND_METHOD() local
2279 if (stmt) { in MYSQLND_METHOD()
2280 DBG_INF_FMT("stmt=%p", stmt); in MYSQLND_METHOD()
2286 mnd_pefree(stmt, persistent); in MYSQLND_METHOD()
2300 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2302 if (!stmt) { in MYSQLND_METHOD()
2305 DBG_RETURN(mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent)); in MYSQLND_METHOD()
2314 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2316 if (!stmt) { in MYSQLND_METHOD()
2319 DBG_RETURN(mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent)); in MYSQLND_METHOD()
2328 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2329 if (stmt) { in MYSQLND_METHOD()
2330 mnd_pefree(param_bind, stmt->persistent); in MYSQLND_METHOD()
2340 MYSQLND_STMT_DATA * stmt = s? s->data : NULL; in MYSQLND_METHOD() local
2341 if (stmt) { in MYSQLND_METHOD()
2342 mnd_pefree(result_bind, stmt->persistent); in MYSQLND_METHOD()