• Gleb Shchepa's avatar
    Bug #38816: kill + flush tables with read lock + stored · dc0a87fd
    Gleb Shchepa authored
                procedures causes crashes!
    
    The problem of that bugreport was mostly fixed by the
    patch for bug 38691.
    However, attached test case focused on another crash or
    valgrind warning problem: SHOW PROCESSLIST query accesses
    freed memory of SP instruction that run in a parallel
    connection.
    
    Changes of thd->query/thd->query_length in dangerous
    places have been guarded with the per-thread
    LOCK_thd_data mutex (the THD::LOCK_delete mutex has been
    renamed to THD::LOCK_thd_data).
    
    
    sql/ha_myisam.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the a THD::set_query() method call/LOCK_thd_data
      mutex.
      Unnecessary locking with the global LOCK_thread_count
      mutex has been removed.
    sql/log_event.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the THD::set_query()) method call/LOCK_thd_data
      mutex.
    sql/slave.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the THD::set_query() method call/LOCK_thd_data mutex.
      
      The THD::LOCK_delete mutex has been renamed to
      THD::LOCK_thd_data.
    sql/sp_head.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the a THD::set_query() method call/LOCK_thd_data
      mutex.
    sql/sql_class.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      The new THD::LOCK_thd_data mutex and THD::set_query()
      method has been added to guard modifications of THD::query/
      THD::query_length fields, also the Statement::set_statement()
      method has been overloaded in the THD class.
      
      The THD::LOCK_delete mutex has been renamed to
      THD::LOCK_thd_data.
    sql/sql_class.h:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      The new THD::LOCK_thd_data mutex and THD::set_query()
      method has been added to guard modifications of THD::query/
      THD::query_length fields, also the Statement::set_statement()
      method has been overloaded in the THD class.
      
      The THD::LOCK_delete mutex has been renamed to
      THD::LOCK_thd_data.
    sql/sql_insert.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the a THD::set_query() method call/LOCK_thd_data
      mutex.
    sql/sql_parse.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Modification of THD::query/query_length has been guarded
      with the a THD::set_query() method call/LOCK_thd_data mutex.
    sql/sql_repl.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      The THD::LOCK_delete mutex has been renamed to
      THD::LOCK_thd_data.
    sql/sql_show.cc:
      Bug #38816: kill + flush tables with read lock + stored
                  procedures causes crashes!
      
      Inter-thread read of THD::query/query_length field has
      been protected with a new per-thread LOCK_thd_data
      mutex in the mysqld_list_processes function.
    dc0a87fd
sql_repl.cc 47.3 KB