diff --git a/pkg/executor/internal/exec/BUILD.bazel b/pkg/executor/internal/exec/BUILD.bazel index 968a4429e06ca..c7dbd065af020 100644 --- a/pkg/executor/internal/exec/BUILD.bazel +++ b/pkg/executor/internal/exec/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//pkg/util/topsql/state", "//pkg/util/tracing", "@com_github_ngaut_pools//:pools", + "@com_github_pingcap_failpoint//:failpoint", "@org_uber_go_atomic//:atomic", ], ) diff --git a/pkg/executor/internal/exec/executor.go b/pkg/executor/internal/exec/executor.go index 60d0ec6f34ade..2afe1844d6110 100644 --- a/pkg/executor/internal/exec/executor.go +++ b/pkg/executor/internal/exec/executor.go @@ -20,6 +20,7 @@ import ( "time" "github.com/ngaut/pools" + "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/domain" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/parser" @@ -89,6 +90,9 @@ func newExecutorChunkAllocator(vars *variable.SessionVars, retFieldTypes []*type // InitCap returns the initial capacity for chunk func (e *executorChunkAllocator) InitCap() int { + failpoint.Inject("initCap", func(val failpoint.Value) { + failpoint.Return(val.(int)) + }) return e.initCap } @@ -99,6 +103,9 @@ func (e *executorChunkAllocator) SetInitCap(c int) { // MaxChunkSize returns the max chunk size. func (e *executorChunkAllocator) MaxChunkSize() int { + failpoint.Inject("maxChunkSize", func(val failpoint.Value) { + failpoint.Return(val.(int)) + }) return e.maxChunkSize }