-
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
*: add global variable tidb_slow_log_masking to control masking slow log query #17637
Conversation
…log query Signed-off-by: crazycs <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #17637 +/- ##
===========================================
Coverage 79.4969% 79.4969%
===========================================
Files 524 524
Lines 141413 141413
===========================================
Hits 112419 112419
Misses 19930 19930
Partials 9064 9064 |
Signed-off-by: crazycs <[email protected]>
/run-all-tests |
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
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
/run-all-tests |
/merge |
Sorry @jackysp, you don't have permission to trigger auto merge event on this branch. |
/run-unit-test /run-integration-br-test |
/merge |
Sorry @AndreMouche, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
/merge |
Sorry @jackysp, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
/merge |
Sorry @jackysp, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
/merge |
Sorry @jackysp, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
/merge |
/run-all-tests |
Sorry @jackysp, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
@crazycs520 merge failed. |
/merge |
Sorry @AndreMouche, you don't have permission to trigger auto merge event on this branch. You are not a committer for this part |
/run-common-test |
@@ -399,6 +399,9 @@ const ( | |||
|
|||
// TiDBEnableClusteredIndex indicates if clustered index feature is enabled. | |||
TiDBEnableClusteredIndex = "tidb_enable_clustered_index" | |||
|
|||
// TiDBSlowLogMasking indicates that whether masking the query data when log slow query. |
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.
Does it only effective for parameterized queries?
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.
What's your mean of parameterized queries
?
Actually the masking SQL is also used to generate the SQL digest.
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.
Oh, I mean prepared statements. For non prepared statements, will they have effect?
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.
yes, It also works on non-prepared statement.
/run-all-tests |
/integration-ddl-test |
/run-integration-ddl-test |
What will happen to the parameters appears in the plan? This can also be a source of leaking data. |
I also opened a related issue for the statement part, which will encounter similar problems and needs some design: #17690 |
Signed-off-by: sre-bot <[email protected]>
cherry pick to release-4.0 in PR #17694 |
…log query (#17637) (#17694) * cherry pick #17637 to release-4.0 Signed-off-by: sre-bot <[email protected]> * fix conflict Signed-off-by: crazycs <[email protected]> Co-authored-by: crazycs <[email protected]> Co-authored-by: Lynn <[email protected]>
Signed-off-by: crazycs [email protected]
What problem does this PR solve?
Issue Number: close #17463
This PR adds global variable
tidb_slow_log_masking
to control masking slow log query.Such as below:
tidb_slow_log_masking
first.just like SQL normalize, such as below:
The original SQL is:
What is changed and how it works?
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note
add global variable tidb_slow_log_masking to control masking slow log query.