Browse Source

branches/zip: Add clarifying comments that the clustered index record must

be protected from being deleted while any externally stored columns are
being fetched.

row_ext_create(),
row_upd_index_replace_new_col_vals(),
row_upd_index_replace_new_col_vals_index_pos(),
row_sel_sec_rec_is_for_blob(),
row_sel_sec_rec_is_for_clust_rec(): Note that the clustered
index record must be covered by a lock or a page latch.

row_upd_sec_index_entry(), row_upd_clust_rec_by_insert(),
row_undo_mod_upd_exist_sec(): Note that these functions probably
do not obtain an appropriate lock on the clustered index record
before fetching any externally stored columns.
pull/73/head
marko 18 years ago
parent
commit
31e200da0b
  1. 7
      include/row0ext.h
  2. 10
      include/row0upd.h
  3. 7
      row/row0ext.c
  4. 16
      row/row0sel.c
  5. 2
      row/row0umod.c
  6. 12
      row/row0upd.c

7
include/row0ext.h

@ -27,8 +27,11 @@ row_ext_create(
dict_col_get_no(); NOT relative to the records
in the clustered index */
const dtuple_t* tuple, /* in: data tuple containing the field
references of the externally stored columns;
must be indexed by col_no */
references of the externally stored
columns; must be indexed by col_no;
the clustered index record must be
covered by a lock or a page latch
to prevent deletion (rollback or purge). */
ulint zip_size,/* compressed page size in bytes, or 0 */
mem_heap_t* heap); /* in: heap where created */

10
include/row0upd.h

@ -185,7 +185,10 @@ given. */
void
row_upd_index_replace_new_col_vals_index_pos(
/*=========================================*/
dtuple_t* entry, /* in/out: index entry where replaced */
dtuple_t* entry, /* in/out: index entry where replaced;
the clustered index record must be
covered by a lock or a page latch to
prevent deletion (rollback or purge) */
dict_index_t* index, /* in: index; NOTE that this may also be a
non-clustered index */
const upd_t* update, /* in: an update vector built for the index so
@ -210,7 +213,10 @@ given. */
void
row_upd_index_replace_new_col_vals(
/*===============================*/
dtuple_t* entry, /* in/out: index entry where replaced */
dtuple_t* entry, /* in/out: index entry where replaced;
the clustered index record must be
covered by a lock or a page latch to
prevent deletion (rollback or purge) */
dict_index_t* index, /* in: index; NOTE that this may also be a
non-clustered index */
const upd_t* update, /* in: an update vector built for the

7
row/row0ext.c

@ -60,8 +60,11 @@ row_ext_create(
dict_col_get_no(); NOT relative to the records
in the clustered index */
const dtuple_t* tuple, /* in: data tuple containing the field
references of the externally stored columns;
must be indexed by col_no */
references of the externally stored
columns; must be indexed by col_no;
the clustered index record must be
covered by a lock or a page latch
to prevent deletion (rollback or purge). */
ulint zip_size,/* compressed page size in bytes, or 0 */
mem_heap_t* heap) /* in: heap where created */
{

16
row/row0sel.c

@ -67,10 +67,13 @@ row_sel_sec_rec_is_for_blob(
ulint mbminlen, /* in: minimum length of a
multi-byte character */
ulint mbmaxlen, /* in: maximum length of a
multi-byte character */
multi-byte character */
const byte* clust_field, /* in: the locally stored part of
the clustered index column, including
the BLOB pointer */
the clustered index column, including
the BLOB pointer; the clustered
index record must be covered by
a lock or a page latch to protect it
against deletion (rollback or purge) */
ulint clust_len, /* in: length of clust_field */
const byte* sec_field, /* in: column in secondary index */
ulint sec_len, /* in: length of sec_field */
@ -104,7 +107,10 @@ row_sel_sec_rec_is_for_clust_rec(
when compared with collation */
const rec_t* sec_rec, /* in: secondary index record */
dict_index_t* sec_index, /* in: secondary index */
const rec_t* clust_rec, /* in: clustered index record */
const rec_t* clust_rec, /* in: clustered index record;
must be protected by a lock or
a page latch against deletion
in rollback or purge */
dict_index_t* clust_index) /* in: clustered index */
{
const byte* sec_field;
@ -2990,8 +2996,8 @@ row_sel_get_clust_rec_for_mysql(
&& !row_sel_sec_rec_is_for_clust_rec(
rec, sec_index, clust_rec, clust_index)) {
clust_rec = NULL;
} else {
#ifdef UNIV_SEARCH_DEBUG
} else {
ut_a(clust_rec == NULL
|| row_sel_sec_rec_is_for_clust_rec(
rec, sec_index, clust_rec, clust_index));

2
row/row0umod.c

@ -637,6 +637,8 @@ row_undo_mod_upd_exist_sec(
but alphabetically they stayed the same, e.g.,
'abc' -> 'aBc'. */
/* TODO: lock the clustered index record
before fetching BLOBs */
row_upd_index_replace_new_col_vals(entry, index,
node->update,
NULL, heap);

12
row/row0upd.c

@ -868,7 +868,10 @@ given. */
void
row_upd_index_replace_new_col_vals_index_pos(
/*=========================================*/
dtuple_t* entry, /* in/out: index entry where replaced */
dtuple_t* entry, /* in/out: index entry where replaced;
the clustered index record must be
covered by a lock or a page latch to
prevent deletion (rollback or purge) */
dict_index_t* index, /* in: index; NOTE that this may also be a
non-clustered index */
const upd_t* update, /* in: an update vector built for the index so
@ -986,7 +989,10 @@ given. */
void
row_upd_index_replace_new_col_vals(
/*===============================*/
dtuple_t* entry, /* in/out: index entry where replaced */
dtuple_t* entry, /* in/out: index entry where replaced;
the clustered index record must be
covered by a lock or a page latch to
prevent deletion (rollback or purge) */
dict_index_t* index, /* in: index; NOTE that this may also be a
non-clustered index */
const upd_t* update, /* in: an update vector built for the
@ -1440,6 +1446,7 @@ row_upd_sec_index_entry(
}
/* Build a new index entry */
/* TODO: lock the clustered index record before fetching BLOBs */
row_upd_index_replace_new_col_vals(entry, index, node->update,
NULL, heap);
@ -1562,6 +1569,7 @@ row_upd_clust_rec_by_insert(
entry = row_build_index_entry(node->row, node->ext, index, heap);
ut_a(entry);
/* TODO: lock the clustered index record before fetching BLOBs */
row_upd_index_replace_new_col_vals(entry, index, node->update,
NULL, heap);

Loading…
Cancel
Save