diff options
author | unknown <lars@mysql.com> | 2005-10-12 23:40:54 +0200 |
---|---|---|
committer | unknown <lars@mysql.com> | 2005-10-12 23:40:54 +0200 |
commit | 92291753ab057d994117a3970772025031df0121 (patch) | |
tree | 42f7b88c34c115fcc1fa6b90384ecec162d198ef /sql/log_event.h | |
parent | 431753ec6267b6ec3e5645f5be7f27da7db1c04a (diff) | |
parent | 4184dc214cebb30215859e269e5a8ac1ed8f87a5 (diff) | |
download | mariadb-git-92291753ab057d994117a3970772025031df0121.tar.gz |
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0
into mysql.com:/users/lthalmann/bk/mysql-5.0-hexdump
sql/log_event.cc:
Auto merged
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 67 |
1 files changed, 39 insertions, 28 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index 29580589a34..80dd40f0dd5 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -451,12 +451,18 @@ struct st_relay_log_info; #ifdef MYSQL_CLIENT /* - A structure for mysqlbinlog to remember the last db, flags2, sql_mode etc; it - is passed to events' print() methods, so that they print only the necessary - USE and SET commands. + A structure for mysqlbinlog to know how to print events + + This structure is passed to the event's print() methods so that only + the necessary USE and SET commands are printed. Last db, flags2, + sql_mode etc are stored here. + + The structure also contain other information on how to print the + events, e.g. short_form, hexdump_from. */ typedef struct st_last_event_info { + /* Old settings for database, sql_mode etc */ // TODO: have the last catalog here ?? char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is bool flags2_inited; @@ -480,6 +486,12 @@ typedef struct st_last_event_info bzero(charset, sizeof(charset)); bzero(time_zone_str, sizeof(time_zone_str)); } + + /* Settings on how to print the events */ + bool short_form; + my_off_t hexdump_from; + uint8 common_header_len; + } LAST_EVENT_INFO; #endif @@ -589,9 +601,9 @@ public: static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event *description_event); /* print*() functions are used by mysqlbinlog */ - virtual void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0) = 0; + virtual void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0) = 0; void print_timestamp(FILE* file, time_t *ts = 0); - void print_header(FILE* file); + void print_header(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif static void *operator new(size_t size) @@ -751,8 +763,8 @@ public: uint32 q_len_arg); #endif /* HAVE_REPLICATION */ #else - void print_query_header(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print_query_header(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Query_log_event(const char* buf, uint event_len, @@ -806,7 +818,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Slave_log_event(const char* buf, uint event_len); @@ -894,8 +906,8 @@ public: bool use_rli_only_for_errors); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info = 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool commented); + void print(FILE* file, LAST_EVENT_INFO* last_event_info = 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool commented); #endif /* @@ -984,7 +996,7 @@ public: #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Start_log_event_v3(const char* buf, @@ -1079,7 +1091,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Intvar_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1120,7 +1132,7 @@ class Rand_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Rand_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1157,7 +1169,7 @@ class Xid_log_event: public Log_event int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Xid_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1199,7 +1211,7 @@ public: void pack_info(Protocol* protocol); int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif User_var_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1225,7 +1237,7 @@ public: {} int exec_event(struct st_relay_log_info* rli); #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Stop_log_event(const char* buf, const Format_description_log_event* description_event): @@ -1264,7 +1276,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Rotate_log_event(const char* buf, uint event_len, @@ -1317,8 +1329,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Create_file_log_event(const char* buf, uint event_len, @@ -1385,7 +1397,7 @@ public: virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Append_block_log_event(const char* buf, uint event_len, @@ -1420,8 +1432,8 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, bool enable_local); #endif Delete_file_log_event(const char* buf, uint event_len, @@ -1456,7 +1468,7 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); #endif Execute_load_log_event(const char* buf, uint event_len, @@ -1541,11 +1553,10 @@ public: int exec_event(struct st_relay_log_info* rli); #endif /* HAVE_REPLICATION */ #else - void print(FILE* file, bool short_form = 0, - LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); /* Prints the query as LOAD DATA LOCAL and with rewritten filename */ - void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, - const char *local_fname); + void print(FILE* file, LAST_EVENT_INFO* last_event_info, + const char *local_fname); #endif Execute_load_query_log_event(const char* buf, uint event_len, const Format_description_log_event *description_event); @@ -1574,7 +1585,7 @@ public: Log_event(buf, description_event) {} ~Unknown_log_event() {} - void print(FILE* file, bool short_form= 0, LAST_EVENT_INFO* last_event_info= 0); + void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0); Log_event_type get_type_code() { return UNKNOWN_EVENT;} bool is_valid() const { return 1; } }; |