diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2009-10-24 23:43:39 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2009-10-24 23:43:39 +0400 |
commit | b027072e01ec9d485a8826eacc615f40eb77cbb6 (patch) | |
tree | 21d9fde1986192054dd36b341aad57e93d16a0e9 /sql/log_event.h | |
parent | 3ea974ad2ff861ed20bc196d5da18ae5cbebe073 (diff) | |
download | mariadb-git-b027072e01ec9d485a8826eacc615f40eb77cbb6.tar.gz |
MWL#36: Add a mysqlbinlog option to change the used database
- Review fixes
client/Makefile.am:
- Make it build on Linux
client/mysqlbinlog.cc:
- Coding style fixes
- Better/more comments
- Use client/sql_string.*, not server's sql/sql_string.*.
- Don't declare a dummy TABLE_LIST structure in the client.
client/sql_string.h:
- Use client/sql_string.*, not server's sql/sql_string.*.
sql/log_event.cc:
= Fix coding style
= Introduce Log_event::event_owns_temp_buf which tells whether Log_event::temp_buf is 'owned' by the Log_event object and should be my_free'd on return.
This is needed because rewrite_db() needs to dispose of the buffer, and
- when mysqlbinlog is reading directly from binlog file, the buffer
should be freed
- when mysqlbinlog is reading from a server, the buffer is a part of network
buffer and shouldn't be freed.
sql/log_event.h:
Introduce Log_event::event_owns_temp_buf which tells whether Log_event::temp_buf is 'owned' by the Log_event object and should be my_free'd on return.
This is needed because rewrite_db() needs to dispose of the buffer, and
- when mysqlbinlog is reading directly from binlog file, the buffer
should be freed
- when mysqlbinlog is reading from a server, the buffer is a part of network
buffer and shouldn't be freed.
sql/mysqld.cc:
- Better/more comments
sql/rpl_filter.cc:
- #ifdef-out Rpl_filter::tables_ok from the client. This allows not
to define dummy TABLE_LIST on the client
sql/rpl_filter.h:
- #ifdef-out Rpl_filter::tables_ok from the client. This allows not
to define dummy TABLE_LIST on the client
sql/sql_string.cc:
- Use client/sql_string.*, not server's sql/sql_string.*.
sql/sql_string.h:
- Use client/sql_string.*, not server's sql/sql_string.*.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index 43e7b9e2205..41451a618a7 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -873,6 +873,13 @@ public: event's type, and its content is distributed in the event-specific fields. */ char *temp_buf; + + /* + TRUE <=> this event 'owns' temp_buf and should call my_free() when done + with it + */ + bool event_owns_temp_buf; + /* Timestamp on the master(for debugging and replication of NOW()/TIMESTAMP). It is important for queries and LOAD DATA @@ -1014,12 +1021,17 @@ public: Log_event(const char* buf, const Format_description_log_event *description_event); virtual ~Log_event() { free_temp_buf();} - void register_temp_buf(char* buf) { temp_buf = buf; } + void register_temp_buf(char* buf, bool must_free) + { + temp_buf= buf; + event_owns_temp_buf= must_free; + } void free_temp_buf() { if (temp_buf) { - my_free(temp_buf, MYF(0)); + if (event_owns_temp_buf) + my_free(temp_buf, MYF(0)); temp_buf = 0; } } |