Skip to content

Commit

Permalink
Fix GetSchema for detached head
Browse files Browse the repository at this point in the history
  • Loading branch information
tbantle22 committed Oct 9, 2024
1 parent eccd1c5 commit 63c2a6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/libraries/doltcore/sqle/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ func (db Database) CreateSchema(ctx *sql.Context, schemaName string) error {
if err := dsess.CheckAccessForDb(ctx, db, branch_control.Permissions_Write); err != nil {
return err
}

root, err := db.GetRoot(ctx)
if err != nil {
return err
Expand Down Expand Up @@ -1400,11 +1401,10 @@ func (db Database) GetSchema(ctx *sql.Context, schemaName string) (sql.DatabaseS
return newInformationSchemaDatabase(db.Name()), true, nil
}

ws, err := db.GetWorkingSet(ctx)
root, err := db.GetRoot(ctx)
if err != nil {
return nil, false, err
}
root := ws.WorkingRoot()

schemas, err := root.GetDatabaseSchemas(ctx)
if err != nil {
Expand Down

0 comments on commit 63c2a6f

Please sign in to comment.