-
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
server: add sql to com_exec/com_fetch dispatch error log #12174
server: add sql to com_exec/com_fetch dispatch error log #12174
Conversation
/run-all-tests |
Could you remove the stack error message, it feels like noise. |
Codecov Report
@@ Coverage Diff @@
## master #12174 +/- ##
===========================================
Coverage 81.2778% 81.2778%
===========================================
Files 454 454
Lines 98290 98290
===========================================
Hits 79888 79888
Misses 12682 12682
Partials 5720 5720 |
maybe we'd better not remove stack in for this case, stack in "dispatch error" is useful for troubleshooting. for example, some low-level method returns std error(e.g. DeadlineExceeded) and error goes up to top-level we should let sql in front of stack info. |
this previous log example is generated by with-stack error. if we can make sure the error no need stack(e.g. KeyDuplicateError) we can use errors.SuspendStack to foribid stack for special error, fot that error, log will be
|
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
LGTM |
/run-all-tests |
cherry pick to release-3.1 in PR #12189 |
cherry pick to release-3.0 in PR #12191 |
/run-cherry-picker |
cherry pick to release-2.1 failed |
It seems that, not for sure, we failed to cherry-pick this commit to release-2.1. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @lysu PTAL. |
What problem does this PR solve?
More and more user use prepare stmt, but current dispatch error log we only can see packet binary info, we don't know which sql meet error.
What is changed and how it works?
add sql to error thrown in handleStmtExec and handleStmtFetch
after this PR, we can got
("select 1" now is in last, we can modify pingcap/errors to let be in front, but we need add msg first)
Check List
Tests
Code changes
Side effects
Related changes
Release note
This change is