Skip to content

Commit

Permalink
Testing out a fix for sql-server integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fulghum committed Dec 23, 2024
1 parent 62618d4 commit 61fd270
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion go/libraries/doltcore/servercfg/yaml_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ func (cfg YAMLConfig) WriteTimeout() uint64 {
// User returns the username that connecting clients must use.
func (cfg YAMLConfig) User() string {
if cfg.UserConfig.Name == nil {
return DefaultUser
// TODO: Having this return "root" by default prevents us from being able to
// tell is a user was explicitly specified or not. The server initialization
// code then thinks an ephemeral user was requested, and doesn't create the
// implicit, persisted root superuser.
// TODO: But... why would this have not allowed a root user to log in?
//return DefaultUser
return ""
}

return *cfg.UserConfig.Name
Expand Down
7 changes: 6 additions & 1 deletion go/libraries/doltcore/servercfg/yaml_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ func TestYAMLConfigDefaults(t *testing.T) {

assert.Equal(t, DefaultHost, cfg.Host())
assert.Equal(t, DefaultPort, cfg.Port())
assert.Equal(t, DefaultUser, cfg.User())
// TODO: Testing out not defaulting the user to "root", so that we can
// distinguish between when a user is explicitly specified or not.
// We want this, so we can tell if the user was explicitly specified
// and should be an ephemeral superuser, or if none was specified
// and we should initialize the implicit root superuser.
assert.Equal(t, "", cfg.User())
assert.Equal(t, DefaultPass, cfg.Password())
assert.Equal(t, uint64(DefaultTimeout), cfg.WriteTimeout())
assert.Equal(t, uint64(DefaultTimeout), cfg.ReadTimeout())
Expand Down

0 comments on commit 61fd270

Please sign in to comment.