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()
329 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_prepare_read_eof()
334 fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE TSRMLS_CC); in mysqlnd_stmt_prepare_read_eof()
337 SET_OOM_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_prepare_read_eof()
339 if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) { in mysqlnd_stmt_prepare_read_eof()
368 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
375 SET_ERROR_AFF_ROWS(stmt->conn); in MYSQLND_METHOD()
378 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
395 s_to_prepare = stmt->conn->m->stmt_init(stmt->conn TSRMLS_CC); in MYSQLND_METHOD()
402 …if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (con… in MYSQLND_METHOD()
422 …MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->p… in MYSQLND_METHOD()
424 SET_OOM_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
430 result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn TSRMLS_CC); in MYSQLND_METHOD()
434 if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn TSRMLS_CC) || in MYSQLND_METHOD()
478 MYSQLND_CONN_DATA * conn; in mysqlnd_stmt_execute_parse_response() local
481 if (!stmt || !stmt->conn) { in mysqlnd_stmt_execute_parse_response()
484 conn = stmt->conn; in mysqlnd_stmt_execute_parse_response()
485 CONN_SET_STATE(conn, CONN_QUERY_SENT); in mysqlnd_stmt_execute_parse_response()
487 ret = mysqlnd_query_read_result_set_header(stmt->conn, s TSRMLS_CC); in mysqlnd_stmt_execute_parse_response()
489 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in mysqlnd_stmt_execute_parse_response()
491 stmt->upsert_status->affected_rows = conn->upsert_status->affected_rows; in mysqlnd_stmt_execute_parse_response()
492 if (CONN_GET_STATE(conn) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
506 SET_EMPTY_ERROR(*stmt->conn->error_info); in mysqlnd_stmt_execute_parse_response()
507 *stmt->upsert_status = *conn->upsert_status; /* copy status */ in mysqlnd_stmt_execute_parse_response()
509 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
515 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
520 stmt->result->conn = stmt->conn->m->get_reference(stmt->conn TSRMLS_CC); in mysqlnd_stmt_execute_parse_response()
524 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
539 CONN_SET_STATE(conn, CONN_READY); in mysqlnd_stmt_execute_parse_response()
587 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
593 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
596 conn = stmt->conn; in MYSQLND_METHOD()
600 SET_ERROR_AFF_ROWS(stmt->conn); in MYSQLND_METHOD()
646 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
681 ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, request, request_len, in MYSQLND_METHOD()
693 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
703 if (ret == PASS && conn->last_query_type == QUERY_UPSERT && stmt->upsert_status->affected_rows) { in MYSQLND_METHOD()
704 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, stmt->upsert_status->affect… in MYSQLND_METHOD()
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->int_and_float_native, in mysqlnd_stmt_fetch_row_unbuffered()
859 result->conn->stats TSRMLS_CC)) in mysqlnd_stmt_fetch_row_unbuffered()
884 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); in mysqlnd_stmt_fetch_row_unbuffered()
901 COPY_CLIENT_ERROR(*stmt->conn->error_info, row_packet->error_info); in mysqlnd_stmt_fetch_row_unbuffered()
904 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
910 memset(result->conn->upsert_status, 0, sizeof(*result->conn->upsert_status)); in mysqlnd_stmt_fetch_row_unbuffered()
911 result->conn->upsert_status->warning_count = row_packet->warning_count; in mysqlnd_stmt_fetch_row_unbuffered()
912 result->conn->upsert_status->server_status = row_packet->server_status; in mysqlnd_stmt_fetch_row_unbuffered()
917 if (result->conn->upsert_status->server_status & SERVER_MORE_RESULTS_EXISTS) { in mysqlnd_stmt_fetch_row_unbuffered()
918 CONN_SET_STATE(result->conn, CONN_NEXT_RESULT_PENDING); in mysqlnd_stmt_fetch_row_unbuffered()
920 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
936 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
939 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
944 conn = stmt->conn; in MYSQLND_METHOD()
947 (!stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_FETCHING_DATA) || in MYSQLND_METHOD()
948 (stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_READY) || in MYSQLND_METHOD()
951 SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
959 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
987 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
996 SET_CLIENT_ERROR(*stmt->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in mysqlnd_fetch_stmt_row_cursor()
1006 SET_EMPTY_ERROR(*stmt->conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1011 if (FAIL == stmt->conn->m->simple_command(stmt->conn, COM_STMT_FETCH, buf, sizeof(buf), in mysqlnd_fetch_stmt_row_cursor()
1014 COPY_CLIENT_ERROR(*stmt->error_info, *stmt->conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1021 if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
1036 result->conn->options->int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
1037 result->conn->stats TSRMLS_CC)) in mysqlnd_fetch_stmt_row_cursor()
1077 ret = PACKET_READ(row_packet, result->conn); in mysqlnd_fetch_stmt_row_cursor()
1082 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
1090 stmt->conn->upsert_status->warning_count = in mysqlnd_fetch_stmt_row_cursor()
1094 stmt->conn->upsert_status->server_status = in mysqlnd_fetch_stmt_row_cursor()
1100 stmt->conn->upsert_status->warning_count = in mysqlnd_fetch_stmt_row_cursor()
1103 stmt->conn->upsert_status->server_status = in mysqlnd_fetch_stmt_row_cursor()
1122 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1141 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1178 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1184 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1187 MYSQLND_CONN_DATA * conn = stmt->conn; in MYSQLND_METHOD() local
1208 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD()
1209 FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf, in MYSQLND_METHOD()
1212 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1214 *stmt->upsert_status = *conn->upsert_status; in MYSQLND_METHOD()
1230 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1267 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD() local
1272 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1277 conn = stmt->conn; in MYSQLND_METHOD()
1280 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1313 if (CONN_GET_STATE(conn) == CONN_READY) { in MYSQLND_METHOD()
1324 ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC); in MYSQLND_METHOD()
1327 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD()
1332 SET_OOM_ERROR(*conn->error_info); in MYSQLND_METHOD()
1354 if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd TSRMLS_CC))) { in MYSQLND_METHOD()
1378 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1393 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1449 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1466 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1505 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1517 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1534 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1549 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1588 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1606 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1769 if (!stmt->field_count || !stmt->conn || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1788 result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent TSRMLS_CC); in MYSQLND_METHOD()
1808 SET_OOM_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD()
1911 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1952 CONN_SET_STATE(stmt->conn, CONN_READY); in MYSQLND_METHOD()
2139 MYSQLND_CONN_DATA * conn; in MYSQLND_METHOD_PRIVATE() local
2144 if (!stmt || !stmt->conn) { in MYSQLND_METHOD_PRIVATE()
2149 conn = stmt->conn; in MYSQLND_METHOD_PRIVATE()
2152 SET_EMPTY_ERROR(*stmt->conn->error_info); in MYSQLND_METHOD_PRIVATE()
2181 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD_PRIVATE()
2182 FAIL == conn->m->simple_command(conn, COM_STMT_CLOSE, cmd_buf, sizeof(cmd_buf), in MYSQLND_METHOD_PRIVATE()
2185 COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); in MYSQLND_METHOD_PRIVATE()
2200 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
2210 if (stmt->conn) { in MYSQLND_METHOD_PRIVATE()
2211 stmt->conn->m->free_reference(stmt->conn TSRMLS_CC); in MYSQLND_METHOD_PRIVATE()
2212 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2353 _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC) in _mysqlnd_stmt_init()
2357 …ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn TSRMLS_C… in _mysqlnd_stmt_init()