diff --git a/pkg/server/admin.go b/pkg/server/admin.go index 989ef5172fb7..71d9c36076d0 100644 --- a/pkg/server/admin.go +++ b/pkg/server/admin.go @@ -1492,7 +1492,7 @@ func (s *adminServer) Locations( ) (*serverpb.LocationsResponse, error) { ctx = s.server.AnnotateCtx(ctx) - userName, err := userFromContext(ctx) + _, err := userFromContext(ctx) if err != nil { return nil, err } @@ -1501,7 +1501,7 @@ func (s *adminServer) Locations( q.Append(`SELECT "localityKey", "localityValue", latitude, longitude FROM system.locations`) rows, cols, err := s.server.sqlServer.internalExecutor.QueryWithCols( ctx, "admin-locations", nil, /* txn */ - sessiondata.InternalExecutorOverride{User: userName}, + sessiondata.InternalExecutorOverride{User: security.RootUser}, q.String(), ) if err != nil { diff --git a/pkg/server/admin_test.go b/pkg/server/admin_test.go index 3914dee416f8..c9044700d7a8 100644 --- a/pkg/server/admin_test.go +++ b/pkg/server/admin_test.go @@ -1512,7 +1512,7 @@ func TestAdminAPILocations(t *testing.T) { ) } var res serverpb.LocationsResponse - if err := getAdminJSONProto(s, "locations", &res); err != nil { + if err := getAdminJSONProtoWithAdminOption(s, "locations", &res, false /* isAdmin */); err != nil { t.Fatal(err) } for i, loc := range testLocations {