fix: 机器文件下载问题修复&dbm重构

This commit is contained in:
meilin.huang
2024-01-12 13:15:30 +08:00
parent bc811cbd49
commit bfd346e65a
32 changed files with 454 additions and 322 deletions

View File

@@ -0,0 +1,26 @@
package mysql
import (
"mayfly-go/internal/db/domain/entity"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func Test_readBinlogInfoFromBackup(t *testing.T) {
text := `
--
-- Position to start replication or point-in-time recovery from
--
-- 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)
}