-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: Add GetUserVarsReader
to EvalContext
#55866
Conversation
Hi @lcwangchao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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. |
@@ -2391,15 +2431,6 @@ func (s *SessionVars) SetStringUserVar(name string, strVal string, collation str | |||
} | |||
} | |||
|
|||
// UnsetUserVar unset an user defined variable by name. | |||
func (s *SessionVars) UnsetUserVar(varName string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnsetUserVar
has been moved to: https://github.com/pingcap/tidb/pull/55866/files#diff-1df3757be8063f9a9a3c70650f58368402d93bbf842ac2e1c2f8426542f1a2f5R742-R748
583afd2
to
a29f457
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55866 +/- ##
=================================================
- Coverage 72.8505% 57.4250% -15.4255%
=================================================
Files 1598 1754 +156
Lines 444454 637621 +193167
=================================================
+ Hits 323787 366154 +42367
- Misses 100737 246545 +145808
- Partials 19930 24922 +4992
Flags with carried forward coverage won't be shown. Click here to find out more.
|
eea67b4
to
cc193dc
Compare
cc193dc
to
d2994e3
Compare
d2994e3
to
5bf3266
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the variable
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qw4990, XuHuaiyu, YangKeao, yudongusa 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 |
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
What problem does this PR solve?
Issue Number: close #55865
What changed and how does it work?
This PR adds new method
GetUserVarsReader
toEvalContext
so that the user vars can be read directly from the context. It has some benefits:BuildSimpleExpr
can now build expressions like@a+1
without adding optional propertySessionVars
to the inner context.@a+1
orget_var("a")
without requiring an additional propertySessionVars
inEvalContext
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.