Skip to content

Commit

Permalink
Added hostname sysvar, fixes #7740 (#7750)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo authored and lysu committed Sep 20, 2018
1 parent 268ace8 commit 8a1847e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ var defaultSysVars = []*SysVar{
{ScopeGlobal, "thread_cache_size", "9"},
{ScopeGlobal, "log_slow_admin_statements", "OFF"},
{ScopeNone, "innodb_checksums", "ON"},
{ScopeNone, "hostname", "localhost"},
{ScopeNone, "hostname", ServerHostname},
{ScopeGlobal | ScopeSession, "auto_increment_offset", "1"},
{ScopeNone, "ft_stopword_file", "(built-in)"},
{ScopeGlobal, "innodb_max_dirty_pages_pct_lwm", "0"},
Expand Down
5 changes: 5 additions & 0 deletions sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

package variable

import (
"os"
)

/*
Steps to add a new TiDB specific system variable:
Expand Down Expand Up @@ -229,4 +233,5 @@ var (
maxDDLReorgWorkerCount int32 = 128
// DDLSlowOprThreshold is the threshold for ddl slow operations, uint is millisecond.
DDLSlowOprThreshold uint32 = 300
ServerHostname, _ = os.Hostname()
)

0 comments on commit 8a1847e

Please sign in to comment.