Skip to content

Commit

Permalink
session,executor: performance improvement in SetProcessInfo (pingcap#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xiekeyi98 authored Mar 13, 2019
1 parent b37d952 commit 09beefb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion executor/executor_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (s *testExecSuite) TestShowProcessList(c *C) {
User: "test",
Host: "127.0.0.1",
DB: "test",
Command: "select * from t",
Command: 't',
State: 1,
Info: "",
}
Expand Down
2 changes: 1 addition & 1 deletion executor/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (e *ShowExec) fetchShowProcessList() error {
pi.User,
pi.Host,
pi.DB,
pi.Command,
mysql.Command2Str[pi.Command],
uint64(time.Since(pi.Time) / time.Second),
fmt.Sprintf("%d", pi.State),
info,
Expand Down
2 changes: 1 addition & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ func (s *session) SetProcessInfo(sql string, t time.Time, command byte) {
pi := util.ProcessInfo{
ID: s.sessionVars.ConnectionID,
DB: s.sessionVars.CurrentDB,
Command: mysql.Command2Str[command],
Command: command,
Time: t,
State: s.Status(),
Info: sql,
Expand Down
2 changes: 1 addition & 1 deletion util/processinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ProcessInfo struct {
User string
Host string
DB string
Command string
Command byte
Time time.Time
State uint16
Info string
Expand Down

0 comments on commit 09beefb

Please sign in to comment.