2024-01-12 13:15:30 +08:00
|
|
|
package mysql
|
2023-12-27 22:59:20 +08:00
|
|
|
|
2025-05-20 21:04:47 +08:00
|
|
|
// func Test_readBinlogInfoFromBackup(t *testing.T) {
|
|
|
|
|
// text := `
|
|
|
|
|
// --
|
|
|
|
|
// -- Position to start replication or point-in-time recovery from
|
|
|
|
|
// --
|
2024-01-12 13:15:30 +08:00
|
|
|
|
2025-05-20 21:04:47 +08:00
|
|
|
// -- CHANGE MASTER TO MASTER_LOG_FILE='binlog.000003', MASTER_LOG_POS=379;
|
|
|
|
|
// `
|
|
|
|
|
// got, err := readBinlogInfoFromBackup(strings.NewReader(text))
|
|
|
|
|
// require.NoError(t, err)
|
|
|
|
|
// require.Equal(t, &entity.BinlogInfo{
|
|
|
|
|
// FileName: "binlog.000003",
|
|
|
|
|
// Sequence: 3,
|
|
|
|
|
// Position: 379,
|
|
|
|
|
// }, got)
|
|
|
|
|
// }
|