Fix crc64 unit test

This commit is contained in:
Ben Johnson
2021-01-16 10:04:03 -07:00
parent 6ac6a8536d
commit 07a65cbac7
2 changed files with 8 additions and 2 deletions

6
db.go
View File

@@ -1485,6 +1485,12 @@ func (db *DB) CRC64() (uint64, Pos, error) {
db.mu.Lock()
defer db.mu.Unlock()
if err := db.init(); err != nil {
return 0, Pos{}, err
} else if db.db == nil {
return 0, Pos{}, os.ErrNotExist
}
// Force a RESTART checkpoint to ensure the database is at the start of the WAL.
if err := db.checkpoint(CheckpointModeRestart); err != nil {
return 0, Pos{}, err