Bug #13457 crash when calling mysql_close when in shutdown state
Submitted: 24 Sep 2005 10:55 Modified: 24 Sep 2005 12:27
Reporter: Ulterior Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:all OS:Any (all)
Assigned to: MySQL Verification Team CPU Architecture:Any

[24 Sep 2005 10:55] Ulterior
I have 8 applicitions which connect to mysql server via direct c library provided with mysql. I have a huge load of data and communication on server side and it's often leads mysql server to shutdown or reboot (poor server performance on large crowding)

It wouldn;t be a problem if my applications after receiving error code

Error: 1053 SQLSTATE: 08S01 (ER_SERVER_SHUTDOWN) Message: Server shutdown in progress 

whould normaly call mysql_close function and reconnect to server, though
after calling it, something weard happens and application crashes.

What am I asking here is it OK not too call this function on server shut down sequence to overcome this, or will it lead to memory leaks after some time?

How to repeat:
Get mysql server to produce

Error: 1053 SQLSTATE: 08S01 (ER_SERVER_SHUTDOWN) Message: Server shutdown in progress 

and call mysql_close function

Suggested fix:
more solid handling on this situation or official work-arround
[24 Sep 2005 12:27] MySQL Verification Team
Sorry but I understand this isn't bug and instead how you are
handling the client side. The server needs to do the connections
clean-up for to avoid orphaned connections and our mysql client
which uses the C API it is a sample how to handle the situation
reported. It tries to reconnect if it is performed a command and
display an error message that the server is away if it is the case
and also when done the quit/exit command not crashes.
So please I ask you for to study the source code of mysql.cc
for to implement that on your side.