summaryrefslogtreecommitdiff
path: root/sql/log_event.h
diff options
context:
space:
mode:
authorLibing Song <libing.song@oracle.com>2012-12-01 08:06:45 +0800
committerLibing Song <libing.song@oracle.com>2012-12-01 08:06:45 +0800
commit775b5c02692dc9587501203a101b5e8c1e24d845 (patch)
tree24b6def08560a4095fa67a45b793930d5340a46d /sql/log_event.h
parenta418755a1a3f4d7ab25cd148147231b332e9bbe8 (diff)
parentbdfc4dc6c6927d4dc46e3cd0c4ff2a1595c174a3 (diff)
downloadmariadb-git-775b5c02692dc9587501203a101b5e8c1e24d845.tar.gz
Auto Merge
Diffstat (limited to 'sql/log_event.h')
-rw-r--r--sql/log_event.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index 1f12b607f5d..5b318463060 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1021,7 +1021,7 @@ public:
return thd ? thd->db : 0;
}
#else
- Log_event() : temp_buf(0) {}
+ Log_event() : temp_buf(0), flags(0) {}
/* avoid having to link mysqlbinlog against libpthread */
static Log_event* read_log_event(IO_CACHE* file,
const Format_description_log_event
@@ -2320,12 +2320,26 @@ public:
#ifdef MYSQL_SERVER
bool write(IO_CACHE* file);
#endif
- bool is_valid() const
+ bool header_is_valid() const
{
return ((common_header_len >= ((binlog_version==1) ? OLD_HEADER_LEN :
LOG_EVENT_MINIMAL_HEADER_LEN)) &&
(post_header_len != NULL));
}
+
+ bool version_is_valid() const
+ {
+ /* It is invalid only when all version numbers are 0 */
+ return !(server_version_split[0] == 0 &&
+ server_version_split[1] == 0 &&
+ server_version_split[2] == 0);
+ }
+
+ bool is_valid() const
+ {
+ return header_is_valid() && version_is_valid();
+ }
+
int get_data_size()
{
/*