Lines Matching refs:conn
46 MYSQLND_CONN_DATA *conn = stmt->conn; in mysqlnd_stmt_send_cursor_fetch_command() local
53 if (conn->command->stmt_fetch(conn, payload) == FAIL) { in mysqlnd_stmt_send_cursor_fetch_command()
54 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_send_cursor_fetch_command()
62 const MYSQLND_CONN_DATA *conn = stmt->conn; in mysqlnd_stmt_check_state() local
67 return GET_CONNECTION_STATE(&conn->state) == CONN_READY; in mysqlnd_stmt_check_state()
69 return GET_CONNECTION_STATE(&conn->state) == CONN_FETCHING_DATA; in mysqlnd_stmt_check_state()
79 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
83 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
102 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
103 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_BUFFERED_SETS); in MYSQLND_METHOD()
117 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
121 …ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buff… in MYSQLND_METHOD()
131 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
137 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
153 COPY_CLIENT_ERROR(conn->error_info, result->stored_data->error_info); in MYSQLND_METHOD()
171 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
175 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
192 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
193 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS); in MYSQLND_METHOD()
202 result = conn->m->result_init(stmt->result->field_count); in MYSQLND_METHOD()
204 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
210 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
214 if (result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY)) { in MYSQLND_METHOD()
219 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
239 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
242 …DBG_RETURN((stmt && conn && (conn->m->get_server_status(conn) & SERVER_MORE_RESULTS_EXISTS))? TRUE… in MYSQLND_METHOD()
252 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
255 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
260 …if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING || !(UPSERT_STATUS_GET_SERVER_S… in MYSQLND_METHOD()
264 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in MYSQLND_METHOD()
281 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_skip_metadata() local
289 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
298 conn->payload_decoder_factory->m.init_result_field_packet(&field_packet); in mysqlnd_stmt_skip_metadata()
304 if (FAIL == PACKET_READ(conn, &field_packet)) { in mysqlnd_stmt_skip_metadata()
322 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response() local
327 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
332 conn->payload_decoder_factory->m.init_prepare_response_packet(&prepare_resp); in mysqlnd_stmt_read_prepare_response()
334 if (FAIL == PACKET_READ(conn, &prepare_resp)) { in mysqlnd_stmt_read_prepare_response()
340 COPY_CLIENT_ERROR(conn->error_info, prepare_resp.error_info); in mysqlnd_stmt_read_prepare_response()
345 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, prepare_resp.warning_count); in mysqlnd_stmt_read_prepare_response()
347 stmt->field_count = conn->field_count = prepare_resp.field_count; in mysqlnd_stmt_read_prepare_response()
362 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof() local
367 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
372 conn->payload_decoder_factory->m.init_eof_packet(&fields_eof); in mysqlnd_stmt_prepare_read_eof()
373 if (FAIL == (ret = PACKET_READ(conn, &fields_eof))) { in mysqlnd_stmt_prepare_read_eof()
400 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
405 if (!stmt || !conn) { in MYSQLND_METHOD()
412 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
415 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
432 s_to_prepare = conn->m->stmt_init(conn); in MYSQLND_METHOD()
443 ret = conn->command->stmt_prepare(conn, query_string); in MYSQLND_METHOD()
445 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
468 MYSQLND_RES * result = conn->m->result_init(stmt_to_prepare->field_count); in MYSQLND_METHOD()
470 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
476 result->conn = conn->m->get_reference(conn); in MYSQLND_METHOD()
480 if (FAIL == result->m.read_result_metadata(result, conn) || in MYSQLND_METHOD()
523 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response() local
527 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
530 SET_CONNECTION_STATE(&conn->state, CONN_QUERY_SENT); in mysqlnd_stmt_execute_parse_response()
532 ret = conn->m->query_read_result_set_header(conn, s); in mysqlnd_stmt_execute_parse_response()
534 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
536 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
537 if (GET_CONNECTION_STATE(&conn->state) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
551 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_stmt_execute_parse_response()
552 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
553 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
554 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
555 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
558 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
564 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
569 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
573 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
593 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_execute_parse_response()
632 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
633 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_… in mysqlnd_stmt_execute_parse_response()
662 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
669 if (!stmt || !conn) { in MYSQLND_METHOD()
675 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
723 ret = conn->command->stmt_execute(conn, payload); in MYSQLND_METHOD()
733 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
774 result->conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_buffered()
775 result->conn->stats); in mysqlnd_stmt_fetch_row_buffered()
832 MYSQLND_CONN_DATA * conn = result->conn; in mysqlnd_stmt_fetch_row_unbuffered() local
845 if (GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA) { in mysqlnd_stmt_fetch_row_unbuffered()
846 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_stmt_fetch_row_unbuffered()
864 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_stmt_fetch_row_unbuffered()
868 result->unbuf->m.free_last_data(result->unbuf, conn->stats); in mysqlnd_stmt_fetch_row_unbuffered()
879 conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_unbuffered()
880 conn->stats)) in mysqlnd_stmt_fetch_row_unbuffered()
901 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); in mysqlnd_stmt_fetch_row_unbuffered()
919 COPY_CLIENT_ERROR(conn->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
924 if (GET_CONNECTION_STATE(&conn->state) != CONN_QUIT_SENT) { in mysqlnd_stmt_fetch_row_unbuffered()
925 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
932 UPSERT_STATUS_RESET(conn->upsert_status); in mysqlnd_stmt_fetch_row_unbuffered()
933 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_stmt_fetch_row_unbuffered()
934 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_stmt_fetch_row_unbuffered()
940 if (UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_MORE_RESULTS_EXISTS) { in mysqlnd_stmt_fetch_row_unbuffered()
941 SET_CONNECTION_STATE(&conn->state, CONN_NEXT_RESULT_PENDING); in mysqlnd_stmt_fetch_row_unbuffered()
943 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
961 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
965 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
971 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
978 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
999 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_fetch_stmt_row_cursor() local
1004 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1012 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_fetch_stmt_row_cursor()
1021 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1031 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
1036 result->unbuf->m.free_last_data(result->unbuf, conn->stats); in mysqlnd_fetch_stmt_row_cursor()
1047 conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
1048 conn->stats)) in mysqlnd_fetch_stmt_row_cursor()
1086 ret = PACKET_READ(conn, row_packet); in mysqlnd_fetch_stmt_row_cursor()
1092 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
1099 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1102 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1107 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1110 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1126 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1129 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1146 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1160 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1163 if (!stmt || !conn) { in MYSQLND_METHOD()
1169 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1172 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
1192 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1195 ret = stmt->conn->command->stmt_reset(stmt->conn, stmt_id); in MYSQLND_METHOD()
1197 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1200 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1214 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1217 if (!stmt || !conn) { in MYSQLND_METHOD()
1254 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1258 if (!stmt || !conn) { in MYSQLND_METHOD()
1264 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1287 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1301 ret = conn->command->stmt_send_long_data(conn, payload); in MYSQLND_METHOD()
1303 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1311 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1333 …if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, C… in MYSQLND_METHOD()
1356 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1359 if (!stmt || !conn) { in MYSQLND_METHOD()
1374 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1427 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1430 if (!stmt || !conn) { in MYSQLND_METHOD()
1447 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1483 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1486 if (!stmt || !conn) { in MYSQLND_METHOD()
1498 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1514 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1517 if (!stmt || !conn) { in MYSQLND_METHOD()
1532 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1571 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1574 if (!stmt || !conn) { in MYSQLND_METHOD()
1592 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1747 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1751 if (!stmt || ! conn) { in MYSQLND_METHOD()
1765 conn->stats, in MYSQLND_METHOD()
1766 conn->options->int_and_float_native); in MYSQLND_METHOD()
1775 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1794 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1896 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1899 if (!stmt || !conn) { in MYSQLND_METHOD()
1939 if (GET_CONNECTION_STATE(&conn->state) != CONN_QUIT_SENT) { in MYSQLND_METHOD()
1940 SET_CONNECTION_STATE(&conn->state, CONN_READY); in MYSQLND_METHOD()
2085 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE() local
2089 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
2095 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD_PRIVATE()
2123 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD_PRIVATE()
2127 ret = conn->command->stmt_close(conn, stmt_id); in MYSQLND_METHOD_PRIVATE()
2129 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2145 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
2155 if (conn) { in MYSQLND_METHOD_PRIVATE()
2156 conn->m->free_reference(conn); in MYSQLND_METHOD_PRIVATE()
2157 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()