• Staale Smedseng's avatar
    Bug #53899 Wrong mysql_stmt_errno() after connection loss with · 18388d21
    Staale Smedseng authored
    automatic reconnect
    
    A client with automatic reconnect enabled will see the error
    message "Lost connection to MySQL server during query" if the
    connection is lost between mysql_stmt_prepare() and
    mysql_stmt_execute(). The mysql_stmt_errno() number, however,
    is 0 -- not the corresponding value 2013.
    
    This patch checks for the case where the prepared statement
    has been pruned due to a connection loss (i.e., stmt->mysql
    has been set to NULL) during a call to cli_advanced_command(),
    and avoids changing the last_errno to the result of the last
    reconnect attempt.
    18388d21
libmysql.c 145 KB