-
Notifications
You must be signed in to change notification settings - Fork 6k
*: support tidb_redact_log for explain (#54553) #55307
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
*: support tidb_redact_log for explain (#54553) #55307
Conversation
5d9b1f6
to
ec9fe6a
Compare
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
e8d4b8b
to
5c77eed
Compare
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-7.5 #55307 +/- ##
================================================
Coverage ? 71.9972%
================================================
Files ? 1414
Lines ? 412241
Branches ? 0
================================================
Hits ? 296802
Misses ? 95550
Partials ? 19889
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[LGTM Timeline notifier]Timeline:
|
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, hawkingrei, qw4990, tangenta, windtalker 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 |
This is an automated cherry-pick of #54553
What problem does this PR solve?
Issue Number: close #54565
Problem Summary:
What changed and how does it work?
The main issue is that TiDB's explain function does not support tidb_redact_log, which has caused this problem to occur.
Due to the substantial size of this PR, I will outline the modifications made and the tests conducted.
The changement of
StringCtx
StringCtx
is used to generate information in the explain function and is also utilized in log generation. Therefore, it cannot directly readctx
to determine the redact mode.So the changement of expression package is to add the
redact
parameter intoStringCtx
and force using theredactDisable
mode when to raise the error.so I refactor the
StringWithCtx
's implementation ofConstant
,Column
. butplanner/core.ToString/StringifyExpressionsWithCtx
is to print the debug info for testing. so it forces to use theredactDisable
pkg/util/ranger/types.go
is to support the redact for theranger
.the changement of the
planner
The main focus is on the physical operator to resolve the explain output. The primary modifications include enabling the expression to support redaction by passing the redact parameter into the expression's explain method. Additionally, some parameters of the operator itself are subjected to redaction.
the changement of the
ranger
Enable the range to support redaction mode.
the main test cases
- avoid plan cache polluting by the redact.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.