Skip to content

Commit 3dab914

Browse files
morgoiamzhoug37
authored andcommitted
*: Hide "Mem" column from SHOW PROCESSSLIST (pingcap#8543)
1 parent e2d9ef1 commit 3dab914

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

executor/executor_pkg_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ func (msm *mockSessionManager) Kill(cid uint64, query bool) {
5757

5858
func (s *testExecSuite) TestShowProcessList(c *C) {
5959
// Compose schema.
60-
names := []string{"Id", "User", "Host", "db", "Command", "Time", "State", "Info", "Mem"}
60+
names := []string{"Id", "User", "Host", "db", "Command", "Time", "State", "Info"}
6161
ftypes := []byte{mysql.TypeLonglong, mysql.TypeVarchar, mysql.TypeVarchar,
62-
mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeLong, mysql.TypeVarchar, mysql.TypeString, mysql.TypeLonglong}
62+
mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeLong, mysql.TypeVarchar, mysql.TypeString}
6363
schema := buildSchema(names, ftypes)
6464

6565
// Compose a mocked session manager.

executor/show.go

-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ func (e *ShowExec) fetchShowProcessList() error {
236236
uint64(time.Since(pi.Time) / time.Second),
237237
fmt.Sprintf("%d", pi.State),
238238
info,
239-
pi.Mem,
240239
})
241240
}
242241
return nil

planner/core/planbuilder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1662,9 +1662,9 @@ func buildShowSchema(s *ast.ShowStmt) (schema *expression.Schema) {
16621662
mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeVarchar,
16631663
}
16641664
case ast.ShowProcessList:
1665-
names = []string{"Id", "User", "Host", "db", "Command", "Time", "State", "Info", "Mem"}
1665+
names = []string{"Id", "User", "Host", "db", "Command", "Time", "State", "Info"}
16661666
ftypes = []byte{mysql.TypeLonglong, mysql.TypeVarchar, mysql.TypeVarchar,
1667-
mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeLong, mysql.TypeVarchar, mysql.TypeString, mysql.TypeLonglong}
1667+
mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeLong, mysql.TypeVarchar, mysql.TypeString}
16681668
case ast.ShowStatsMeta:
16691669
names = []string{"Db_name", "Table_name", "Partition_name", "Update_time", "Modify_count", "Row_count"}
16701670
ftypes = []byte{mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeVarchar, mysql.TypeDatetime, mysql.TypeLonglong, mysql.TypeLonglong}

session/session.go

-1
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@ func (s *session) ShowProcess() util.ProcessInfo {
15091509
tmp := s.processInfo.Load()
15101510
if tmp != nil {
15111511
pi = tmp.(util.ProcessInfo)
1512-
pi.Mem = s.GetSessionVars().StmtCtx.MemTracker.BytesConsumed()
15131512
}
15141513
return pi
15151514
}

util/processinfo.go

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type ProcessInfo struct {
2727
Time time.Time
2828
State uint16
2929
Info string
30-
Mem int64
3130
}
3231

3332
// SessionManager is an interface for session manage. Show processlist and

0 commit comments

Comments
 (0)