[PHP-DEV] dbase_add_record is broken From: Joey Smith (joey <email protected>)
Date: 08/13/00

I'm not quite sure what the problem is, but dbase_add_record is only
putting (null) into the fields...

I have done a little bit of investigative work to try and discover the
problem. A user submitted a sample script that I have verified works
against the latest PHP3, but not PHP4. I can send the script
privately...

Here is what I find really odd (this is from gdb):

If I try and insert a breakpoint in php_if_dbase_add_record, execution
never breaks...the script runs until the end. But there are the
appropriate number of rows and fields on the .dbf file, all containing
the string "(null)".

I I insert the breakpoint as "dbase.c:277" (which occurs somewhere near
the middle of "PHP_FUNCTION(dbase_add_record)"), I see the following odd
behavior:

Breakpoint 1, php_if_dbase_add_record (ht=2, return_value=0x8243c24,
this_ptr=0x0, return_value_used=0) at dbase.c:278
278 if (zend_hash_index_find(fields->value.ht, i, (void
**)&field) == FAILURE) {
(gdb) n
284 tmp = *field;
(gdb) p tmp
No symbol "tmp" in current context.
(gdb) p *field
$1 = {value = {lval = 136591780, dval = 1.8607713020815746e-269, str =
{val = 0x82439a4 "d:$\b\004", len = 136554788},
    ht = 0x82439a4, obj = {ce = 0x82439a4, properties = 0x823a924}},
type = 0 '\000', is_ref = 0 '\000', refcount = 0}
(gdb)

Huh? Does this make sense to anyone?

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>