From:             oleg1917 at mail dot ru
Operating system: centos 4.3
PHP version:      5.1.6
PHP Bug Type:     DBM/DBA related
Bug description:  for some keys cdbmake creates corrupted db and cdb can't read 
valid db.

Description:
------------
i used integer numbers packed into binary strings as keys.
for some numbers dba's cdbmake handler produces files that can't be read
by Bernshtein's tools like cdbtest and CPAN's perl module CDB_File. And
vice versa files produced by Bernshtein's cdbmake and CPAN's perl module
CDB_File can't be read by dba's cdb handler.

Reproduce code:
---------------
<?php
        $handler = 'cdb_make';
        $db_file = '129php.cdb';
        echo "database handler: $handler\n";
        // print md5 checksum of 129test.cdb which is generated by
cdb_make program
        var_dump(md5_file(dirname(__FILE__).'/129test.cdb'));
        if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) {
                dba_insert(pack('i',129), "Booo!", $db_make);
                dba_close($db_make);
                // write md5 checksum of generated database file
                var_dump(md5_file($db_file));
        } else {
                echo "Error creating database\n";
        }
?>

Expected result:
----------------
database handler: cdb_make
string(32) "1f34b74bde3744265acfc21e0f30af95"
string(32) "1f34b74bde3744265acfc21e0f30af95"

Actual result:
--------------
database handler: cdb_make
string(32) "1f34b74bde3744265acfc21e0f30af95"
string(32) "b9ee8bfe966a01e287f8aa45b3fcc958"

-- 
Edit bug report at http://bugs.php.net/?id=38698&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38698&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38698&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38698&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38698&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38698&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38698&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38698&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38698&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38698&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38698&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38698&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38698&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38698&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38698&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38698&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38698&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38698&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38698&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38698&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38698&r=mysqlcfg

Reply via email to