Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d71e0c2d
Commit
d71e0c2d
authored
Oct 16, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Add const qualifiers to read-only rec_t* parameters
of rec accessor functions.
parent
26d81785
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
164 additions
and
163 deletions
+164
-163
include/rem0rec.h
include/rem0rec.h
+44
-44
include/rem0rec.ic
include/rem0rec.ic
+80
-79
page/page0zip.c
page/page0zip.c
+4
-4
rem/rem0rec.c
rem/rem0rec.c
+36
-36
No files found.
include/rem0rec.h
View file @
d71e0c2d
...
...
@@ -80,10 +80,10 @@ UNIV_INLINE
ulint
rec_get_next_offs
(
/*==============*/
/* out: the page offset of the next
chained record
*/
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/* out: the page offset of the next
chained record, or 0 if none
*/
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
The following function is used to set the next record offset field
of an old-style record. */
...
...
@@ -109,8 +109,8 @@ UNIV_INLINE
ulint
rec_get_n_fields_old
(
/*=================*/
/* out: number of data fields */
rec_t
*
rec
);
/* in: physical record */
/* out: number of data fields */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
The following function is used to get the number of fields
in a record. */
...
...
@@ -119,7 +119,7 @@ ulint
rec_get_n_fields
(
/*=============*/
/* out: number of data fields */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
);
/* in: record descriptor */
/**********************************************************
The following function is used to get the number of records owned by the
...
...
@@ -128,8 +128,8 @@ UNIV_INLINE
ulint
rec_get_n_owned_old
(
/*================*/
/* out: number of owned records */
rec_t
*
rec
);
/* in: old-style physical record */
/* out: number of owned records */
const
rec_t
*
rec
);
/* in: old-style physical record */
/**********************************************************
The following function is used to set the number of owned records. */
UNIV_INLINE
...
...
@@ -146,8 +146,8 @@ UNIV_INLINE
ulint
rec_get_n_owned_new
(
/*================*/
/* out: number of owned records */
rec_t
*
rec
);
/* in: new-style physical record */
/* out: number of owned records */
const
rec_t
*
rec
);
/* in: new-style physical record */
/**********************************************************
The following function is used to set the number of owned records. */
UNIV_INLINE
...
...
@@ -164,9 +164,9 @@ UNIV_INLINE
ulint
rec_get_info_bits
(
/*==============*/
/* out: info bits */
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/* out: info bits */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
The following function is used to set the info bits of a record. */
UNIV_INLINE
...
...
@@ -189,8 +189,8 @@ UNIV_INLINE
ulint
rec_get_status
(
/*===========*/
/* out: status bits */
rec_t
*
rec
);
/* in: physical record */
/* out: status bits */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
The following function is used to set the status bits of a new-style record. */
...
...
@@ -208,9 +208,9 @@ UNIV_INLINE
ulint
rec_get_info_and_status_bits
(
/*=========================*/
/* out: info bits */
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/* out: info bits */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
The following function is used to set the info and status
bits of a record. (Only compact records have status bits.) */
...
...
@@ -227,9 +227,9 @@ UNIV_INLINE
ulint
rec_get_deleted_flag
(
/*=================*/
/* out: nonzero if delete marked */
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/* out: nonzero if delete marked */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
The following function is used to set the deleted bit. */
UNIV_INLINE
...
...
@@ -253,8 +253,8 @@ UNIV_INLINE
ibool
rec_get_node_ptr_flag
(
/*==================*/
/* out: TRUE if node pointer */
rec_t
*
rec
);
/* in: physical record */
/* out: TRUE if node pointer */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
The following function is used to get the order number
of an old-style record in the heap of the index page. */
...
...
@@ -262,8 +262,8 @@ UNIV_INLINE
ulint
rec_get_heap_no_old
(
/*================*/
/* out: heap order number */
rec_t
*
rec
);
/* in: physical record */
/* out: heap order number */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
The following function is used to set the heap number
field in an old-style record. */
...
...
@@ -280,8 +280,8 @@ UNIV_INLINE
ulint
rec_get_heap_no_new
(
/*================*/
/* out: heap order number */
rec_t
*
rec
);
/* in: physical record */
/* out: heap order number */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
The following function is used to set the heap number
field in a new-style record. */
...
...
@@ -298,8 +298,8 @@ UNIV_INLINE
ibool
rec_get_1byte_offs_flag
(
/*====================*/
/* out: TRUE if 1-byte form */
rec_t
*
rec
);
/* in: physical record */
/* out: TRUE if 1-byte form */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
Determine how many of the first n columns in a compact
...
...
@@ -321,7 +321,7 @@ ulint*
rec_get_offsets_func
(
/*=================*/
/* out: the new offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
,
/* in: array consisting of offsets[0]
allocated elements, or an array from
...
...
@@ -357,7 +357,7 @@ ibool
rec_offs_validate
(
/*==============*/
/* out: TRUE if valid */
rec_t
*
rec
,
/* in: record or NULL */
const
rec_t
*
rec
,
/* in: record or NULL */
dict_index_t
*
index
,
/* in: record descriptor or NULL */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/****************************************************************
...
...
@@ -367,7 +367,7 @@ UNIV_INLINE
void
rec_offs_make_valid
(
/*================*/
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
...
...
@@ -391,9 +391,9 @@ UNIV_INLINE
ulint
rec_get_nth_field_size
(
/*===================*/
/* out: field size in bytes */
rec_t
*
rec
,
/* in: record */
ulint
n
);
/* in: index of the field */
/* out: field size in bytes */
const
rec_t
*
rec
,
/* in: record */
ulint
n
);
/* in: index of the field */
/****************************************************************
The following function is used to get a pointer to the nth
data field in a record. */
...
...
@@ -489,7 +489,7 @@ ulint
rec_get_data_size_old
(
/*==================*/
/* out: size */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**************************************************************
The following function returns the number of fields in a record. */
UNIV_INLINE
...
...
@@ -563,7 +563,7 @@ rec_t*
rec_copy_prefix_to_buf
(
/*===================*/
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
byte
**
buf
,
/* in/out: memory buffer
...
...
@@ -576,7 +576,7 @@ ulint
rec_fold
(
/*=====*/
/* out: the folded value */
rec_t
*
rec
,
/* in: the physical record */
const
rec_t
*
rec
,
/* in: the physical record */
const
ulint
*
offsets
,
/* in: array returned by
rec_get_offsets() */
ulint
n_fields
,
/* in: number of complete
...
...
@@ -632,7 +632,7 @@ void
rec_copy_prefix_to_dtuple
(
/*======================*/
dtuple_t
*
tuple
,
/* in: data tuple */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
mem_heap_t
*
heap
);
/* in: memory heap */
...
...
@@ -643,7 +643,7 @@ ibool
rec_validate
(
/*=========*/
/* out: TRUE if ok */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/*******************************************************************
Prints an old-style physical record. */
...
...
@@ -652,7 +652,7 @@ void
rec_print_old
(
/*==========*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/*******************************************************************
Prints a physical record. */
...
...
@@ -660,7 +660,7 @@ void
rec_print_new
(
/*==========*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/*******************************************************************
Prints a physical record. */
...
...
@@ -669,7 +669,7 @@ void
rec_print
(
/*======*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
);
/* in: record descriptor */
#define REC_INFO_BITS 6
/* This is single byte bit-field */
...
...
include/rem0rec.ic
View file @
d71e0c2d
This diff is collapsed.
Click to expand it.
page/page0zip.c
View file @
d71e0c2d
...
...
@@ -283,7 +283,7 @@ page_zip_get_n_prev_extern(
ut_ad
(
dict_table_is_comp
(
index
->
table
));
ut_ad
(
dict_index_is_clust
(
index
));
heap_no
=
rec_get_heap_no_new
(
(
rec_t
*
)
rec
);
heap_no
=
rec_get_heap_no_new
(
rec
);
ut_ad
(
heap_no
>=
2
);
/* exclude infimum and supremum */
left
=
heap_no
-
2
;
if
(
UNIV_UNLIKELY
(
!
left
))
{
...
...
@@ -2496,7 +2496,7 @@ page_zip_write_rec(
slot
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
ut_a
(
slot
);
/* Copy the delete mark. */
if
(
rec_get_deleted_flag
(
(
rec_t
*
)
rec
,
TRUE
))
{
if
(
rec_get_deleted_flag
(
rec
,
TRUE
))
{
*
slot
|=
PAGE_ZIP_DIR_SLOT_DEL
>>
8
;
}
else
{
*
slot
&=
~
(
PAGE_ZIP_DIR_SLOT_DEL
>>
8
);
...
...
@@ -2507,7 +2507,7 @@ page_zip_write_rec(
-
PAGE_DIR
-
PAGE_DIR_SLOT_SIZE
*
page_dir_get_n_slots
(
page
));
heap_no
=
rec_get_heap_no_new
(
(
rec_t
*
)
rec
);
heap_no
=
rec_get_heap_no_new
(
rec
);
ut_ad
(
heap_no
>=
2
);
/* not infimum or supremum */
ut_ad
(
heap_no
<
page_dir_get_n_heap
(
page
));
...
...
@@ -2790,7 +2790,7 @@ page_zip_write_blob_ptr(
ut_ad
(
page_zip_simple_validate
(
page_zip
));
ut_ad
(
page_zip
->
size
>
PAGE_DATA
+
page_zip_dir_size
(
page_zip
));
ut_ad
(
rec_offs_comp
(
offsets
));
ut_ad
(
rec_offs_validate
(
(
rec_t
*
)
rec
,
NULL
,
offsets
));
ut_ad
(
rec_offs_validate
(
rec
,
NULL
,
offsets
));
ut_ad
(
rec_offs_nth_extern
(
offsets
,
n
));
ut_ad
(
page_zip
->
m_start
>=
PAGE_DATA
);
...
...
rem/rem0rec.c
View file @
d71e0c2d
...
...
@@ -133,8 +133,8 @@ static
ibool
rec_validate_old
(
/*=============*/
/* out: TRUE if ok */
rec_t
*
rec
);
/* in: physical record */
/* out: TRUE if ok */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
Determine how many of the first n columns in a compact
...
...
@@ -156,7 +156,7 @@ rec_get_n_extern_new(
ulint
i
;
ut_ad
(
dict_table_is_comp
(
index
->
table
));
ut_ad
(
rec_get_status
(
(
rec_t
*
)
rec
)
==
REC_STATUS_ORDINARY
);
ut_ad
(
rec_get_status
(
rec
)
==
REC_STATUS_ORDINARY
);
ut_ad
(
n
==
ULINT_UNDEFINED
||
n
<=
dict_index_get_n_fields
(
index
));
if
(
n
==
ULINT_UNDEFINED
)
{
...
...
@@ -229,7 +229,7 @@ void
rec_init_offsets
(
/*=============*/
/* out: the offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
)
/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */
...
...
@@ -379,7 +379,7 @@ ulint*
rec_get_offsets_func
(
/*=================*/
/* out: the new offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
,
/* in: array consisting of offsets[0]
allocated elements, or an array from
...
...
@@ -1112,13 +1112,13 @@ void
rec_copy_prefix_to_dtuple
(
/*======================*/
dtuple_t
*
tuple
,
/* in: data tuple */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
mem_heap_t
*
heap
)
/* in: memory heap */
{
dfield_t
*
field
;
byte
*
data
;
const
byte
*
data
;
ulint
len
;
byte
*
buf
=
NULL
;
ulint
i
;
...
...
@@ -1137,7 +1137,7 @@ rec_copy_prefix_to_dtuple(
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
field
=
dtuple_get_nth_field
(
tuple
,
i
);
data
=
rec_get_nth_field
(
rec
,
offsets
,
i
,
&
len
);
data
=
rec_get_nth_field
(
(
rec_t
*
)
rec
,
offsets
,
i
,
&
len
);
if
(
len
!=
UNIV_SQL_NULL
)
{
buf
=
mem_heap_alloc
(
heap
,
len
);
...
...
@@ -1156,13 +1156,13 @@ static
rec_t
*
rec_copy_prefix_to_buf_old
(
/*=======================*/
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
area_end
,
/* in: end of the prefix data */
byte
**
buf
,
/* in/out: memory buffer for the copied prefix,
or NULL */
ulint
*
buf_size
)
/* in/out: buffer size */
/* out, own: copied record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
area_end
,
/* in: end of the prefix data */
byte
**
buf
,
/* in/out: memory buffer for
the copied prefix,
or NULL */
ulint
*
buf_size
)
/* in/out: buffer size */
{
rec_t
*
copy_rec
;
ulint
area_start
;
...
...
@@ -1202,15 +1202,15 @@ rec_t*
rec_copy_prefix_to_buf
(
/*===================*/
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
byte
**
buf
,
/* in/out: memory buffer
for the copied prefix, or NULL */
ulint
*
buf_size
)
/* in/out: buffer size */
{
byte
*
nulls
;
byte
*
lens
;
const
byte
*
nulls
;
const
byte
*
lens
;
ulint
i
;
ulint
prefix_len
;
ulint
null_mask
;
...
...
@@ -1314,15 +1314,15 @@ static
ibool
rec_validate_old
(
/*=============*/
/* out: TRUE if ok */
rec_t
*
rec
)
/* in: physical record */
/* out: TRUE if ok */
const
rec_t
*
rec
)
/* in: physical record */
{
byte
*
data
;
ulint
len
;
ulint
n_fields
;
ulint
len_sum
=
0
;
ulint
sum
=
0
;
ulint
i
;
const
byte
*
data
;
ulint
len
;
ulint
n_fields
;
ulint
len_sum
=
0
;
ulint
sum
=
0
;
ulint
i
;
ut_a
(
rec
);
n_fields
=
rec_get_n_fields_old
(
rec
);
...
...
@@ -1334,7 +1334,7 @@ rec_validate_old(
}
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
data
=
rec_get_nth_field_old
(
rec
,
i
,
&
len
);
data
=
rec_get_nth_field_old
(
(
rec_t
*
)
rec
,
i
,
&
len
);
if
(
!
((
len
<
UNIV_PAGE_SIZE
)
||
(
len
==
UNIV_SQL_NULL
)))
{
fprintf
(
stderr
,
...
...
@@ -1375,7 +1375,7 @@ ibool
rec_validate
(
/*=========*/
/* out: TRUE if ok */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
const
ulint
*
offsets
)
/* in: array returned by rec_get_offsets() */
{
const
byte
*
data
;
...
...
@@ -1397,7 +1397,7 @@ rec_validate(
ut_a
(
rec_offs_comp
(
offsets
)
||
n_fields
<=
rec_get_n_fields_old
(
rec
));
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
data
=
rec_get_nth_field
(
rec
,
offsets
,
i
,
&
len
);
data
=
rec_get_nth_field
(
(
rec_t
*
)
rec
,
offsets
,
i
,
&
len
);
if
(
!
((
len
<
UNIV_PAGE_SIZE
)
||
(
len
==
UNIV_SQL_NULL
)))
{
fprintf
(
stderr
,
...
...
@@ -1418,11 +1418,11 @@ rec_validate(
}
}
if
(
len_sum
!=
(
ulint
)(
rec_get_end
(
rec
,
offsets
)
-
rec
))
{
if
(
len_sum
!=
rec_offs_data_size
(
offsets
))
{
fprintf
(
stderr
,
"InnoDB: Error: record len should be %lu, len %lu
\n
"
,
(
ulong
)
len_sum
,
(
ulong
)
(
rec_get_end
(
rec
,
offsets
)
-
rec
));
(
ulong
)
rec_offs_data_size
(
offsets
));
return
(
FALSE
);
}
...
...
@@ -1442,7 +1442,7 @@ void
rec_print_old
(
/*==========*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
)
/* in: physical record */
const
rec_t
*
rec
)
/* in: physical record */
{
const
byte
*
data
;
ulint
len
;
...
...
@@ -1461,7 +1461,7 @@ rec_print_old(
for
(
i
=
0
;
i
<
n
;
i
++
)
{
data
=
rec_get_nth_field_old
(
rec
,
i
,
&
len
);
data
=
rec_get_nth_field_old
(
(
rec_t
*
)
rec
,
i
,
&
len
);
fprintf
(
file
,
" %lu:"
,
(
ulong
)
i
);
...
...
@@ -1493,7 +1493,7 @@ void
rec_print_new
(
/*==========*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
const
ulint
*
offsets
)
/* in: array returned by rec_get_offsets() */
{
const
byte
*
data
;
...
...
@@ -1516,7 +1516,7 @@ rec_print_new(
for
(
i
=
0
;
i
<
rec_offs_n_fields
(
offsets
);
i
++
)
{
data
=
rec_get_nth_field
(
rec
,
offsets
,
i
,
&
len
);
data
=
rec_get_nth_field
(
(
rec_t
*
)
rec
,
offsets
,
i
,
&
len
);
fprintf
(
file
,
" %lu:"
,
(
ulong
)
i
);
...
...
@@ -1547,7 +1547,7 @@ void
rec_print
(
/*======*/
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
)
/* in: record descriptor */
{
ut_ad
(
index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment