From c09dd214be64ba06f5f32d4d64ead7b371566c7c Mon Sep 17 00:00:00 2001 From: marko Date: Mon, 20 Aug 2007 06:59:22 +0000 Subject: [PATCH] branches/zip: Add const qualifiers to the upd_t* parameters of some functions. --- btr/btr0cur.c | 4 ++-- include/btr0cur.h | 4 ++-- include/row0upd.h | 11 ++++++----- row/row0upd.c | 17 +++++++++-------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/btr/btr0cur.c b/btr/btr0cur.c index 2971cd4cdd4..5068f615e08 100644 --- a/btr/btr0cur.c +++ b/btr/btr0cur.c @@ -2043,7 +2043,7 @@ btr_cur_pessimistic_update( mem_heap_t** heap, /* in/out: pointer to memory heap, or NULL */ big_rec_t** big_rec,/* out: big rec vector whose fields have to be stored externally by the caller, or NULL */ - upd_t* update, /* in: update vector; this is allowed also + const upd_t* update, /* in: update vector; this is allowed also contain trx id and roll ptr fields, but the values in update vector have no effect */ ulint cmpl_info,/* in: compiler info on secondary index @@ -3400,7 +3400,7 @@ btr_cur_mark_extern_inherited_fields( rec_t* rec, /* in/out: record in a clustered index */ dict_index_t* index, /* in: index of the page */ const ulint* offsets,/* in: array returned by rec_get_offsets() */ - upd_t* update, /* in: update vector */ + const upd_t* update, /* in: update vector */ mtr_t* mtr) /* in: mtr, or NULL if not logged */ { ulint n; diff --git a/include/btr0cur.h b/include/btr0cur.h index 0e219b3bb50..a72c8e9fcc6 100644 --- a/include/btr0cur.h +++ b/include/btr0cur.h @@ -269,7 +269,7 @@ btr_cur_pessimistic_update( mem_heap_t** heap, /* in/out: pointer to memory heap, or NULL */ big_rec_t** big_rec,/* out: big rec vector whose fields have to be stored externally by the caller, or NULL */ - upd_t* update, /* in: update vector; this is allowed also + const upd_t* update, /* in: update vector; this is allowed also contain trx id and roll ptr fields, but the values in update vector have no effect */ ulint cmpl_info,/* in: compiler info on secondary index @@ -444,7 +444,7 @@ btr_cur_mark_extern_inherited_fields( rec_t* rec, /* in/out: record in a clustered index */ dict_index_t* index, /* in: index of the page */ const ulint* offsets,/* in: array returned by rec_get_offsets() */ - upd_t* update, /* in: update vector */ + const upd_t* update, /* in: update vector */ mtr_t* mtr); /* in: mtr, or NULL if not logged */ /*********************************************************************** The complement of the previous function: in an update entry may inherit diff --git a/include/row0upd.h b/include/row0upd.h index a8f918ac9d4..e7d682e83df 100644 --- a/include/row0upd.h +++ b/include/row0upd.h @@ -208,7 +208,7 @@ row_upd_index_replace_new_col_vals( dtuple_t* entry, /* in/out: index entry where replaced */ dict_index_t* index, /* in: index; NOTE that this may also be a non-clustered index */ - upd_t* update, /* in: an update vector built for the + const upd_t* update, /* in: an update vector built for the CLUSTERED index so that the field number in an upd_field is the clustered index position */ mem_heap_t* heap); /* in: memory heap to which we allocate and @@ -244,10 +244,11 @@ NOTE: we compare the fields as binary strings! */ ibool row_upd_changes_some_index_ord_field_binary( /*========================================*/ - /* out: TRUE if update vector may change - an ordering field in an index record */ - dict_table_t* table, /* in: table */ - upd_t* update);/* in: update vector for the row */ + /* out: TRUE if update vector + may change an ordering field + in an index record */ + const dict_table_t* table, /* in: table */ + const upd_t* update);/* in: update vector for the row */ /*************************************************************** Updates a row in a table. This is a high-level function used in SQL execution graphs. */ diff --git a/row/row0upd.c b/row/row0upd.c index 2c8ae10cfa7..3182b176669 100644 --- a/row/row0upd.c +++ b/row/row0upd.c @@ -84,7 +84,7 @@ row_upd_changes_first_fields_binary( /* out: TRUE if changes */ dtuple_t* entry, /* in: old value of index entry */ dict_index_t* index, /* in: index of entry */ - upd_t* update, /* in: update vector for the row */ + const upd_t* update, /* in: update vector for the row */ ulint n); /* in: how many first fields to check */ @@ -925,7 +925,7 @@ row_upd_index_replace_new_col_vals( dtuple_t* entry, /* in/out: index entry where replaced */ dict_index_t* index, /* in: index; NOTE that this may also be a non-clustered index */ - upd_t* update, /* in: an update vector built for the + const upd_t* update, /* in: an update vector built for the CLUSTERED index so that the field number in an upd_field is the clustered index position */ mem_heap_t* heap) /* in: memory heap to which we allocate and @@ -1068,10 +1068,11 @@ NOTE: we compare the fields as binary strings! */ ibool row_upd_changes_some_index_ord_field_binary( /*========================================*/ - /* out: TRUE if update vector may change - an ordering field in an index record */ - dict_table_t* table, /* in: table */ - upd_t* update) /* in: update vector for the row */ + /* out: TRUE if update vector + may change an ordering field + in an index record */ + const dict_table_t* table, /* in: table */ + const upd_t* update) /* in: update vector for the row */ { upd_field_t* upd_field; dict_index_t* index; @@ -1105,7 +1106,7 @@ row_upd_changes_first_fields_binary( /* out: TRUE if changes */ dtuple_t* entry, /* in: index entry */ dict_index_t* index, /* in: index of entry */ - upd_t* update, /* in: update vector for the row */ + const upd_t* update, /* in: update vector for the row */ ulint n) /* in: how many first fields to check */ { ulint n_upd_fields; @@ -1182,7 +1183,7 @@ UNIV_INLINE void row_upd_eval_new_vals( /*==================*/ - upd_t* update) /* in: update vector */ + upd_t* update) /* in/out: update vector */ { que_node_t* exp; upd_field_t* upd_field;