Moved connected_host_details struct to PgSQL_Connection

v3.0_4799_4827
Rahim Kanji 1 year ago
parent 1bb8d55fc6
commit f6fb8bbf2e

@ -348,10 +348,7 @@ class PgSQL_Connection_Placeholder {
PgSQL_Connection_userinfo *userinfo;
PgSQL_Data_Stream *myds;
struct {
char* hostname;
char* ip;
} connected_host_details;
/**
* @brief Keeps tracks of the 'server_status'. Do not confuse with the 'server_status' from the
* 'MYSQL' connection itself. This flag keeps track of the configured server status from the
@ -587,6 +584,11 @@ public:
void reset();
struct {
char* hostname;
char* ip;
} connected_host_details;
PgSQL_Variable variables[PGSQL_NAME_LAST_HIGH_WM];
uint32_t var_hash[PGSQL_NAME_LAST_HIGH_WM];
// for now we store possibly missing variables in the lower range

@ -324,7 +324,7 @@ PgSQL_Connection_Placeholder::PgSQL_Connection_Placeholder() {
statuses.questions = 0;
statuses.pgconnpoll_get = 0;
statuses.pgconnpoll_put = 0;
memset(&connected_host_details, 0, sizeof(connected_host_details));
};
PgSQL_Connection_Placeholder::~PgSQL_Connection_Placeholder() {
@ -369,14 +369,7 @@ PgSQL_Connection_Placeholder::~PgSQL_Connection_Placeholder() {
options.session_track_gtids=NULL;
}
if (connected_host_details.hostname) {
free(connected_host_details.hostname);
connected_host_details.hostname = NULL;
}
if (connected_host_details.ip) {
free(connected_host_details.ip);
connected_host_details.hostname = NULL;
}
};
bool PgSQL_Connection_Placeholder::set_autocommit(bool _ac) {
@ -648,6 +641,7 @@ PgSQL_Connection::PgSQL_Connection() {
new_result = true;
is_copy_out = false;
reset_error();
memset(&connected_host_details, 0, sizeof(connected_host_details));
}
PgSQL_Connection::~PgSQL_Connection() {

Loading…
Cancel
Save