Skip to content

Commit

Permalink
remove an unnecessary argument (pingcap#9857)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaut authored Mar 22, 2019
1 parent f478af0 commit e53b56b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion executor/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (e *ShowExec) fetchShowProcessList() error {
if !hasProcessPriv && pi.User != loginUser.Username {
continue
}
row := pi.ToRow(mysql.Command2Str, e.Full)
row := pi.ToRow(e.Full)
e.appendRow(row)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func dataForProcesslist(ctx sessionctx.Context) [][]types.Datum {
continue
}

rows := pi.ToRow(mysql.Command2Str, true)
rows := pi.ToRow(true)
record := types.MakeDatums(rows...)
records = append(records, record)
}
Expand Down
6 changes: 4 additions & 2 deletions util/processinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package util
import (
"fmt"
"time"

"github.com/pingcap/parser/mysql"
)

// ProcessInfo is a struct used for show processlist statement.
Expand All @@ -31,7 +33,7 @@ type ProcessInfo struct {
}

// ToRow returns []interface{} for the row data of "show processlist" and "select * from infoschema.processlist".
func (pi *ProcessInfo) ToRow(cmd2str map[byte]string, full bool) []interface{} {
func (pi *ProcessInfo) ToRow(full bool) []interface{} {
var info string
if full {
info = pi.Info
Expand All @@ -44,7 +46,7 @@ func (pi *ProcessInfo) ToRow(cmd2str map[byte]string, full bool) []interface{} {
pi.User,
pi.Host,
pi.DB,
cmd2str[pi.Command],
mysql.Command2Str[pi.Command],
t,
fmt.Sprintf("%d", pi.State),
info,
Expand Down

0 comments on commit e53b56b

Please sign in to comment.