#23975 [Asn->Csd]: dba_open locking error with ndbm/db2/db3
| From: | helly@php.net | Date: | Thu, 12 Jun 2003 20:01:24 +0000 |
| Subject: | #23975 [Asn->Csd]: dba_open locking error with ndbm/db2/db3 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-41798@lists.php.net to get a copy of this message | ||
ID: 23975
Updated by: helly@php.net
-Summary: dba_open locking error with db3
Reported By: rhalstenbach at t-online dot de
-Status: Assigned
+Status: Closed
Bug Type: DBM/DBA related
-Operating System: Windows
+Operating System: ANY
PHP Version: 4.3.2
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Maybe this applies to dbm, too. However the problem is solved in a
generic way.
Previous Comments:
------------------------------------------------------------------------
[2003-06-10 05:19:49] adam at saki dot com dot au
This is actually because the locking will prematurely create an empty
file, causing the VCWD_STAT command in dba_db3.c to return 0, resulting
in the wrong parameters to db_open.
This can be verified by putting a stat command after the lock detection
code and before the call to open (line 590 in ext/dba/dba.c).
------------------------------------------------------------------------
[2003-06-05 01:28:33] sniper@php.net
Marcus, take a look?
------------------------------------------------------------------------
[2003-06-03 03:43:56] rhalstenbach at t-online dot de
The new locking feature (introduced with 4.3.0) does not work correctly
in default mode "d". Very annoying because it is the default mode ...
Example:
<?php
$d1 = dba_open("c:/www/htdocs/dbfile", "c", "db3); // Old syntax,
specifying no locking mode means mode "d", i.e. same as "cd"
if ($d1 === FALSE) die("Could not open dbfile");
?>
Same problem for mode "w".
It works correctly for locking mode "l" and for suppressing locking via
"-". Obviously the dba_open() function tries to create a lock file with
exactly the same name as the database file - what fails of course.
Tested on WindowsXP with db3, but i think it will fail for every
db-driver (except gdbm) on every OS.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23975&edit=1