EmergencyReparent used to stop replication on all slaves,
then SetMaster would see replication is off, and not restart it.
Fixed unit and intergration tests to test this case.
MysqlDaemon fake now only has one place to store replication status.
API changes:
- SlaveStatus returns a myproto.ReplicationStatus (not a pointer any more)
- StopReplicationAndGetPosition is changed to StopReplicationAndGetStatus
- SetMaster has an extra forceStartSlave boolean.
If they were replicating, we stop / set master / start, if they were
not, we just set master. Side effect is ReparentTablet may not
start replication if it was stopped, but it's better that way.
1. add sqldb.Conn and move mysql.ConnectionParams to sqldb package.
2. change mysql.Connect function to return sqldb.Conn.
3. update places using *mysql.Connection to sqldb.Conn.
4. update places using *mysql.ConnectionParams to *sqldb.ConnParams.
5. changes places that use mysql.Connect to sqldb.Get().
6. Some randome go style fix (suggested by golint).
7. define package level variable DefaultDB in sqldb.
8. go/mysql will register its Connect func in init function.
This is intended for use internally by vttablet, in cases when it cannot
directly access the mysqld process because they are running in separate
cgroups (containers). Since vttablet and mysqld can share files, many
actions can still be done directly by vttablet. However, starting and
stopping mysqld must be done from within mysqld's cgroup, so these
actions are executed remotely by mysqlctld.