Skip to content

Commit 0d0fca4

Browse files
craig[bot]rafiss
andcommitted
Merge #153733
153733: sql: don't check privilege per-row of crdb_internal.tables r=rafiss a=rafiss The privilege check here is from quite a long time ago, and it no longer is desired. The similar tables pg_catalog.pg_class and information_schema.tables allow one to view table metadata without any special privileges, so crdb_internal.tables should match that as well. No release note since this is an internal introspection API. Epic: None Release note: None Co-authored-by: Rafi Shamim <[email protected]>
2 parents 4c0b9c9 + d5a71d0 commit 0d0fca4

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pkg/sql/crdb_internal.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,6 @@ CREATE TABLE crdb_internal.tables (
615615
if !isTable {
616616
continue
617617
}
618-
if ok, err := p.HasAnyPrivilege(ctx, table); err != nil {
619-
return err
620-
} else if !ok {
621-
continue
622-
}
623618
dbName := dbNames[table.GetParentID()]
624619
if dbName == "" {
625620
// The parent database was deleted. This is possible e.g. when
@@ -692,11 +687,6 @@ func crdbInternalTablesDatabaseLookupFunc(
692687
if !isTable {
693688
return nil
694689
}
695-
if ok, err := p.HasAnyPrivilege(ctx, table); err != nil {
696-
return err
697-
} else if !ok {
698-
return nil
699-
}
700690
seenAny = true
701691
schemaName := scNames[table.GetParentSchemaID()]
702692
if schemaName == "" {

0 commit comments

Comments
 (0)