Skip to content

Commit 7898f49

Browse files
authored
Fix show processlist panic (#1991)
1 parent 307c012 commit 7898f49

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

enginetest/queries/queries.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ var SpatialQueryTests = []QueryTest{
742742
}
743743

744744
var QueryTests = []QueryTest{
745+
{
746+
Query: "show full processlist",
747+
Expected: []sql.Row{},
748+
},
745749
{
746750
Query: "select * from (select i, i2 from niltable) a(x,y) union select * from (select 1, NULL) b(x,y) union select * from (select i, i2 from niltable) c(x,y)",
747751
ExpectedColumns: sql.Schema{

sql/planbuilder/show.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func (b *Builder) buildShow(inScope *scope, s *ast.Show, query string) (outScope
3434
showType := strings.ToLower(s.Type)
3535
switch showType {
3636
case "processlist":
37+
outScope = inScope.push()
3738
outScope.node = plan.NewShowProcessList()
3839
case ast.CreateTableStr, "create view":
3940
return b.buildShowTable(inScope, s, showType)

0 commit comments

Comments
 (0)