MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
read0read.h File Reference
#include "univ.i"
#include "ut0byte.h"
#include "ut0lst.h"
#include "trx0trx.h"
#include "read0types.h"
#include "read0read.ic"
Include dependency graph for read0read.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  read_view_t
struct  cursor_view_t

Macros

#define VIEW_NORMAL   1
#define VIEW_HIGH_GRANULARITY   2

Functions

UNIV_INTERN read_view_tread_view_open_now (trx_id_t cr_trx_id, mem_heap_t *heap)
UNIV_INTERN read_view_tread_view_purge_open (mem_heap_t *heap)
UNIV_INLINE void read_view_remove (read_view_t *view, bool own_mutex)
UNIV_INTERN void read_view_close_for_mysql (trx_t *trx)
UNIV_INLINE bool read_view_sees_trx_id (const read_view_t *view, trx_id_t trx_id) __attribute__((nonnull
UNIV_INTERN void read_view_print (const read_view_t *view)
UNIV_INTERN cursor_view_tread_cursor_view_create_for_mysql (trx_t *cr_trx)
UNIV_INTERN void read_cursor_view_close_for_mysql (trx_t *trx, cursor_view_t *curview)
UNIV_INTERN void read_cursor_set_for_mysql (trx_t *trx, cursor_view_t *curview)

Variables

UNIV_INLINE bool warn_unused_result

Detailed Description

Cursor read

Created 2/16/1997 Heikki Tuuri

Definition in file read0read.h.

Macro Definition Documentation

#define VIEW_HIGH_GRANULARITY   2

High-granularity read view where transaction does not see changes made by active transactions and own changes after a point in time when this read view was created.

Definition at line 168 of file read0read.h.

#define VIEW_NORMAL   1

Read view types Normal consistent read view where transaction does not see changes made by active transactions except creating transaction.

Definition at line 164 of file read0read.h.

Function Documentation

UNIV_INTERN void read_cursor_set_for_mysql ( trx_t trx,
cursor_view_t curview 
)

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. in: consistent cursor view to be set

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.

Parameters
trxin: transaction where cursor is set
curviewin: consistent cursor view to be set

Definition at line 636 of file read0read.cc.

UNIV_INTERN void read_cursor_view_close_for_mysql ( trx_t trx,
cursor_view_t curview 
)

Close a given consistent cursor view for mysql and restore global read view back to a transaction read view. in: cursor view to be closed

Close a given consistent cursor view for mysql and restore global read view back to a transaction read view.

Parameters
trxin: trx
curviewin: cursor view to be closed

Definition at line 610 of file read0read.cc.

Here is the call graph for this function:

UNIV_INTERN cursor_view_t* read_cursor_view_create_for_mysql ( trx_t cr_trx)

Create a consistent cursor view for mysql to be used in cursors. In this consistent read view modifications done by the creating transaction or future transactions are not visible. in: trx where cursor view is created

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 are not visible.

Parameters
cr_trxin: trx where cursor view is created

Definition at line 543 of file read0read.cc.

Here is the call graph for this function:

UNIV_INTERN void read_view_close_for_mysql ( trx_t trx)

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. in: trx which has a read 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.

Parameters
trxin: trx which has a read view

Definition at line 484 of file read0read.cc.

Here is the call graph for this function:

UNIV_INTERN read_view_t* read_view_open_now ( trx_id_t  cr_trx_id,
mem_heap_t heap 
)

Opens a read view where exactly the transactions serialized before this point in time are seen in the view.

Returns
own: read view struct in: memory heap from which allocated

Opens a read view where exactly the transactions serialized before this point in time are seen in the view.

Returns
own: read view struct
Parameters
cr_trx_idin: trx_id of creating transaction, or 0 used in purge
heapin: memory heap from which allocated

Definition at line 377 of file read0read.cc.

UNIV_INTERN void read_view_print ( const read_view_t view)

Prints a read view to stderr. in: read view

Prints a read view to stderr.

Parameters
viewin: read view

Definition at line 502 of file read0read.cc.

UNIV_INTERN read_view_t* read_view_purge_open ( mem_heap_t heap)

Makes a copy of the oldest existing read view, or opens a new. The view must be closed with ..._close.

Returns
own: read view struct in: memory heap from which allocated

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.

Returns
own: read view struct
Parameters
heapin: memory heap from which allocated

Definition at line 403 of file read0read.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INLINE void read_view_remove ( read_view_t view,
bool  own_mutex 
)

Remove a read view from the trx_sys->view_list. in: true if caller owns the trx_sys_t::mutex

Parameters
viewin: read view, can be 0

Here is the caller graph for this function:

UNIV_INLINE bool read_view_sees_trx_id ( const read_view_t view,
trx_id_t  trx_id 
)

Checks if a read view sees the specified transaction.

Returns
true if sees
Parameters
viewin: read view
trx_idin: trx id

Here is the caller graph for this function: