Bug #5668 Lost connection causes segfault
Submitted: 20 Sep 2004 15:30 Modified: 8 Oct 2004 11:15
Reporter: Nathaniel Blanchard Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.4 OS:Windows (Windows XP / Redhat 7.3)
Assigned to: CPU Architecture:Any

[20 Sep 2004 15:30] Nathaniel Blanchard
Description:
Calling mysql_stmt_execute after the connection to the database has been lost results in a GPF/segfault.  

How to repeat:
Open a connection to the database using the C API, before calling mysql_stmt_execute, shutdown the database or disconnect your network cable.  Something in mysql_stmt_execute will cause the program to crash.  For now, I got around the crash by adding a mysql_ping test just before it, but a lost connection shouldn't cause a segfault, a more graceful error would be nice.
[8 Oct 2004 11:15] Hartmut Holzgraefe
i get the expected error message:

stmt execute failed:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)