From: info at heyne dot biz
Operating system: Suse 9.0
PHP version: 5.0.4
PHP Bug Type: dBase related
Bug description: dbase_add_record() failed
Description:
------------
dbase_add_record() failed with 'unexpected error'
Problem located in dbase.c:
PHP_FUNCTION(dbase_add_record) { .....
for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) {
zval tmp;
if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) ==
FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error");
efree(cp);
RETURN_FALSE;
}
Reproduce code:
---------------
$db = dbase_open( 'test.dbf', 2 );
$record = dbase_get_record_with_names ( $db, 1);
unset($record['deleted']);
dbase_add_record( $db, $record );
dbase_close($db);
--> test.dbf contains only String fields ! <--
Expected result:
----------------
Record should be inserted
Actual result:
--------------
Warning: dbase_add_record() [function.dbase-add-record]: unexpected error
in .../export_db.php on line 4
--
Edit bug report at http://bugs.php.net/?id=33480&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33480&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33480&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33480&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33480&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33480&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33480&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33480&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33480&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33480&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33480&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33480&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33480&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33480&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33480&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33480&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33480&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33480&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33480&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33480&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33480&r=mysqlcfg