My Project
Classes | Defines | Typedefs | Enumerations | Functions | Variables
log_event.h File Reference

Binary log event definitions. This includes generic code common to all types of log events, as well as specific code for each type of log event. More...

#include <my_bitmap.h>
#include "rpl_constants.h"
#include "table_id.h"
#include <set>
#include "log_event_old.h"

Go to the source code of this file.

Classes

struct  old_sql_ex
struct  sql_ex_info
struct  st_mts_db_names
class  Log_event
class  Query_log_event
class  Load_log_event
class  Start_log_event_v3
class  Format_description_log_event
class  Intvar_log_event
class  Rand_log_event
class  Xid_log_event
class  User_var_log_event
class  Stop_log_event
class  Rotate_log_event
class  Create_file_log_event
class  Append_block_log_event
class  Delete_file_log_event
class  Execute_load_log_event
class  Begin_load_query_log_event
class  Execute_load_query_log_event
class  Table_map_log_event
class  Rows_log_event
class  Write_rows_log_event
class  Update_rows_log_event
class  Delete_rows_log_event
class  Incident_log_event
class  Ignorable_log_event
class  Rows_query_log_event
class  Gtid_log_event
class  Previous_gtids_log_event

Defines

#define PREFIX_SQL_LOAD   "SQL_LOAD-"
#define TEMP_FILE_MAX_LEN   UUID_LENGTH+38
#define ASSERT_OR_RETURN_ERROR(COND, ERRNO)   DBUG_ASSERT(COND)
#define LOG_READ_EOF   -1
#define LOG_READ_BOGUS   -2
#define LOG_READ_IO   -3
#define LOG_READ_MEM   -5
#define LOG_READ_TRUNC   -6
#define LOG_READ_TOO_LARGE   -7
#define LOG_READ_CHECKSUM_FAILURE   -8
#define LOG_EVENT_OFFSET   4
#define BINLOG_VERSION   4
#define ST_SERVER_VER_LEN   50
#define DUMPFILE_FLAG   0x1
#define OPT_ENCLOSED_FLAG   0x2
#define REPLACE_FLAG   0x4
#define IGNORE_FLAG   0x8
#define FIELD_TERM_EMPTY   0x1
#define ENCLOSED_EMPTY   0x2
#define LINE_TERM_EMPTY   0x4
#define LINE_START_EMPTY   0x8
#define ESCAPED_EMPTY   0x10
#define NUM_LOAD_DELIM_STRS   5
#define LOG_EVENT_HEADER_LEN   19U /* the fixed header length */
#define OLD_HEADER_LEN   13U /* the fixed header length in 3.23 */
#define LOG_EVENT_MINIMAL_HEADER_LEN   19U
#define QUERY_HEADER_MINIMAL_LEN   (4 + 4 + 1 + 2)
#define QUERY_HEADER_LEN   (QUERY_HEADER_MINIMAL_LEN + 2)
#define STOP_HEADER_LEN   0
#define LOAD_HEADER_LEN   (4 + 4 + 4 + 1 +1 + 4)
#define START_V3_HEADER_LEN   (2 + ST_SERVER_VER_LEN + 4)
#define ROTATE_HEADER_LEN   8
#define INTVAR_HEADER_LEN   0
#define CREATE_FILE_HEADER_LEN   4
#define APPEND_BLOCK_HEADER_LEN   4
#define EXEC_LOAD_HEADER_LEN   4
#define DELETE_FILE_HEADER_LEN   4
#define NEW_LOAD_HEADER_LEN   LOAD_HEADER_LEN
#define RAND_HEADER_LEN   0
#define USER_VAR_HEADER_LEN   0
#define FORMAT_DESCRIPTION_HEADER_LEN   (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES)
#define XID_HEADER_LEN   0
#define BEGIN_LOAD_QUERY_HEADER_LEN   APPEND_BLOCK_HEADER_LEN
#define ROWS_HEADER_LEN_V1   8
#define TABLE_MAP_HEADER_LEN   8
#define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN   (4 + 4 + 4 + 1)
#define EXECUTE_LOAD_QUERY_HEADER_LEN   (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
#define INCIDENT_HEADER_LEN   2
#define HEARTBEAT_HEADER_LEN   0
#define IGNORABLE_HEADER_LEN   0
#define ROWS_HEADER_LEN_V2   10
#define MAX_DBS_IN_EVENT_MTS   16
#define OVER_MAX_DBS_IN_EVENT_MTS   254
#define MAX_SIZE_LOG_EVENT_STATUS
#define MAX_LOG_EVENT_HEADER
#define MAX_MAX_ALLOWED_PACKET   1024*1024*1024
#define EVENT_TYPE_OFFSET   4
#define SERVER_ID_OFFSET   5
#define EVENT_LEN_OFFSET   9
#define LOG_POS_OFFSET   13
#define FLAGS_OFFSET   17
#define ST_BINLOG_VER_OFFSET   0
#define ST_SERVER_VER_OFFSET   2
#define ST_CREATED_OFFSET   (ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN)
#define ST_COMMON_HEADER_LEN_OFFSET   (ST_CREATED_OFFSET + 4)
#define SL_MASTER_PORT_OFFSET   8
#define SL_MASTER_POS_OFFSET   0
#define SL_MASTER_HOST_OFFSET   10
#define Q_THREAD_ID_OFFSET   0
#define Q_EXEC_TIME_OFFSET   4
#define Q_DB_LEN_OFFSET   8
#define Q_ERR_CODE_OFFSET   9
#define Q_STATUS_VARS_LEN_OFFSET   11
#define Q_DATA_OFFSET   QUERY_HEADER_LEN
#define Q_FLAGS2_CODE   0
#define Q_SQL_MODE_CODE   1
#define Q_CATALOG_CODE   2
#define Q_AUTO_INCREMENT   3
#define Q_CHARSET_CODE   4
#define Q_TIME_ZONE_CODE   5
#define Q_CATALOG_NZ_CODE   6
#define Q_LC_TIME_NAMES_CODE   7
#define Q_CHARSET_DATABASE_CODE   8
#define Q_TABLE_MAP_FOR_UPDATE_CODE   9
#define Q_MASTER_DATA_WRITTEN_CODE   10
#define Q_INVOKER   11
#define Q_UPDATED_DB_NAMES   12
#define Q_MICROSECONDS   13
#define I_TYPE_OFFSET   0
#define I_VAL_OFFSET   1
#define RAND_SEED1_OFFSET   0
#define RAND_SEED2_OFFSET   8
#define UV_VAL_LEN_SIZE   4
#define UV_VAL_IS_NULL   1
#define UV_VAL_TYPE_SIZE   1
#define UV_NAME_LEN_SIZE   4
#define UV_CHARSET_NUMBER_SIZE   4
#define L_THREAD_ID_OFFSET   0
#define L_EXEC_TIME_OFFSET   4
#define L_SKIP_LINES_OFFSET   8
#define L_TBL_LEN_OFFSET   12
#define L_DB_LEN_OFFSET   13
#define L_NUM_FIELDS_OFFSET   14
#define L_SQL_EX_OFFSET   18
#define L_DATA_OFFSET   LOAD_HEADER_LEN
#define R_POS_OFFSET   0
#define R_IDENT_OFFSET   8
#define CF_FILE_ID_OFFSET   0
#define CF_DATA_OFFSET   CREATE_FILE_HEADER_LEN
#define AB_FILE_ID_OFFSET   0
#define AB_DATA_OFFSET   APPEND_BLOCK_HEADER_LEN
#define EL_FILE_ID_OFFSET   0
#define DF_FILE_ID_OFFSET   0
#define TM_MAPID_OFFSET   0
#define TM_FLAGS_OFFSET   6
#define RW_MAPID_OFFSET   0
#define RW_FLAGS_OFFSET   6
#define RW_VHLEN_OFFSET   8
#define RW_V_TAG_LEN   1
#define RW_V_EXTRAINFO_TAG   0
#define ELQ_FILE_ID_OFFSET   QUERY_HEADER_LEN
#define ELQ_FN_POS_START_OFFSET   ELQ_FILE_ID_OFFSET + 4
#define ELQ_FN_POS_END_OFFSET   ELQ_FILE_ID_OFFSET + 8
#define ELQ_DUP_HANDLING_OFFSET   ELQ_FILE_ID_OFFSET + 12
#define BINLOG_MAGIC   "\xfe\x62\x69\x6e"
#define LOG_EVENT_BINLOG_IN_USE_F   0x1
#define LOG_EVENT_THREAD_SPECIFIC_F   0x4
#define LOG_EVENT_SUPPRESS_USE_F   0x8
#define LOG_EVENT_ARTIFICIAL_F   0x20
#define LOG_EVENT_RELAY_LOG_F   0x40
#define LOG_EVENT_IGNORABLE_F   0x80
#define LOG_EVENT_NO_FILTER_F   0x100
#define LOG_EVENT_MTS_ISOLATE_F   0x200
#define OPTIONS_WRITTEN_TO_BIN_LOG
#define EXPECTED_OPTIONS   ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19))
#define CHECKSUM_CRC32_SIGNATURE_LEN   4
#define BINLOG_CHECKSUM_LEN   CHECKSUM_CRC32_SIGNATURE_LEN
#define BINLOG_CHECKSUM_ALG_DESC_LEN   1 /* 1 byte checksum alg descriptor */
#define LOG_EVENT_TYPES   (ENUM_END_EVENT-1)

