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
94c77111
Commit
94c77111
authored
Oct 20, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Add const qualifiers to some read-only byte* and rec_t*
parameters of some functions.
parent
f1348098
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
41 deletions
+44
-41
include/row0row.h
include/row0row.h
+10
-10
include/row0row.ic
include/row0row.ic
+4
-4
include/trx0sys.h
include/trx0sys.h
+5
-4
include/trx0sys.ic
include/trx0sys.ic
+2
-2
include/trx0undo.h
include/trx0undo.h
+2
-2
include/trx0undo.ic
include/trx0undo.ic
+2
-2
row/row0row.c
row/row0row.c
+15
-14
trx/trx0sys.c
trx/trx0sys.c
+4
-3
No files found.
include/row0row.h
View file @
94c77111
...
...
@@ -28,7 +28,7 @@ ulint
row_get_trx_id_offset
(
/*==================*/
/* out: offset of DATA_TRX_ID */
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
dict_index_t
*
index
,
/* in: clustered index */
const
ulint
*
offsets
);
/* in: rec_get_offsets(rec, index) */
/*************************************************************************
...
...
@@ -38,7 +38,7 @@ dulint
row_get_rec_trx_id
(
/*===============*/
/* out: value of the field */
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
dict_index_t
*
index
,
/* in: clustered index */
const
ulint
*
offsets
);
/* in: rec_get_offsets(rec, index) */
/*************************************************************************
...
...
@@ -48,7 +48,7 @@ dulint
row_get_rec_roll_ptr
(
/*=================*/
/* out: value of the field */
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
,
/* in: record */
dict_index_t
*
index
,
/* in: clustered index */
const
ulint
*
offsets
);
/* in: rec_get_offsets(rec, index) */
/*********************************************************************
...
...
@@ -80,7 +80,7 @@ row_build(
data fields on the index page, and thus is
more efficient */
dict_index_t
*
index
,
/* in: clustered index */
rec_t
*
rec
,
/* in: record in the clustered index;
const
rec_t
*
rec
,
/* in: record in the clustered index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -107,7 +107,7 @@ row_rec_to_index_entry(
heap as the latter only places pointers to
data fields on the index page */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -130,7 +130,7 @@ row_build_row_ref(
heap, whereas the latter only places pointers
to data fields on the index page */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -149,7 +149,7 @@ row_build_row_ref_in_tuple(
dtuple_t
*
ref
,
/* in/out: row reference built; see the
NOTE below! */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: the data fields in ref will point
directly into this record, therefore,
the buffer page of this record must be
...
...
@@ -182,7 +182,7 @@ row_build_row_ref_fast(
const
ulint
*
map
,
/* in: array of field numbers in rec
telling how ref should be built from
the fields of rec */
rec_t
*
rec
,
/* in: record in the index; must be
const
rec_t
*
rec
,
/* in: record in the index; must be
preserved while ref is used, as we do
not copy field values to heap */
const
ulint
*
offsets
);
/* in: array returned by rec_get_offsets() */
...
...
@@ -209,7 +209,7 @@ row_get_clust_rec(
/*==============*/
/* out: record or NULL, if no record found */
ulint
mode
,
/* in: BTR_MODIFY_LEAF, ... */
rec_t
*
rec
,
/* in: record in a secondary index */
const
rec_t
*
rec
,
/* in: record in a secondary index */
dict_index_t
*
index
,
/* in: secondary index */
dict_index_t
**
clust_index
,
/* out: clustered index */
mtr_t
*
mtr
);
/* in: mtr */
...
...
@@ -221,7 +221,7 @@ row_search_index_entry(
/*===================*/
/* out: TRUE if found */
dict_index_t
*
index
,
/* in: index */
dtuple_t
*
entry
,
/* in: index entry */
const
dtuple_t
*
entry
,
/* in: index entry */
ulint
mode
,
/* in: BTR_MODIFY_LEAF, ... */
btr_pcur_t
*
pcur
,
/* in/out: persistent cursor, which must
be closed by the caller */
...
...
include/row0row.ic
View file @
94c77111
...
...
@@ -17,7 +17,7 @@ dulint
row_get_rec_trx_id(
/*===============*/
/* out: value of the field */
rec_t*
rec, /* in: record */
const rec_t*
rec, /* in: record */
dict_index_t* index, /* in: clustered index */
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
{
...
...
@@ -42,7 +42,7 @@ dulint
row_get_rec_roll_ptr(
/*=================*/
/* out: value of the field */
rec_t*
rec, /* in: record */
const rec_t*
rec, /* in: record */
dict_index_t* index, /* in: clustered index */
const ulint* offsets)/* in: rec_get_offsets(rec, index) */
{
...
...
@@ -72,13 +72,13 @@ row_build_row_ref_fast(
const ulint* map, /* in: array of field numbers in rec
telling how ref should be built from
the fields of rec */
rec_t*
rec, /* in: record in the index; must be
const rec_t*
rec, /* in: record in the index; must be
preserved while ref is used, as we do
not copy field values to heap */
const ulint* offsets)/* in: array returned by rec_get_offsets() */
{
dfield_t* dfield;
byte*
field;
const byte*
field;
ulint len;
ulint ref_len;
ulint field_no;
...
...
include/trx0sys.h
View file @
94c77111
...
...
@@ -222,7 +222,7 @@ dulint
trx_read_trx_id
(
/*============*/
/* out: id */
byte
*
ptr
);
/* in: pointer to memory from where to read */
const
byte
*
ptr
);
/* in: pointer to memory from where to read */
/********************************************************************
Looks for the trx handle with the given id in trx_list. */
UNIV_INLINE
...
...
@@ -287,8 +287,9 @@ magic number shows it valid. */
void
trx_sys_print_mysql_binlog_offset_from_page
(
/*========================================*/
byte
*
page
);
/* in: buffer containing the trx system header page,
i.e., page number TRX_SYS_PAGE_NO in the tablespace */
const
byte
*
page
);
/* in: buffer containing the trx
system header page, i.e., page number
TRX_SYS_PAGE_NO in the tablespace */
#endif
/* UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL master log offset info in the trx system header if
...
...
include/trx0sys.ic
View file @
94c77111
...
...
@@ -233,7 +233,7 @@ dulint
trx_read_trx_id(
/*============*/
/* out: id */
byte* ptr) /* in: pointer to memory from where to read */
const
byte* ptr) /* in: pointer to memory from where to read */
{
#if DATA_TRX_ID_LEN != 6
# error "DATA_TRX_ID_LEN != 6"
...
...
include/trx0undo.h
View file @
94c77111
...
...
@@ -65,7 +65,7 @@ dulint
trx_read_roll_ptr
(
/*==============*/
/* out: roll ptr */
byte
*
ptr
);
/* in: pointer to memory from where to read */
const
byte
*
ptr
);
/* in: pointer to memory from where to read */
/**********************************************************************
Gets an undo log page and x-latches it. */
UNIV_INLINE
...
...
include/trx0undo.ic
View file @
94c77111
...
...
@@ -112,7 +112,7 @@ dulint
trx_read_roll_ptr(
/*==============*/
/* out: roll ptr */
byte* ptr) /* in: pointer to memory from where to read */
const
byte* ptr) /* in: pointer to memory from where to read */
{
#if DATA_ROLL_PTR_LEN != 7
# error "DATA_ROLL_PTR_LEN != 7"
...
...
row/row0row.c
View file @
94c77111
...
...
@@ -35,12 +35,13 @@ ulint
row_get_trx_id_offset
(
/*==================*/
/* out: offset of DATA_TRX_ID */
rec_t
*
rec
,
/* in: record */
const
rec_t
*
rec
__attribute__
((
unused
)),
/* in: record */
dict_index_t
*
index
,
/* in: clustered index */
const
ulint
*
offsets
)
/* in: rec_get_offsets(rec, index) */
{
ulint
pos
;
byte
*
field
;
ulint
offset
;
ulint
len
;
ut_ad
(
dict_index_is_clust
(
index
));
...
...
@@ -48,11 +49,11 @@ row_get_trx_id_offset(
pos
=
dict_index_get_sys_col_pos
(
index
,
DATA_TRX_ID
);
field
=
rec_get_nth_field
(
rec
,
offsets
,
pos
,
&
len
);
offset
=
rec_get_nth_field_offs
(
offsets
,
pos
,
&
len
);
ut_ad
(
len
==
DATA_TRX_ID_LEN
);
return
(
field
-
rec
);
return
(
offset
);
}
/*********************************************************************
...
...
@@ -160,7 +161,7 @@ row_build(
data fields on the index page, and thus is
more efficient */
dict_index_t
*
index
,
/* in: clustered index */
rec_t
*
rec
,
/* in: record in the clustered index;
const
rec_t
*
rec
,
/* in: record in the clustered index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -233,7 +234,7 @@ row_build(
dfield_t
*
dfield
=
dtuple_get_nth_field
(
row
,
dict_col_get_no
(
col
));
byte
*
field
=
rec_get_nth_field
(
const
byte
*
field
=
rec_get_nth_field
(
rec
,
offsets
,
i
,
&
len
);
dfield_set_data
(
dfield
,
field
,
len
);
...
...
@@ -276,7 +277,7 @@ row_rec_to_index_entry(
heap as the latter only places pointers to
data fields on the index page */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -289,7 +290,7 @@ row_rec_to_index_entry(
dtuple_t
*
entry
;
dfield_t
*
dfield
;
ulint
i
;
byte
*
field
;
const
byte
*
field
;
ulint
len
;
ulint
rec_len
;
byte
*
buf
;
...
...
@@ -354,7 +355,7 @@ row_build_row_ref(
heap, whereas the latter only places pointers
to data fields on the index page */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: in the case ROW_COPY_POINTERS
the data fields in the row will point
directly into this record, therefore,
...
...
@@ -368,7 +369,7 @@ row_build_row_ref(
dict_index_t
*
clust_index
;
dfield_t
*
dfield
;
dtuple_t
*
ref
;
byte
*
field
;
const
byte
*
field
;
ulint
len
;
ulint
ref_len
;
ulint
pos
;
...
...
@@ -459,7 +460,7 @@ row_build_row_ref_in_tuple(
dtuple_t
*
ref
,
/* in/out: row reference built; see the
NOTE below! */
dict_index_t
*
index
,
/* in: index */
rec_t
*
rec
,
/* in: record in the index;
const
rec_t
*
rec
,
/* in: record in the index;
NOTE: the data fields in ref will point
directly into this record, therefore,
the buffer page of this record must be
...
...
@@ -469,7 +470,7 @@ row_build_row_ref_in_tuple(
{
dict_index_t
*
clust_index
;
dfield_t
*
dfield
;
byte
*
field
;
const
byte
*
field
;
ulint
len
;
ulint
ref_len
;
ulint
pos
;
...
...
@@ -656,7 +657,7 @@ row_get_clust_rec(
/*==============*/
/* out: record or NULL, if no record found */
ulint
mode
,
/* in: BTR_MODIFY_LEAF, ... */
rec_t
*
rec
,
/* in: record in a secondary index */
const
rec_t
*
rec
,
/* in: record in a secondary index */
dict_index_t
*
index
,
/* in: secondary index */
dict_index_t
**
clust_index
,
/* out: clustered index */
mtr_t
*
mtr
)
/* in: mtr */
...
...
@@ -697,7 +698,7 @@ row_search_index_entry(
/*===================*/
/* out: TRUE if found */
dict_index_t
*
index
,
/* in: index */
dtuple_t
*
entry
,
/* in: index entry */
const
dtuple_t
*
entry
,
/* in: index entry */
ulint
mode
,
/* in: BTR_MODIFY_LEAF, ... */
btr_pcur_t
*
pcur
,
/* in/out: persistent cursor, which must
be closed by the caller */
...
...
trx/trx0sys.c
View file @
94c77111
...
...
@@ -665,10 +665,11 @@ magic number shows it valid. */
void
trx_sys_print_mysql_binlog_offset_from_page
(
/*========================================*/
byte
*
page
)
/* in: buffer containing the trx system header page,
i.e., page number TRX_SYS_PAGE_NO in the tablespace */
const
byte
*
page
)
/* in: buffer containing the trx
system header page, i.e., page number
TRX_SYS_PAGE_NO in the tablespace */
{
trx_sysf_t
*
sys_header
;
const
trx_sysf_t
*
sys_header
;
sys_header
=
page
+
TRX_SYS
;
...
...
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