Commit graph

2 commits

Author SHA1 Message Date
unknown
58f984add2 BUG#6353 V2:
Replication using replicate-rewrite-db did not work for LOAD DATA INFILE.
Now is does.  There was one place in the code that used current database 
instead of the rewrite database.


mysql-test/r/rpl_rewrite_db.result:
  New tests
mysql-test/t/rpl_rewrite_db-slave.opt:
  New tests
mysql-test/t/rpl_rewrite_db.test:
  New tests
sql/log_event.cc:
  Added db to set_fields function so that current db is used.
sql/log_event.h:
  Added db to set_fields function so that current db is used.
2004-11-15 17:03:54 +01:00
unknown
afe39f2590 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
2004-10-19 22:27:19 +02:00