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

types: more strict for types.StrictFlags #47842

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Oct 20, 2023

What problem does this PR solve?

Issue Number: close #47829

What is changed and how it works?

  • Replace FlagClipNegativeToZero with FlagAllowNegativeToUnsigned which has a opposite semantics to make the StrictFlags (all-zero value) more strict.
  • Introduce DefaultStmtFlags with FlagAllowNegativeToUnsigned set to 1 to keep it same behavior with old implement.

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 do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 20, 2023
@lcwangchao lcwangchao force-pushed the more_strict_types_flags branch 2 times, most recently from 0d4acf2 to 6f53dda Compare October 20, 2023 05:24
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #47842 (26ef35b) into master (9f97c9a) will increase coverage by 0.9331%.
Report is 3 commits behind head on master.
The diff coverage is 92.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47842        +/-   ##
================================================
+ Coverage   71.8756%   72.8088%   +0.9331%     
================================================
  Files          1399       1422        +23     
  Lines        405325     411696      +6371     
================================================
+ Hits         291330     299751      +8421     
+ Misses        94353      93101      -1252     
+ Partials      19642      18844       -798     
Flag Coverage Δ
integration 41.5267% <75.0000%> (?)
unit 71.8691% <88.0000%> (-0.0066%) ⬇️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser ∅ <ø> (∅)
br 48.7294% <50.0000%> (-4.2478%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 20, 2023
@lcwangchao lcwangchao force-pushed the more_strict_types_flags branch 2 times, most recently from a2a912d to 67cd6f0 Compare October 20, 2023 05:46
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 20, 2023
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

// DefaultStmtFlags is the default flags for statement context with the flag `FlagAllowNegativeToUnsigned` set.
// TODO: make DefaultStmtFlags to be equal with StrictFlags, and setting flag `FlagAllowNegativeToUnsigned`
// is only for make the code to be equivalent with the old implement during refactoring.
const DefaultStmtFlags = context.DefaultStmtFlags
Copy link
Member

Choose a reason for hiding this comment

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

Good! I'll also need to introduce the Default flags in #47029 🤣

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 20, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 20, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-20 07:38:37.858036029 +0000 UTC m=+1988315.445146159: ☑️ agreed by lance6716.
  • 2023-10-20 07:49:55.29208888 +0000 UTC m=+1988992.879199025: ☑️ agreed by YangKeao.

Copy link
Contributor

@windtalker windtalker 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
Copy link

ti-chi-bot bot commented Oct 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, windtalker, 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 Oct 20, 2023
@ti-chi-bot ti-chi-bot bot merged commit 92749f7 into pingcap:master Oct 20, 2023
22 of 28 checks passed
@lcwangchao lcwangchao deleted the more_strict_types_flags branch October 23, 2023 06:15
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.

Make types.StrictFlags more strict
4 participants