• Konstantin Osipov's avatar
    ------------------------------------------------------------ · 10db8e79
    Konstantin Osipov authored
    revno: 2617.68.23
    committer: Dmitry Lenev <dlenev@mysql.com>
    branch nick: mysql-next-bg-pre1
    timestamp: Wed 2009-09-16 09:34:42 +0400
    message:
      Pre-requisite patch for fixing bug #30977 "Concurrent statement
      using stored function and DROP FUNCTION breaks SBR".
    
      CREATE TABLE SELECT statements take exclusive metadata lock on table
      being created. Invariant of metadata locking subsystem states that
      such lock should be taken before taking any kind of shared locks.
      Once metadata locks on stored routines are introduced statements like
      "CREATE TABLE ... SELECT f1()" will break this invariant by taking
      shared locks on routines before exclusive lock on target table.
      To avoid this, open_tables() is reworked to process tables which are
      directly used by the statement before stored routines are processed.
    10db8e79
sql_base.cc 275 KB