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 StaticExprContext instead of mock context to build expression #54101

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Jun 19, 2024

What problem does this PR solve?

Issue Number: ref #53388, close #54271

What changed and how does it work?

Remove mock.NewContext and use NewStaticExprContext to build expression for partition table.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 19, 2024
Copy link

tiprow bot commented Jun 19, 2024

Hi @lcwangchao. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.5403%. Comparing base (b3ed886) to head (b7c9243).
Report is 23 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54101         +/-   ##
=================================================
- Coverage   72.8667%   56.5403%   -16.3265%     
=================================================
  Files          1519       1643        +124     
  Lines        435373     615025     +179652     
=================================================
+ Hits         317242     347737      +30495     
- Misses        98583     243985     +145402     
- Partials      19548      23303       +3755     
Flag Coverage Δ
integration 37.5930% <100.0000%> (?)
unit 72.1717% <100.0000%> (+0.2960%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.7489% <ø> (+6.6005%) ⬆️

Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM, with one curious question :)

Comment on lines 243 to 244
ctx := contextstatic.NewStaticExprContext()
dbName := model.NewCIStr(ctx.GetEvalCtx().CurrentDB())
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this get the actual Current DB name? Or just the same default / empty string every time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is always an empty string and same with the previous behavior with mock.Context. (Seems it's useless, but just keep logic unchanged)

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 19, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 19, 2024
Copy link

ti-chi-bot bot commented Jun 19, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-19 07:31:18.51513388 +0000 UTC m=+186405.000622712: ☑️ agreed by mjonss.
  • 2024-06-19 09:21:42.488690401 +0000 UTC m=+193028.974179228: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot bot added the approved label Jun 21, 2024
@YangKeao
Copy link
Member

/retest

2 similar comments
@hawkingrei
Copy link
Member

/retest

@lcwangchao
Copy link
Collaborator Author

/retest

Copy link

tiprow bot commented Jun 25, 2024

@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 27, 2024
@lcwangchao lcwangchao requested review from YangKeao and mjonss June 27, 2024 05:39
@lcwangchao
Copy link
Collaborator Author

/retest

Copy link

tiprow bot commented Jun 27, 2024

@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@lcwangchao
Copy link
Collaborator Author

/hold

@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 Jun 27, 2024
Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM, good find and explanation!

Copy link

ti-chi-bot bot commented Jun 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

@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 Jun 27, 2024
@ti-chi-bot ti-chi-bot bot merged commit 08d5d29 into pingcap:master Jun 27, 2024
20 of 21 checks passed
@lcwangchao lcwangchao deleted the par_expr_ctx branch June 27, 2024 09:34
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different partition locations for the same key when SQL mode is differnt
5 participants