diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 4b6cc4fa9..9493fa546 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -172,8 +172,9 @@ MySQL_Connection::~MySQL_Connection() { async_free_result(); if (send_quit) { mysql_close_start(mysql); + } else { + mysql_close_no_command(mysql); } - mysql_close_no_command(mysql); mysql=NULL; } // // FIXME: with the use of mysql client library , this part should be gone.