Skip to content

Commit

Permalink
sql: sequences: handle integer overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Vilter committed Jan 9, 2018
1 parent dcd66eb commit 3b744de
Show file tree
Hide file tree
Showing 7 changed files with 502 additions and 162 deletions.
1 change: 1 addition & 0 deletions pkg/roachpb/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions pkg/roachpb/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,3 +618,13 @@ func (*TxnPrevAttemptError) message(_ *Error) string {
}

var _ ErrorDetailInterface = &TxnPrevAttemptError{}

func (e *IntegerOverflowError) Error() string {
return e.message(nil)
}

func (e *IntegerOverflowError) message(_ *Error) string {
return fmt.Sprintf(
"key %s with value %d incremented by %d results in overflow",
e.Key, e.CurrentValue, e.IncrementValue)
}
Loading

0 comments on commit 3b744de

Please sign in to comment.