-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
lighting: expose limited fields for kv.Session
#55517
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. |
) | ||
|
||
func TestSession(t *testing.T) { | ||
session := kv.NewSessionCtx(&encode.SessionOptions{SQLMode: mysql.ModeNone, Timestamp: 1234567890}, log.L()) |
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.
This test is deleted because kv.NewSessionCtx
is deleted
return &tidbEncoder{ | ||
mode: config.SQLMode, | ||
tbl: config.Table, | ||
se: se, |
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.
seems tidbEncoder.se
is useless, just delete it.
c6aa732
to
2f874c9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55517 +/- ##
================================================
- Coverage 74.8899% 74.8227% -0.0673%
================================================
Files 1576 1598 +22
Lines 365726 452241 +86515
================================================
+ Hits 273892 338379 +64487
- Misses 72057 92961 +20904
- Partials 19777 20901 +1124
Flags with carried forward coverage won't be shown. Click here to find out more.
|
// transaction type and provides the session variables to the TiDB library | ||
// optimized for Lightning. | ||
type Session struct { | ||
type session struct { |
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.
Here I make the original session private because not all fields in sessionctx.Context
will be used. The public
struct Session
will wrap this session
and provide some necessary methods.
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.
please add this as code comment
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.
rest lgtm
// transaction type and provides the session variables to the TiDB library | ||
// optimized for Lightning. | ||
type Session struct { | ||
type session struct { |
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.
please add this as code comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, tangenta 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. |
/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. |
/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. |
…e-upstream * origin/master: parser: call `SetText` correctly for `CreateViewStmt` (#55520) lighting: expose limited fields for `kv.Session` (#55517) show: prefilter table name with like pattern and show full tables (#55396) Planner: Do not allow cardinality to go below 1 (#55242) *: replace maps.Copy which is for map clone with std maps.Clone (#55530) infoschema: add WithRefillOption for TableByName and TableByID (#55511) domain: change groupSize in splitForConcurrentFetch (#55518) ddl: fix resuming to wrong checkpoint when failed during adding index (#55506)
…e-upstream * origin/master: parser: call `SetText` correctly for `CreateViewStmt` (pingcap#55520) lighting: expose limited fields for `kv.Session` (pingcap#55517) show: prefilter table name with like pattern and show full tables (pingcap#55396) Planner: Do not allow cardinality to go below 1 (pingcap#55242) *: replace maps.Copy which is for map clone with std maps.Clone (pingcap#55530) infoschema: add WithRefillOption for TableByName and TableByID (pingcap#55511) domain: change groupSize in splitForConcurrentFetch (pingcap#55518) ddl: fix resuming to wrong checkpoint when failed during adding index (pingcap#55506) Signed-off-by: Wish <breezewish@outlook.com>
What problem does this PR solve?
Issue Number: ref #53388
What changed and how does it work?
This PR makes some changes to
kv.Session
to avoid expose all fields ofsessionctx.Context
. This approach can make developers more clear about what contexts are used in lightning and easier to check whether the mocked session have been constructed properly.This PR makes the old implementation of
sessionctx.Context
private, and in the further PRs, we'll remove this privatesession
struct.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.