mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-10455: libmariadbclient18 + MySQL-python leaks memory on failed connections
Support of CLIENT_REMEMBER_OPTIONS and freeing options added.
This commit is contained in:
parent
b5fb2a685b
commit
66ac894c40
2 changed files with 4 additions and 2 deletions
|
@ -3644,6 +3644,8 @@ error:
|
|||
/* Free alloced memory */
|
||||
end_server(mysql);
|
||||
mysql_close_free(mysql);
|
||||
if (!(client_flag & CLIENT_REMEMBER_OPTIONS))
|
||||
mysql_close_free_options(mysql);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
@ -3714,7 +3716,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
|
|||
}
|
||||
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
|
||||
mysql->db, mysql->port, mysql->unix_socket,
|
||||
mysql->client_flag))
|
||||
mysql->client_flag | CLIENT_REMEMBER_OPTIONS))
|
||||
{
|
||||
if (ctxt)
|
||||
my_context_install_suspend_resume_hook(ctxt, NULL, NULL);
|
||||
|
|
|
@ -6061,7 +6061,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
|
|||
#ifndef DBUG_OFF
|
||||
mi->events_till_disconnect = disconnect_slave_event_count;
|
||||
#endif
|
||||
ulong client_flag= 0;
|
||||
ulong client_flag= CLIENT_REMEMBER_OPTIONS;
|
||||
if (opt_slave_compressed_protocol)
|
||||
client_flag=CLIENT_COMPRESS; /* We will use compression */
|
||||
|
||||
|
|
Loading…
Reference in a new issue