|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10380 dba_*open with mode 'c' problem
Submitted: 2001-04-18 10:02 UTC Modified: 2002-01-12 02:26 UTC
From: Assigned:
Status: Closed Package: DBM/DBA related
PHP Version: 4.0 Latest CVS (18/04/2001) OS: RedHat 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2001-04-18 10:02 UTC]
db3 support compiled in without problems, all functions
available and working.

apache-1.3.19, php snapshot from today.
db3 3.1.14-6, devel, utils, stock rpm install in rhl-7.0.

database directory is "drwxrwxrwt";

using dba_open or dba_popen, with mode 'c', if the
database doesn't exist, it is created and the function
performs as expected. If the database already exists,
the function should open the database for read/write
access. Instead, it throws:

driver initialization failed...

despite having just created the database itself.

For example:

$dbpath = "/usr/local/db3data/test/testdb3.db3";
$dbmode = "c";
$dbhandler = "db3";

$dbh = dba_popen($dbpath,$dbmode,$dbhandler);
$mykey = "mykey";
$myval = "Hello World";
if (!dba_exists($mykey,$dbh)) {
   echo "Key doesn't exist, adding it.<br>\n";
   dba_insert ($mykey, $myval, $dbh);               
else {
   $storedval = dba_fetch($mykey, $dbh);        
   echo $storedval;

This snippet will work as expected if the database
doesn't exist. If it does, the error occurs, where
according to the docs it should just open the database
for read write access.

If the database exists and I change the mode to 'w',
expected behaviour occurs.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-12 02:26 UTC]
Fixed in current CVS
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 02:01:32 2024 UTC