Commit 1180c22a authored by davi@moksha.local's avatar davi@moksha.local
Browse files

Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates

The problem is that a SELECT on one thread is blocked by INSERT ... ON
DUPLICATE KEY UPDATE on another thread even when low_priority_updates is
activated.

The solution is to possibly downgrade the lock type to the setting of
low_priority_updates if the INSERT cannot be concurrent.
parent f51c6acc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
  if (duplic == DUP_UPDATE ||
      duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT)
  {
    *lock_type= TL_WRITE;
    *lock_type= TL_WRITE_DEFAULT;
    return;
  }