summaryrefslogtreecommitdiff
path: root/sql/log_event.h
diff options
context:
space:
mode:
authorunknown <lars@mysql.com>2005-10-19 19:31:24 +0200
committerunknown <lars@mysql.com>2005-10-19 19:31:24 +0200
commite040920f9599ad2c435d0d9dda000b0fc2c42d26 (patch)
tree7f3a10396daf14519b836fbe4699fabbd3f20147 /sql/log_event.h
parent92291753ab057d994117a3970772025031df0121 (diff)
downloadmariadb-git-e040920f9599ad2c435d0d9dda000b0fc2c42d26.tar.gz
mysqlbinlog --hexdump patch 4:
Rename last_event_info to print_event_info to better reflect the new semantics client/mysqlbinlog.cc: Rename last_event_info to print_event_info sql/log_event.cc: Rename last_event_info to print_event_info sql/log_event.h: Rename last_event_info to print_event_info
Diffstat (limited to 'sql/log_event.h')
-rw-r--r--sql/log_event.h73
1 files changed, 39 insertions, 34 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index 80dd40f0dd5..db212c8b4b1 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -453,16 +453,21 @@ struct st_relay_log_info;
/*
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.
+ 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
{
- /* Old settings for database, sql_mode etc */
+ /*
+ 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;
@@ -473,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.
*/
@@ -492,7 +497,7 @@ typedef struct st_last_event_info
my_off_t hexdump_from;
uint8 common_header_len;
-} LAST_EVENT_INFO;
+} PRINT_EVENT_INFO;
#endif
@@ -601,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, 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, LAST_EVENT_INFO* last_event_info= 0);
+ void print_header(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
static void *operator new(size_t size)
@@ -763,8 +768,8 @@ public:
uint32 q_len_arg);
#endif /* HAVE_REPLICATION */
#else
- void print_query_header(FILE* file, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, 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,
@@ -818,7 +823,7 @@ public:
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, 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);
@@ -906,8 +911,8 @@ public:
bool use_rli_only_for_errors);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, LAST_EVENT_INFO* last_event_info = 0);
- void print(FILE* file, 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
/*
@@ -996,7 +1001,7 @@ public:
#endif /* HAVE_REPLICATION */
#else
Start_log_event_v3() {}
- void print(FILE* file, 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,
@@ -1091,7 +1096,7 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, 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);
@@ -1132,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, 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);
@@ -1169,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, 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);
@@ -1211,7 +1216,7 @@ public:
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, 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);
@@ -1237,7 +1242,7 @@ public:
{}
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, 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):
@@ -1276,7 +1281,7 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, 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,
@@ -1329,8 +1334,8 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, 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,
@@ -1397,7 +1402,7 @@ public:
virtual int get_create_or_append() const;
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, 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,
@@ -1432,8 +1437,8 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, 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,
@@ -1468,7 +1473,7 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, 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,
@@ -1553,9 +1558,9 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, 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, LAST_EVENT_INFO* last_event_info,
+ 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,
@@ -1585,7 +1590,7 @@ public:
Log_event(buf, description_event)
{}
~Unknown_log_event() {}
- void print(FILE* file, 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; }
};