Commit 7a41306b authored by marko's avatar marko

branches/zip: Minor improvements.

lock_update_delete(): Add the debug assertion ut_ad(page == page_align(rec)).

lock_rec_insert_check_and_lock(): Determine next_rec_heap_no before
acquiring the kernel mutex.  Require the table to be at least S-locked
in fast index creation.
parent 060a95be
...@@ -3167,6 +3167,8 @@ lock_update_delete( ...@@ -3167,6 +3167,8 @@ lock_update_delete(
ulint heap_no; ulint heap_no;
ulint next_heap_no; ulint next_heap_no;
ut_ad(page == page_align(rec));
if (page_is_comp(page)) { if (page_is_comp(page)) {
heap_no = rec_get_heap_no_new(rec); heap_no = rec_get_heap_no_new(rec);
next_heap_no = rec_get_heap_no_new(page next_heap_no = rec_get_heap_no_new(page
...@@ -4875,17 +4877,16 @@ lock_rec_insert_check_and_lock( ...@@ -4875,17 +4877,16 @@ lock_rec_insert_check_and_lock(
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
next_rec = page_rec_get_next(rec); next_rec = page_rec_get_next(rec);
next_rec_heap_no = page_rec_get_heap_no(next_rec);
lock_mutex_enter_kernel(); lock_mutex_enter_kernel();
/* When inserting a record into an index, the table must be at /* When inserting a record into an index, the table must be at
least IX-locked or we must be building an index, in which case least IX-locked or we must be building an index, in which case
the table must be at least IS-locked. */ the table must be at least S-locked. */
ut_ad(lock_table_has(trx, index->table, LOCK_IX) ut_ad(lock_table_has(trx, index->table, LOCK_IX)
|| (*index->name == TEMP_INDEX_PREFIX || (*index->name == TEMP_INDEX_PREFIX
&& lock_table_has(trx, index->table, LOCK_IS))); && lock_table_has(trx, index->table, LOCK_S)));
next_rec_heap_no = page_rec_get_heap_no(next_rec);
lock = lock_rec_get_first(block, next_rec_heap_no); lock = lock_rec_get_first(block, next_rec_heap_no);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment