• Dmitry Shulga's avatar
    Fixed bug #42496 - the server could crash on a debug assert after a failure · bd41af86
    Dmitry Shulga authored
    to write into a closed socket
    
    sql/protocol.cc:
      Protocol::flush modified: set thd->main_da.can_overwrite_status= TRUE
      before call to net_flush() in order to prevent crash on assert in case
      of socket write failure, reset it to FALSE when net_flush() returned;
      Protocol::send_fields modified: return from method with error if call to
      my_net_write(), proto.write() or write_eof_packet() failed.
    sql/sql_cache.cc:
      Query_cache::send_result_to_client modified: call to
      thd->main_da.disable_status() only if write to socket
      was successful.
    sql/sql_cursor.cc:
      Materialized_cursor::fetch modified: leave method if call to
      result->send_data() failed.
    sql/sql_prepare.cc:
      send_prep_stmt() modified: call to thd->main_da.disable_status()
      only if thd->protocol_text.send_fields() completed successfully.
    bd41af86
sql_cursor.cc 21.1 KB