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
...
@@ -80,10 +80,10 @@ UNIV_INLINE
ulint
ulint
rec_get_next_offs
(
rec_get_next_offs
(
/*==============*/
/*==============*/
/* out: the page offset of the next
/* out: the page offset of the next
chained record
*/
chained record, or 0 if none
*/
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
/**********************************************************
The following function is used to set the next record offset field
The following function is used to set the next record offset field
of an old-style record. */
of an old-style record. */
...
@@ -109,8 +109,8 @@ UNIV_INLINE
...
@@ -109,8 +109,8 @@ UNIV_INLINE
ulint
ulint
rec_get_n_fields_old
(
rec_get_n_fields_old
(
/*=================*/
/*=================*/
/* out: number of data fields */
/* out: number of data fields */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
The following function is used to get the number of fields
The following function is used to get the number of fields
in a record. */
in a record. */
...
@@ -119,7 +119,7 @@ ulint
...
@@ -119,7 +119,7 @@ ulint
rec_get_n_fields
(
rec_get_n_fields
(
/*=============*/
/*=============*/
/* out: number of data 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 */
dict_index_t
*
index
);
/* in: record descriptor */
/**********************************************************
/**********************************************************
The following function is used to get the number of records owned by the
The following function is used to get the number of records owned by the
...
@@ -128,8 +128,8 @@ UNIV_INLINE
...
@@ -128,8 +128,8 @@ UNIV_INLINE
ulint
ulint
rec_get_n_owned_old
(
rec_get_n_owned_old
(
/*================*/
/*================*/
/* out: number of owned records */
/* out: number of owned records */
rec_t
*
rec
);
/* in: old-style physical record */
const
rec_t
*
rec
);
/* in: old-style physical record */
/**********************************************************
/**********************************************************
The following function is used to set the number of owned records. */
The following function is used to set the number of owned records. */
UNIV_INLINE
UNIV_INLINE
...
@@ -146,8 +146,8 @@ UNIV_INLINE
...
@@ -146,8 +146,8 @@ UNIV_INLINE
ulint
ulint
rec_get_n_owned_new
(
rec_get_n_owned_new
(
/*================*/
/*================*/
/* out: number of owned records */
/* out: number of owned records */
rec_t
*
rec
);
/* in: new-style physical record */
const
rec_t
*
rec
);
/* in: new-style physical record */
/**********************************************************
/**********************************************************
The following function is used to set the number of owned records. */
The following function is used to set the number of owned records. */
UNIV_INLINE
UNIV_INLINE
...
@@ -164,9 +164,9 @@ UNIV_INLINE
...
@@ -164,9 +164,9 @@ UNIV_INLINE
ulint
ulint
rec_get_info_bits
(
rec_get_info_bits
(
/*==============*/
/*==============*/
/* out: info bits */
/* out: info bits */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
/**********************************************************
The following function is used to set the info bits of a record. */
The following function is used to set the info bits of a record. */
UNIV_INLINE
UNIV_INLINE
...
@@ -189,8 +189,8 @@ UNIV_INLINE
...
@@ -189,8 +189,8 @@ UNIV_INLINE
ulint
ulint
rec_get_status
(
rec_get_status
(
/*===========*/
/*===========*/
/* out: status bits */
/* out: status bits */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
The following function is used to set the status bits of a new-style record. */
The following function is used to set the status bits of a new-style record. */
...
@@ -208,9 +208,9 @@ UNIV_INLINE
...
@@ -208,9 +208,9 @@ UNIV_INLINE
ulint
ulint
rec_get_info_and_status_bits
(
rec_get_info_and_status_bits
(
/*=========================*/
/*=========================*/
/* out: info bits */
/* out: info bits */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
/**********************************************************
The following function is used to set the info and status
The following function is used to set the info and status
bits of a record. (Only compact records have status bits.) */
bits of a record. (Only compact records have status bits.) */
...
@@ -227,9 +227,9 @@ UNIV_INLINE
...
@@ -227,9 +227,9 @@ UNIV_INLINE
ulint
ulint
rec_get_deleted_flag
(
rec_get_deleted_flag
(
/*=================*/
/*=================*/
/* out: nonzero if delete marked */
/* out: nonzero if delete marked */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
comp
);
/* in: nonzero=compact page format */
ulint
comp
);
/* in: nonzero=compact page format */
/**********************************************************
/**********************************************************
The following function is used to set the deleted bit. */
The following function is used to set the deleted bit. */
UNIV_INLINE
UNIV_INLINE
...
@@ -253,8 +253,8 @@ UNIV_INLINE
...
@@ -253,8 +253,8 @@ UNIV_INLINE
ibool
ibool
rec_get_node_ptr_flag
(
rec_get_node_ptr_flag
(
/*==================*/
/*==================*/
/* out: TRUE if node pointer */
/* out: TRUE if node pointer */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
The following function is used to get the order number
The following function is used to get the order number
of an old-style record in the heap of the index page. */
of an old-style record in the heap of the index page. */
...
@@ -262,8 +262,8 @@ UNIV_INLINE
...
@@ -262,8 +262,8 @@ UNIV_INLINE
ulint
ulint
rec_get_heap_no_old
(
rec_get_heap_no_old
(
/*================*/
/*================*/
/* out: heap order number */
/* out: heap order number */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
The following function is used to set the heap number
The following function is used to set the heap number
field in an old-style record. */
field in an old-style record. */
...
@@ -280,8 +280,8 @@ UNIV_INLINE
...
@@ -280,8 +280,8 @@ UNIV_INLINE
ulint
ulint
rec_get_heap_no_new
(
rec_get_heap_no_new
(
/*================*/
/*================*/
/* out: heap order number */
/* out: heap order number */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
The following function is used to set the heap number
The following function is used to set the heap number
field in a new-style record. */
field in a new-style record. */
...
@@ -298,8 +298,8 @@ UNIV_INLINE
...
@@ -298,8 +298,8 @@ UNIV_INLINE
ibool
ibool
rec_get_1byte_offs_flag
(
rec_get_1byte_offs_flag
(
/*====================*/
/*====================*/
/* out: TRUE if 1-byte form */
/* out: TRUE if 1-byte form */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
Determine how many of the first n columns in a compact
Determine how many of the first n columns in a compact
...
@@ -321,7 +321,7 @@ ulint*
...
@@ -321,7 +321,7 @@ ulint*
rec_get_offsets_func
(
rec_get_offsets_func
(
/*=================*/
/*=================*/
/* out: the new offsets */
/* out: the new offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
,
/* in: array consisting of offsets[0]
ulint
*
offsets
,
/* in: array consisting of offsets[0]
allocated elements, or an array from
allocated elements, or an array from
...
@@ -357,7 +357,7 @@ ibool
...
@@ -357,7 +357,7 @@ ibool
rec_offs_validate
(
rec_offs_validate
(
/*==============*/
/*==============*/
/* out: TRUE if valid */
/* 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 */
dict_index_t
*
index
,
/* in: record descriptor or NULL */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/****************************************************************
/****************************************************************
...
@@ -367,7 +367,7 @@ UNIV_INLINE
...
@@ -367,7 +367,7 @@ UNIV_INLINE
void
void
rec_offs_make_valid
(
rec_offs_make_valid
(
/*================*/
/*================*/
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
...
@@ -391,9 +391,9 @@ UNIV_INLINE
...
@@ -391,9 +391,9 @@ UNIV_INLINE
ulint
ulint
rec_get_nth_field_size
(
rec_get_nth_field_size
(
/*===================*/
/*===================*/
/* out: field size in bytes */
/* out: field size in bytes */
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
ulint
n
);
/* in: index of the field */
ulint
n
);
/* in: index of the field */
/****************************************************************
/****************************************************************
The following function is used to get a pointer to the nth
The following function is used to get a pointer to the nth
data field in a record. */
data field in a record. */
...
@@ -489,7 +489,7 @@ ulint
...
@@ -489,7 +489,7 @@ ulint
rec_get_data_size_old
(
rec_get_data_size_old
(
/*==================*/
/*==================*/
/* out: size */
/* 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. */
The following function returns the number of fields in a record. */
UNIV_INLINE
UNIV_INLINE
...
@@ -563,7 +563,7 @@ rec_t*
...
@@ -563,7 +563,7 @@ rec_t*
rec_copy_prefix_to_buf
(
rec_copy_prefix_to_buf
(
/*===================*/
/*===================*/
/* out, own: copied record */
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
n_fields
,
/* in: number of fields to copy */
byte
**
buf
,
/* in/out: memory buffer
byte
**
buf
,
/* in/out: memory buffer
...
@@ -576,7 +576,7 @@ ulint
...
@@ -576,7 +576,7 @@ ulint
rec_fold
(
rec_fold
(
/*=====*/
/*=====*/
/* out: the folded value */
/* 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
const
ulint
*
offsets
,
/* in: array returned by
rec_get_offsets() */
rec_get_offsets() */
ulint
n_fields
,
/* in: number of complete
ulint
n_fields
,
/* in: number of complete
...
@@ -632,7 +632,7 @@ void
...
@@ -632,7 +632,7 @@ void
rec_copy_prefix_to_dtuple
(
rec_copy_prefix_to_dtuple
(
/*======================*/
/*======================*/
dtuple_t
*
tuple
,
/* in: data tuple */
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 */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
n_fields
,
/* in: number of fields to copy */
mem_heap_t
*
heap
);
/* in: memory heap */
mem_heap_t
*
heap
);
/* in: memory heap */
...
@@ -643,7 +643,7 @@ ibool
...
@@ -643,7 +643,7 @@ ibool
rec_validate
(
rec_validate
(
/*=========*/
/*=========*/
/* out: TRUE if ok */
/* 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
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/*******************************************************************
/*******************************************************************
Prints an old-style physical record. */
Prints an old-style physical record. */
...
@@ -652,7 +652,7 @@ void
...
@@ -652,7 +652,7 @@ void
rec_print_old
(
rec_print_old
(
/*==========*/
/*==========*/
FILE
*
file
,
/* in: file where to print */
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/*******************************************************************
/*******************************************************************
Prints a physical record. */
Prints a physical record. */
...
@@ -660,7 +660,7 @@ void
...
@@ -660,7 +660,7 @@ void
rec_print_new
(
rec_print_new
(
/*==========*/
/*==========*/
FILE
*
file
,
/* in: file where to print */
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
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
/*******************************************************************
/*******************************************************************
Prints a physical record. */
Prints a physical record. */
...
@@ -669,7 +669,7 @@ void
...
@@ -669,7 +669,7 @@ void
rec_print
(
rec_print
(
/*======*/
/*======*/
FILE
*
file
,
/* in: file where to 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 */
dict_index_t
*
index
);
/* in: record descriptor */
#define REC_INFO_BITS 6
/* This is single byte bit-field */
#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(
...
@@ -283,7 +283,7 @@ page_zip_get_n_prev_extern(
ut_ad
(
dict_table_is_comp
(
index
->
table
));
ut_ad
(
dict_table_is_comp
(
index
->
table
));
ut_ad
(
dict_index_is_clust
(
index
));
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 */
ut_ad
(
heap_no
>=
2
);
/* exclude infimum and supremum */
left
=
heap_no
-
2
;
left
=
heap_no
-
2
;
if
(
UNIV_UNLIKELY
(
!
left
))
{
if
(
UNIV_UNLIKELY
(
!
left
))
{
...
@@ -2496,7 +2496,7 @@ page_zip_write_rec(
...
@@ -2496,7 +2496,7 @@ page_zip_write_rec(
slot
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
slot
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
ut_a
(
slot
);
ut_a
(
slot
);
/* Copy the delete mark. */
/* 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
;
*
slot
|=
PAGE_ZIP_DIR_SLOT_DEL
>>
8
;
}
else
{
}
else
{
*
slot
&=
~
(
PAGE_ZIP_DIR_SLOT_DEL
>>
8
);
*
slot
&=
~
(
PAGE_ZIP_DIR_SLOT_DEL
>>
8
);
...
@@ -2507,7 +2507,7 @@ page_zip_write_rec(
...
@@ -2507,7 +2507,7 @@ page_zip_write_rec(
-
PAGE_DIR
-
PAGE_DIR_SLOT_SIZE
-
PAGE_DIR
-
PAGE_DIR_SLOT_SIZE
*
page_dir_get_n_slots
(
page
));
*
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
>=
2
);
/* not infimum or supremum */
ut_ad
(
heap_no
<
page_dir_get_n_heap
(
page
));
ut_ad
(
heap_no
<
page_dir_get_n_heap
(
page
));
...
@@ -2790,7 +2790,7 @@ page_zip_write_blob_ptr(
...
@@ -2790,7 +2790,7 @@ page_zip_write_blob_ptr(
ut_ad
(
page_zip_simple_validate
(
page_zip
));
ut_ad
(
page_zip_simple_validate
(
page_zip
));
ut_ad
(
page_zip
->
size
>
PAGE_DATA
+
page_zip_dir_size
(
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_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
(
rec_offs_nth_extern
(
offsets
,
n
));
ut_ad
(
page_zip
->
m_start
>=
PAGE_DATA
);
ut_ad
(
page_zip
->
m_start
>=
PAGE_DATA
);
...
...
rem/rem0rec.c
View file @
d71e0c2d
...
@@ -133,8 +133,8 @@ static
...
@@ -133,8 +133,8 @@ static
ibool
ibool
rec_validate_old
(
rec_validate_old
(
/*=============*/
/*=============*/
/* out: TRUE if ok */
/* out: TRUE if ok */
rec_t
*
rec
);
/* in: physical record */
const
rec_t
*
rec
);
/* in: physical record */
/**********************************************************
/**********************************************************
Determine how many of the first n columns in a compact
Determine how many of the first n columns in a compact
...
@@ -156,7 +156,7 @@ rec_get_n_extern_new(
...
@@ -156,7 +156,7 @@ rec_get_n_extern_new(
ulint
i
;
ulint
i
;
ut_ad
(
dict_table_is_comp
(
index
->
table
));
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
));
ut_ad
(
n
==
ULINT_UNDEFINED
||
n
<=
dict_index_get_n_fields
(
index
));
if
(
n
==
ULINT_UNDEFINED
)
{
if
(
n
==
ULINT_UNDEFINED
)
{
...
@@ -229,7 +229,7 @@ void
...
@@ -229,7 +229,7 @@ void
rec_init_offsets
(
rec_init_offsets
(
/*=============*/
/*=============*/
/* out: the offsets */
/* out: the offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
)
/* in/out: array of offsets;
ulint
*
offsets
)
/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */
in: n=rec_offs_n_fields(offsets) */
...
@@ -379,7 +379,7 @@ ulint*
...
@@ -379,7 +379,7 @@ ulint*
rec_get_offsets_func
(
rec_get_offsets_func
(
/*=================*/
/*=================*/
/* out: the new offsets */
/* out: the new offsets */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
*
offsets
,
/* in: array consisting of offsets[0]
ulint
*
offsets
,
/* in: array consisting of offsets[0]
allocated elements, or an array from
allocated elements, or an array from
...
@@ -1112,13 +1112,13 @@ void
...
@@ -1112,13 +1112,13 @@ void
rec_copy_prefix_to_dtuple
(
rec_copy_prefix_to_dtuple
(
/*======================*/
/*======================*/
dtuple_t
*
tuple
,
/* in: data tuple */
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 */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
n_fields
,
/* in: number of fields to copy */
mem_heap_t
*
heap
)
/* in: memory heap */
mem_heap_t
*
heap
)
/* in: memory heap */
{
{
dfield_t
*
field
;
dfield_t
*
field
;
byte
*
data
;
const
byte
*
data
;
ulint
len
;
ulint
len
;
byte
*
buf
=
NULL
;
byte
*
buf
=
NULL
;
ulint
i
;
ulint
i
;
...
@@ -1137,7 +1137,7 @@ rec_copy_prefix_to_dtuple(
...
@@ -1137,7 +1137,7 @@ rec_copy_prefix_to_dtuple(
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
field
=
dtuple_get_nth_field
(
tuple
,
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
)
{
if
(
len
!=
UNIV_SQL_NULL
)
{
buf
=
mem_heap_alloc
(
heap
,
len
);
buf
=
mem_heap_alloc
(
heap
,
len
);
...
@@ -1156,13 +1156,13 @@ static
...
@@ -1156,13 +1156,13 @@ static
rec_t
*
rec_t
*
rec_copy_prefix_to_buf_old
(
rec_copy_prefix_to_buf_old
(
/*=======================*/
/*=======================*/
/* out, own: copied record */
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
area_end
,
/* in: end of the prefix data */
ulint
area_end
,
/* in: end of the prefix data */
byte
**
buf
,
/* in/out: memory buffer for the copied prefix,
byte
**
buf
,
/* in/out: memory buffer for
or NULL */
the copied prefix,
or NULL */
ulint
*
buf_size
)
/* in/out: buffer size */
ulint
*
buf_size
)
/* in/out: buffer size */
{
{
rec_t
*
copy_rec
;
rec_t
*
copy_rec
;
ulint
area_start
;
ulint
area_start
;
...
@@ -1202,15 +1202,15 @@ rec_t*
...
@@ -1202,15 +1202,15 @@ rec_t*
rec_copy_prefix_to_buf
(
rec_copy_prefix_to_buf
(
/*===================*/
/*===================*/
/* out, own: copied record */
/* out, own: copied record */
rec_t
*
rec
,
/* in: physical record */
const
rec_t
*
rec
,
/* in: physical record */
dict_index_t
*
index
,
/* in: record descriptor */
dict_index_t
*
index
,
/* in: record descriptor */
ulint
n_fields
,
/* in: number of fields to copy */
ulint
n_fields
,
/* in: number of fields to copy */
byte
**
buf
,
/* in/out: memory buffer
byte
**
buf
,
/* in/out: memory buffer
for the copied prefix, or NULL */
for the copied prefix, or NULL */
ulint
*
buf_size
)
/* in/out: buffer size */
ulint
*
buf_size
)
/* in/out: buffer size */
{
{
byte
*
nulls
;
const
byte
*
nulls
;
byte
*
lens
;
const
byte
*
lens
;
ulint
i
;
ulint
i
;
ulint
prefix_len
;
ulint
prefix_len
;
ulint
null_mask
;
ulint
null_mask
;
...
@@ -1314,15 +1314,15 @@ static
...
@@ -1314,15 +1314,15 @@ static
ibool
ibool
rec_validate_old
(
rec_validate_old
(
/*=============*/
/*=============*/
/* out: TRUE if ok */
/* out: TRUE if ok */
rec_t
*
rec
)
/* in: physical record */
const
rec_t
*
rec
)
/* in: physical record */
{
{
byte
*
data
;
const
byte
*
data
;
ulint
len
;
ulint
len
;
ulint
n_fields
;
ulint
n_fields
;
ulint
len_sum
=
0
;
ulint
len_sum
=
0
;
ulint
sum
=
0
;
ulint
sum
=
0
;
ulint
i
;
ulint
i
;
ut_a
(
rec
);
ut_a
(
rec
);
n_fields
=
rec_get_n_fields_old
(
rec
);
n_fields
=
rec_get_n_fields_old
(
rec
);
...
@@ -1334,7 +1334,7 @@ rec_validate_old(
...
@@ -1334,7 +1334,7 @@ rec_validate_old(
}
}
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
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
)))
{
if
(
!
((
len
<
UNIV_PAGE_SIZE
)
||
(
len
==
UNIV_SQL_NULL
)))
{
fprintf
(
stderr
,
fprintf
(
stderr
,
...
@@ -1375,7 +1375,7 @@ ibool
...
@@ -1375,7 +1375,7 @@ ibool
rec_validate
(
rec_validate
(
/*=========*/
/*=========*/
/* out: TRUE if ok */
/* 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
ulint
*
offsets
)
/* in: array returned by rec_get_offsets() */
{
{
const
byte
*
data
;
const
byte
*
data
;
...
@@ -1397,7 +1397,7 @@ rec_validate(
...
@@ -1397,7 +1397,7 @@ rec_validate(
ut_a
(
rec_offs_comp
(
offsets
)
||
n_fields
<=
rec_get_n_fields_old
(
rec
));
ut_a
(
rec_offs_comp
(
offsets
)
||
n_fields
<=
rec_get_n_fields_old
(
rec
));
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
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
)))
{
if
(
!
((
len
<
UNIV_PAGE_SIZE
)
||
(
len
==
UNIV_SQL_NULL
)))
{
fprintf
(
stderr
,
fprintf
(
stderr
,
...
@@ -1418,11 +1418,11 @@ rec_validate(
...
@@ -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
,
fprintf
(
stderr
,
"InnoDB: Error: record len should be %lu, len %lu
\n
"
,
"InnoDB: Error: record len should be %lu, len %lu
\n
"
,
(
ulong
)
len_sum
,
(
ulong
)
len_sum
,
(
ulong
)
(
rec_get_end
(
rec
,
offsets
)
-
rec
));
(
ulong
)
rec_offs_data_size
(
offsets
));
return
(
FALSE
);
return
(
FALSE
);
}
}
...
@@ -1442,7 +1442,7 @@ void
...
@@ -1442,7 +1442,7 @@ void
rec_print_old
(
rec_print_old
(
/*==========*/
/*==========*/
FILE
*
file
,
/* in: file where to print */
FILE
*
file
,
/* in: file where to print */
rec_t
*
rec
)
/* in: physical record */
const
rec_t
*
rec
)
/* in: physical record */
{
{
const
byte
*
data
;
const
byte
*
data
;
ulint
len
;
ulint
len
;
...
@@ -1461,7 +1461,7 @@ rec_print_old(
...
@@ -1461,7 +1461,7 @@ rec_print_old(
for
(
i
=
0
;
i
<
n
;
i
++
)
{
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
);
fprintf
(
file
,
" %lu:"
,
(
ulong
)
i
);
...
@@ -1493,7 +1493,7 @@ void
...
@@ -1493,7 +1493,7 @@ void
rec_print_new
(
rec_print_new
(
/*==========*/
/*==========*/
FILE
*
file
,
/* in: file where to print */
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
ulint
*
offsets
)
/* in: array returned by rec_get_offsets() */
{
{
const
byte
*
data
;
const
byte
*
data
;
...
@@ -1516,7 +1516,7 @@ rec_print_new(
...
@@ -1516,7 +1516,7 @@ rec_print_new(
for
(
i
=
0
;
i
<
rec_offs_n_fields
(
offsets
);
i
++
)
{
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
);
fprintf
(
file
,
" %lu:"
,
(
ulong
)
i
);
...
@@ -1547,7 +1547,7 @@ void
...
@@ -1547,7 +1547,7 @@ void
rec_print
(
rec_print
(
/*======*/
/*======*/
FILE
*
file
,
/* in: file where to 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 */
dict_index_t
*
index
)
/* in: record descriptor */
{
{
ut_ad
(
index
);
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