Lines Matching refs:conn

43 	MYSQLND_CONN_DATA *conn = stmt->conn;  in mysqlnd_stmt_send_cursor_fetch_command()  local
50 if (conn->command->stmt_fetch(conn, payload) == FAIL) { in mysqlnd_stmt_send_cursor_fetch_command()
51 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_send_cursor_fetch_command()
59 const MYSQLND_CONN_DATA *conn = stmt->conn; in mysqlnd_stmt_check_state() local
64 return GET_CONNECTION_STATE(&conn->state) == CONN_READY; in mysqlnd_stmt_check_state()
66 return GET_CONNECTION_STATE(&conn->state) == CONN_FETCHING_DATA; in mysqlnd_stmt_check_state()
76 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
80 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
99 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
100 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_BUFFERED_SETS); in MYSQLND_METHOD()
114 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
118 …ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buff… in MYSQLND_METHOD()
128 COPY_CLIENT_ERROR(conn->error_info, result->stored_data->error_info); in MYSQLND_METHOD()
146 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
150 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
167 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
168 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS); in MYSQLND_METHOD()
177 result = conn->m->result_init(stmt->result->field_count); in MYSQLND_METHOD()
179 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
185 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
189 if (result->m.store_result(result, conn, stmt)) { in MYSQLND_METHOD()
194 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
214 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
217 …DBG_RETURN((stmt && conn && (conn->m->get_server_status(conn) & SERVER_MORE_RESULTS_EXISTS))? TRUE… in MYSQLND_METHOD()
227 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
230 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
235 …if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING || !(UPSERT_STATUS_GET_SERVER_S… in MYSQLND_METHOD()
239 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in MYSQLND_METHOD()
256 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_skip_metadata() local
264 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
273 conn->payload_decoder_factory->m.init_result_field_packet(&field_packet); in mysqlnd_stmt_skip_metadata()
279 if (FAIL == PACKET_READ(conn, &field_packet)) { in mysqlnd_stmt_skip_metadata()
297 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response() local
302 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
307 conn->payload_decoder_factory->m.init_prepare_response_packet(&prepare_resp); in mysqlnd_stmt_read_prepare_response()
309 if (FAIL == PACKET_READ(conn, &prepare_resp)) { in mysqlnd_stmt_read_prepare_response()
315 COPY_CLIENT_ERROR(conn->error_info, prepare_resp.error_info); in mysqlnd_stmt_read_prepare_response()
320 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, prepare_resp.warning_count); in mysqlnd_stmt_read_prepare_response()
322 stmt->field_count = conn->field_count = prepare_resp.field_count; in mysqlnd_stmt_read_prepare_response()
337 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof() local
342 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
347 conn->payload_decoder_factory->m.init_eof_packet(&fields_eof); in mysqlnd_stmt_prepare_read_eof()
348 if (FAIL == (ret = PACKET_READ(conn, &fields_eof))) { in mysqlnd_stmt_prepare_read_eof()
375 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
378 if (!stmt || !conn) { in MYSQLND_METHOD()
385 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
388 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
394 MYSQLND_STMT * s_to_prepare = conn->m->stmt_init(conn); in MYSQLND_METHOD()
419 ret = conn->command->stmt_prepare(conn, query_string); in MYSQLND_METHOD()
421 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
444 MYSQLND_RES * result = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
446 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
452 result->conn = conn->m->get_reference(conn); in MYSQLND_METHOD()
456 if (FAIL == result->m.read_result_metadata(result, conn) || in MYSQLND_METHOD()
479 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response() local
483 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
486 SET_CONNECTION_STATE(&conn->state, CONN_QUERY_SENT); in mysqlnd_stmt_execute_parse_response()
488 ret = conn->m->query_read_result_set_header(conn, s); in mysqlnd_stmt_execute_parse_response()
490 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
492 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
493 if (GET_CONNECTION_STATE(&conn->state) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
507 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_stmt_execute_parse_response()
508 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
509 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
510 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
511 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
514 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
520 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
525 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
531 if (stmt->result_bind && conn->field_count != stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
532 if (conn->field_count < stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
534 for (unsigned i = conn->field_count; i < stmt->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
539 mnd_erealloc(stmt->result_bind, conn->field_count * sizeof(MYSQLND_RESULT_BIND)); in mysqlnd_stmt_execute_parse_response()
540 if (conn->field_count > stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
542 for (unsigned i = stmt->field_count; i < conn->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
549 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
564 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_execute_parse_response()
603 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
604 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_… in mysqlnd_stmt_execute_parse_response()
633 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
640 if (!stmt || !conn) { in MYSQLND_METHOD()
646 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
697 ret = conn->command->stmt_execute(conn, payload); in MYSQLND_METHOD()
707 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
723 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
727 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
733 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
740 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
761 MYSQLND_CONN_DATA * conn = stmt->conn; in mysqlnd_fetch_stmt_row_cursor() local
767 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
775 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_fetch_stmt_row_cursor()
784 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
795 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
805 conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
806 conn->stats)) in mysqlnd_fetch_stmt_row_cursor()
817 ret = PACKET_READ(conn, row_packet); in mysqlnd_fetch_stmt_row_cursor()
818 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
825 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
828 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
833 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
836 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
855 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
858 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
875 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
906 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
909 if (!stmt || !conn) { in MYSQLND_METHOD()
915 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
918 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
938 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
941 ret = stmt->conn->command->stmt_reset(stmt->conn, stmt_id); in MYSQLND_METHOD()
943 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
946 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
960 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
963 if (!stmt || !conn) { in MYSQLND_METHOD()
1000 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1004 if (!stmt || !conn) { in MYSQLND_METHOD()
1010 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1033 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1047 ret = conn->command->stmt_send_long_data(conn, payload); in MYSQLND_METHOD()
1049 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1057 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1079 …if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, C… in MYSQLND_METHOD()
1102 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1105 if (!stmt || !conn) { in MYSQLND_METHOD()
1120 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1175 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1178 if (!stmt || !conn) { in MYSQLND_METHOD()
1195 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1231 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1234 if (!stmt || !conn) { in MYSQLND_METHOD()
1246 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1262 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1265 if (!stmt || !conn) { in MYSQLND_METHOD()
1280 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1319 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1322 if (!stmt || !conn) { in MYSQLND_METHOD()
1340 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1473 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1477 if (!stmt || ! conn) { in MYSQLND_METHOD()
1494 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1513 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1617 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1620 if (!stmt || !conn) { in MYSQLND_METHOD()
1771 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE() local
1775 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
1781 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD_PRIVATE()
1809 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD_PRIVATE()
1813 ret = conn->command->stmt_close(conn, stmt_id); in MYSQLND_METHOD_PRIVATE()
1815 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
1831 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
1841 if (conn) { in MYSQLND_METHOD_PRIVATE()
1842 conn->m->free_reference(conn); in MYSQLND_METHOD_PRIVATE()
1843 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()