MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
handler_api.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MYSQL_SERVER   1
#define HDL_READ   0x1
#define HDL_WRITE   0x2

Typedefs

typedef enum hdl_op_type hdl_op_type_t

Enumerations

enum  hdl_op_type { HDL_UPDATE, HDL_INSERT, HDL_DELETE }

Functions

void * handler_create_thd (bool enable_binlog)
void * handler_open_table (void *my_thd, const char *db_name, const char *table_name, int lock_mode)
void handler_binlog_row (void *my_thd, void *my_table, int mode)
void handler_thd_attach (void *my_thd, void **original_thd)
void handler_binlog_commit (void *my_thd, void *my_table)
void handler_binlog_rollback (void *my_thd, void *my_table)
void handler_rec_init (void *my_table)
void handler_rec_setup_str (void *my_table, int field_id, const char *str, int len)
void handler_rec_setup_int (void *my_table, int field_id, int value, bool unsigned_flag, bool is_null)
void handler_rec_setup_uint64 (void *my_table, int field_id, unsigned long long value, bool unsigned_flag, bool is_null)
int handler_unlock_table (void *my_thd, void *my_table, int mode)
void handler_close_thd (void *my_thd)
void handler_store_record (void *my_table)
void handler_binlog_truncate (void *my_thd, char *table_name)

Detailed Description

Interface to MySQL Handler functions, currently used for binlogging

Created 3/14/2011 Jimmy Yang

Definition in file handler_api.h.

Macro Definition Documentation

#define HDL_READ   0x1

Defines for handler_unlock_table()'s mode field

Definition at line 33 of file handler_api.h.

Typedef Documentation

typedef enum hdl_op_type hdl_op_type_t

Defines for handler_binlog_row()'s mode field

Enumeration Type Documentation

Defines for handler_binlog_row()'s mode field

Definition at line 37 of file handler_api.h.

Function Documentation

void handler_binlog_commit ( void *  my_thd,
void *  my_table 
)

Commit and flush binlog from cache to binlog file in: TABLE structure

Commit and flush binlog from cache to binlog file

Parameters
my_thdin: THD*
my_tablein: TABLE structure

Definition at line 206 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_binlog_rollback ( void *  my_thd,
void *  my_table 
)

Rollback a transaction in: TABLE structure

Rollback a transaction

Parameters
my_thdin: THD*
my_tablein: TABLE structure

Definition at line 222 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_binlog_row ( void *  my_thd,
void *  my_table,
int  mode 
)

Wrapper of function binlog_log_row() to binlog an operation on a row in: type of DML

Wrapper of function binlog_log_row() to binlog an operation on a row

Parameters
my_thdin: THD*
my_tablein: TABLE structure
modein: type of DML

Definition at line 166 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_binlog_truncate ( void *  my_thd,
char *  table_name 
)

binlog a truncate table statement in: table name

Binlog a truncate table statement

Parameters
my_thdin: THD*
table_namein: table name

Definition at line 242 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_close_thd ( void *  my_thd)

close an handler in: thread

Close the handler

Parameters
my_thdin: THD

Definition at line 360 of file handler_api.cc.

Here is the caller graph for this function:

void* handler_create_thd ( bool  enable_binlog)

Creates a THD object.

Returns
a pointer to the THD object, NULL if failed in: whether to enable binlog

Create a THD object.

Returns
a pointer to the THD object, NULL if failed
Parameters
enable_binlogin: whether to enable binlog

Definition at line 70 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void* handler_open_table ( void *  my_thd,
const char *  db_name,
const char *  table_name,
int  lock_type 
)

Creates a MySQL TABLE object with specified database name and table name.

Returns
a pointer to the TABLE object, NULL if does not exist in: lock mode

Returns a MySQL "TABLE" object with specified database name and table name.

Returns
a pointer to the TABLE object, NULL if does not exist
Parameters
my_thdin: THD*
db_namein: NUL terminated database name
table_namein: NUL terminated table name
lock_typein: lock mode

Definition at line 130 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_rec_init ( void *  my_table)

Reset TABLE->record[0] in: Table metadata

Reset TABLE->record[0]

Parameters
my_tablein/out: TABLE structure

Definition at line 266 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_rec_setup_int ( void *  my_table,
int  field_id,
int  value,
bool  unsigned_flag,
bool  is_null 
)

Set up an integer field in TABLE->record[0] in: whether it is null value

Set up an integer field in TABLE->record[0]

Parameters
my_tablein/out: TABLE structure
field_idin: Field ID for the field
valuein: value to set
unsigned_flagin: whether it is unsigned
is_nullin: whether it is null value

Definition at line 301 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_rec_setup_str ( void *  my_table,
int  field_id,
const char *  str,
int  len 
)

Store a string in TABLE->record[0] for field specified by "field_id" in: length of string

Store a string in TABLE->record[0] for field specified by "field_id"

Parameters
my_tablein/out: TABLE structure
field_idin: Field ID for the field
strin: string to set
lenin: length of string

Definition at line 276 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_rec_setup_uint64 ( void *  my_table,
int  field_id,
unsigned long long  value,
bool  unsigned_flag,
bool  is_null 
)

Set up an integer field in TABLE->record[0] in: whether it is null value

Set up an unsigned int64 field in TABLE->record[0]

Parameters
my_tablein/out: TABLE structure
field_idin: Field ID for the field
valuein: value to set
unsigned_flagin: whether it is unsigned
is_nullin: whether it is null value

Definition at line 325 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_store_record ( void *  my_table)

copy an record in: TABLE

Store a record

Parameters
my_tablein: TABLE

Definition at line 350 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void handler_thd_attach ( void *  my_thd,
void **  original_thd 
)

This is used to temporarily switch to another session, so that POSIX thread looks like session attached to out: the current THD

This is used to temporarily switch to another session, so that POSIX thread looks like session attached to

Parameters
my_thdin: THD*
original_thdout: current THD

Definition at line 109 of file handler_api.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int handler_unlock_table ( void *  my_thd,
void *  my_table,
int  mode 
)

Unlock a table and commit the transaction return 0 if fail to commit the transaction in: mode

Unlock a table and commit the transaction return 0 if failed to commit the transaction

Parameters
my_thdin: thread
my_tablein: Table metadata
modein: mode

Definition at line 380 of file handler_api.cc.

Here is the caller graph for this function: