Skip to content

Commit

Permalink
fix: adapt to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NoyException committed Dec 24, 2024
1 parent 3e65fc9 commit c930501
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pgserver/duck_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,10 @@ func (h *DuckHandler) executeQuery(ctx *sql.Context, query string, parsed tree.S
if err != nil {
break
}
// If the query contains a schema name, we need to execute the query to set the schema as default.
if len(parts) > 1 {
exec()
} else {
schema = types.OkResultSchema
iter = sql.RowsToRowIter(sql.NewRow(types.OkResult{}))
}
// exec() will get the current schema from the underlying connection. If we don't set the schema to public here,
// exec() may fail because of the absence of the old schema in the newly switched catalog.
ctx.Session.SetCurrentDatabase("public")
exec()
} else {
exec()
}
Expand Down

0 comments on commit c930501

Please sign in to comment.