Commit 19569a8b authored by marko's avatar marko

branches/zip: Minor cleanup.

page_cur_tuple_insert(), page_cur_rec_insert(): Improve the documentation.
Note that the physical position of page_cursor may change.

page_cur_rec_insert(), page_cur_insert_rec_low(), page_cur_insert_rec_zip():
Add a const qualifier to the parameter rec.
parent e7284367
...@@ -139,14 +139,15 @@ page_cur_move_to_prev( ...@@ -139,14 +139,15 @@ page_cur_move_to_prev(
/*************************************************************** /***************************************************************
Inserts a record next to page cursor. Returns pointer to inserted record if Inserts a record next to page cursor. Returns pointer to inserted record if
succeed, i.e., enough space available, NULL otherwise. The cursor stays at succeed, i.e., enough space available, NULL otherwise. The cursor stays at
the same position. */ the same logical position, but the physical position may change if it is
pointing to a compressed page that was reorganized. */
UNIV_INLINE UNIV_INLINE
rec_t* rec_t*
page_cur_tuple_insert( page_cur_tuple_insert(
/*==================*/ /*==================*/
/* out: pointer to record if succeed, NULL /* out: pointer to record if succeed, NULL
otherwise */ otherwise */
page_cur_t* cursor, /* in: a page cursor */ page_cur_t* cursor, /* in/out: a page cursor */
const dtuple_t* tuple, /* in: pointer to a data tuple */ const dtuple_t* tuple, /* in: pointer to a data tuple */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
const ulint* ext, /* in: array of extern field numbers */ const ulint* ext, /* in: array of extern field numbers */
...@@ -155,15 +156,16 @@ page_cur_tuple_insert( ...@@ -155,15 +156,16 @@ page_cur_tuple_insert(
/*************************************************************** /***************************************************************
Inserts a record next to page cursor. Returns pointer to inserted record if Inserts a record next to page cursor. Returns pointer to inserted record if
succeed, i.e., enough space available, NULL otherwise. The cursor stays at succeed, i.e., enough space available, NULL otherwise. The cursor stays at
the same position. */ the same logical position, but the physical position may change if it is
pointing to a compressed page that was reorganized. */
UNIV_INLINE UNIV_INLINE
rec_t* rec_t*
page_cur_rec_insert( page_cur_rec_insert(
/*================*/ /*================*/
/* out: pointer to record if succeed, NULL /* out: pointer to record if succeed, NULL
otherwise */ otherwise */
page_cur_t* cursor, /* in: a page cursor */ page_cur_t* cursor, /* in/out: a page cursor */
rec_t* rec, /* in: record to insert */ const rec_t* rec, /* in: record to insert */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr); /* in: mini-transaction handle, or NULL */ mtr_t* mtr); /* in: mini-transaction handle, or NULL */
...@@ -180,7 +182,7 @@ page_cur_insert_rec_low( ...@@ -180,7 +182,7 @@ page_cur_insert_rec_low(
rec_t* current_rec,/* in: pointer to current record after rec_t* current_rec,/* in: pointer to current record after
which the new record is inserted */ which the new record is inserted */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
rec_t* rec, /* in: pointer to a physical record */ const rec_t* rec, /* in: pointer to a physical record */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr); /* in: mini-transaction handle, or NULL */ mtr_t* mtr); /* in: mini-transaction handle, or NULL */
/*************************************************************** /***************************************************************
...@@ -198,7 +200,7 @@ page_cur_insert_rec_zip( ...@@ -198,7 +200,7 @@ page_cur_insert_rec_zip(
which the new record is inserted */ which the new record is inserted */
buf_block_t* block, /* in: buffer block of *current_rec */ buf_block_t* block, /* in: buffer block of *current_rec */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
rec_t* rec, /* in: pointer to a physical record */ const rec_t* rec, /* in: pointer to a physical record */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr); /* in: mini-transaction handle, or NULL */ mtr_t* mtr); /* in: mini-transaction handle, or NULL */
/***************************************************************** /*****************************************************************
......
...@@ -207,14 +207,15 @@ page_cur_search( ...@@ -207,14 +207,15 @@ page_cur_search(
/*************************************************************** /***************************************************************
Inserts a record next to page cursor. Returns pointer to inserted record if Inserts a record next to page cursor. Returns pointer to inserted record if
succeed, i.e., enough space available, NULL otherwise. The cursor stays at succeed, i.e., enough space available, NULL otherwise. The cursor stays at
the same position. */ the same logical position, but the physical position may change if it is
pointing to a compressed page that was reorganized. */
UNIV_INLINE UNIV_INLINE
rec_t* rec_t*
page_cur_tuple_insert( page_cur_tuple_insert(
/*==================*/ /*==================*/
/* out: pointer to record if succeed, NULL /* out: pointer to record if succeed, NULL
otherwise */ otherwise */
page_cur_t* cursor, /* in: a page cursor */ page_cur_t* cursor, /* in/out: a page cursor */
const dtuple_t* tuple, /* in: pointer to a data tuple */ const dtuple_t* tuple, /* in: pointer to a data tuple */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
const ulint* ext, /* in: array of extern field numbers */ const ulint* ext, /* in: array of extern field numbers */
...@@ -250,15 +251,16 @@ page_cur_tuple_insert( ...@@ -250,15 +251,16 @@ page_cur_tuple_insert(
/*************************************************************** /***************************************************************
Inserts a record next to page cursor. Returns pointer to inserted record if Inserts a record next to page cursor. Returns pointer to inserted record if
succeed, i.e., enough space available, NULL otherwise. The cursor stays at succeed, i.e., enough space available, NULL otherwise. The cursor stays at
the same position. */ the same logical position, but the physical position may change if it is
pointing to a compressed page that was reorganized. */
UNIV_INLINE UNIV_INLINE
rec_t* rec_t*
page_cur_rec_insert( page_cur_rec_insert(
/*================*/ /*================*/
/* out: pointer to record if succeed, NULL /* out: pointer to record if succeed, NULL
otherwise */ otherwise */
page_cur_t* cursor, /* in: a page cursor */ page_cur_t* cursor, /* in/out: a page cursor */
rec_t* rec, /* in: record to insert */ const rec_t* rec, /* in: record to insert */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /* in: mini-transaction handle, or NULL */ mtr_t* mtr) /* in: mini-transaction handle, or NULL */
......
...@@ -895,7 +895,7 @@ page_cur_insert_rec_low( ...@@ -895,7 +895,7 @@ page_cur_insert_rec_low(
rec_t* current_rec,/* in: pointer to current record after rec_t* current_rec,/* in: pointer to current record after
which the new record is inserted */ which the new record is inserted */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
rec_t* rec, /* in: pointer to a physical record */ const rec_t* rec, /* in: pointer to a physical record */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /* in: mini-transaction handle, or NULL */ mtr_t* mtr) /* in: mini-transaction handle, or NULL */
{ {
...@@ -1141,7 +1141,7 @@ page_cur_insert_rec_zip( ...@@ -1141,7 +1141,7 @@ page_cur_insert_rec_zip(
which the new record is inserted */ which the new record is inserted */
buf_block_t* block, /* in: buffer block of *current_rec */ buf_block_t* block, /* in: buffer block of *current_rec */
dict_index_t* index, /* in: record descriptor */ dict_index_t* index, /* in: record descriptor */
rec_t* rec, /* in: pointer to a physical record */ const rec_t* rec, /* in: pointer to a physical record */
ulint* offsets,/* in/out: rec_get_offsets(rec, index) */ ulint* offsets,/* in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /* in: mini-transaction handle, or NULL */ mtr_t* mtr) /* in: mini-transaction handle, or NULL */
{ {
......
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