InnoDB Plugin  1.0
Data Structures | Functions
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.

Data Structures

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))
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)

Detailed Description

Cursor read

Created 2/16/1997 Heikki Tuuri

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.

#define VIEW_NORMAL   1

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

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

Parameters
trxin: transaction where cursor is set
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

Parameters
trxin: trx
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

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

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
Parameters
cr_trx_idin: trx_id of creating transaction, or 0 used in purge
UNIV_INTERN void read_view_print ( const read_view_t view)

Prints a read view to stderr. in: read view

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
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

Remove a read view from the trx_sys->view_list.

Parameters
viewin: read view, can be 0
own_mutexin: true if caller owns the trx_sys_t::mutex
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