summaryrefslogtreecommitdiff
path: root/storage/xtradb/read/read0read.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/read/read0read.c')
-rw-r--r--storage/xtradb/read/read0read.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/storage/xtradb/read/read0read.c b/storage/xtradb/read/read0read.c
index e3e5ee5d623..85adae4ddff 100644
--- a/storage/xtradb/read/read0read.c
+++ b/storage/xtradb/read/read0read.c
@@ -16,7 +16,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
-/******************************************************
+/**************************************************//**
+@file read/read0read.c
Cursor read
Created 2/16/1997 Heikki Tuuri
@@ -136,39 +137,40 @@ TODO: proof this
*/
-/*************************************************************************
-Creates a read view object. */
+/*********************************************************************//**
+Creates a read view object.
+@return own: read view struct */
UNIV_INLINE
read_view_t*
read_view_create_low(
/*=================*/
- /* out, own: read view struct */
- ulint n, /* in: number of cells in the trx_ids array */
- mem_heap_t* heap) /* in: memory heap from which allocated */
+ ulint n, /*!< in: number of cells in the trx_ids array */
+ mem_heap_t* heap) /*!< in: memory heap from which allocated */
{
read_view_t* view;
view = mem_heap_alloc(heap, sizeof(read_view_t));
view->n_trx_ids = n;
- view->trx_ids = mem_heap_alloc(heap, n * sizeof(dulint));
+ view->trx_ids = mem_heap_alloc(heap, n * sizeof *view->trx_ids);
return(view);
}
-/*************************************************************************
+/*********************************************************************//**
Makes a copy of the oldest existing read view, with the exception that also
the creating trx of the oldest view is set as not visible in the 'copied'
view. Opens a new view if no views currently exist. The view must be closed
-with ..._close. This is used in purge. */
+with ..._close. This is used in purge.
+@return own: read view struct */
UNIV_INTERN
read_view_t*
read_view_oldest_copy_or_open_new(
/*==============================*/
- /* out, own: read view struct */
- dulint cr_trx_id, /* in: trx_id of creating
- transaction, or (0, 0) used in purge*/
- mem_heap_t* heap) /* in: memory heap from which
+ trx_id_t cr_trx_id, /*!< in: trx_id of creating
+ transaction, or ut_dulint_zero
+ used in purge */
+ mem_heap_t* heap) /*!< in: memory heap from which
allocated */
{
read_view_t* old_view;
@@ -241,18 +243,18 @@ read_view_oldest_copy_or_open_new(
return(view_copy);
}
-/*************************************************************************
+/*********************************************************************//**
Opens a read view where exactly the transactions serialized before this
-point in time are seen in the view. */
+point in time are seen in the view.
+@return own: read view struct */
UNIV_INTERN
read_view_t*
read_view_open_now(
/*===============*/
- /* out, own: read view struct */
- dulint cr_trx_id, /* in: trx_id of creating
- transaction, or (0, 0) used in
- purge */
- mem_heap_t* heap) /* in: memory heap from which
+ trx_id_t cr_trx_id, /*!< in: trx_id of creating
+ transaction, or ut_dulint_zero
+ used in purge */
+ mem_heap_t* heap) /*!< in: memory heap from which
allocated */
{
read_view_t* view;
@@ -316,27 +318,27 @@ read_view_open_now(
return(view);
}
-/*************************************************************************
+/*********************************************************************//**
Closes a read view. */
UNIV_INTERN
void
read_view_close(
/*============*/
- read_view_t* view) /* in: read view */
+ read_view_t* view) /*!< in: read view */
{
ut_ad(mutex_own(&kernel_mutex));
UT_LIST_REMOVE(view_list, trx_sys->view_list, view);
}
-/*************************************************************************
+/*********************************************************************//**
Closes a consistent read view for MySQL. This function is called at an SQL
statement end if the trx isolation level is <= TRX_ISO_READ_COMMITTED. */
UNIV_INTERN
void
read_view_close_for_mysql(
/*======================*/
- trx_t* trx) /* in: trx which has a read view */
+ trx_t* trx) /*!< in: trx which has a read view */
{
ut_a(trx->global_read_view);
@@ -352,13 +354,13 @@ read_view_close_for_mysql(
mutex_exit(&kernel_mutex);
}
-/*************************************************************************
+/*********************************************************************//**
Prints a read view to stderr. */
UNIV_INTERN
void
read_view_print(
/*============*/
- read_view_t* view) /* in: read view */
+ const read_view_t* view) /*!< in: read view */
{
ulint n_ids;
ulint i;
@@ -393,7 +395,7 @@ read_view_print(
}
}
-/*************************************************************************
+/*********************************************************************//**
Create a high-granularity consistent cursor view for mysql to be used
in cursors. In this consistent read view modifications done by the
creating transaction after the cursor is created or future transactions
@@ -402,7 +404,7 @@ UNIV_INTERN
cursor_view_t*
read_cursor_view_create_for_mysql(
/*==============================*/
- trx_t* cr_trx) /* in: trx where cursor view is created */
+ trx_t* cr_trx) /*!< in: trx where cursor view is created */
{
cursor_view_t* curview;
read_view_t* view;
@@ -485,15 +487,15 @@ read_cursor_view_create_for_mysql(
return(curview);
}
-/*************************************************************************
+/*********************************************************************//**
Close a given consistent cursor view for mysql and restore global read view
back to a transaction read view. */
UNIV_INTERN
void
read_cursor_view_close_for_mysql(
/*=============================*/
- trx_t* trx, /* in: trx */
- cursor_view_t* curview)/* in: cursor view to be closed */
+ trx_t* trx, /*!< in: trx */
+ cursor_view_t* curview)/*!< in: cursor view to be closed */
{
ut_a(curview);
ut_a(curview->read_view);
@@ -513,7 +515,7 @@ read_cursor_view_close_for_mysql(
mem_heap_free(curview->heap);
}
-/*************************************************************************
+/*********************************************************************//**
This function sets a given consistent cursor view to a transaction
read view if given consistent cursor view is not NULL. Otherwise, function
restores a global read view to a transaction read view. */
@@ -521,8 +523,8 @@ UNIV_INTERN
void
read_cursor_set_for_mysql(
/*======================*/
- trx_t* trx, /* in: transaction where cursor is set */
- cursor_view_t* curview)/* in: consistent cursor view to be set */
+ trx_t* trx, /*!< in: transaction where cursor is set */
+ cursor_view_t* curview)/*!< in: consistent cursor view to be set */
{
ut_a(trx);