|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15664 dba_firstkey() isn't returning the first key
Submitted: 2002-02-21 14:18 UTC Modified: 2002-09-30 20:41 UTC
From: caperry at webofficenow dot com Assigned:
Status: Not a bug Package: DBM/DBA related
PHP Version: 4.1.1 OS: Linux
Private report: No CVE-ID: None
 [2002-02-21 14:18 UTC] caperry at webofficenow dot com
Using dba with the gdbm backend.  Creating a new database and inserting 10 values.  When I go to look at that database using a dba_firstkey() followed by a series of dba_nextkey() calls, I do not get back all the data.  If I ask for specific  keys that did not show up, they exist and have data.  Any ideas?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-21 14:23 UTC]
Can you attach a short, concise snippet of code I
can use to reproduce this please?
 [2002-02-21 16:06 UTC] caperry at webofficenow dot com
Well, it figures that after I open a bug I can't reproduce it.  8^) It does appear to be random, as we never see it in testing, but when the code is being pounded on by a few people at once, it's more frequent.  All the code I have is rather large and complicated.  I can give some senarios:

We use a GDBM file as a log for file transfers.  When clearing the log, we do a dba_firstkey and check if it's OKay to be deleted.  If it is, we delete the key and do a dba_firstkey again.  A lot of times the first few items are skipped this way.

We have another piece of code the pulls "big" (greater than 100 chars) values out of a database and puts 10 of them in a GDBM file.  Again, it occasionally skips the first one or two.  I have some example code, but as I said - it seems to work right now.
 [2002-09-30 20:41 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 16:01:24 2023 UTC