Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu committed Feb 13, 2023
1 parent a1c4225 commit 39f8804
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions dumpling/export/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import (
"time"

"github.com/DATA-DOG/go-sqlmock"
<<<<<<< HEAD
=======
"github.com/coreos/go-semver/semver"
"github.com/go-sql-driver/mysql"
>>>>>>> 1746f02a1d (dumpling: fix cannot dump data bug when dumpling fails to check has tikv (#40977))
"github.com/pingcap/errors"
"github.com/pingcap/failpoint"
"github.com/pingcap/tidb/br/pkg/version"
Expand Down Expand Up @@ -230,72 +226,6 @@ func TestUnregisterMetrics(t *testing.T) {
// should not panic
require.Error(t, err)
}
<<<<<<< HEAD
=======

func TestSetDefaultSessionParams(t *testing.T) {
testCases := []struct {
si version.ServerInfo
sessionParams map[string]interface{}
expectedParams map[string]interface{}
}{
{
si: version.ServerInfo{
ServerType: version.ServerTypeTiDB,
HasTiKV: true,
ServerVersion: semver.New("6.1.0"),
},
sessionParams: map[string]interface{}{
"tidb_snapshot": "2020-01-01 00:00:00",
},
expectedParams: map[string]interface{}{
"tidb_snapshot": "2020-01-01 00:00:00",
},
},
{
si: version.ServerInfo{
ServerType: version.ServerTypeTiDB,
HasTiKV: true,
ServerVersion: semver.New("6.2.0"),
},
sessionParams: map[string]interface{}{
"tidb_snapshot": "2020-01-01 00:00:00",
},
expectedParams: map[string]interface{}{
"tidb_enable_paging": "ON",
"tidb_snapshot": "2020-01-01 00:00:00",
},
},
{
si: version.ServerInfo{
ServerType: version.ServerTypeTiDB,
HasTiKV: true,
ServerVersion: semver.New("6.2.0"),
},
sessionParams: map[string]interface{}{
"tidb_enable_paging": "OFF",
"tidb_snapshot": "2020-01-01 00:00:00",
},
expectedParams: map[string]interface{}{
"tidb_enable_paging": "OFF",
"tidb_snapshot": "2020-01-01 00:00:00",
},
},
{
si: version.ServerInfo{
ServerType: version.ServerTypeMySQL,
ServerVersion: semver.New("8.0.32"),
},
sessionParams: map[string]interface{}{},
expectedParams: map[string]interface{}{},
},
}

for _, testCase := range testCases {
setDefaultSessionParams(testCase.si, testCase.sessionParams)
require.Equal(t, testCase.expectedParams, testCase.sessionParams)
}
}

func TestSetSessionParams(t *testing.T) {
// case 1: fail to set tidb_snapshot, should return error with hint
Expand Down Expand Up @@ -357,4 +287,3 @@ func TestSetSessionParams(t *testing.T) {
err = setSessionParam(d)
require.NoError(t, err)
}
>>>>>>> 1746f02a1d (dumpling: fix cannot dump data bug when dumpling fails to check has tikv (#40977))

0 comments on commit 39f8804

Please sign in to comment.