-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMyEvent.cpp
77 lines (68 loc) · 1.65 KB
/
MyEvent.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// Created by 顾伟刚 on 15/5/27.
//
#include "MyEvent.h"
std::string event_types[] = {
"Unknown",
"Start_v3",
"Query",
"Stop",
"Rotate",
"Intvar",
"Load",
"Slave",
"Create_file",
"Append_block",
"Exec_load",
"Delete_file",
"New_load",
"RAND",
"User var",
"Format_desc",
"Xid",
"Begin_load_query",
"Execute_load_query",
"Table_map",
"Write_rows_event_old",
"Update_rows_event_old",
"Delete_rows_event_old",
"Write_rows_v1",
"Update_rows_v1",
"Delete_rows_v1",
"Incident",
"Heartbeat",
"Ignorable",
"Rows_query",
"Write_rows",
"Update_rows",
"Delete_rows",
"Gtid",
"Anonymous_Gtid",
"Previous_gtids",
"User Defined"
};
MyEvent::~MyEvent() {
}
bool MyEvent::is_rows_event() {
if(m_type == binary_log::PRE_GA_WRITE_ROWS_EVENT ||
m_type == binary_log::PRE_GA_UPDATE_ROWS_EVENT ||
m_type == binary_log::PRE_GA_DELETE_ROWS_EVENT ||
m_type == binary_log::WRITE_ROWS_EVENT ||
m_type == binary_log::WRITE_ROWS_EVENT_V1 ||
m_type == binary_log::UPDATE_ROWS_EVENT ||
m_type == binary_log::UPDATE_ROWS_EVENT_V1 ||
m_type == binary_log::DELETE_ROWS_EVENT ||
m_type == binary_log::DELETE_ROWS_EVENT_V1) {
return true;
}
return false;
}
std::string MyEvent::get_type_str() {
return event_types[m_type];
}
MyEvent::MyEvent() {
}
int MyEvent::set_type(Log_event_type type) {
m_type = type;
return ERR_OK;
}