aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tx.go b/tx.go
index 395dce3..52b68ef 100644
--- a/tx.go
+++ b/tx.go
@@ -184,8 +184,12 @@ func (tx *Tx) Commit() error {
}
tx.meta.freelist = p.id
+ // If the high water mark has moved up then attempt to grow the database.
if tx.meta.pgid > opgid {
- tx.db.growSize(int(tx.meta.pgid+1) * tx.db.pageSize)
+ if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil {
+ tx.rollback()
+ return err
+ }
}
// Write dirty pages to disk.