Skip to content

Commit

Permalink
cherry pick #22731 to release-5.0-rc
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>
  • Loading branch information
lichunzhu authored and ti-srebot committed Mar 5, 2021
1 parent 8304d66 commit 606d76a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sig/execution:
- distsql/*
- executor/*
- !executor/brie*
- util/chunk/*
- util/disk/*
- util/execdetails/*
Expand Down Expand Up @@ -31,3 +32,6 @@ sig/DDL:

component/config:
- config/*

sig/migrate:
- executor/brie*
5 changes: 5 additions & 0 deletions executor/brie.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/printer"
"github.com/pingcap/tidb/util/sqlexec"
)

Expand Down Expand Up @@ -466,3 +467,7 @@ func (gs *tidbGlueSession) Record(name string, value uint64) {
gs.info.archiveSize = value
}
}

func (gs *tidbGlueSession) GetVersion() string {
return "TiDB\n" + printer.GetTiDBInfo()
}
28 changes: 28 additions & 0 deletions executor/brie_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2021 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package executor

import . "github.com/pingcap/check"

type testBRIESuite struct{}

var _ = Suite(&testBRIESuite{})

func (s *testPartitionSuite) TestGlueGetVersion(c *C) {
g := tidbGlueSession{}
version := g.GetVersion()
c.Assert(version, Matches, `(.|\n)*Release Version(.|\n)*`)
c.Assert(version, Matches, `(.|\n)*Git Commit Hash(.|\n)*`)
c.Assert(version, Matches, `(.|\n)*GoVersion(.|\n)*`)
}

0 comments on commit 606d76a

Please sign in to comment.