2
* Copyright (C) 2013 Drizzle Developer Group
3
* Copyright (C) 2013 Kuldeep Porwal
6
* Use and distribution licensed under the BSD license. See
7
* the COPYING file in the parent directory for full text.
9
* summary: parse table map event
15
#ifndef event_interface
16
#define event_interface
17
#include"event_interface.h"
29
//using namespace binlogevent;
32
class TableMapEvent : public Events
36
TableMapEvent() : table_id(-1),
43
column_type_def(NULL),
44
column_meta_data(NULL)
54
* Get the raw data and call all the setters with
57
* @param[in] data Raw data from binglog.
60
void initWithData(const unsigned char * data);
66
* @retval timestamp of event.
69
uint32_t getTimestamp();
71
* @retval type of event.
74
enum_event_type getType();
76
* @retval server-id of the originating mysql-server. Used to filter out events in circular replication.
79
uint32_t getServerId();
81
* @retval of position of the next event .
86
* @retval Binlog Event Flag from header
92
* @retval numeric table id
95
uint64_t getTableId();
97
* @retval flag of post header
100
uint16_t getFlagPh();
102
* @retval length of the schema name
105
int getSchemaNameLen();
107
* @retval schema name
110
char * getSchemaName();
112
* @retval length of table name
115
int getTableNameLen();
120
char * getTableName();
122
* In funtion : conversion of length-encoded integer into its numeric value
123
* @retval number of columns in the table map
126
uint64_t getColumnCount();
128
* @retval array of column definitions, one byte per field type
131
uint8_t * getColumnTypeDef();
134
* @retval enum {INT,STRING} as a type of column
138
enum_col_type getColType(int colNo);
143
void setTableId(uint64_t value);
147
* @param[in] value Post header flag.
150
void setFlagPh(uint16_t value);
152
* set schema_name_len.
154
* @param[in] value Length of the schema name.
157
void setSchemaNameLen(uint8_t value);
161
* @param[in] value Schema Name or Database name.
164
void setSchemaName(char *value);
166
* set table_name_len.
168
* @param[in] value Table name length.
171
void setTableNameLen(uint8_t value);
175
* @param[in] value Table name.
178
void setTableName(char *value);
182
* @param[in] value Column count in table map.
185
void setColumnCount(uint64_t value);
187
* set column_type_def.
189
* @param[in] value Array of column definitions, one byte per field type
192
void setColumnTypeDef(uint8_t * value);
198
uint16_t flag; //post header
199
uint8_t schema_name_len;
201
uint8_t table_name_len;
203
uint64_t column_count;
204
uint8_t * column_type_def;
205
uint64_t * column_meta_data;
208
} /*namespace binlogevent*/