Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000076OCaml~DO NOT USE (was: OCaml general)public2000-04-03 03:522000-04-03 04:24
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000076: Dbm.iter throws Not_found on empty database
DescriptionFull_Name: David Clarke
Version: 2.99
OS: Redhat Linix 6.1
Submission from: (

Calling Dbm.iter on a database which has no entries results in
a Not_found exception being thrown. This is contrary to the specification.

It throws the exception in the call to "firstkey", as specified.
The following minor change should fix the problem (see the last line)


(* Usual iterator *)
let iter f t =
  let rec walk k =
    f k (find t k);
    match try Some(nextkey t) with Not_found -> None
         None -> ()
       | Some k -> walk k
(* walk (firstkey t) -- current line *)
    try walk (firstkey t) with Not_found -> ()


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2000-04-03 04:24

Thanks for your report.

It is now fixed in the CVS version.
The Db library has been corrected identically.
administrator (administrator)
2000-04-03 04:24

Fixed in 3.00.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker