-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: remove mock.Context
from DDL reorg
#55873
Conversation
Hi @lcwangchao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
sessCtx := bCtx.sessCtx | ||
sessCtx.GetSessionVars().StmtCtx.SetTypeFlags( | ||
sessCtx.GetSessionVars().StmtCtx.TypeFlags(). | ||
WithIgnoreZeroDateErr(!reorgInfo.ReorgMeta.SQLMode.HasStrictMode())) | ||
bCtx.exprCtx = bCtx.sessCtx.GetExprCtx() | ||
bCtx.tblCtx = bCtx.sessCtx.GetTableCtx() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -148,17 +276,6 @@ func reorgTimeZoneWithTzLoc(tzLoc *model.TimeZoneLocation) (*time.Location, erro | |||
return tzLoc.GetLocation() | |||
} | |||
|
|||
func newReorgSessCtx(store kv.Storage) sessionctx.Context { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove newReorgSessCtx
from production code because it only used in test now. So we moved it to test and renamed it to newMockReorgSessCtx
a53b568
to
2f55b48
Compare
// Prevent initializing the mock context in the workers concurrently. | ||
// For details, see https://github.com/pingcap/tidb/issues/40879. | ||
if _, ok := sessCtx.(*mock.Context); ok { | ||
_ = sessCtx.GetDomainInfoSchema() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it because mock.Context
is not used now.
return nil, errors.Trace(err) | ||
} | ||
|
||
if isUpdateColumn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55873 +/- ##
=================================================
- Coverage 72.8403% 57.0061% -15.8342%
=================================================
Files 1599 1754 +155
Lines 444670 633551 +188881
=================================================
+ Hits 323899 361163 +37264
- Misses 100835 247519 +146684
- Partials 19936 24869 +4933
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2f55b48
to
c62aeb6
Compare
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
c62aeb6
to
7c7458b
Compare
7c7458b
to
3cf83be
Compare
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
3ca44c5
to
3b433b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #53388
What changed and how does it work?
This PR:
reorgTableMutateContext
as thetable.MutateContext
to provide context for DDL reorgnewReorgSessCtx
from production code.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.