diff options
author | unknown <guilhem@mysql.com> | 2004-10-19 22:27:19 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-10-19 22:27:19 +0200 |
commit | afe39f259042a5a6dfa558d4b96b214b84be5926 (patch) | |
tree | 7f6c082dfcfda2b4cd6cb85dd9c54d984d87268a /sql/slave.h | |
parent | 221d51ebb1b178061904e68cc2ff40a11da835d1 (diff) | |
download | mariadb-git-afe39f259042a5a6dfa558d4b96b214b84be5926.tar.gz |
Optimization: in the replication slave, we can avoid doing one strlen() per event's execution,
as we already have db_len in Log_event. Only if rewrite_db() changed the db we need a strlen
(so we now do the strlen() in rewrite_db). Plus a test (we had none for --replicate-rewrite-db :( ).
sql/log_event.cc:
The goal is to get of rid of one strlen() per replication event in slave:
we don't need to compute strlen(thd->db) as we already have db_len in the event;
only case where we need to do a strlen() is if rewrite_db() changed the db.
Note that db_len is always a meaningful value. It's 0 if event's db is 0.
sql/slave.cc:
rewrite_db now returns the len of the returned db.
print_slave_db_safe() needn't call rewrite_db() as rewrite_db() is already called by caller.
sql/slave.h:
declaration updates for slave.cc
Diffstat (limited to 'sql/slave.h')
-rw-r--r-- | sql/slave.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/slave.h b/sql/slave.h index 20167094453..97f197fb50a 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -510,8 +510,8 @@ int add_table_rule(HASH* h, const char* table_spec); int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec); void init_table_rule_hash(HASH* h, bool* h_inited); void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited); -const char *rewrite_db(const char* db); -const char *print_slave_db_safe(const char* db); +const char *rewrite_db(const char* db, uint *new_db_len); +const char *print_slave_db_safe(const char *db); int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); void skip_load_data_infile(NET* net); void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); |