File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package variables
17
17
import (
18
18
"fmt"
19
19
"math"
20
+ "os"
20
21
"strings"
21
22
"sync"
22
23
"time"
@@ -187,6 +188,11 @@ func init() {
187
188
InitSystemVariables ()
188
189
}
189
190
191
+ func getHostname () string {
192
+ hostname , _ := os .Hostname ()
193
+ return hostname
194
+ }
195
+
190
196
// systemVars is the internal collection of all MySQL system variables according to the following pages:
191
197
// https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
192
198
// https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html
@@ -1009,7 +1015,7 @@ var systemVars = map[string]sql.SystemVariable{
1009
1015
Dynamic : false ,
1010
1016
SetVarHintApplies : false ,
1011
1017
Type : types .NewSystemStringType ("hostname" ),
1012
- Default : "" ,
1018
+ Default : getHostname () ,
1013
1019
},
1014
1020
"immediate_server_version" : & sql.MysqlSystemVariable {
1015
1021
Name : "immediate_server_version" ,
You can’t perform that action at this time.
0 commit comments