Skip to content

Commit

Permalink
Merge #31925
Browse files Browse the repository at this point in the history
31925: sql: error wording and type fix r=BramGruneir a=BramGruneir

Reword and convert a generic error to a pgerror.

Release note: None

Co-authored-by: Bram Gruneir <bram@cockroachlabs.com>
  • Loading branch information
craig[bot] and BramGruneir committed Oct 26, 2018
2 parents 41780ec + ab88e3d commit bd877a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/sql/pg_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"bytes"

"github.com/cockroachdb/cockroach/pkg/security"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
"github.com/cockroachdb/cockroach/pkg/sql/sem/builtins"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sem/types"
Expand Down Expand Up @@ -682,9 +683,8 @@ CREATE TABLE pg_catalog.pg_constraint (
confmatchtype = fkMatchTypeSimple
columnIDs := con.Index.ColumnIDs
if int(con.FK.SharedPrefixLen) > len(columnIDs) {
return errors.Errorf(
"For foreign key %q's shared prefix len (%d) is greater than the number of columns "+
"in the index (%d). This might be an indication of inconsistency.",
return pgerror.NewAssertionErrorf(
"foreign key %q's SharedPrefixLen (%d) is greater than the columns in the index (%d)",
con.FK.Name,
con.FK.SharedPrefixLen,
int32(len(columnIDs)),
Expand Down

0 comments on commit bd877a0

Please sign in to comment.