Skip to content

Commit f2a556d

Browse files
committed
Don't use placeholder for username
This is needed in order to work with v22.1 (unreleased). This also includes a small change to keep the version number as a field on testserver.
1 parent 70bef8d commit f2a556d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

testserver/tenant.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ func (ts *testServerImpl) NewTenantServer(proxy bool) (TestServer, error) {
188188

189189
tenant := &testServerImpl{
190190
serverArgs: ts.serverArgs,
191+
version: ts.version,
191192
state: stateNew,
192193
baseDir: ts.baseDir,
193194
cmdArgs: args,
@@ -230,7 +231,7 @@ func (ts *testServerImpl) NewTenantServer(proxy bool) (TestServer, error) {
230231

231232
if rootPassword != "" {
232233
// Allow root to login via password.
233-
if _, err := tenantDB.Exec(`ALTER USER $1 WITH PASSWORD $2`, "root", rootPassword); err != nil {
234+
if _, err := tenantDB.Exec(`ALTER USER root WITH PASSWORD $1`, rootPassword); err != nil {
234235
return nil, fmt.Errorf("%s cannot set password: %w", tenantserverMessagePrefix, err)
235236
}
236237

testserver/testserver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ type TestServer interface {
103103
// testServerImpl is a TestServer implementation.
104104
type testServerImpl struct {
105105
mu sync.RWMutex
106+
version *version.Version
106107
serverArgs testServerArgs
107108
state int
108109
baseDir string
@@ -393,6 +394,7 @@ func NewTestServer(opts ...TestServerOpt) (TestServer, error) {
393394

394395
ts := &testServerImpl{
395396
serverArgs: *serverArgs,
397+
version: v,
396398
state: stateNew,
397399
baseDir: baseDir,
398400
cmdArgs: args,
@@ -492,7 +494,7 @@ func (ts *testServerImpl) pollListeningURLFile() error {
492494
return err
493495
}
494496
defer db.Close()
495-
if _, err := db.Exec(`ALTER USER $1 WITH PASSWORD $2`, "root", pw); err != nil {
497+
if _, err := db.Exec(`ALTER USER root WITH PASSWORD $1`, pw); err != nil {
496498
return err
497499
}
498500

0 commit comments

Comments
 (0)