-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement
It's better to remove the mock.Context
usages in TiDB production code. The reason is that mock.Context
is not designed for production code. It is designed for testing, that means some values in it are not reasonable in production and some values will be modified by the developer without any care.
We can replace some code that uses mock.Context
with some "static" context we introduced before such as StaticExprContext
or DistSQLContext
Tasks
- ddl: remove
mock.Context
ref inddl/session/session_pool.go
#53378 - ddl: introduce
newReorgExprCtx
to replacemock.Context
usage #53389 - ddl,expression: introduce
CtxWithHandleTruncateErrLevel
to wrap a expression context to handle truncate error #53441 - ddl: introduce
newDefaultReorgDistSQLCtx
to replace mock context in DDL reorg #53467 - ddl: remove
mock.Context
usage inaddIndexIngestWorker
#53479 - ddl: split
sessionctx.Context
to sub contexts inCopContextBase
#53642 - ddl: separate
sessionctx.Context
inbackfillCtx
to sub-contexts #53671 - ddl: remove useless fields in
CopContextBase
#53721 - ddl: use static contexts in
NewReorgCopContext
#55823 - ddl: remove
mock.Context
from DDL reorg #55873 - lighting: replace lightning inner contexts with manged ones #56038
- lightning: remove legacy code of
session
#56174 - meta: introduce
metabuild.Context
to build meta #56176 - *: remove
mock.NewContext()
usage when building table meta in production code #56348 - *: use
exprstatic.ExprContext
to replacemock.Context
inToConstraint
#56355 - *: force forbiding to use
mock.NewContext
in production code #56654
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.