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