From:             vesely at tana dot it
Operating system: Solaris
PHP version:      4.3.4
PHP Bug Type:     DBM/DBA related
Bug description:  Unexpected data loss when opening dba file

Description:
------------
Opening a file in 'c' mode (see example below)
truncates the file!! The docs say '"c" for read/write
access and database creation if it doesn't currently exist.'

I cannot understand that comment at line 658 in
ext/dba/dba.c, as it seems to imply that truncating
the database is necessary for locking it (??).

Reproduce code:
---------------
dba_open("important_data.db", "c", "db4");

Expected result:
----------------
open db (create if doesn't exist)

Actual result:
--------------
truncated db

-- 
Edit bug report at http://bugs.php.net/?id=26304&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26304&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26304&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26304&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26304&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26304&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26304&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26304&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26304&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26304&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26304&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26304&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26304&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26304&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26304&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26304&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26304&r=float

Reply via email to