Skip to content
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

*: use errctx to handle divide zero error #50042

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Jan 3, 2024

What problem does this PR solve?

Issue Number: close #50041

What changed and how does it work?

use errctx to handle divide zero error

  • Delete StatementContext.DividedByZeroAsWarning and use the error group ErrDivisionByZero to mark the error handle level.
  • Delete StatementContext.InReorg because it is useless now.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 3, 2024
@lcwangchao lcwangchao added the compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. label Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Merging #50042 (05cff48) into master (6f32664) will increase coverage by 10.0169%.
Report is 15 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50042         +/-   ##
=================================================
+ Coverage   71.8820%   81.8990%   +10.0169%     
=================================================
  Files          1439       2442       +1003     
  Lines        346160     673020     +326860     
=================================================
+ Hits         248827     551197     +302370     
- Misses        77058     101084      +24026     
- Partials      20275      20739        +464     
Flag Coverage Δ
integration 48.6315% <100.0000%> (?)
unit 79.2450% <98.6206%> (+7.3629%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 73.6130% <ø> (+17.3001%) ⬆️
parser ∅ <ø> (∅)
br 71.8388% <100.0000%> (+20.3798%) ⬆️

@lcwangchao lcwangchao force-pushed the errctx_div_zero branch 5 times, most recently from 193ef18 to 01233c9 Compare January 3, 2024 12:21
@lcwangchao lcwangchao removed the compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. label Jan 3, 2024
@lcwangchao lcwangchao force-pushed the errctx_div_zero branch 6 times, most recently from a57f791 to 56ddaee Compare January 3, 2024 13:36
@lcwangchao
Copy link
Collaborator Author

/hold

wait #5007 merged first

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 4, 2024
@lance6716
Copy link
Contributor

/approve

@lcwangchao
Copy link
Collaborator Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 4, 2024
pkg/executor/executor.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 4, 2024
Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 4, 2024
Copy link

ti-chi-bot bot commented Jan 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-04 10:28:26.523216598 +0000 UTC m=+2339197.560443510: ☑️ agreed by tangenta.
  • 2024-01-04 12:15:41.141155821 +0000 UTC m=+2345632.178382785: ☑️ agreed by YangKeao.

@lcwangchao
Copy link
Collaborator Author

/retest

Copy link

ti-chi-bot bot commented Jan 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, tangenta, XuHuaiyu, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Jan 5, 2024
@ti-chi-bot ti-chi-bot bot merged commit 98f4e87 into pingcap:master Jan 5, 2024
34 checks passed
@lcwangchao lcwangchao deleted the errctx_div_zero branch January 5, 2024 05:53
AilinKid pushed a commit to AilinKid/tidb that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use errctx to handle divide zero error
5 participants