plugin: fix audit plugin will cause tidb panic (#23803) #23820
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cherry-pick #23803 to release-5.0-rc
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/23820
After apply modifications, you can push your change to this PR via:
Signed-off-by: AilinKid [email protected]
What problem does this PR solve?
Issue Number: close #23786
What is changed and how it works?
What's Changed: fix the sessionVars.connectionInfo may be nil when exit a conn.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
before this pr: tidb panic
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x2f5de34]
goroutine 809 [running]:
github.com/pingcap/tidb/server.(*Server).onConn.func4(0xc0006d3590, 0xc0006d3380, 0xc00155ddee)
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:486 +0xb4
github.com/pingcap/tidb/plugin.ForeachPlugin(0xc0011e6d01, 0xc00155df00, 0xc00141ba10, 0x0)
/home/arenatlx/go/src/github.com/pingcap/tidb/plugin/plugin.go:419 +0x137
github.com/pingcap/tidb/server.(*Server).onConn(0xc0012c2dd0, 0xc0011e6d00)
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:482 +0xaf9
created by github.com/pingcap/tidb/server.(*Server).Run
/home/arenatlx/go/src/github.com/pingcap/tidb/server/server.go:383 +0x8d5
this pr
HAPPY
Release note