You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mysqlbinlog/get_unexecuted_binlog_pos_b...

25 lines
650 B
Go

package binlog
import (
"testing"
)
func TestGetUnexecutedBinlogPosByGtid(t *testing.T) {
executedGtid := "f60ab33c-c604-11e3-8e1c-e66ccf50db66:1-124"
pos, err := GetUnexecutedBinlogPosByGtid("./test/mysql-bin56.000003", executedGtid, false)
if nil != err {
t.Fatalf("unexpected error: %v", err)
}
if 125553 != pos {
t.Fatalf("wrong pos %v", pos)
}
}
func TestGetUnexecutedBinlogPosByGtid2(t *testing.T) {
executedGtid := "f60ab33c-c604-11e3-8e1c-e66ccf50db66:1-136"
_, err := GetUnexecutedBinlogPosByGtid("./test/mysql-bin56.000003", executedGtid, false)
if nil == err || "EOF" != err.Error() {
t.Fatalf("wrong err %v", err)
}
}