Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
[dbconfigs] revert vitessio#4814 as it breaks tablet utf8mb4 settings (
Browse files Browse the repository at this point in the history
  • Loading branch information
brirams authored May 23, 2019
1 parent 3489b15 commit 1d7a89c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions go/vt/dbconfigs/dbconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,27 @@ func HasConnectionParams() bool {
// is used to initialize the per-user conn params.
func Init(defaultSocketFile string) (*DBConfigs, error) {
// The new base configs, if set, supersede legacy settings.
for _, uc := range dbConfigs.userConfigs {
if HasConnectionParams() {
if HasConnectionParams() {
for _, uc := range dbConfigs.userConfigs {
uc.param.Host = baseConfig.Host
uc.param.Port = baseConfig.Port
uc.param.UnixSocket = baseConfig.UnixSocket
} else if uc.param.UnixSocket == "" && uc.param.Host == "" {
uc.param.UnixSocket = defaultSocketFile
uc.param.Charset = baseConfig.Charset
uc.param.Flags = baseConfig.Flags
if uc.useSSL {
uc.param.SslCa = baseConfig.SslCa
uc.param.SslCaPath = baseConfig.SslCaPath
uc.param.SslCert = baseConfig.SslCert
uc.param.SslKey = baseConfig.SslKey
uc.param.ServerName = baseConfig.ServerName
}
}

uc.param.Charset = baseConfig.Charset
uc.param.Flags = baseConfig.Flags
if uc.useSSL {
uc.param.SslCa = baseConfig.SslCa
uc.param.SslCaPath = baseConfig.SslCaPath
uc.param.SslCert = baseConfig.SslCert
uc.param.SslKey = baseConfig.SslKey
uc.param.ServerName = baseConfig.ServerName
} else {
// Use supplied socket value if conn parameters are not specified.
for _, uc := range dbConfigs.userConfigs {
if uc.param.UnixSocket == "" && uc.param.Host == "" {
uc.param.UnixSocket = defaultSocketFile
}
}
}

Expand Down

0 comments on commit 1d7a89c

Please sign in to comment.