tidb
tidb copied to clipboard
*: fix empty SQL in slow log for internal statement (#54274)
This is an automated cherry-pick of #54274
What problem does this PR solve?
Issue Number: close #54190 , close #52743 , close #53264
What changed and how does it work?
The internal session does not init EnableRedactLog which cause redact.String always returns empty string.
Init it as an default value in this PR.
Check List
Tests
- [ ] Unit test
- [ ] Integration test
- [x] Manual test (add detailed scripts or steps below)
set @@tidb_slow_log_threshold=0;
And check the output slow logs. No empty strings again.
- [ ] 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.
fix empty SQL in slow log for internal statement
Codecov Report
Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
Please upload report for BASE (
release-8.1@ef173c6). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## release-8.1 #54309 +/- ##
================================================
Coverage ? 71.5714%
================================================
Files ? 1465
Lines ? 425772
Branches ? 0
================================================
Hits ? 304731
Misses ? 100634
Partials ? 20407
| Flag | Coverage Δ | |
|---|---|---|
| unit | 71.5714% <60.0000%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 53.9957% <0.0000%> (?) |
|
| parser | ∅ <0.0000%> (?) |
|
| br | 40.9230% <0.0000%> (?) |
/retest
[LGTM Timeline notifier]
Timeline:
2024-06-29 10:50:35.855254482 +0000 UTC m=+1062362.340743313: :ballot_box_with_check: agreed by lcwangchao.2024-07-29 06:41:11.451292315 +0000 UTC m=+165187.731340385: :ballot_box_with_check: agreed by xhebox.
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: lcwangchao, xhebox, yudongusa
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [lcwangchao,xhebox]
- ~~pkg/sessionctx/variable/OWNERS~~ [yudongusa]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest