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

linter, executor: fix the constructor linter and add it to BaseExecutor/BaseExecutorV2 #56485

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Oct 8, 2024

What problem does this PR solve?

Issue Number: close #56484

Problem Summary:

What changed and how does it work?

  1. This PR adds the constructor annotation to the struct BaseExecutor/BaseExecutorV2 to avoid constructing the struct unexpectedly.
  2. This PR fixes the invalid constructor linter, and correct some behaviors.

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 the release-note-none Denotes a PR that doesn't merit a release note. label Oct 8, 2024
Copy link

ti-chi-bot bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ailinkid for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 8, 2024
@@ -276,6 +277,8 @@ func newExecutorKillerHandler(handler signalHandler) executorKillerHandler {

// BaseExecutorV2 is a simplified version of `BaseExecutor`, which doesn't contain a full session context
type BaseExecutorV2 struct {
_ constructor.Constructor `ctor:"NewBaseExecutorV2,BuildNewBaseExecutorV2"`
Copy link
Member Author

Choose a reason for hiding this comment

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

@yibin87 PTAL. It can guarantee that BaseExecutorV2 will not be manually initialized except in NewBaseExecutorV2 and BuildNewBaseExecutorV2.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.1930%. Comparing base (7daf026) to head (aaf1b81).
Report is 14 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #56485        +/-   ##
================================================
+ Coverage   73.3685%   75.1930%   +1.8245%     
================================================
  Files          1624       1648        +24     
  Lines        448117     458348     +10231     
================================================
+ Hits         328777     344646     +15869     
+ Misses        99198      92404      -6794     
- Partials      20142      21298      +1156     
Flag Coverage Δ
integration 50.4807% <66.6666%> (?)
unit 72.4467% <88.8888%> (-0.0142%) ⬇️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 52.0316% <ø> (+6.5186%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner 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.

Fix the constructor linter
1 participant