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()
694 ret = conn->command->stmt_execute(conn, payload); in MYSQLND_METHOD()
704 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
720 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
724 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
730 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
737 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
758 MYSQLND_CONN_DATA * conn = stmt->conn; in mysqlnd_fetch_stmt_row_cursor() local
764 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
772 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_fetch_stmt_row_cursor()
781 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
792 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
802 conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
803 conn->stats)) in mysqlnd_fetch_stmt_row_cursor()
814 ret = PACKET_READ(conn, row_packet); in mysqlnd_fetch_stmt_row_cursor()
815 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
822 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
825 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
830 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
833 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
852 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
855 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
872 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
903 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
906 if (!stmt || !conn) { in MYSQLND_METHOD()
912 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
915 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
935 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
938 ret = stmt->conn->command->stmt_reset(stmt->conn, stmt_id); in MYSQLND_METHOD()
940 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
943 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
957 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
960 if (!stmt || !conn) { in MYSQLND_METHOD()
997 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1001 if (!stmt || !conn) { in MYSQLND_METHOD()
1007 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1030 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1044 ret = conn->command->stmt_send_long_data(conn, payload); in MYSQLND_METHOD()
1046 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1054 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1076 …if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, C… in MYSQLND_METHOD()
1099 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1102 if (!stmt || !conn) { in MYSQLND_METHOD()
1117 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1172 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1175 if (!stmt || !conn) { in MYSQLND_METHOD()
1192 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1228 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1231 if (!stmt || !conn) { in MYSQLND_METHOD()
1243 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1259 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1262 if (!stmt || !conn) { in MYSQLND_METHOD()
1277 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1316 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1319 if (!stmt || !conn) { in MYSQLND_METHOD()
1337 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1470 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1474 if (!stmt || ! conn) { in MYSQLND_METHOD()
1491 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1510 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1614 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1617 if (!stmt || !conn) { in MYSQLND_METHOD()
1768 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE() local
1772 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
1778 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD_PRIVATE()
1806 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD_PRIVATE()
1810 ret = conn->command->stmt_close(conn, stmt_id); in MYSQLND_METHOD_PRIVATE()
1812 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
1828 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
1838 if (conn) { in MYSQLND_METHOD_PRIVATE()
1839 conn->m->free_reference(conn); in MYSQLND_METHOD_PRIVATE()
1840 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()