• unknown's avatar
    More DBUG statements · 8b670ee3
    unknown authored
    Replaced COND_refresh with COND_global_read_lock becasue of a bug in NTPL threads when using different mutexes as arguments to pthread_cond_wait()
    The original code caused a hang in FLUSH TABLES WITH READ LOCK in some circumstances because pthread_cond_broadcast() was not delivered to other threads.
    This fixes:
    Bug#16986: Deadlock condition with MyISAM tables
    Bug#20048: FLUSH TABLES WITH READ LOCK causes a deadlock
    
    
    mysql-test/r/flush.result:
      Added test case for deadlock with FLUSH TABLES WITH READ LOCK
    mysql-test/r/lock_multi.result:
      Test for bug in LOCK TABLE + optimize table
    mysql-test/t/flush.test:
      Added test case for deadlock with FLUSH TABLES WITH READ LOCK
    mysql-test/t/lock_multi.test:
      Test for bug in LOCK TABLE + optimize table
    sql/lock.cc:
      Replaced COND_refresh with COND_global_read_lock becasue of a bug in NTPL threads when using different mutexes as arguments to pthread_cond_wait()
      The original code caused a hang in FLUSH TABLES WITH READ LOCK in some circumstances because pthread_cond_broadcast() was not delivered to other threads
    sql/mysql_priv.h:
      Added COND_global_read_lock
    sql/mysqld.cc:
      Added COND_global_read_lock
    sql/sql_base.cc:
      More DBUG statements
      Added a broadcast in remove_table_from_cache() to release any threads waiting in open
    8b670ee3
mysql_priv.h 62 KB