(t *testing.T)
| 732 | } |
| 733 | |
| 734 | func getReplicaLogPosition(t *testing.T) (string, string) { |
| 735 | rows, err := replicaDatabase.Queryx("SHOW REPLICA STATUS;") |
| 736 | require.NoError(t, err) |
| 737 | replicaStatus := convertMapScanResultToStrings(readNextRow(t, rows)) |
| 738 | executedGtidSet := replicaStatus["Executed_Gtid_Set"].(string) |
| 739 | require.NoError(t, rows.Close()) |
| 740 | |
| 741 | // the executedGtidSet is like the format of "binlog.000002:6757", split it into file and pos |
| 742 | parts := strings.Split(executedGtidSet, ":") |
| 743 | require.Equal(t, 2, len(parts)) |
| 744 | sourceLogFile := parts[0] |
| 745 | sourceLogPos := parts[1] |
| 746 | return sourceLogFile, sourceLogPos |
| 747 | } |
| 748 | |
| 749 | // startReplication configures the replication source on the replica and runs the START REPLICA statement. |
| 750 | func startReplication(t *testing.T, port int) { |
no test coverage detected