Lines Matching refs:conn

61 	MYSQLND_CONN_DATA * conn;  in MYSQLND_METHOD()  local
65 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
70 conn = stmt->conn; in MYSQLND_METHOD()
83 if (CONN_GET_STATE(conn) != CONN_FETCHING_DATA || in MYSQLND_METHOD()
86 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
94 SET_EMPTY_ERROR(*conn->error_info); in MYSQLND_METHOD()
95 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PS_BUFFERED_SETS); in MYSQLND_METHOD()
105 ret = result->m.store_result_fetch_data(conn, result, result->meta, TRUE TSRMLS_CC); in MYSQLND_METHOD()
113 COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info); in MYSQLND_METHOD()
130 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
134 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
139 conn = stmt->conn; in MYSQLND_METHOD()
152 …if (CONN_GET_STATE(conn) != CONN_FETCHING_DATA || stmt->state != MYSQLND_STMT_WAITING_USE_OR_STORE… in MYSQLND_METHOD()
153 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
159 SET_EMPTY_ERROR(*conn->error_info); in MYSQLND_METHOD()
160 MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS); in MYSQLND_METHOD()
163 result = conn->m->result_init(stmt->result->field_count, stmt->persistent TSRMLS_CC); in MYSQLND_METHOD()
165 SET_OOM_ERROR(*conn->error_info); in MYSQLND_METHOD()
171 SET_OOM_ERROR(*conn->error_info); in MYSQLND_METHOD()
175 if ((result = result->m.store_result(result, conn, TRUE TSRMLS_CC))) { in MYSQLND_METHOD()
180 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
202 …DBG_RETURN((stmt && stmt->conn && (stmt->conn->m->get_server_status(stmt->conn TSRMLS_CC) & SERVER… in MYSQLND_METHOD()
214 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
217 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
220 conn = stmt->conn; in MYSQLND_METHOD()
223 …if (CONN_GET_STATE(conn) != CONN_NEXT_RESULT_PENDING || !(conn->upsert_status->server_status & SER… in MYSQLND_METHOD()
250 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_skip_metadata()
255 …field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE TSRMLS_… in mysqlnd_stmt_skip_metadata()
258 SET_OOM_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_skip_metadata()
263 if (FAIL == PACKET_READ(field_packet, stmt->conn)) { in mysqlnd_stmt_skip_metadata()
285 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_read_prepare_response()
290 …prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE TSR… in mysqlnd_stmt_read_prepare_response()
293 SET_OOM_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_read_prepare_response()
297 if (FAIL == PACKET_READ(prepare_resp, stmt->conn)) { in mysqlnd_stmt_read_prepare_response()
303 COPY_CLIENT_ERROR(*stmt->conn->error_info, prepare_resp->error_info); in mysqlnd_stmt_read_prepare_response()
308 stmt->warning_count = stmt->conn->upsert_status->warning_count = prepare_resp->warning_count; in mysqlnd_stmt_read_prepare_response()
309 stmt->field_count = stmt->conn->field_count = prepare_resp->field_count; in mysqlnd_stmt_read_prepare_response()
328 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_prepare_read_eof()
333 fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE TSRMLS_CC); in mysqlnd_stmt_prepare_read_eof()
336 SET_OOM_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_prepare_read_eof()
338 if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) { in mysqlnd_stmt_prepare_read_eof()
367 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
374 SET_ERROR_AFF_ROWS(stmt->conn); in MYSQLND_METHOD()
377 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
394 s_to_prepare = stmt->conn->m->stmt_init(stmt->conn TSRMLS_CC); in MYSQLND_METHOD()
401 …if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (con… in MYSQLND_METHOD()
421 …MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->p… in MYSQLND_METHOD()
423 SET_OOM_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
429 result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn TSRMLS_CC); in MYSQLND_METHOD()
433 if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn TSRMLS_CC) || in MYSQLND_METHOD()
477 MYSQLND_CONN_DATA * conn; in mysqlnd_stmt_execute_parse_response() local
480 if (!stmt || !stmt->conn) { in mysqlnd_stmt_execute_parse_response()
483 conn = stmt->conn; in mysqlnd_stmt_execute_parse_response()
484 CONN_SET_STATE(conn, CONN_QUERY_SENT); in mysqlnd_stmt_execute_parse_response()
486 ret = mysqlnd_query_read_result_set_header(stmt->conn, s TSRMLS_CC); in mysqlnd_stmt_execute_parse_response()
488 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
490 stmt->upsert_status->affected_rows = conn->upsert_status->affected_rows; in mysqlnd_stmt_execute_parse_response()
491 if (CONN_GET_STATE(conn) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
505 SET_EMPTY_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_execute_parse_response()
506 *stmt->upsert_status = *conn->upsert_status; /* copy status */ in mysqlnd_stmt_execute_parse_response()
508 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
514 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
519 stmt->result->conn = stmt->conn->m->get_reference(stmt->conn TSRMLS_CC); in mysqlnd_stmt_execute_parse_response()
523 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
538 CONN_SET_STATE(conn, CONN_READY); in mysqlnd_stmt_execute_parse_response()
586 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
592 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
595 conn = stmt->conn; in MYSQLND_METHOD()
599 SET_ERROR_AFF_ROWS(stmt->conn); in MYSQLND_METHOD()
645 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
680 ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, request, request_len, in MYSQLND_METHOD()
692 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
702 if (ret == PASS && conn->last_query_type == QUERY_UPSERT && stmt->upsert_status->affected_rows) { in MYSQLND_METHOD()
703 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, stmt->upsert_status->affect… in MYSQLND_METHOD()
739 result->conn->options->numeric_and_datetime_as_unicode, in mysqlnd_stmt_fetch_row_buffered()
740 result->conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_buffered()
741 result->conn->stats TSRMLS_CC); in mysqlnd_stmt_fetch_row_buffered()
826 if (CONN_GET_STATE(result->conn) != CONN_FETCHING_DATA) { in mysqlnd_stmt_fetch_row_unbuffered()
827 SET_CLIENT_ERROR(*result->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in mysqlnd_stmt_fetch_row_unbuffered()
843 if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { in mysqlnd_stmt_fetch_row_unbuffered()
858 result->conn->options->numeric_and_datetime_as_unicode, in mysqlnd_stmt_fetch_row_unbuffered()
859 result->conn->options->int_and_float_native, in mysqlnd_stmt_fetch_row_unbuffered()
860 result->conn->stats TSRMLS_CC)) in mysqlnd_stmt_fetch_row_unbuffered()
892 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); in mysqlnd_stmt_fetch_row_unbuffered()
909 COPY_CLIENT_ERROR(*stmt->conn->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
912 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
918 memset(result->conn->upsert_status, 0, sizeof(*result->conn->upsert_status)); in mysqlnd_stmt_fetch_row_unbuffered()
919 result->conn->upsert_status->warning_count = row_packet->warning_count; in mysqlnd_stmt_fetch_row_unbuffered()
920 result->conn->upsert_status->server_status = row_packet->server_status; in mysqlnd_stmt_fetch_row_unbuffered()
925 if (result->conn->upsert_status->server_status & SERVER_MORE_RESULTS_EXISTS) { in mysqlnd_stmt_fetch_row_unbuffered()
926 CONN_SET_STATE(result->conn, CONN_NEXT_RESULT_PENDING); in mysqlnd_stmt_fetch_row_unbuffered()
928 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
944 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
947 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
952 conn = stmt->conn; in MYSQLND_METHOD()
955 (!stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_FETCHING_DATA) || in MYSQLND_METHOD()
956 (stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_READY) || in MYSQLND_METHOD()
959 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
967 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
995 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1004 SET_CLIENT_ERROR(*stmt->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in mysqlnd_fetch_stmt_row_cursor()
1014 SET_EMPTY_ERROR(*stmt->conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1019 if (FAIL == stmt->conn->m->simple_command(stmt->conn, COM_STMT_FETCH, buf, sizeof(buf), in mysqlnd_fetch_stmt_row_cursor()
1022 COPY_CLIENT_ERROR(*stmt->error_info, *stmt->conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1029 if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
1044 result->conn->options->numeric_and_datetime_as_unicode, in mysqlnd_fetch_stmt_row_cursor()
1045 result->conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
1046 result->conn->stats TSRMLS_CC)) in mysqlnd_fetch_stmt_row_cursor()
1092 ret = PACKET_READ(row_packet, result->conn); in mysqlnd_fetch_stmt_row_cursor()
1097 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
1105 stmt->conn->upsert_status->warning_count = in mysqlnd_fetch_stmt_row_cursor()
1109 stmt->conn->upsert_status->server_status = in mysqlnd_fetch_stmt_row_cursor()
1115 stmt->conn->upsert_status->warning_count = in mysqlnd_fetch_stmt_row_cursor()
1118 stmt->conn->upsert_status->server_status = in mysqlnd_fetch_stmt_row_cursor()
1137 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1156 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1193 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1199 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1202 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
1223 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD()
1224 FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf, in MYSQLND_METHOD()
1227 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1229 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1245 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1282 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
1287 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1292 conn = stmt->conn; in MYSQLND_METHOD()
1295 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1328 if (CONN_GET_STATE(conn) == CONN_READY) { in MYSQLND_METHOD()
1339 ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC); in MYSQLND_METHOD()
1342 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1347 SET_OOM_ERROR(*conn->error_info); in MYSQLND_METHOD()
1369 if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd TSRMLS_CC))) { in MYSQLND_METHOD()
1393 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1408 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1464 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1481 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1520 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1532 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1549 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1564 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1603 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1621 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1784 if (!stmt->field_count || !stmt->conn || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1803 result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent TSRMLS_CC); in MYSQLND_METHOD()
1823 SET_OOM_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1926 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1967 CONN_SET_STATE(stmt->conn, CONN_READY); in MYSQLND_METHOD()
2154 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD_PRIVATE() local
2159 if (!stmt || !stmt->conn) { in MYSQLND_METHOD_PRIVATE()
2164 conn = stmt->conn; in MYSQLND_METHOD_PRIVATE()
2167 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD_PRIVATE()
2196 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD_PRIVATE()
2197 FAIL == conn->m->simple_command(conn, COM_STMT_CLOSE, cmd_buf, sizeof(cmd_buf), in MYSQLND_METHOD_PRIVATE()
2200 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2215 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
2225 if (stmt->conn) { in MYSQLND_METHOD_PRIVATE()
2226 stmt->conn->m->free_reference(stmt->conn TSRMLS_CC); in MYSQLND_METHOD_PRIVATE()
2227 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2368 _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC) in _mysqlnd_stmt_init()
2372 …ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn TSRMLS_C… in _mysqlnd_stmt_init()