Skip to content

Commit

Permalink
sql: stop swallowing errors from UncachedPhysicalAccessor.IsValidSchema
Browse files Browse the repository at this point in the history
Before this commit we'd swallow retriable errors during execution. This can
be very problematic as it can lead to lost writes and other general funkiness.
We're opting to not write a test for this specific case as there is ongoing
work to change interfaces to preclude this sort of bug.

Fixes #43067
Fixes #37883 (comment)

Release note: None
  • Loading branch information
ajwerner committed Dec 16, 2019
1 parent e908f3a commit 892ab04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/sql/physical_schema_accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ func (a UncachedPhysicalAccessor) GetObjectNames(
flags tree.DatabaseListFlags,
) (TableNames, error) {
ok, schemaID, err := a.IsValidSchema(ctx, txn, dbDesc.ID, scName)
if !ok || err != nil {
if err != nil {
return nil, err
}
if !ok {
if flags.Required {
tn := tree.MakeTableNameWithSchema(tree.Name(dbDesc.Name), tree.Name(scName), "")
return nil, sqlbase.NewUnsupportedSchemaUsageError(tree.ErrString(&tn.TableNamePrefix))
Expand Down

0 comments on commit 892ab04

Please sign in to comment.