• Michael Widenius's avatar
    Fixed lp:933719, "Assertion open_tables == 0 ... " in THD::restore_backup_open_tables_state. · 54e49ffc
    Michael Widenius authored
    This also fixes a (not likely) crashing bug when forcing a thread that was doing a table lock to re-open it's files, for example by creating a trigger.
    
    
    mysys/thr_lock.c:
      Added more checking to find wrong locks.
      Removed one, not needed, parameter to thr_lock
    sql/lock.cc:
      Fixed mysql_lock_tables() to retry with new sql_lock if lock fails. This was needed as table may be closed and reopened between retry's and then the old sql_lock will point to stale data.
    sql/mysql_priv.h:
      Updated prototype
    sql/sql_base.cc:
      Ensure that all tables are closed if opening of system table failes; This fixes the assert in THD::restore_backup_open_tables_state
    sql/sql_handler.cc:
      Updated variable type
    54e49ffc
mysql_priv.h 109 KB