Skip to content

Commit

Permalink
infoschema: fix pseudo data for profiling table (#8092) (#8096)
Browse files Browse the repository at this point in the history
  • Loading branch information
alivxxx authored and shenli committed Oct 30, 2018
1 parent ebebc2a commit 56b8c4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ func dataForPseudoProfiling() [][]types.Datum {
0, // PAGE_FAULTS_MAJOR
0, // PAGE_FAULTS_MINOR
0, // SWAPS
0, // SOURCE_FUNCTION
0, // SOURCE_FILE
"", // SOURCE_FUNCTION
"", // SOURCE_FILE
0, // SOURCE_LINE
)
rows = append(rows, row)
Expand Down
17 changes: 17 additions & 0 deletions infoschema/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,20 @@ func (s *testSuite) TestSchemataCharacterSet(c *C) {
testkit.Rows("utf8mb4 utf8_bin"))

}

func (s *testSuite) TestProfiling(c *C) {
testleak.BeforeTest()
defer testleak.AfterTest(c)()
store, err := mockstore.NewMockTikvStore()
c.Assert(err, IsNil)
defer store.Close()
session.SetStatsLease(0)
do, err := session.BootstrapSession(store)
c.Assert(err, IsNil)
defer do.Close()

tk := testkit.NewTestKit(c, store)
tk.MustQuery("select * from information_schema.profiling").Check(testkit.Rows())
tk.MustExec("set @@profiling=1")
tk.MustQuery("select * from information_schema.profiling").Check(testkit.Rows("0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"))
}

0 comments on commit 56b8c4a

Please sign in to comment.