WL#3735: Replication begin/end log markers

Affects: Server-Prototype Only   —   Status: Un-Assigned   —   Priority: Medium

Clearify begin/end of statements in log.

1. Sending table map events for every statement is inefficient.  It
   would be nice if we only had to send table map events when the
   table has been changed.

2. The first row-based event after a set of table map events does the
   locking of all tables.  The current code is complicated since the
   first row-based event might be for a table that should be filtered
   away.  Having the locking in a separate event, will simplify the
   filtering code of the row-based events.

SOLUTION (Just a draft, needs more work)
1. We need to clarify what the log should contain for the following
   four things happening on the master:
   a. Start transaction : This is a BEGIN query log event.  We
      probably need to have this for all transactions.

   b. Start statement : This needs to somehow encode all tables used
      in the statement so that tables that use table locking can make
      the table locks.

   c. End statement : This is just a flag.

   d. End transaction : Currently coded as COMMIT or ROLLBACK query
      log events or XID events.

2. For each of these we need to specify exactly when the events/flags
   should be generated and when not (i.e. is it allowed to have
   implicitly marked begin/end markers?).

1. How should the table map list be purged in the slave?