Commit 44340b6e authored by marko's avatar marko

branches/zip: Add comments that clarify why the remaining calls to

row_build(), row_upd_index_replace_new_col_vals_index_pos(), and
row_upd_index_replace_new_col_vals() are safe.

btr_cur_optimistic_update(), btr_cur_pessimistic_update(): Note that
the B-tree page of the clustered index record is latched in mtr.

trx_undo_prev_version_build(): Add const qualifiers to index_rec
and rec.  Note that the page of index_rec is latched in index_mtr.

row_vers_impl_x_locked_off_kernel(), row_vers_old_has_index_entry():
Note that the stack of versions is locked by mtr and thus it is
safe to call row_build().
parent aaccf926
......@@ -1863,6 +1863,9 @@ any_extern:
/* We checked above that there are no externally stored fields. */
ut_a(!n_ext);
/* The page containing the clustered index record
corresponding to new_entry is latched in mtr.
Thus the following call is safe. */
row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
FALSE, NULL, heap);
old_rec_size = rec_offs_size(offsets);
......@@ -2134,6 +2137,9 @@ btr_cur_pessimistic_update(
ut_ad(rec_offs_validate(NULL, index, offsets));
rec_offs_make_valid(rec, index, offsets);
/* The page containing the clustered index record
corresponding to new_entry is latched in mtr.
Thus the following call is safe. */
row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
FALSE, *heap, *heap);
if (!(flags & BTR_KEEP_SYS_FLAG)) {
......
......@@ -251,11 +251,11 @@ trx_undo_prev_version_build(
the previous version is not >= purge_view,
which means that it may have been removed,
DB_ERROR if corrupted record */
rec_t* index_rec,/* in: clustered index record in the
const rec_t* index_rec,/* in: clustered index record in the
index tree */
mtr_t* index_mtr,/* in: mtr which contains the latch to
index_rec page and purge_view */
rec_t* rec, /* in: version of a clustered index record */
const rec_t* rec, /* in: version of a clustered index record */
dict_index_t* index, /* in: clustered index */
ulint* offsets,/* in: rec_get_offsets(rec, index) */
mem_heap_t* heap, /* in: memory heap from which the memory
......
......@@ -163,6 +163,9 @@ row_vers_impl_x_locked_off_kernel(
clust_offsets = rec_get_offsets(
prev_version, clust_index, NULL,
ULINT_UNDEFINED, &heap);
/* The stack of versions is locked by mtr.
Thus, it is safe to fetch the prefixes for
externally stored columns. */
row = row_build(ROW_COPY_POINTERS, clust_index,
prev_version, clust_offsets,
NULL, &ext, heap);
......@@ -339,6 +342,9 @@ row_vers_old_has_index_entry(
if (also_curr && !rec_get_deleted_flag(rec, comp)) {
row_ext_t* ext;
/* The stack of versions is locked by mtr.
Thus, it is safe to fetch the prefixes for
externally stored columns. */
row = row_build(ROW_COPY_POINTERS, clust_index,
rec, clust_offsets, NULL, &ext, heap);
entry = row_build_index_entry(row, ext, index, heap);
......@@ -396,6 +402,9 @@ row_vers_old_has_index_entry(
if (!rec_get_deleted_flag(prev_version, comp)) {
row_ext_t* ext;
/* The stack of versions is locked by mtr.
Thus, it is safe to fetch the prefixes for
externally stored columns. */
row = row_build(ROW_COPY_POINTERS, clust_index,
prev_version, clust_offsets,
NULL, &ext, heap);
......
......@@ -1317,12 +1317,12 @@ trx_undo_prev_version_build(
the previous version is not >= purge_view,
which means that it may have been removed,
DB_ERROR if corrupted record */
rec_t* index_rec,/* in: clustered index record in the
const rec_t* index_rec,/* in: clustered index record in the
index tree */
mtr_t* index_mtr __attribute__((unused)),
/* in: mtr which contains the latch to
index_rec page and purge_view */
rec_t* rec, /* in: version of a clustered index record */
const rec_t* rec, /* in: version of a clustered index record */
dict_index_t* index, /* in: clustered index */
ulint* offsets,/* in: rec_get_offsets(rec, index) */
mem_heap_t* heap, /* in: memory heap from which the memory
......@@ -1467,6 +1467,9 @@ trx_undo_prev_version_build(
entry = row_rec_to_index_entry(ROW_COPY_DATA, rec, index,
offsets, &n_ext, heap);
n_ext += btr_push_update_extern_fields(entry, update);
/* The page containing the clustered index record
corresponding to entry is latched in mtr. Thus the
following call is safe. */
row_upd_index_replace_new_col_vals(entry, index, update,
heap, heap);
......
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