forked from go-mysql-org/go-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_test.go
40 lines (31 loc) · 810 Bytes
/
setup_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package dump
import (
"flag"
"testing"
"github.com/go-mysql-org/go-mysql/mysql"
. "github.com/pingcap/check"
)
// use docker mysql for test
var host = flag.String("host", "127.0.0.1", "MySQL host")
var port = flag.Int("port", 3306, "MySQL host")
var execution = flag.String("exec", "mysqldump", "mysqldump execution path")
func Test(t *testing.T) {
TestingT(t)
}
type testParseHandler struct {
gset mysql.GTIDSet
}
func (h *testParseHandler) BinLog(name string, pos uint64) error {
return nil
}
func (h *testParseHandler) GtidSet(gtidsets string) (err error) {
if h.gset != nil {
err = h.gset.Update(gtidsets)
} else {
h.gset, err = mysql.ParseGTIDSet("mysql", gtidsets)
}
return err
}
func (h *testParseHandler) Data(schema string, table string, values []string) error {
return nil
}