diff options
Diffstat (limited to 'rwtransaction.go')
-rw-r--r-- | rwtransaction.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rwtransaction.go b/rwtransaction.go index 57135f3..84e6425 100644 --- a/rwtransaction.go +++ b/rwtransaction.go @@ -82,6 +82,12 @@ func (t *RWTransaction) NextSequence(name string) (int, error) { return 0, ErrBucketNotFound } + // Make sure next sequence number will not be larger than the maximum + // integer size of the system. + if b.bucket.sequence == uint64(maxInt) { + return 0, ErrSequenceOverflow + } + // Increment and return the sequence. b.bucket.sequence++ |