Implemented logic to store results with notices in the Query Cache

pull/4770/head
Rahim Kanji 1 year ago
parent f16f553995
commit abbe02d99f

@ -2877,7 +2877,7 @@ void PgSQL_Connection::unhandled_notice_cb(void* arg, const PGresult* result) {
assert(arg);
PgSQL_Connection* conn = (PgSQL_Connection*)arg;
proxy_error("Unhandled notice: '%s' received from backend [PID: %d] (Host: %s, Port: %d, User: %s, FD: %d, State: %d). Please report this issue for further investigation and enhancements.\n",
PQresultErrorMessage(result), conn->get_pg_backend_pid(), conn->get_pg_host(), conn->get_pg_port(), conn->get_pg_user(), conn->get_pg_socket_fd(), conn->async_state_machine);
PQresultErrorMessage(result), conn->get_pg_backend_pid(), conn->get_pg_host(), atoi(conn->get_pg_port()), conn->get_pg_user(), conn->get_pg_socket_fd(), (int)conn->async_state_machine);
#ifdef DEBUG
assert(0);
#endif

@ -6260,7 +6260,8 @@ void PgSQL_Session::PgSQL_Result_to_PgSQL_wire(PgSQL_Connection* _conn, PgSQL_Da
if (query_result && query_result->get_result_packet_type() != PGSQL_QUERY_RESULT_NO_DATA) {
bool transfer_started = query_result->is_transfer_started();
// if there is an error, it will be false so results are not cached
bool is_tuple = query_result->get_result_packet_type() == (PGSQL_QUERY_RESULT_TUPLE | PGSQL_QUERY_RESULT_COMMAND | PGSQL_QUERY_RESULT_READY);
bool is_tuple = query_result->get_result_packet_type() == ((PGSQL_QUERY_RESULT_TUPLE | PGSQL_QUERY_RESULT_COMMAND | PGSQL_QUERY_RESULT_READY) ||
(PGSQL_QUERY_RESULT_NOTICE | PGSQL_QUERY_RESULT_TUPLE | PGSQL_QUERY_RESULT_COMMAND | PGSQL_QUERY_RESULT_READY));
const uint64_t num_rows = query_result->get_num_rows();
const uint64_t resultset_size = query_result->get_resultset_size();
const auto _affected_rows = query_result->get_affected_rows();

Loading…
Cancel
Save