Lines Matching refs:conn
61 MYSQLND * conn; in MYSQLND_METHOD() local
66 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
71 conn = stmt->conn; in MYSQLND_METHOD()
84 if (CONN_GET_STATE(conn) != CONN_FETCHING_DATA || in MYSQLND_METHOD()
87 SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
95 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
96 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, to_cache TSRMLS_CC); in MYSQLND_METHOD()
113 conn->error_info = result->stored_data->error_info; in MYSQLND_METHOD()
130 MYSQLND * 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(stmt->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(stmt->conn->error_info); in MYSQLND_METHOD()
171 SET_OOM_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
175 if ((result = result->m.store_result(result, conn, TRUE TSRMLS_CC))) { in MYSQLND_METHOD()
180 stmt->error_info = conn->error_info; in MYSQLND_METHOD()
202 DBG_RETURN((stmt && stmt->conn && (stmt->conn->upsert_status.server_status & in MYSQLND_METHOD()
215 MYSQLND * conn; in MYSQLND_METHOD() local
218 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
221 conn = stmt->conn; in MYSQLND_METHOD()
224 …if (CONN_GET_STATE(conn) != CONN_NEXT_RESULT_PENDING || !(conn->upsert_status.server_status & SERV… in MYSQLND_METHOD()
229 …DBG_INF_FMT("server_status=%u cursor=%u", conn->upsert_status.server_status, conn->upsert_status.s… in MYSQLND_METHOD()
252 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_skip_metadata()
257 …field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE TSRMLS_… in mysqlnd_stmt_skip_metadata()
260 SET_OOM_ERROR(stmt->conn->error_info); in mysqlnd_stmt_skip_metadata()
265 if (FAIL == PACKET_READ(field_packet, stmt->conn)) { in mysqlnd_stmt_skip_metadata()
287 if (!stmt || !stmt->conn || !stmt->conn->protocol) { in mysqlnd_stmt_read_prepare_response()
292 …prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE TSR… in mysqlnd_stmt_read_prepare_response()
295 SET_OOM_ERROR(stmt->conn->error_info); in mysqlnd_stmt_read_prepare_response()
299 if (FAIL == PACKET_READ(prepare_resp, stmt->conn)) { in mysqlnd_stmt_read_prepare_response()
304 stmt->error_info = stmt->conn->error_info = prepare_resp->error_info; in mysqlnd_stmt_read_prepare_response()
309 stmt->warning_count = stmt->conn->upsert_status.warning_count = prepare_resp->warning_count; in mysqlnd_stmt_read_prepare_response()
310 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()
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, quer… 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; 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 stmt->error_info = conn->error_info; in mysqlnd_stmt_execute_parse_response()
489 stmt->upsert_status.affected_rows = conn->upsert_status.affected_rows; in mysqlnd_stmt_execute_parse_response()
490 if (CONN_GET_STATE(conn) == CONN_QUIT_SENT) { in mysqlnd_stmt_execute_parse_response()
504 SET_EMPTY_ERROR(stmt->conn->error_info); in mysqlnd_stmt_execute_parse_response()
505 stmt->upsert_status = conn->upsert_status; in mysqlnd_stmt_execute_parse_response()
507 if (conn->last_query_type == QUERY_UPSERT || conn->last_query_type == QUERY_LOAD_LOCAL) { in mysqlnd_stmt_execute_parse_response()
513 if (!stmt->result->conn) { in mysqlnd_stmt_execute_parse_response()
518 stmt->result->conn = stmt->conn->m->get_reference(stmt->conn TSRMLS_CC); in mysqlnd_stmt_execute_parse_response()
522 stmt->field_count = stmt->result->field_count = conn->field_count; in mysqlnd_stmt_execute_parse_response()
537 CONN_SET_STATE(conn, CONN_READY); in mysqlnd_stmt_execute_parse_response()
585 MYSQLND * conn; in MYSQLND_METHOD() local
591 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
594 conn = stmt->conn; in MYSQLND_METHOD()
598 SET_ERROR_AFF_ROWS(stmt->conn); in MYSQLND_METHOD()
662 SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in MYSQLND_METHOD()
697 ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, (char *)request, request_len, in MYSQLND_METHOD()
709 stmt->error_info = conn->error_info; in MYSQLND_METHOD()
719 if (ret == PASS && conn->last_query_type == QUERY_UPSERT && stmt->upsert_status.affected_rows) { in MYSQLND_METHOD()
720 …MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, stmt->upsert_status.affecte… in MYSQLND_METHOD()
757 result->conn->options.numeric_and_datetime_as_unicode, in mysqlnd_stmt_fetch_row_buffered()
758 result->conn->options.int_and_float_native, in mysqlnd_stmt_fetch_row_buffered()
759 result->conn->stats TSRMLS_CC); in mysqlnd_stmt_fetch_row_buffered()
844 if (CONN_GET_STATE(result->conn) != CONN_FETCHING_DATA) { in mysqlnd_stmt_fetch_row_unbuffered()
845 SET_CLIENT_ERROR(result->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in mysqlnd_stmt_fetch_row_unbuffered()
861 if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { in mysqlnd_stmt_fetch_row_unbuffered()
878 result->conn->options.numeric_and_datetime_as_unicode, in mysqlnd_stmt_fetch_row_unbuffered()
879 result->conn->options.int_and_float_native, in mysqlnd_stmt_fetch_row_unbuffered()
880 result->conn->stats TSRMLS_CC)) in mysqlnd_stmt_fetch_row_unbuffered()
912 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_UNBUF); in mysqlnd_stmt_fetch_row_unbuffered()
929 stmt->conn->error_info = row_packet->error_info; in mysqlnd_stmt_fetch_row_unbuffered()
932 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
938 result->conn->upsert_status.warning_count = row_packet->warning_count; in mysqlnd_stmt_fetch_row_unbuffered()
939 result->conn->upsert_status.server_status = row_packet->server_status; in mysqlnd_stmt_fetch_row_unbuffered()
944 if (result->conn->upsert_status.server_status & SERVER_MORE_RESULTS_EXISTS) { in mysqlnd_stmt_fetch_row_unbuffered()
945 CONN_SET_STATE(result->conn, CONN_NEXT_RESULT_PENDING); in mysqlnd_stmt_fetch_row_unbuffered()
947 CONN_SET_STATE(result->conn, CONN_READY); in mysqlnd_stmt_fetch_row_unbuffered()
963 MYSQLND * conn; in MYSQLND_METHOD() local
966 if (!stmt || !stmt->conn || !stmt->result) { in MYSQLND_METHOD()
971 conn = stmt->conn; in MYSQLND_METHOD()
974 (!stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_FETCHING_DATA) || in MYSQLND_METHOD()
975 (stmt->cursor_exists && CONN_GET_STATE(conn) != CONN_READY) || in MYSQLND_METHOD()
978 SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, in MYSQLND_METHOD()
986 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS); in MYSQLND_METHOD()
1015 if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) { in mysqlnd_fetch_stmt_row_cursor()
1024 SET_CLIENT_ERROR(stmt->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, in mysqlnd_fetch_stmt_row_cursor()
1034 SET_EMPTY_ERROR(stmt->conn->error_info); in mysqlnd_fetch_stmt_row_cursor()
1039 if (FAIL == stmt->conn->m->simple_command(stmt->conn, COM_STMT_FETCH, (char *)buf, sizeof(buf), in mysqlnd_fetch_stmt_row_cursor()
1042 stmt->error_info = stmt->conn->error_info; in mysqlnd_fetch_stmt_row_cursor()
1048 if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { in mysqlnd_fetch_stmt_row_cursor()
1066 result->conn->options.numeric_and_datetime_as_unicode, in mysqlnd_fetch_stmt_row_cursor()
1067 result->conn->options.int_and_float_native, in mysqlnd_fetch_stmt_row_cursor()
1068 result->conn->stats TSRMLS_CC)) in mysqlnd_fetch_stmt_row_cursor()
1114 ret = PACKET_READ(row_packet, result->conn); in mysqlnd_fetch_stmt_row_cursor()
1119 MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR); in mysqlnd_fetch_stmt_row_cursor()
1127 stmt->conn->upsert_status.warning_count = in mysqlnd_fetch_stmt_row_cursor()
1131 stmt->conn->upsert_status.server_status = in mysqlnd_fetch_stmt_row_cursor()
1137 stmt->conn->upsert_status.warning_count = in mysqlnd_fetch_stmt_row_cursor()
1140 stmt->conn->upsert_status.server_status = in mysqlnd_fetch_stmt_row_cursor()
1159 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1178 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1215 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1221 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1224 MYSQLND * conn = stmt->conn; in MYSQLND_METHOD() local
1261 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD()
1262 FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, (char *)cmd_buf, in MYSQLND_METHOD()
1265 stmt->error_info = conn->error_info; in MYSQLND_METHOD()
1267 stmt->upsert_status = conn->upsert_status; in MYSQLND_METHOD()
1282 MYSQLND * 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()
1329 if (CONN_GET_STATE(conn) == CONN_READY) { in MYSQLND_METHOD()
1340 …ret = conn->m->simple_command(conn, cmd, (char *)cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRM… in MYSQLND_METHOD()
1343 stmt->error_info = conn->error_info; in MYSQLND_METHOD()
1348 SET_OOM_ERROR(conn->error_info); in MYSQLND_METHOD()
1370 if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd TSRMLS_CC))) { in MYSQLND_METHOD()
1394 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1409 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1466 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1484 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1523 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1535 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1553 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1568 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1607 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1625 SET_EMPTY_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1788 if (!stmt->field_count || !stmt->conn || !stmt->result || !stmt->result->meta) { in MYSQLND_METHOD()
1807 result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent TSRMLS_CC); in MYSQLND_METHOD()
1827 SET_OOM_ERROR(stmt->conn->error_info); in MYSQLND_METHOD()
1929 if (!stmt || !stmt->conn) { in MYSQLND_METHOD()
1970 CONN_SET_STATE(stmt->conn, CONN_READY); in MYSQLND_METHOD()
2139 MYSQLND * 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()
2182 if (CONN_GET_STATE(conn) == CONN_READY && in MYSQLND_METHOD_PRIVATE()
2183 FAIL == conn->m->simple_command(conn, COM_STMT_CLOSE, (char *)cmd_buf, sizeof(cmd_buf), in MYSQLND_METHOD_PRIVATE()
2186 stmt->error_info = conn->error_info; in MYSQLND_METHOD_PRIVATE()
2201 MYSQLND_INC_CONN_STATISTIC(conn->stats, statistic); in MYSQLND_METHOD_PRIVATE()
2211 if (stmt->conn) { in MYSQLND_METHOD_PRIVATE()
2212 stmt->conn->m->free_reference(stmt->conn TSRMLS_CC); in MYSQLND_METHOD_PRIVATE()
2213 stmt->conn = NULL; in MYSQLND_METHOD_PRIVATE()
2353 MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC) in _mysqlnd_stmt_init()
2356 MYSQLND_STMT * ret = mnd_pecalloc(1, alloc_size, conn->persistent); in _mysqlnd_stmt_init()
2365 ret->persistent = conn->persistent; in _mysqlnd_stmt_init()
2367 stmt = ret->data = mnd_pecalloc(1, sizeof(MYSQLND_STMT_DATA), conn->persistent); in _mysqlnd_stmt_init()
2372 stmt->persistent = conn->persistent; in _mysqlnd_stmt_init()
2386 stmt->conn = conn->m->get_reference(conn TSRMLS_CC); in _mysqlnd_stmt_init()
2391 SET_OOM_ERROR(conn->error_info); in _mysqlnd_stmt_init()