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 /mysql-test/r/rpl_rewrite_db.result | |
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 'mysql-test/r/rpl_rewrite_db.result')
-rw-r--r-- | mysql-test/r/rpl_rewrite_db.result | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_rewrite_db.result new file mode 100644 index 00000000000..2804b98dea1 --- /dev/null +++ b/mysql-test/r/rpl_rewrite_db.result @@ -0,0 +1,22 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop database if exists mysqltest1; +create database mysqltest1; +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +a +9 +show databases like 'mysqltest1'; +Database (mysqltest1) +mysqltest1 +select * from test.t1; +a +9 +drop table t1; +drop database mysqltest1; |