diff --git a/infoschema/tables.go b/infoschema/tables.go index d47bb0e007870..80e80a54144b7 100644 --- a/infoschema/tables.go +++ b/infoschema/tables.go @@ -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) diff --git a/infoschema/tables_test.go b/infoschema/tables_test.go index 919f7b9a9e0b7..0bdd327075f8a 100644 --- a/infoschema/tables_test.go +++ b/infoschema/tables_test.go @@ -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")) +}