Commit cbc35003 authored by marko's avatar marko

branches/zip: Non-functional change: Add some missing const qualifiers.

btr_index_rec_validate_report(), btr_index_rec_validate(): Add const
qualifiers to page, rec, index.

row_vers_old_has_index_entry(), row_vers_build_for_consistent_read():
Add const qualifier to rec.

row_vers_build_for_semi_consistent_read(): Add const qualifier to rec
and old_vers.

row_sel_store_row_id_to_prebuilt(): Add const qualifiers to
index_rec, index, offsets.

row_sel_build_prev_vers_for_mysql(): Add const qualifier to rec.

row_sel_get_clust_rec_for_mysql(): Add const qualifier to rec and out_rec.

row_sel_try_search_shortcut_for_mysql(): Add const qualifier to out_rec.
parent 94c77010
......@@ -2932,9 +2932,9 @@ static
void
btr_index_rec_validate_report(
/*==========================*/
const page_t* page, /* in: index page */
const rec_t* rec, /* in: index record */
dict_index_t* index) /* in: index */
const page_t* page, /* in: index page */
const rec_t* rec, /* in: index record */
const dict_index_t* index) /* in: index */
{
fputs("InnoDB: Record in ", stderr);
dict_index_name_print(stderr, NULL, index);
......@@ -2949,17 +2949,17 @@ UNIV_INTERN
ibool
btr_index_rec_validate(
/*===================*/
/* out: TRUE if ok */
rec_t* rec, /* in: index record */
dict_index_t* index, /* in: index */
ibool dump_on_error) /* in: TRUE if the function
should print hex dump of record
and page on error */
/* out: TRUE if ok */
const rec_t* rec, /* in: index record */
const dict_index_t* index, /* in: index */
ibool dump_on_error) /* in: TRUE if the function
should print hex dump of record
and page on error */
{
ulint len;
ulint n;
ulint i;
page_t* page;
const page_t* page;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
......
......@@ -453,12 +453,12 @@ UNIV_INTERN
ibool
btr_index_rec_validate(
/*===================*/
/* out: TRUE if ok */
rec_t* rec, /* in: index record */
dict_index_t* index, /* in: index */
ibool dump_on_error); /* in: TRUE if the function
should print hex dump of record
and page on error */
/* out: TRUE if ok */
const rec_t* rec, /* in: index record */
const dict_index_t* index, /* in: index */
ibool dump_on_error); /* in: TRUE if the function
should print hex dump of record
and page on error */
/******************************************************************
Checks the consistency of an index tree. */
UNIV_INTERN
......
......@@ -57,7 +57,7 @@ row_vers_old_has_index_entry(
ibool also_curr,/* in: TRUE if also rec is included in the
versions to search; otherwise only versions
prior to it are searched */
rec_t* rec, /* in: record in the clustered index; the
const rec_t* rec, /* in: record in the clustered index; the
caller must have a latch on the page */
mtr_t* mtr, /* in: mtr holding the latch on rec; it will
also hold the latch on purge_view */
......@@ -72,7 +72,7 @@ ulint
row_vers_build_for_consistent_read(
/*===============================*/
/* out: DB_SUCCESS or DB_MISSING_HISTORY */
rec_t* rec, /* in: record in a clustered index; the
const rec_t* rec, /* in: record in a clustered index; the
caller must have a latch on the page; this
latch locks the top of the stack of versions
of this records */
......@@ -85,7 +85,7 @@ row_vers_build_for_consistent_read(
mem_heap_t** offset_heap,/* in/out: memory heap from which
the offsets are allocated */
mem_heap_t* in_heap,/* in: memory heap from which the memory for
old_vers is allocated; memory for possible
*old_vers is allocated; memory for possible
intermediate versions is allocated and freed
locally within the function */
rec_t** old_vers);/* out, own: old version, or NULL if the
......@@ -100,7 +100,7 @@ ulint
row_vers_build_for_semi_consistent_read(
/*====================================*/
/* out: DB_SUCCESS or DB_MISSING_HISTORY */
rec_t* rec, /* in: record in a clustered index; the
const rec_t* rec, /* in: record in a clustered index; the
caller must have a latch on the page; this
latch locks the top of the stack of versions
of this records */
......@@ -111,10 +111,10 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t** offset_heap,/* in/out: memory heap from which
the offsets are allocated */
mem_heap_t* in_heap,/* in: memory heap from which the memory for
old_vers is allocated; memory for possible
*old_vers is allocated; memory for possible
intermediate versions is allocated and freed
locally within the function */
rec_t** old_vers);/* out, own: rec, old version, or NULL if the
const rec_t** old_vers);/* out: rec, old version, or NULL if the
record does not exist in the view, that is,
it was freshly inserted afterwards */
......
......@@ -651,12 +651,12 @@ row_sel_build_committed_vers_for_mysql(
/* out: DB_SUCCESS or error code */
dict_index_t* clust_index, /* in: clustered index */
row_prebuilt_t* prebuilt, /* in: prebuilt struct */
rec_t* rec, /* in: record in a clustered index */
const rec_t* rec, /* in: record in a clustered index */
ulint** offsets, /* in/out: offsets returned by
rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /* in/out: memory heap from which
the offsets are allocated */
rec_t** old_vers, /* out: old version, or NULL if the
const rec_t** old_vers, /* out: old version, or NULL if the
record does not exist in the view:
i.e., it was freshly inserted
afterwards */
......@@ -2494,14 +2494,14 @@ static
void
row_sel_store_row_id_to_prebuilt(
/*=============================*/
row_prebuilt_t* prebuilt, /* in: prebuilt */
rec_t* index_rec, /* in: record */
dict_index_t* index, /* in: index of the record */
const ulint* offsets) /* in: rec_get_offsets
(index_rec, index) */
row_prebuilt_t* prebuilt, /* in/out: prebuilt */
const rec_t* index_rec, /* in: record */
const dict_index_t* index, /* in: index of the record */
const ulint* offsets) /* in: rec_get_offsets
(index_rec, index) */
{
byte* data;
ulint len;
const byte* data;
ulint len;
ut_ad(rec_offs_validate(index_rec, index, offsets));
......@@ -2847,7 +2847,7 @@ row_sel_build_prev_vers_for_mysql(
read_view_t* read_view, /* in: read view */
dict_index_t* clust_index, /* in: clustered index */
row_prebuilt_t* prebuilt, /* in: prebuilt struct */
rec_t* rec, /* in: record in a clustered index */
const rec_t* rec, /* in: record in a clustered index */
ulint** offsets, /* in/out: offsets returned by
rec_get_offsets(rec, clust_index) */
mem_heap_t** offset_heap, /* in/out: memory heap from which
......@@ -2883,12 +2883,12 @@ row_sel_get_clust_rec_for_mysql(
/* out: DB_SUCCESS or error code */
row_prebuilt_t* prebuilt,/* in: prebuilt struct in the handle */
dict_index_t* sec_index,/* in: secondary index where rec resides */
rec_t* rec, /* in: record in a non-clustered index; if
const rec_t* rec, /* in: record in a non-clustered index; if
this is a locking read, then rec is not
allowed to be delete-marked, and that would
not make sense either */
que_thr_t* thr, /* in: query thread */
rec_t** out_rec,/* out: clustered record or an old version of
const rec_t** out_rec,/* out: clustered record or an old version of
it, NULL if the old version did not exist
in the read view, i.e., it was a fresh
inserted version */
......@@ -2903,7 +2903,7 @@ row_sel_get_clust_rec_for_mysql(
access the clustered index */
{
dict_index_t* clust_index;
rec_t* clust_rec;
const rec_t* clust_rec;
rec_t* old_vers;
ulint err;
trx_t* trx;
......@@ -3234,7 +3234,7 @@ ulint
row_sel_try_search_shortcut_for_mysql(
/*==================================*/
/* out: SEL_FOUND, SEL_EXHAUSTED, SEL_RETRY */
rec_t** out_rec,/* out: record if found */
const rec_t** out_rec,/* out: record if found */
row_prebuilt_t* prebuilt,/* in: prebuilt struct */
ulint** offsets,/* in/out: for rec_get_offsets(*out_rec) */
mem_heap_t** heap, /* in/out: heap for rec_get_offsets() */
......@@ -3244,7 +3244,7 @@ row_sel_try_search_shortcut_for_mysql(
const dtuple_t* search_tuple = prebuilt->search_tuple;
btr_pcur_t* pcur = prebuilt->pcur;
trx_t* trx = prebuilt->trx;
rec_t* rec;
const rec_t* rec;
ut_ad(dict_index_is_clust(index));
ut_ad(!prebuilt->templ_contains_blob);
......@@ -3335,9 +3335,9 @@ row_search_for_mysql(
trx_t* trx = prebuilt->trx;
dict_index_t* clust_index;
que_thr_t* thr;
rec_t* rec;
rec_t* result_rec;
rec_t* clust_rec;
const rec_t* rec;
const rec_t* result_rec;
const rec_t* clust_rec;
ulint err = DB_SUCCESS;
ibool unique_search = FALSE;
ibool unique_search_from_clust_index = FALSE;
......@@ -3757,13 +3757,12 @@ shortcut_fails_too_big_rec:
/* Try to place a gap lock on the next index record
to prevent phantoms in ORDER BY ... DESC queries */
const rec_t* next = page_rec_get_next_const(rec);
offsets = rec_get_offsets(page_rec_get_next(rec),
index, offsets,
offsets = rec_get_offsets(next, index, offsets,
ULINT_UNDEFINED, &heap);
err = sel_set_rec_lock(btr_pcur_get_block(pcur),
page_rec_get_next(rec),
index, offsets,
next, index, offsets,
prebuilt->select_lock_type,
LOCK_GAP, thr);
......@@ -4103,7 +4102,7 @@ no_gap_lock:
lock_type, thr);
switch (err) {
rec_t* old_vers;
const rec_t* old_vers;
case DB_SUCCESS:
break;
case DB_LOCK_WAIT:
......
......@@ -306,14 +306,14 @@ row_vers_old_has_index_entry(
ibool also_curr,/* in: TRUE if also rec is included in the
versions to search; otherwise only versions
prior to it are searched */
rec_t* rec, /* in: record in the clustered index; the
const rec_t* rec, /* in: record in the clustered index; the
caller must have a latch on the page */
mtr_t* mtr, /* in: mtr holding the latch on rec; it will
also hold the latch on purge_view */
dict_index_t* index, /* in: the secondary index */
const dtuple_t* ientry) /* in: the secondary index entry */
{
rec_t* version;
const rec_t* version;
rec_t* prev_version;
dict_index_t* clust_index;
ulint* clust_offsets;
......@@ -443,7 +443,7 @@ ulint
row_vers_build_for_consistent_read(
/*===============================*/
/* out: DB_SUCCESS or DB_MISSING_HISTORY */
rec_t* rec, /* in: record in a clustered index; the
const rec_t* rec, /* in: record in a clustered index; the
caller must have a latch on the page; this
latch locks the top of the stack of versions
of this records */
......@@ -455,14 +455,14 @@ row_vers_build_for_consistent_read(
mem_heap_t** offset_heap,/* in/out: memory heap from which
the offsets are allocated */
mem_heap_t* in_heap,/* in: memory heap from which the memory for
old_vers is allocated; memory for possible
*old_vers is allocated; memory for possible
intermediate versions is allocated and freed
locally within the function */
rec_t** old_vers)/* out, own: old version, or NULL if the
record does not exist in the view, that is,
it was freshly inserted afterwards */
{
rec_t* version;
const rec_t* version;
rec_t* prev_version;
dulint trx_id;
mem_heap_t* heap = NULL;
......@@ -575,7 +575,7 @@ ulint
row_vers_build_for_semi_consistent_read(
/*====================================*/
/* out: DB_SUCCESS or DB_MISSING_HISTORY */
rec_t* rec, /* in: record in a clustered index; the
const rec_t* rec, /* in: record in a clustered index; the
caller must have a latch on the page; this
latch locks the top of the stack of versions
of this records */
......@@ -586,14 +586,14 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t** offset_heap,/* in/out: memory heap from which
the offsets are allocated */
mem_heap_t* in_heap,/* in: memory heap from which the memory for
old_vers is allocated; memory for possible
*old_vers is allocated; memory for possible
intermediate versions is allocated and freed
locally within the function */
rec_t** old_vers)/* out, own: rec, old version, or NULL if the
const rec_t** old_vers)/* out: rec, old version, or NULL if the
record does not exist in the view, that is,
it was freshly inserted afterwards */
{
rec_t* version;
const rec_t* version;
mem_heap_t* heap = NULL;
byte* buf;
ulint err;
......
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