diff options
author | guilhem@mysql.com <> | 2005-02-03 16:22:16 +0100 |
---|---|---|
committer | guilhem@mysql.com <> | 2005-02-03 16:22:16 +0100 |
commit | ed1696f6b9d2ed32168ddaba4c2d9cd1529022a1 (patch) | |
tree | 7a4b93f6301c5bdc29371dda2344050ce305ba4c /sql/slave.h | |
parent | d8f0e8f04e1546292342e3409c4d44f524998c1c (diff) | |
download | mariadb-git-ed1696f6b9d2ed32168ddaba4c2d9cd1529022a1.tar.gz |
WL#1062 "log charset info into all Query_log_event":
we store 7 bytes (1 + 2*3) in every Query_log_event.
In the future if users want binlog optimized for small size and less safe,
we could add --binlog-no-charset (and binlog-no-sql-mode etc): charset info
is something by design optional (even if for now we don't offer possibility to disable it):
it's not a binlog format change.
We try to reduce the number of get_charset() calls in the slave SQL thread to a minimum
by caching the charset read from the previous event (which will often be equal to the one of the current event).
We don't use SET ONE_SHOT for charset-aware repl (we still do for timezones, will be fixed later).
No more errors if one changes the global value of charset vars on master or slave
(as we log charset info in all Query_log_event).
Not fixing Load_log_event as it will be rewritten soon by Dmitri.
Testing how mysqlbinlog behaves in rpl_charset.test.
mysqlbinlog needs to know where charset file is (to be able to convert a charset number found
in binlog (e.g. in User_var_log_event) to a charset name); mysql-test-run needs to pass
the correct value for this option to mysqlbinlog.
Many result udpates (adding charset info into every event shifts log_pos in SHOW BINLOG EVENTS).
Roughly the same job is to be done for timezones :)
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/slave.h b/sql/slave.h index e0816fd45a7..598ff0a7845 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -291,6 +291,8 @@ typedef struct st_relay_log_info UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1, UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1 } until_log_names_cmp_result; + + char cached_charset[6]; st_relay_log_info(); ~st_relay_log_info(); @@ -334,6 +336,14 @@ typedef struct st_relay_log_info return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos : group_relay_log_pos); } + /* + Last charset (6 bytes) seen by slave SQL thread is cached here; it helps + the thread save 3 get_charset() per Query_log_event if the charset is not + changing from event to event (common situation). + When the 6 bytes are equal to 0 is used to mean "cache is invalidated". + */ + void cached_charset_invalidate(); + bool cached_charset_compare(char *charset); } RELAY_LOG_INFO; |