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

expression: introduce StaticExprContext to build expressions #52853

Merged
merged 1 commit into from Apr 29, 2024

Conversation

lcwangchao
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #52852

What changed and how does it work?

Just like #52631, we provide a static implementation for ExprContext. You can use NewStaticExprContext to create it:

ctx := NewStaticExprContext(
    WithEvalCtx(evalCtx),
    WithCharset("gbk", "gbk_bin"),
    // ...
)

You can also use Apply to create a new context with specified context updated:

ctx2 := ctx.Apply(
    WithEvalCtx(evalCtx),
    WithCharset("gbk", "gbk_bin"),
    // ...
) 

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 size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 24, 2024
Copy link

tiprow bot commented Apr 24, 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/test-infra repository.

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 98.57143% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 74.3749%. Comparing base (6eac861) to head (32efa6b).
Report is 44 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52853        +/-   ##
================================================
+ Coverage   72.3621%   74.3749%   +2.0128%     
================================================
  Files          1477       1478         +1     
  Lines        427992     428471       +479     
================================================
+ Hits         309704     318675      +8971     
+ Misses        99027      89948      -9079     
- Partials      19261      19848       +587     
Flag Coverage Δ
integration 49.0680% <0.0000%> (?)
unit 71.1903% <98.5714%> (-0.0629%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 49.6650% <ø> (+8.4691%) ⬆️

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

@easonn7
Copy link

easonn7 commented Apr 26, 2024

/approve

Copy link

ti-chi-bot bot commented Apr 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, 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

Copy link

ti-chi-bot bot commented Apr 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-24 06:55:49.395314548 +0000 UTC m=+156906.135217460: ☑️ agreed by YangKeao.
  • 2024-04-29 08:49:22.524818423 +0000 UTC m=+260716.281953995: ☑️ agreed by XuHuaiyu.

@ti-chi-bot ti-chi-bot bot merged commit f7de725 into pingcap:master Apr 29, 2024
21 of 23 checks passed
@lcwangchao lcwangchao deleted the staticexprctx branch April 29, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

introduce StaticExprContext to provide a static implementation for ExprContext
4 participants