Check for compatibility between locks and locks
Path:/MYSQL-5.5.43/STORAGE/INNOBASE/LOCK/LOCK0LOCK.C
Implementation: See the strength of the lock comparison
/*Lock Compatibility MATRIX * is IX S X AI * is + + +-+ * IX + +-- + * S +-+---* X------* AI + +---* * Note that for rows, in Nodb only acquires S or X locks. * For tables, InnoDB normally acquires is or IX locks. * S or X table locks is only acquired for LOCK TABLES. * Auto-increment (AI) locks is needed because of * statement-level MySQL Binlog. * See also Lock_mode_compatible (). *//*********************************************************************//**calculates If lock mode 1 is compatible with lock mode 2. @return Nonzero if mode1 compatible with Mode2*/univ_inlineulintlock_mode_compatible (/*=================*/ enumLock_mode Mode1,/*!< in:lock Mode*/ enumLock_mode Mode2)/*!< in:lock Mode*/{ut_ad (mode1= = Lock_x | | Mode1 = = lock_s | | Mode1 = =Lock_ix|| Mode1 = = Lock_is | | Mode1 = =lock_auto_inc); Ut_ad (Mode2= = Lock_x | | Mode2 = = lock_s | | Mode2 = =Lock_ix|| Mode2 = = Lock_is | | Mode2 = =lock_auto_inc); return((lock_mode_compatibility) &LK (Mode1, Mode2));}
Compatibility between InnoDB locks