@@ -22,6 +22,7 @@ import (
22
22
"time"
23
23
24
24
"github.com/pingcap/failpoint"
25
+ "github.com/pingcap/tidb/pkg/config/kerneltype"
25
26
"github.com/pingcap/tidb/pkg/ddl/schematracker"
26
27
"github.com/pingcap/tidb/pkg/ddl/schemaver"
27
28
"github.com/pingcap/tidb/pkg/domain"
@@ -30,6 +31,7 @@ import (
30
31
"github.com/pingcap/tidb/pkg/session"
31
32
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
32
33
"github.com/pingcap/tidb/pkg/store/mockstore"
34
+ "github.com/pingcap/tidb/pkg/store/mockstore/teststore"
33
35
"github.com/pingcap/tidb/pkg/tablecodec"
34
36
"github.com/pingcap/tidb/pkg/testkit"
35
37
"github.com/pingcap/tidb/pkg/testkit/testfailpoint"
@@ -51,7 +53,7 @@ func createFailDBSuite(t *testing.T) (s *failedSuite) {
51
53
func createFailDBSuiteWithLease (t * testing.T , lease time.Duration ) (s * failedSuite ) {
52
54
s = new (failedSuite )
53
55
var err error
54
- s .store , err = mockstore . NewMockStore (
56
+ s .store , err = teststore . NewMockStoreWithoutBootstrap (
55
57
mockstore .WithClusterInspector (func (c testutils.Cluster ) {
56
58
mockstore .BootstrapWithSingleStore (c )
57
59
s .cluster = c
@@ -211,6 +213,9 @@ func TestAddIndexFailed(t *testing.T) {
211
213
212
214
// Split the table.
213
215
tableStart := tablecodec .GenTableRecordPrefix (tblID )
216
+ if kerneltype .IsNextGen () {
217
+ tableStart = s .store .GetCodec ().EncodeKey (tableStart )
218
+ }
214
219
s .cluster .SplitKeys (tableStart , tableStart .PrefixNext (), 100 )
215
220
216
221
tk .MustExec ("alter table t add index idx_b(b)" )
0 commit comments