Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.1
-
None
-
None
-
Linux - MySQL Server 5.5.53
Windows 7 - MySQL Server 5.5.48
Description
<MYSQL_OPT_RECONNECT> is not working when the server is sending a CR_SERVER_LOST (error 2013). This happens when the 'low' wait-timeout on the server has been reached.
How to repeat:
-------------------
[mysqld]
wait-timeout = 30
MYSQL * m_MySql = mysql_init( NULL );
mysql_optionsv( m_MySql, MYSQL_OPT_RECONNECT, (void *)"1" );
m_MySql = mysql_real_connect
(
m_MySql,
Host,
User,
Pass,
Db,
Port,
NULL,
CLIENT_REMEMBER_OPTIONS
);
sleep(31); // 31 seconds
mysql_query( m_MySql, "SELECT 1;" );
The <mysql_query> fails since the wait_timeout on the MySQL-server has been exceeded,
and the server has closed the connection and sent error 2013.