diff options
author | lars@mysql.com <> | 2005-10-19 19:42:14 +0200 |
---|---|---|
committer | lars@mysql.com <> | 2005-10-19 19:42:14 +0200 |
commit | 1aae3e1da1565760a9c349c9fbf34d6aab8385de (patch) | |
tree | 9afbc921773de2330e45bdd55145dfc7f01e7673 /sql/log_event.h | |
parent | bee76b78a248c5fe998bb6f6c8921e2c709be114 (diff) | |
parent | 4ccb1c6e36b91201c4fa3f8094bbc0038bbe04bb (diff) | |
download | mariadb-git-1aae3e1da1565760a9c349c9fbf34d6aab8385de.tar.gz |
Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0
into mysql.com:/users/lthalmann/bk/mysql-5.0-hexdump
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index b0f76aa1034..d8204314645 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -451,12 +451,23 @@ 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, + + There are two types of settings stored here: + 1. Last db, flags2, sql_mode etc comes from the last printed event. + They are stored so that only the necessary USE and SET commands + are printed. + 2. Other information on how to print the events, e.g. short_form, + hexdump_from. These are not dependent on the last event. */ -typedef struct st_last_event_info +typedef struct st_print_event_info { + /* + Settings for database, sql_mode etc that comes from the last event + that was printed. + */ // TODO: have the last catalog here ?? char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is bool flags2_inited; @@ -467,12 +478,12 @@ typedef struct st_last_event_info bool charset_inited; char charset[6]; // 3 variables, each of them storable in 2 bytes char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH]; - st_last_event_info() + st_print_event_info() :flags2_inited(0), sql_mode_inited(0), auto_increment_increment(1),auto_increment_offset(1), charset_inited(0) { /* - Currently we only use static LAST_EVENT_INFO objects, so zeroed at + Currently we only use static PRINT_EVENT_INFO objects, so zeroed at program's startup, but these explicit bzero() is for the day someone creates dynamic instances. */ @@ -480,7 +491,13 @@ typedef struct st_last_event_info bzero(charset, sizeof(charset)); bzero(time_zone_str, sizeof(time_zone_str)); } -} LAST_EVENT_INFO; + + /* Settings on how to print the events */ + bool short_form; + my_off_t hexdump_from; + uint8 common_header_len; + +} PRINT_EVENT_INFO; #endif @@ -589,9 +606,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, PRINT_EVENT_INFO* print_event_info= 0) = 0; void print_timestamp(FILE* file, time_t *ts = 0); - void print_header(FILE* file); + void print_header(FILE* file, PRINT_EVENT_INFO* print_event_info= 0); #endif static void *operator new(size_t size) @@ -751,8 +768,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, PRINT_EVENT_INFO* print_event_info= 0); + void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0); #endif Query_log_event(const char* buf, uint event_len, @@ -806,7 +823,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Slave_log_event(const char* buf, uint event_len); @@ -894,8 +911,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, PRINT_EVENT_INFO* print_event_info = 0); + void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented); #endif /* @@ -984,7 +1001,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Start_log_event_v3(const char* buf, @@ -1079,7 +1096,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Intvar_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1120,7 +1137,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Rand_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1157,7 +1174,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Xid_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1199,7 +1216,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, PRINT_EVENT_INFO* print_event_info= 0); #endif User_var_log_event(const char* buf, const Format_description_log_event* description_event); @@ -1225,7 +1242,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Stop_log_event(const char* buf, const Format_description_log_event* description_event): @@ -1263,7 +1280,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Rotate_log_event(const char* buf, uint event_len, @@ -1316,8 +1333,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, PRINT_EVENT_INFO* print_event_info= 0); + void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local); #endif Create_file_log_event(const char* buf, uint event_len, @@ -1384,7 +1401,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Append_block_log_event(const char* buf, uint event_len, @@ -1419,8 +1436,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, PRINT_EVENT_INFO* print_event_info= 0); + void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local); #endif Delete_file_log_event(const char* buf, uint event_len, @@ -1455,7 +1472,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, PRINT_EVENT_INFO* print_event_info= 0); #endif Execute_load_log_event(const char* buf, uint event_len, @@ -1540,11 +1557,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, PRINT_EVENT_INFO* print_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, PRINT_EVENT_INFO* print_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); @@ -1573,7 +1589,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, PRINT_EVENT_INFO* print_event_info= 0); Log_event_type get_type_code() { return UNKNOWN_EVENT;} bool is_valid() const { return 1; } }; |