1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#35132: MySQLadmin --wait ping always crashes on Windows systems

Failing to connect would release parts of the MYSQL struct.
We would then proceed to try again to connect without re-
initializing the struct.

We prevent the unwanted freeing of data we'll still need now.


client/mysqladmin.cc:
  Losing a connection (or not even getting on in the first place) should
  not trash the MYSQL-struct.
  
  Add a lot of comments.
  
  Rewrite re-connection fu.
sql-common/client.c:
  Assert against bad parameters usually caused by de-initing a
  MYSQL-struct without re-initing it again before re-use.
This commit is contained in:
Tatiana A. Nurnberg
2009-08-31 10:01:13 -07:00
parent 1ba25ae47c
commit d85148d84c
2 changed files with 108 additions and 29 deletions

View File

@@ -416,6 +416,15 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
const char *prefix;
int i;
/*
If this is NULL, somebody freed the MYSQL* options. mysql_close()
is a good candidate. We don't just silently (re)set it to
def_shared_memory_base_name as that would create really confusing/buggy
behavior if the user passed in a different name on the command-line or
in a my.cnf.
*/
DBUG_ASSERT(shared_memory_base_name != NULL);
/*
get enough space base-name + '_' + longest suffix we might ever send
*/