Commit 6ee593b1 authored by marko's avatar marko

branches/zip: Add const qualifiers to read-only pointers.

rec_get_nth_field_offs_old(): Split from rec_get_nth_field_old().

rec_get_nth_field_old(): Reimplement as a constness-preserving macro.

dict_drop_index_tree(), dict_truncate_index_tree(): Note that rec is
an in/out parameter, as the B-tree root page number will be updated.
parent 92f2a680
......@@ -2831,8 +2831,8 @@ static
void
btr_index_rec_validate_report(
/*==========================*/
page_t* page, /* in: index page */
rec_t* rec, /* in: index record */
const page_t* page, /* in: index page */
const rec_t* rec, /* in: index record */
dict_index_t* index) /* in: index */
{
fputs("InnoDB: Record in ", stderr);
......
......@@ -647,14 +647,14 @@ Drops the index tree associated with a row in SYS_INDEXES table. */
void
dict_drop_index_tree(
/*=================*/
rec_t* rec, /* in: record in the clustered index of SYS_INDEXES
table */
rec_t* rec, /* in/out: record in the clustered index
of SYS_INDEXES table */
mtr_t* mtr) /* in: mtr having the latch on the record page */
{
ulint root_page_no;
ulint space;
byte* ptr;
ulint len;
ulint root_page_no;
ulint space;
const byte* ptr;
ulint len;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
......@@ -714,7 +714,7 @@ dict_truncate_index_tree(
/* out: new root page number, or
FIL_NULL on failure */
dict_table_t* table, /* in: the table the index belongs to */
rec_t* rec, /* in: record in the clustered index of
rec_t* rec, /* in/out: record in the clustered index of
SYS_INDEXES table */
mtr_t* mtr) /* in: mtr having the latch
on the record page. The mtr may be
......@@ -724,7 +724,7 @@ dict_truncate_index_tree(
ulint space;
ulint type;
dulint index_id;
byte* ptr;
const byte* ptr;
ulint len;
ulint comp;
dict_index_t* index;
......
......@@ -62,8 +62,8 @@ dict_get_first_table_name_in_db(
dtuple_t* tuple;
mem_heap_t* heap;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
mtr_t mtr;
......@@ -143,8 +143,8 @@ dict_print(void)
dict_index_t* sys_index;
dict_table_t* table;
btr_pcur_t pcur;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
mtr_t mtr;
......@@ -230,15 +230,15 @@ static
ulint
dict_sys_tables_get_zip_size(
/*=========================*/
/* out: compressed page size in kilobytes;
or 0 if the tablespace is uncompressed,
ULINT_UNDEFINED on error */
rec_t* rec) /* in: a record of SYS_TABLES */
/* out: compressed page size in kilobytes;
or 0 if the tablespace is uncompressed,
ULINT_UNDEFINED on error */
const rec_t* rec) /* in: a record of SYS_TABLES */
{
byte* field;
ulint len;
ulint n_cols;
ulint table_type;
const byte* field;
ulint len;
ulint n_cols;
ulint table_type;
field = rec_get_nth_field_old(rec, 5, &len);
ut_a(len == 4);
......@@ -280,7 +280,7 @@ dict_check_tablespaces_and_store_max_id(
dict_table_t* sys_tables;
dict_index_t* sys_index;
btr_pcur_t pcur;
rec_t* rec;
const rec_t* rec;
ulint max_space_id = 0;
mtr_t mtr;
......@@ -320,11 +320,11 @@ dict_check_tablespaces_and_store_max_id(
if (!rec_get_deleted_flag(rec, 0)) {
/* We found one */
byte* field;
ulint len;
ulint space_id;
ulint zip_size_in_k;
char* name;
const byte* field;
ulint len;
ulint space_id;
ulint zip_size_in_k;
char* name;
field = rec_get_nth_field_old(rec, 0, &len);
name = mem_strdupl((char*) field, len);
......@@ -386,8 +386,8 @@ dict_load_columns(
btr_pcur_t pcur;
dtuple_t* tuple;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
byte* buf;
char* name;
......@@ -515,8 +515,8 @@ dict_load_fields(
dfield_t* dfield;
ulint pos_and_prefix_len;
ulint prefix_len;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
byte* buf;
ulint i;
......@@ -616,8 +616,8 @@ dict_load_indexes(
btr_pcur_t pcur;
dtuple_t* tuple;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
ulint name_len;
char* name_buf;
......@@ -789,8 +789,8 @@ dict_load_table(
dtuple_t* tuple;
mem_heap_t* heap;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
ulint space;
ulint n_cols;
......@@ -967,8 +967,8 @@ dict_load_table_on_id(
dfield_t* dfield;
dict_index_t* sys_table_ids;
dict_table_t* sys_tables;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
dict_table_t* table;
mtr_t mtr;
......@@ -1083,8 +1083,8 @@ dict_load_foreign_cols(
btr_pcur_t pcur;
dtuple_t* tuple;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
ulint i;
mtr_t mtr;
......@@ -1161,8 +1161,8 @@ dict_load_foreign(
dtuple_t* tuple;
mem_heap_t* heap2;
dfield_t* dfield;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
mtr_t mtr;
......@@ -1289,8 +1289,8 @@ dict_load_foreigns(
dfield_t* dfield;
dict_index_t* sec_index;
dict_table_t* sys_foreign;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
char* id ;
ulint err;
......
......@@ -4688,13 +4688,13 @@ fil_addr_is_null(
Accessor functions for a file page */
ulint
fil_page_get_prev(byte* page)
fil_page_get_prev(const byte* page)
{
return(mach_read_from_4(page + FIL_PAGE_PREV));
}
ulint
fil_page_get_next(byte* page)
fil_page_get_next(const byte* page)
{
return(mach_read_from_4(page + FIL_PAGE_NEXT));
}
......
......@@ -980,8 +980,8 @@ Reads the space id from the first page of a tablespace. */
ulint
fsp_header_get_space_id(
/*====================*/
/* out: space id, ULINT UNDEFINED if error */
page_t* page) /* in: first page of a tablespace */
/* out: space id, ULINT UNDEFINED if error */
const page_t* page) /* in: first page of a tablespace */
{
ulint fsp_id;
ulint id;
......@@ -1008,8 +1008,9 @@ Reads the compressed page size from the first page of a tablespace. */
ulint
fsp_header_get_zip_size(
/*=====================*/
/* out: compressed page size, or 0 if uncompressed */
page_t* page) /* in: first page of a tablespace */
/* out: compressed page size in bytes,
or 0 if uncompressed */
const page_t* page) /* in: first page of a tablespace */
{
return(mach_read_from_4(FSP_HEADER_OFFSET + FSP_PAGE_ZIP_SIZE + page));
}
......
......@@ -414,16 +414,16 @@ ibool
flst_validate(
/*==========*/
/* out: TRUE if ok */
flst_base_node_t* base, /* in: pointer to base node of list */
const flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr1) /* in: mtr */
{
ulint space;
flst_node_t* node;
fil_addr_t node_addr;
fil_addr_t base_addr;
ulint len;
ulint i;
mtr_t mtr2;
ulint space;
const flst_node_t* node;
fil_addr_t node_addr;
fil_addr_t base_addr;
ulint len;
ulint i;
mtr_t mtr2;
ut_ad(base);
ut_ad(mtr_memo_contains_page(mtr1, base, MTR_MEMO_PAGE_X_FIX));
......@@ -476,15 +476,15 @@ Prints info of a file-based list. */
void
flst_print(
/*=======*/
flst_base_node_t* base, /* in: pointer to base node of list */
const flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr) /* in: mtr */
{
buf_frame_t* frame;
ulint len;
const buf_frame_t* frame;
ulint len;
ut_ad(base && mtr);
ut_ad(mtr_memo_contains_page(mtr, base, MTR_MEMO_PAGE_X_FIX));
frame = page_align(base);
frame = page_align((byte*) base);
len = flst_get_len(base, mtr);
......@@ -493,5 +493,5 @@ flst_print(
"Base node in space %lu page %lu byte offset %lu; len %lu\n",
(ulong) page_get_space_id(frame),
(ulong) page_get_page_no(frame),
(ulong) (base - frame), (ulong) len);
(ulong) page_offset(base), (ulong) len);
}
......@@ -238,7 +238,7 @@ ha_remove_all_nodes_to_page(
/*========================*/
hash_table_t* table, /* in: hash table */
ulint fold, /* in: fold value */
page_t* page) /* in: buffer page */
const page_t* page) /* in: buffer page */
{
ha_node_t* node;
......
......@@ -412,7 +412,7 @@ void
ibuf_data_sizes_update(
/*===================*/
ibuf_data_t* data, /* in: ibuf data struct */
page_t* root, /* in: ibuf tree root */
const page_t* root, /* in: ibuf tree root */
mtr_t* mtr) /* in: mtr */
{
ulint old_size;
......@@ -616,15 +616,16 @@ UNIV_INLINE
ulint
ibuf_bitmap_page_get_bits(
/*======================*/
/* out: value of bits */
page_t* page, /* in: bitmap page */
ulint page_no,/* in: page whose bits to get */
ulint zip_size,/* in: compressed page size in bytes;
0 for uncompressed pages */
ulint bit, /* in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ... */
mtr_t* mtr __attribute__((unused))) /* in: mtr containing an
x-latch to the bitmap
page */
/* out: value of bits */
const page_t* page, /* in: bitmap page */
ulint page_no,/* in: page whose bits to get */
ulint zip_size,/* in: compressed page size in bytes;
0 for uncompressed pages */
ulint bit, /* in: IBUF_BITMAP_FREE,
IBUF_BITMAP_BUFFERED, ... */
mtr_t* mtr __attribute__((unused)))
/* in: mtr containing an
x-latch to the bitmap page */
{
ulint byte_offset;
ulint bit_offset;
......@@ -1072,11 +1073,11 @@ static
ulint
ibuf_rec_get_page_no(
/*=================*/
/* out: page number */
rec_t* rec) /* in: ibuf record */
/* out: page number */
const rec_t* rec) /* in: ibuf record */
{
byte* field;
ulint len;
const byte* field;
ulint len;
ut_ad(ibuf_inside());
ut_ad(rec_get_n_fields_old(rec) > 2);
......@@ -1107,11 +1108,11 @@ static
ulint
ibuf_rec_get_space(
/*===============*/
/* out: space id */
rec_t* rec) /* in: ibuf record */
/* out: space id */
const rec_t* rec) /* in: ibuf record */
{
byte* field;
ulint len;
const byte* field;
ulint len;
ut_ad(ibuf_inside());
ut_ad(rec_get_n_fields_old(rec) > 2);
......@@ -1213,7 +1214,7 @@ ibuf_build_entry_from_ibuf_rec(
ibuf_rec, the caller must hold a
latch to the ibuf_rec page as long
as the entry is used! */
rec_t* ibuf_rec, /* in: record in an insert buffer */
const rec_t* ibuf_rec, /* in: record in an insert buffer */
mem_heap_t* heap, /* in: heap where built */
dict_index_t** pindex) /* out, own: dummy index that
describes the entry */
......@@ -1221,7 +1222,7 @@ ibuf_build_entry_from_ibuf_rec(
dtuple_t* tuple;
dfield_t* field;
ulint n_fields;
byte* types;
const byte* types;
const byte* data;
ulint len;
ulint i;
......@@ -1307,18 +1308,19 @@ static
ulint
ibuf_rec_get_volume(
/*================*/
/* out: size of index record in bytes + an upper
limit of the space taken in the page directory */
rec_t* ibuf_rec)/* in: ibuf record */
/* out: size of index record in bytes
+ an upper limit of the space taken in the
page directory */
const rec_t* ibuf_rec)/* in: ibuf record */
{
dtype_t dtype;
ibool new_format = FALSE;
ulint data_size = 0;
ulint n_fields;
byte* types;
byte* data;
ulint len;
ulint i;
dtype_t dtype;
ibool new_format = FALSE;
ulint data_size = 0;
ulint n_fields;
const byte* types;
const byte* data;
ulint len;
ulint i;
ut_ad(ibuf_inside());
ut_ad(rec_get_n_fields_old(ibuf_rec) > 2);
......@@ -2355,7 +2357,6 @@ ibuf_get_volume_buffered(
volume = 0;
rec = btr_pcur_get_rec(pcur);
page = page_align(rec);
if (page_rec_is_supremum(rec)) {
......@@ -2503,8 +2504,8 @@ ibuf_update_max_tablespace_id(void)
/*===============================*/
{
ulint max_space_id;
rec_t* rec;
byte* field;
const rec_t* rec;
const byte* field;
ulint len;
ibuf_data_t* ibuf_data;
dict_index_t* ibuf_index;
......@@ -2999,7 +3000,7 @@ ibuf_delete_rec(
should belong */
btr_pcur_t* pcur, /* in: pcur positioned on the record to
delete, having latch mode BTR_MODIFY_LEAF */
dtuple_t* search_tuple,
const dtuple_t* search_tuple,
/* in: search tuple for entries of page_no */
mtr_t* mtr) /* in: mtr */
{
......@@ -3576,7 +3577,7 @@ ibuf_is_empty(void)
{
ibuf_data_t* data;
ibool is_empty;
page_t* root;
const page_t* root;
mtr_t mtr;
ibuf_enter();
......
......@@ -62,7 +62,7 @@ dict_truncate_index_tree(
/* out: new root page number, or
FIL_NULL on failure */
dict_table_t* table, /* in: the table the index belongs to */
rec_t* rec, /* in: record in the clustered index of
rec_t* rec, /* in/out: record in the clustered index of
SYS_INDEXES table */
mtr_t* mtr); /* in: mtr having the latch
on the record page. The mtr may be
......@@ -73,8 +73,8 @@ Drops the index tree associated with a row in SYS_INDEXES table. */
void
dict_drop_index_tree(
/*=================*/
rec_t* rec, /* in: record in the clustered index of SYS_INDEXES
table */
rec_t* rec, /* in/out: record in the clustered index
of SYS_INDEXES table */
mtr_t* mtr); /* in: mtr having the latch on the record page */
/********************************************************************
Creates the foreign key constraints system tables inside InnoDB
......
......@@ -662,9 +662,9 @@ fil_addr_is_null(
Accessor functions for a file page */
ulint
fil_page_get_prev(byte* page);
fil_page_get_prev(const byte* page);
ulint
fil_page_get_next(byte* page);
fil_page_get_next(const byte* page);
/*************************************************************************
Sets the file page type. */
......
......@@ -80,16 +80,17 @@ Reads the space id from the first page of a tablespace. */
ulint
fsp_header_get_space_id(
/*====================*/
/* out: space id, ULINT UNDEFINED if error */
page_t* page); /* in: first page of a tablespace */
/* out: space id, ULINT UNDEFINED if error */
const page_t* page); /* in: first page of a tablespace */
/**************************************************************************
Reads the compressed page size from the first page of a tablespace. */
ulint
fsp_header_get_zip_size(
/*=====================*/
/* out: compressed page size, or 0 if uncompressed */
page_t* page); /* in: first page of a tablespace */
/* out: compressed page size in bytes,
or 0 if uncompressed */
const page_t* page); /* in: first page of a tablespace */
/**************************************************************************
Writes the space id and compressed page size to a tablespace header.
This function is used past the buffer pool when we in fil0fil.c create
......
......@@ -116,7 +116,7 @@ ulint
flst_get_len(
/*=========*/
/* out: length */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Gets list first node address. */
......@@ -125,7 +125,7 @@ fil_addr_t
flst_get_first(
/*===========*/
/* out: file address */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Gets list last node address. */
......@@ -134,7 +134,7 @@ fil_addr_t
flst_get_last(
/*==========*/
/* out: file address */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Gets list next node address. */
......@@ -142,18 +142,18 @@ UNIV_INLINE
fil_addr_t
flst_get_next_addr(
/*===============*/
/* out: file address */
flst_node_t* node, /* in: pointer to node */
mtr_t* mtr); /* in: mini-transaction handle */
/* out: file address */
const flst_node_t* node, /* in: pointer to node */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Gets list prev node address. */
UNIV_INLINE
fil_addr_t
flst_get_prev_addr(
/*===============*/
/* out: file address */
flst_node_t* node, /* in: pointer to node */
mtr_t* mtr); /* in: mini-transaction handle */
/* out: file address */
const flst_node_t* node, /* in: pointer to node */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Writes a file address. */
UNIV_INLINE
......@@ -169,9 +169,9 @@ UNIV_INLINE
fil_addr_t
flst_read_addr(
/*===========*/
/* out: file address */
fil_faddr_t* faddr, /* in: pointer to file faddress */
mtr_t* mtr); /* in: mini-transaction handle */
/* out: file address */
const fil_faddr_t* faddr, /* in: pointer to file faddress */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
Validates a file-based list. */
......@@ -179,7 +179,7 @@ ibool
flst_validate(
/*==========*/
/* out: TRUE if ok */
flst_base_node_t* base, /* in: pointer to base node of list */
const flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr1); /* in: mtr */
/************************************************************************
Prints info of a file-based list. */
......@@ -187,7 +187,7 @@ Prints info of a file-based list. */
void
flst_print(
/*=======*/
flst_base_node_t* base, /* in: pointer to base node of list */
const flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr); /* in: mtr */
......
......@@ -50,9 +50,9 @@ UNIV_INLINE
fil_addr_t
flst_read_addr(
/*===========*/
/* out: file address */
fil_faddr_t* faddr, /* in: pointer to file faddress */
mtr_t* mtr) /* in: mini-transaction handle */
/* out: file address */
const fil_faddr_t* faddr, /* in: pointer to file faddress */
mtr_t* mtr) /* in: mini-transaction handle */
{
fil_addr_t addr;
......@@ -87,7 +87,7 @@ ulint
flst_get_len(
/*=========*/
/* out: length */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr) /* in: mini-transaction handle */
{
return(mtr_read_ulint(base + FLST_LEN, MLOG_4BYTES, mtr));
......@@ -100,7 +100,7 @@ fil_addr_t
flst_get_first(
/*===========*/
/* out: file address */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr) /* in: mini-transaction handle */
{
return(flst_read_addr(base + FLST_FIRST, mtr));
......@@ -113,7 +113,7 @@ fil_addr_t
flst_get_last(
/*==========*/
/* out: file address */
flst_base_node_t* base, /* in: pointer to base node */
const flst_base_node_t* base, /* in: pointer to base node */
mtr_t* mtr) /* in: mini-transaction handle */
{
return(flst_read_addr(base + FLST_LAST, mtr));
......@@ -125,9 +125,9 @@ UNIV_INLINE
fil_addr_t
flst_get_next_addr(
/*===============*/
/* out: file address */
flst_node_t* node, /* in: pointer to node */
mtr_t* mtr) /* in: mini-transaction handle */
/* out: file address */
const flst_node_t* node, /* in: pointer to node */
mtr_t* mtr) /* in: mini-transaction handle */
{
return(flst_read_addr(node + FLST_NEXT, mtr));
}
......@@ -138,9 +138,9 @@ UNIV_INLINE
fil_addr_t
flst_get_prev_addr(
/*===============*/
/* out: file address */
flst_node_t* node, /* in: pointer to node */
mtr_t* mtr) /* in: mini-transaction handle */
/* out: file address */
const flst_node_t* node, /* in: pointer to node */
mtr_t* mtr) /* in: mini-transaction handle */
{
return(flst_read_addr(node + FLST_PREV, mtr));
}
......@@ -95,7 +95,7 @@ ha_remove_all_nodes_to_page(
/*========================*/
hash_table_t* table, /* in: hash table */
ulint fold, /* in: fold value */
page_t* page); /* in: buffer page */
const page_t* page); /* in: buffer page */
/*****************************************************************
Validates a given range of the cells in hash table. */
......
......@@ -222,19 +222,19 @@ Reads 1 - 4 bytes from a file page buffered in the buffer pool. */
ulint
mtr_read_ulint(
/*===========*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
ulint type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
mtr_t* mtr); /* in: mini-transaction handle */
/* out: value read */
const byte* ptr, /* in: pointer from where to read */
ulint type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************
Reads 8 bytes from a file page buffered in the buffer pool. */
dulint
mtr_read_dulint(
/*============*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
mtr_t* mtr); /* in: mini-transaction handle */
/* out: value read */
const byte* ptr, /* in: pointer from where to read */
mtr_t* mtr); /* in: mini-transaction handle */
/*************************************************************************
This macro locks an rw-lock in s-mode. */
#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\
......
......@@ -372,17 +372,19 @@ rec_offs_make_valid(
ulint* offsets);/* in: array returned by rec_get_offsets() */
/****************************************************************
The following function is used to get a pointer to the nth
The following function is used to get the offset to the nth
data field in an old-style record. */
byte*
rec_get_nth_field_old(
/*==================*/
/* out: pointer to the field */
rec_t* rec, /* in: record */
ulint n, /* in: index of the field */
ulint* len); /* out: length of the field; UNIV_SQL_NULL
if SQL null */
ulint
rec_get_nth_field_offs_old(
/*=======================*/
/* out: offset to the field */
const rec_t* rec, /* in: record */
ulint n, /* in: index of the field */
ulint* len); /* out: length of the field; UNIV_SQL_NULL
if SQL null */
#define rec_get_nth_field_old(rec, n, len) \
((rec) + rec_get_nth_field_offs_old(rec, n, len))
/****************************************************************
Gets the physical size of an old-style field.
Also an SQL null may have a field of size > 0,
......@@ -407,7 +409,7 @@ rec_get_nth_field_offs(
ulint* len); /* out: length of the field; UNIV_SQL_NULL
if SQL null */
#define rec_get_nth_field(rec, offsets, n, len) \
(rec + rec_get_nth_field_offs(offsets, n, len))
((rec) + rec_get_nth_field_offs(offsets, n, len))
/**********************************************************
Determine if the offsets are for a record in the new
compact format. */
......
......@@ -275,7 +275,7 @@ ulint
mtr_read_ulint(
/*===========*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
const byte* ptr, /* in: pointer from where to read */
ulint type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
mtr_t* mtr __attribute__((unused)))
/* in: mini-transaction handle */
......@@ -300,7 +300,7 @@ dulint
mtr_read_dulint(
/*============*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
const byte* ptr, /* in: pointer from where to read */
mtr_t* mtr __attribute__((unused)))
/* in: mini-transaction handle */
{
......
......@@ -552,17 +552,17 @@ rec_get_offsets_reverse(
}
/****************************************************************
The following function is used to get a pointer to the nth
The following function is used to get the offset to the nth
data field in an old-style record. */
byte*
rec_get_nth_field_old(
/*==================*/
/* out: pointer to the field */
rec_t* rec, /* in: record */
ulint n, /* in: index of the field */
ulint* len) /* out: length of the field; UNIV_SQL_NULL if SQL
null */
ulint
rec_get_nth_field_offs_old(
/*=======================*/
/* out: offset to the field */
const rec_t* rec, /* in: record */
ulint n, /* in: index of the field */
ulint* len) /* out: length of the field;
UNIV_SQL_NULL if SQL null */
{
ulint os;
ulint next_os;
......@@ -589,7 +589,7 @@ rec_get_nth_field_old(
if (next_os & REC_1BYTE_SQL_NULL_MASK) {
*len = UNIV_SQL_NULL;
return(rec + os);
return(os);
}
next_os = next_os & ~REC_1BYTE_SQL_NULL_MASK;
......@@ -601,7 +601,7 @@ rec_get_nth_field_old(
if (next_os & REC_2BYTE_SQL_NULL_MASK) {
*len = UNIV_SQL_NULL;
return(rec + os);
return(os);
}
next_os = next_os & ~(REC_2BYTE_SQL_NULL_MASK
......@@ -612,7 +612,7 @@ rec_get_nth_field_old(
ut_ad(*len < UNIV_PAGE_SIZE);
return(rec + os);
return(os);
}
/**************************************************************
......@@ -1334,7 +1334,7 @@ rec_validate_old(
}
for (i = 0; i < n_fields; i++) {
data = rec_get_nth_field_old((rec_t*) rec, i, &len);
data = rec_get_nth_field_old(rec, i, &len);
if (!((len < UNIV_PAGE_SIZE) || (len == UNIV_SQL_NULL))) {
fprintf(stderr,
......@@ -1461,7 +1461,7 @@ rec_print_old(
for (i = 0; i < n; i++) {
data = rec_get_nth_field_old((rec_t*) rec, i, &len);
data = rec_get_nth_field_old(rec, i, &len);
fprintf(file, " %lu:", (ulong) i);
......
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