File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1754,9 +1754,9 @@ RecLock::lock_alloc(
1754
1754
/* ********************************************************************/ /* *
1755
1755
Check if lock1 has higher priority than lock2.
1756
1756
NULL has lowest priority.
1757
- If either is a high priority transaction, the lock has higher priority.
1758
1757
If neither of them is wait lock, the first one has higher priority.
1759
1758
If only one of them is a wait lock, it has lower priority.
1759
+ If either is a high priority transaction, the lock has higher priority.
1760
1760
Otherwise, the one with an older transaction has higher priority.
1761
1761
@returns true if lock1 has higher priority, false otherwise. */
1762
1762
bool
@@ -1769,12 +1769,15 @@ has_higher_priority(
1769
1769
} else if (lock2 == NULL ) {
1770
1770
return true ;
1771
1771
}
1772
- // No preference. Compre them by wait mode and trx age .
1772
+ // Granted locks has higher priority .
1773
1773
if (!lock_get_wait (lock1)) {
1774
1774
return true ;
1775
1775
} else if (!lock_get_wait (lock2)) {
1776
1776
return false ;
1777
1777
}
1778
+ if (trx_is_high_priority (lock1->trx )) {
1779
+ return false ;
1780
+ }
1778
1781
return lock1->trx ->start_time_micro <= lock2->trx ->start_time_micro ;
1779
1782
}
1780
1783
You can’t perform that action at this time.
0 commit comments