• Tatjana Azundris Nuernberg's avatar
    BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS · b6b47f88
    Tatjana Azundris Nuernberg authored
    On shutdown(), Windows can drop traffic still queued for sending even if that
    wasn't specifically requested. As a result, fatal errors (those after
    signaling which the server will drop the connection) were sometimes only
    seen as "connection lost" on the client side, because the server-side
    shutdown() erraneously discarded the correct error message before sending
    it.
    
    If on Windows, we now use the Windows API to access the (non-broken) equivalent
    of shutdown().
    
    Backport from trunk
    
    include/violite.h:
      export mysql_socket_shutdown(). It lives in vio in the backport.
    sql/mysqld.cc:
      Go through our own shutdown() rather than straight to the POSIX one.
    vio/viosocket.c:
      Define mysql_socket_shutdown(). On UNIXoid systems, it's just a wrapper for shutdown(), but
      on Window, it uses DisconnectEx, which is magic.
    b6b47f88
viosocket.c 17.8 KB