Typedefs

typedef ulonglong sql_mode_t
typedef struct
st_db_worker_hash_entry 
db_worker_hash_entry
typedef struct st_mts_db_names Mts_db_names

Enumerations

enum  enum_binlog_checksum_alg { BINLOG_CHECKSUM_ALG_OFF = 0, BINLOG_CHECKSUM_ALG_CRC32 = 1, BINLOG_CHECKSUM_ALG_ENUM_END, BINLOG_CHECKSUM_ALG_UNDEF = 255 }
enum  Log_event_type {
  UNKNOWN_EVENT = 0, START_EVENT_V3 = 1, QUERY_EVENT = 2, STOP_EVENT = 3,
  ROTATE_EVENT = 4, INTVAR_EVENT = 5, LOAD_EVENT = 6, SLAVE_EVENT = 7,
  CREATE_FILE_EVENT = 8, APPEND_BLOCK_EVENT = 9, EXEC_LOAD_EVENT = 10, DELETE_FILE_EVENT = 11,
  NEW_LOAD_EVENT = 12, RAND_EVENT = 13, USER_VAR_EVENT = 14, FORMAT_DESCRIPTION_EVENT = 15,
  XID_EVENT = 16, BEGIN_LOAD_QUERY_EVENT = 17, EXECUTE_LOAD_QUERY_EVENT = 18, TABLE_MAP_EVENT = 19,
  PRE_GA_WRITE_ROWS_EVENT = 20, PRE_GA_UPDATE_ROWS_EVENT = 21, PRE_GA_DELETE_ROWS_EVENT = 22, WRITE_ROWS_EVENT_V1 = 23,
  UPDATE_ROWS_EVENT_V1 = 24, DELETE_ROWS_EVENT_V1 = 25, INCIDENT_EVENT = 26, HEARTBEAT_LOG_EVENT = 27,
  IGNORABLE_LOG_EVENT = 28, ROWS_QUERY_LOG_EVENT = 29, WRITE_ROWS_EVENT = 30, UPDATE_ROWS_EVENT = 31,
  DELETE_ROWS_EVENT = 32, GTID_LOG_EVENT = 33, ANONYMOUS_GTID_LOG_EVENT = 34, PREVIOUS_GTIDS_LOG_EVENT = 35,
  ENUM_END_EVENT
}
enum  Int_event_type { INVALID_INT_EVENT = 0, LAST_INSERT_ID_EVENT = 1, INSERT_ID_EVENT = 2 }
enum  enum_load_dup_handling { LOAD_DUP_ERROR = 0, LOAD_DUP_IGNORE, LOAD_DUP_REPLACE }

Functions

char * str_to_hex (char *to, const char *from, uint len)
int append_query_string (THD *thd, const CHARSET_INFO *csinfo, String const *from, String *to)
bool event_checksum_test (uchar *buf, ulong event_len, uint8 alg)
uint8 get_checksum_alg (const char *buf, ulong len)
bool is_gtid_event (Log_event *evt)
ulong version_product (const uchar *version_split)
void do_server_version_split (char *version, uchar split_versions[3])
size_t my_strmov_quoted_identifier (char *buffer, const char *identifier)
size_t my_strmov_quoted_identifier_helper (int q, char *buffer, const char *identifier, uint length)

Variables

char server_version [SERVER_VERSION_LENGTH]
TYPELIB binlog_checksum_typelib

Detailed Description

Binary log event definitions. This includes generic code common to all types of log events, as well as specific code for each type of log event.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines