Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf committed Apr 17, 2023
1 parent 31751af commit 29db287
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ else
CGO_ENABLED=1 $(GOBUILD) -tags enterprise $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' tidb-server/main.go
endif

enterprise-server: enterprise-prepare enterprise-server-build
enterprise-server:
@make enterprise-prepare
@make enterprise-server-build

server_check:
ifeq ($(TARGET), "")
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ifneq "$(TIDB_EDITION)" "Enterprise"
endif
endif

ENTERPRISE_EXTENSION_VERSION := None
ENTERPRISE_EXTENSION_VERSION :=

ifeq ($(shell if [ -a extension/enterprise/.git ]; then echo "true"; fi),true)
ENTERPRISE_EXTENSION_VERSION := $(shell cd extension/enterprise && git rev-parse HEAD)
Expand Down
18 changes: 13 additions & 5 deletions util/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

// PrintTiDBInfo prints the TiDB version information.
func PrintTiDBInfo() {
logutil.BgLogger().Info("Welcome to TiDB.",
fields := []zap.Field{
zap.String("Release Version", mysql.TiDBReleaseVersion),
zap.String("Edition", versioninfo.TiDBEdition),
zap.String("Git Commit Hash", versioninfo.TiDBGitHash),
Expand All @@ -41,7 +41,11 @@ func PrintTiDBInfo() {
zap.Bool("Race Enabled", israce.RaceEnabled),
zap.Bool("Check Table Before Drop", config.CheckTableBeforeDrop),
zap.String("TiKV Min Version", versioninfo.TiKVMinVersion),
zap.String("Extension Version", versioninfo.TiDBEnterpriseExtensionVersion))
}
if versioninfo.TiDBEnterpriseExtensionVersion != "" {
fields = append(fields, zap.String("Extension Version", versioninfo.TiDBEnterpriseExtensionVersion))
}
logutil.BgLogger().Info("Welcome to TiDB.", fields...)
configJSON, err := json.Marshal(config.GetGlobalConfig())
if err != nil {
panic(err)
Expand All @@ -51,6 +55,10 @@ func PrintTiDBInfo() {

// GetTiDBInfo returns the git hash and build time of this tidb-server binary.
func GetTiDBInfo() string {
enterpriseVersion := ""
if versioninfo.TiDBEnterpriseExtensionVersion != "" {
enterpriseVersion = fmt.Sprintf("\nEnterprise Edition: %s", versioninfo.TiDBEnterpriseExtensionVersion)
}
return fmt.Sprintf("Release Version: %s\n"+
"Edition: %s\n"+
"Git Commit Hash: %s\n"+
Expand All @@ -60,8 +68,8 @@ func GetTiDBInfo() string {
"Race Enabled: %v\n"+
"TiKV Min Version: %s\n"+
"Check Table Before Drop: %v\n"+
"Store: %s\n"+
"Extension Version: %s",
"Store: %s"+
"%s",
mysql.TiDBReleaseVersion,
versioninfo.TiDBEdition,
versioninfo.TiDBGitHash,
Expand All @@ -72,7 +80,7 @@ func GetTiDBInfo() string {
versioninfo.TiKVMinVersion,
config.CheckTableBeforeDrop,
config.GetGlobalConfig().Store,
versioninfo.TiDBEnterpriseExtensionVersion,
enterpriseVersion,
)
}

Expand Down
2 changes: 1 addition & 1 deletion util/versioninfo/versioninfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ var (
TiDBEdition = CommunityEdition
// TiKVMinVersion is the minimum version of TiKV that can be compatible with the current TiDB.
TiKVMinVersion = "6.2.0-alpha"
TiDBEnterpriseExtensionVersion = "None"
TiDBEnterpriseExtensionVersion = ""
)

0 comments on commit 29db287

Please sign in to comment.