MySQL 5.6.14 Source Code Document
|
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) |
Interface to MySQL Handler functions, currently used for binlogging
Created 3/14/2011 Jimmy Yang
Definition in file handler_api.h.
#define HDL_READ 0x1 |
Defines for handler_unlock_table()'s mode field
Definition at line 33 of file handler_api.h.
typedef enum hdl_op_type hdl_op_type_t |
Defines for handler_binlog_row()'s mode field
enum hdl_op_type |
Defines for handler_binlog_row()'s mode field
Definition at line 37 of file handler_api.h.
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
my_thd | in: THD* |
my_table | in: TABLE structure |
Definition at line 206 of file handler_api.cc.
void handler_binlog_rollback | ( | void * | my_thd, |
void * | my_table | ||
) |
Rollback a transaction in: TABLE structure
Rollback a transaction
my_thd | in: THD* |
my_table | in: TABLE structure |
Definition at line 222 of file handler_api.cc.
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
my_thd | in: THD* |
my_table | in: TABLE structure |
mode | in: type of DML |
Definition at line 166 of file handler_api.cc.
void handler_binlog_truncate | ( | void * | my_thd, |
char * | table_name | ||
) |
binlog a truncate table statement in: table name
Binlog a truncate table statement
my_thd | in: THD* |
table_name | in: table name |
Definition at line 242 of file handler_api.cc.
void handler_close_thd | ( | void * | my_thd | ) |
close an handler in: thread
Close the handler
my_thd | in: THD |
Definition at line 360 of file handler_api.cc.
void* handler_create_thd | ( | bool | enable_binlog | ) |
Creates a THD object.
Create a THD object.
enable_binlog | in: whether to enable binlog |
Definition at line 70 of file handler_api.cc.
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 MySQL "TABLE" object with specified database name and table name.
my_thd | in: THD* |
db_name | in: NUL terminated database name |
table_name | in: NUL terminated table name |
lock_type | in: lock mode |
Definition at line 130 of file handler_api.cc.
void handler_rec_init | ( | void * | my_table | ) |
Reset TABLE->record[0] in: Table metadata
Reset TABLE->record[0]
my_table | in/out: TABLE structure |
Definition at line 266 of file handler_api.cc.
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]
my_table | in/out: TABLE structure |
field_id | in: Field ID for the field |
value | in: value to set |
unsigned_flag | in: whether it is unsigned |
is_null | in: whether it is null value |
Definition at line 301 of file handler_api.cc.
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"
my_table | in/out: TABLE structure |
field_id | in: Field ID for the field |
str | in: string to set |
len | in: length of string |
Definition at line 276 of file handler_api.cc.
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]
my_table | in/out: TABLE structure |
field_id | in: Field ID for the field |
value | in: value to set |
unsigned_flag | in: whether it is unsigned |
is_null | in: whether it is null value |
Definition at line 325 of file handler_api.cc.
void handler_store_record | ( | void * | my_table | ) |
copy an record in: TABLE
Store a record
my_table | in: TABLE |
Definition at line 350 of file handler_api.cc.
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
my_thd | in: THD* |
original_thd | out: current THD |
Definition at line 109 of file handler_api.cc.
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
my_thd | in: thread |
my_table | in: Table metadata |
mode | in: mode |
Definition at line 380 of file handler_api.cc.