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 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
134 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
150 COPY_CLIENT_ERROR(conn->error_info, result->stored_data->error_info); in MYSQLND_METHOD()
168 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
172 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
189 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
190 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS); in MYSQLND_METHOD()
199 result = conn->m->result_init(stmt->result->field_count); in MYSQLND_METHOD()
201 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
207 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
211 if (result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY)) { in MYSQLND_METHOD()
216 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
236 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
239 …DBG_RETURN((stmt && conn && (conn->m->get_server_status(conn) & SERVER_MORE_RESULTS_EXISTS))? TRUE… in MYSQLND_METHOD()
249 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
252 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
257 …if (GET_CONNECTION_STATE(&conn->state) != CONN_NEXT_RESULT_PENDING || !(UPSERT_STATUS_GET_SERVER_S… in MYSQLND_METHOD()
261 …%u cursor=%u", UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status), UPSERT_STATUS_GET_SERVER_STAT… in MYSQLND_METHOD()
278 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_skip_metadata() local
286 if (!stmt || !conn) { in mysqlnd_stmt_skip_metadata()
295 conn->payload_decoder_factory->m.init_result_field_packet(&field_packet); in mysqlnd_stmt_skip_metadata()
301 if (FAIL == PACKET_READ(conn, &field_packet)) { in mysqlnd_stmt_skip_metadata()
319 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_read_prepare_response() local
324 if (!stmt || !conn) { in mysqlnd_stmt_read_prepare_response()
329 conn->payload_decoder_factory->m.init_prepare_response_packet(&prepare_resp); in mysqlnd_stmt_read_prepare_response()
331 if (FAIL == PACKET_READ(conn, &prepare_resp)) { in mysqlnd_stmt_read_prepare_response()
337 COPY_CLIENT_ERROR(conn->error_info, prepare_resp.error_info); in mysqlnd_stmt_read_prepare_response()
342 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, prepare_resp.warning_count); in mysqlnd_stmt_read_prepare_response()
344 stmt->field_count = conn->field_count = prepare_resp.field_count; in mysqlnd_stmt_read_prepare_response()
359 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_prepare_read_eof() local
364 if (!stmt || !conn) { in mysqlnd_stmt_prepare_read_eof()
369 conn->payload_decoder_factory->m.init_eof_packet(&fields_eof); in mysqlnd_stmt_prepare_read_eof()
370 if (FAIL == (ret = PACKET_READ(conn, &fields_eof))) { in mysqlnd_stmt_prepare_read_eof()
397 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
400 if (!stmt || !conn) { in MYSQLND_METHOD()
407 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
410 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
416 MYSQLND_STMT * s_to_prepare = conn->m->stmt_init(conn); in MYSQLND_METHOD()
441 ret = conn->command->stmt_prepare(conn, query_string); in MYSQLND_METHOD()
443 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
466 MYSQLND_RES * result = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
468 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
474 result->conn = conn->m->get_reference(conn); in MYSQLND_METHOD()
478 if (FAIL == result->m.read_result_metadata(result, conn) || in MYSQLND_METHOD()
501 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_stmt_execute_parse_response() local
505 if (!stmt || !conn) { in mysqlnd_stmt_execute_parse_response()
508 SET_CONNECTION_STATE(&conn->state, CONN_QUERY_SENT); in mysqlnd_stmt_execute_parse_response()
510 ret = conn->m->query_read_result_set_header(conn, s); in mysqlnd_stmt_execute_parse_response()
512 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
514 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
515 if (GET_CONNECTION_STATE(&conn->state) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
529 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_stmt_execute_parse_response()
530 UPSERT_STATUS_SET_WARNINGS(stmt->upsert_status, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status)); in mysqlnd_stmt_execute_parse_response()
531 …UPSERT_STATUS_SET_AFFECTED_ROWS(stmt->upsert_status, UPSERT_STATUS_GET_AFFECTED_ROWS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
532 …UPSERT_STATUS_SET_SERVER_STATUS(stmt->upsert_status, UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_… in mysqlnd_stmt_execute_parse_response()
533 …UPSERT_STATUS_SET_LAST_INSERT_ID(stmt->upsert_status, UPSERT_STATUS_GET_LAST_INSERT_ID(conn->upser… in mysqlnd_stmt_execute_parse_response()
536 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
542 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
547 stmt->result->conn = conn->m->get_reference(conn); in mysqlnd_stmt_execute_parse_response()
553 if (stmt->result_bind && conn->field_count != stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
554 if (conn->field_count < stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
556 for (unsigned i = conn->field_count; i < stmt->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
561 mnd_erealloc(stmt->result_bind, conn->field_count * sizeof(MYSQLND_RESULT_BIND)); in mysqlnd_stmt_execute_parse_response()
562 if (conn->field_count > stmt->field_count) { in mysqlnd_stmt_execute_parse_response()
564 for (unsigned i = stmt->field_count; i < conn->field_count; i++) { in mysqlnd_stmt_execute_parse_response()
571 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
591 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_execute_parse_response()
630 …if (ret == PASS && conn->last_query_type == QUERY_UPSERT && UPSERT_STATUS_GET_AFFECTED_ROWS(stmt->… in mysqlnd_stmt_execute_parse_response()
631 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, UPSERT_STATUS_GET_AFFECTED_… in mysqlnd_stmt_execute_parse_response()
660 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
667 if (!stmt || !conn) { in MYSQLND_METHOD()
673 UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status); in MYSQLND_METHOD()
721 ret = conn->command->stmt_execute(conn, payload); in MYSQLND_METHOD()
731 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
772 result->conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_buffered()
773 result->conn->stats); in mysqlnd_stmt_fetch_row_buffered()
830 MYSQLND_CONN_DATA * conn = result->conn; in mysqlnd_stmt_fetch_row_unbuffered() local
843 if (GET_CONNECTION_STATE(&conn->state) != CONN_FETCHING_DATA) { in mysqlnd_stmt_fetch_row_unbuffered()
844 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_stmt_fetch_row_unbuffered()
862 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_stmt_fetch_row_unbuffered()
866 result->unbuf->m.free_last_data(result->unbuf, conn->stats); in mysqlnd_stmt_fetch_row_unbuffered()
877 conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_unbuffered()
878 conn->stats)) in mysqlnd_stmt_fetch_row_unbuffered()
899 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); in mysqlnd_stmt_fetch_row_unbuffered()
917 COPY_CLIENT_ERROR(conn->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
922 if (GET_CONNECTION_STATE(&conn->state) != CONN_QUIT_SENT) { in mysqlnd_stmt_fetch_row_unbuffered()
923 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
930 UPSERT_STATUS_RESET(conn->upsert_status); in mysqlnd_stmt_fetch_row_unbuffered()
931 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_stmt_fetch_row_unbuffered()
932 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_stmt_fetch_row_unbuffered()
938 if (UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status) & SERVER_MORE_RESULTS_EXISTS) { in mysqlnd_stmt_fetch_row_unbuffered()
939 SET_CONNECTION_STATE(&conn->state, CONN_NEXT_RESULT_PENDING); in mysqlnd_stmt_fetch_row_unbuffered()
941 SET_CONNECTION_STATE(&conn->state, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
959 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
963 if (!stmt || !conn || !stmt->result) { in MYSQLND_METHOD()
969 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in MYSQLND_METHOD()
976 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
997 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in mysqlnd_fetch_stmt_row_cursor() local
1002 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1010 …SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync); in mysqlnd_fetch_stmt_row_cursor()
1019 SET_EMPTY_ERROR(conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1029 if (PASS == (ret = PACKET_READ(conn, row_packet)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
1034 result->unbuf->m.free_last_data(result->unbuf, conn->stats); in mysqlnd_fetch_stmt_row_cursor()
1045 conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
1046 conn->stats)) in mysqlnd_fetch_stmt_row_cursor()
1084 ret = PACKET_READ(conn, row_packet); in mysqlnd_fetch_stmt_row_cursor()
1090 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
1097 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1100 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1105 UPSERT_STATUS_SET_WARNINGS(conn->upsert_status, row_packet->warning_count); in mysqlnd_fetch_stmt_row_cursor()
1108 UPSERT_STATUS_SET_SERVER_STATUS(conn->upsert_status, row_packet->server_status); in mysqlnd_fetch_stmt_row_cursor()
1124 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1127 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1144 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1158 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1161 if (!stmt || !conn) { in MYSQLND_METHOD()
1167 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1170 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
1190 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1193 ret = stmt->conn->command->stmt_reset(stmt->conn, stmt_id); in MYSQLND_METHOD()
1195 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1198 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1212 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1215 if (!stmt || !conn) { in MYSQLND_METHOD()
1252 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1256 if (!stmt || !conn) { in MYSQLND_METHOD()
1262 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1285 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD()
1299 ret = conn->command->stmt_send_long_data(conn, payload); in MYSQLND_METHOD()
1301 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1309 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1331 …if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, C… in MYSQLND_METHOD()
1354 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1357 if (!stmt || !conn) { in MYSQLND_METHOD()
1372 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1425 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1428 if (!stmt || !conn) { in MYSQLND_METHOD()
1445 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1481 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1484 if (!stmt || !conn) { in MYSQLND_METHOD()
1496 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1512 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1515 if (!stmt || !conn) { in MYSQLND_METHOD()
1530 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1569 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1572 if (!stmt || !conn) { in MYSQLND_METHOD()
1590 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD()
1736 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1740 if (!stmt || ! conn) { in MYSQLND_METHOD()
1754 conn->stats, in MYSQLND_METHOD()
1755 conn->options->int_and_float_native); in MYSQLND_METHOD()
1764 result_meta = conn->m->result_init(stmt->field_count); in MYSQLND_METHOD()
1783 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1885 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD() local
1888 if (!stmt || !conn) { in MYSQLND_METHOD()
2039 MYSQLND_CONN_DATA * conn = stmt? stmt->conn : NULL; in MYSQLND_METHOD_PRIVATE() local
2043 if (!stmt || !conn) { in MYSQLND_METHOD_PRIVATE()
2049 SET_EMPTY_ERROR(conn->error_info); in MYSQLND_METHOD_PRIVATE()
2077 if (GET_CONNECTION_STATE(&conn->state) == CONN_READY) { in MYSQLND_METHOD_PRIVATE()
2081 ret = conn->command->stmt_close(conn, stmt_id); in MYSQLND_METHOD_PRIVATE()
2083 COPY_CLIENT_ERROR(stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2099 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
2109 if (conn) { in MYSQLND_METHOD_PRIVATE()
2110 conn->m->free_reference(conn); in MYSQLND_METHOD_PRIVATE()
2111 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()