@@ -27,9 +27,13 @@ import (
27
27
"github.com/pingcap/tidb/ddl"
28
28
"github.com/pingcap/tidb/ddl/ingest"
29
29
"github.com/pingcap/tidb/ddl/testutil"
30
+ << << << < HEAD
30
31
"github.com/pingcap/tidb/domain"
31
32
"github.com/pingcap/tidb/errno"
32
33
"github.com/pingcap/tidb/parser/model"
34
+ == == == =
35
+ "github.com/pingcap/tidb/errno"
36
+ >> >> >> > cd0f864f714 (lightning / backend / local : fix `buildIndexDupTasks` (#44442 ))
33
37
"github.com/pingcap/tidb/sessionctx/variable"
34
38
"github.com/pingcap/tidb/testkit"
35
39
"github.com/pingcap/tidb/tests/realtikvtest"
@@ -455,6 +459,7 @@ func TestAddIndexFinishImportError(t *testing.T) {
455
459
require .True (t , strings .Contains (jobTp , "ingest" ), jobTp )
456
460
}
457
461
462
+ << << << < HEAD
458
463
func (c * testCallback ) OnJobRunAfter (job * model.Job ) {
459
464
if c .OnJobRunAfterExported != nil {
460
465
c .OnJobRunAfterExported (job )
@@ -523,16 +528,32 @@ func TestAddIndexBackfillLostUpdate(t *testing.T) {
523
528
}
524
529
525
530
func TestAddIndexPreCheckFailed (t * testing.T ) {
531
+ == == == =
532
+ func TestAddIndexRemoteDuplicateCheck (t * testing .T ) {
533
+ >> >> >> > cd0f864f714 (lightning / backend / local : fix `buildIndexDupTasks` (#44442 ))
526
534
store := realtikvtest .CreateMockStoreAndSetup (t )
527
535
tk := testkit .NewTestKit (t , store )
528
536
tk .MustExec ("drop database if exists addindexlit;" )
529
537
tk .MustExec ("create database addindexlit;" )
530
538
tk .MustExec ("use addindexlit;" )
531
539
tk .MustExec (`set global tidb_ddl_enable_fast_reorg=on;` )
540
+ << << << < HEAD
532
541
533
542
tk .MustExec ("create table t(id int primary key, b int, k int);" )
534
543
tk .MustExec ("insert into t values (1, 1, 1);" )
535
544
require .NoError (t , failpoint .Enable ("github.com/pingcap/tidb/ddl/ingest/mockIngestCheckEnvFailed" , "return" ))
536
545
tk .MustGetErrMsg ("alter table t add index idx(b);" , "[ddl:8256]Check ingest environment failed: mock error" )
537
546
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/ddl/ingest/mockIngestCheckEnvFailed" ))
547
+ == == == =
548
+ tk .MustExec ("set global tidb_ddl_reorg_worker_cnt=1;" )
549
+
550
+ tk .MustExec ("create table t(id int primary key, b int, k int);" )
551
+ tk .MustQuery ("split table t by (30000);" ).Check (testkit .Rows ("1 1" ))
552
+ tk .MustExec ("insert into t values(1, 1, 1);" )
553
+ tk .MustExec ("insert into t values(100000, 1, 1);" )
554
+
555
+ ingest .ForceSyncFlagForTest = true
556
+ tk .MustGetErrCode ("alter table t add unique index idx(b);" , errno .ErrDupEntry )
557
+ ingest .ForceSyncFlagForTest = false
558
+ >> >> >> > cd0f864f714 (lightning / backend / local : fix `buildIndexDupTasks` (#44442 ))
538
559
}
0 commit comments