Skip to content

Commit

Permalink
clean up comments, error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephanie You committed Jul 24, 2023
1 parent f73d3e4 commit 2eee7b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions go/cmd/dolt/commands/sqlserver/sqlclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,20 @@ func (c ConnectionQueryist) Query(ctx *sql.Context, query string) (sql.Schema, s

// BuildConnectionStringQueryist returns a Queryist that connects to the server specified by the given server config. Presence in this
// module isn't ideal, but it's the only way to get the server config into the queryist.
func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, creds *cli.UserPassword, apr *argparser.ArgParseResults, host string, port int, useTLS bool, database string) (cli.LateBindQueryist, error) {
func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, creds *cli.UserPassword, apr *argparser.ArgParseResults, host string, port int, useTLS bool, dbRev string) (cli.LateBindQueryist, error) {
clientConfig, err := GetClientConfig(cwdFS, creds, apr)
if err != nil {
return nil, err
}

dbName, _ := dsess.SplitRevisionDbName(database)
// ParseDSN currently doesn't support `/` in the db name
dbName, _ := dsess.SplitRevisionDbName(dbRev)
parsedMySQLConfig, err := mysqlDriver.ParseDSN(ConnectionString(clientConfig, dbName))
if err != nil {
return nil, err
}

// ParseDSN currently doesn't support `/` in the db name
parsedMySQLConfig.DBName = database
parsedMySQLConfig.DBName = dbRev
parsedMySQLConfig.Addr = fmt.Sprintf("%s:%d", host, port)

if useTLS {
Expand All @@ -507,7 +507,7 @@ func BuildConnectionStringQueryist(ctx context.Context, cwdFS filesys.Filesys, c

var lateBind cli.LateBindQueryist = func(ctx context.Context) (cli.Queryist, *sql.Context, func(), error) {
sqlCtx := sql.NewContext(ctx)
sqlCtx.SetCurrentDatabase(database)
sqlCtx.SetCurrentDatabase(dbRev)
return queryist, sqlCtx, func() { conn.Conn(ctx) }, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go/cmd/dolt/dolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func buildLateBinder(ctx context.Context, cwdFS filesys.Filesys, mrEnv *env.Mult
dbName, _ := dsess.SplitRevisionDbName(useDb)
targetEnv = mrEnv.GetEnv(dbName)
if targetEnv == nil {
return nil, fmt.Errorf("The provided --use-db %s does not exist or is not a directory.", dbName)
return nil, fmt.Errorf("The provided --use-db %s does not exist.", dbName)
}
} else {
useDb = mrEnv.GetFirstDatabase()
Expand Down

0 comments on commit 2eee7b1

Please sign in to comment.