summaryrefslogtreecommitdiff
path: root/storage/innobase/lock/lock0lock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/lock/lock0lock.cc')
-rw-r--r--storage/innobase/lock/lock0lock.cc75
1 files changed, 39 insertions, 36 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 5dc437dbcd7..5f706a5aaaf 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -26,8 +26,7 @@ Created 5/7/1996 Heikki Tuuri
#define LOCK_MODULE_IMPLEMENTATION
-
-#include "ha_prototypes.h"
+#include "univ.i"
#include <mysql/service_thd_error_context.h>
#include <sql_class.h>
@@ -37,11 +36,8 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0mem.h"
#include "trx0purge.h"
#include "trx0sys.h"
-#include "srv0mon.h"
#include "ut0vec.h"
-#include "btr0btr.h"
-#include "dict0boot.h"
-#include "ut0new.h"
+#include "btr0cur.h"
#include "row0sel.h"
#include "row0mysql.h"
#include "row0vers.h"
@@ -3289,48 +3285,55 @@ lock_update_discard(
lock_mutex_enter();
- if (!lock_rec_get_first_on_page(lock_sys.rec_hash, block)
- && (!lock_rec_get_first_on_page(lock_sys.prdt_hash, block))) {
- /* No locks exist on page, nothing to do */
+ if (lock_rec_get_first_on_page(lock_sys.rec_hash, block)) {
+ ut_ad(!lock_rec_get_first_on_page(lock_sys.prdt_hash, block));
+ ut_ad(!lock_rec_get_first_on_page(lock_sys.prdt_page_hash,
+ block));
+ /* Inherit all the locks on the page to the record and
+ reset all the locks on the page */
- lock_mutex_exit();
+ if (page_is_comp(page)) {
+ rec = page + PAGE_NEW_INFIMUM;
- return;
- }
-
- /* Inherit all the locks on the page to the record and reset all
- the locks on the page */
-
- if (page_is_comp(page)) {
- rec = page + PAGE_NEW_INFIMUM;
+ do {
+ heap_no = rec_get_heap_no_new(rec);
- do {
- heap_no = rec_get_heap_no_new(rec);
+ lock_rec_inherit_to_gap(heir_block, block,
+ heir_heap_no, heap_no);
- lock_rec_inherit_to_gap(heir_block, block,
- heir_heap_no, heap_no);
+ lock_rec_reset_and_release_wait(
+ block, heap_no);
- lock_rec_reset_and_release_wait(block, heap_no);
+ rec = page + rec_get_next_offs(rec, TRUE);
+ } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
+ } else {
+ rec = page + PAGE_OLD_INFIMUM;
- rec = page + rec_get_next_offs(rec, TRUE);
- } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
- } else {
- rec = page + PAGE_OLD_INFIMUM;
+ do {
+ heap_no = rec_get_heap_no_old(rec);
- do {
- heap_no = rec_get_heap_no_old(rec);
+ lock_rec_inherit_to_gap(heir_block, block,
+ heir_heap_no, heap_no);
- lock_rec_inherit_to_gap(heir_block, block,
- heir_heap_no, heap_no);
+ lock_rec_reset_and_release_wait(
+ block, heap_no);
- lock_rec_reset_and_release_wait(block, heap_no);
+ rec = page + rec_get_next_offs(rec, FALSE);
+ } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
+ }
- rec = page + rec_get_next_offs(rec, FALSE);
- } while (heap_no != PAGE_HEAP_NO_SUPREMUM);
+ lock_rec_free_all_from_discard_page_low(
+ block->page.id.space(), block->page.id.page_no(),
+ lock_sys.rec_hash);
+ } else {
+ lock_rec_free_all_from_discard_page_low(
+ block->page.id.space(), block->page.id.page_no(),
+ lock_sys.prdt_hash);
+ lock_rec_free_all_from_discard_page_low(
+ block->page.id.space(), block->page.id.page_no(),
+ lock_sys.prdt_page_hash);
}
- lock_rec_free_all_from_discard_page(block);
-
lock_mutex_exit();
}