(t *testing.T)
| 935 | } |
| 936 | |
| 937 | func TestBuildRegionQueriesWithoutPartition(t *testing.T) { |
| 938 | db, mock, err := sqlmock.New() |
| 939 | require.NoError(t, err) |
| 940 | defer func() { |
| 941 | require.NoError(t, db.Close()) |
| 942 | }() |
| 943 | |
| 944 | conn, err := db.Conn(context.Background()) |
| 945 | require.NoError(t, err) |
| 946 | baseConn := newBaseConn(conn, true, nil) |
| 947 | tctx, cancel := tcontext.Background().WithLogger(appLogger).WithCancel() |
| 948 | metrics := newMetrics(promutil.NewDefaultFactory(), nil) |
| 949 | |
| 950 | d := &Dumper{ |
| 951 | tctx: tctx, |
| 952 | conf: DefaultConfig(), |
| 953 | cancelCtx: cancel, |
| 954 | metrics: metrics, |
| 955 | selectTiDBTableRegionFunc: selectTiDBTableRegion, |
| 956 | } |
| 957 | d.conf.ServerInfo = version.ServerInfo{ |
| 958 | HasTiKV: true, |
| 959 | ServerType: version.ServerTypeTiDB, |
| 960 | ServerVersion: gcSafePointVersion, |
| 961 | } |
| 962 | d.conf.Rows = 200000 |
| 963 | database := "foo" |
| 964 | table := "bar" |
| 965 | |
| 966 | testCases := []struct { |
| 967 | regionResults [][]driver.Value |
| 968 | handleColNames []string |
| 969 | handleColTypes []string |
| 970 | expectedWhereClauses []string |
| 971 | hasTiDBRowID bool |
| 972 | }{ |
| 973 | { |
| 974 | [][]driver.Value{ |
| 975 | {"7480000000000000FF3300000000000000F8", "7480000000000000FF3300000000000000F8"}, |
| 976 | }, |
| 977 | []string{"a"}, |
| 978 | []string{"BIGINT"}, |
| 979 | []string{ |
| 980 | "", |
| 981 | }, |
| 982 | false, |
| 983 | }, |
| 984 | { |
| 985 | [][]driver.Value{ |
| 986 | {"7480000000000000FF3300000000000000F8", "7480000000000000FF3300000000000000F8"}, |
| 987 | }, |
| 988 | []string{"_tidb_rowid"}, |
| 989 | []string{"BIGINT"}, |
| 990 | []string{ |
| 991 | "", |
| 992 | }, |
| 993 | true, |
| 994 | }, |
nothing calls this directly
no test coverage detected