PHP 4.0 Bug #5112: dbase_create broken.. Here is a quick fix.
| From: | rezbin at yahoo dot com | Date: | Sun, 18 Jun 2000 21:54:27 +0000 |
| Subject: | PHP 4.0 Bug #5112: dbase_create broken.. Here is a quick fix. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21697@lists.php.net to get a copy of this message | ||
From: rezbin@yahoo.com
Operating system: Linux 2.2.13
PHP version: 4.0 Latest CVS (18/06/2000)
PHP Bug Type: dBase related
Bug description: dbase_create broken.. Here is a quick fix.
There is a problem with dbase_create in that it fails to recongnize the 2nd parameter as being an
array of arrays.
I have done some digging, and found a solution to the problem, albet just a quick-fix it does do the
trick.
First thing to do is apply the quick patch to the dbase.c file that is mentioned in bug ID: 4813,
that will remove the page fault problems.
The way to get the function to work is this:
on the line 569:
pval *filename, *fields, *field, *value;
make it read:
pval *filename, *fields, *field, *value, **tmp;
On line 626 change:
if (zend_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) {
to read:
if (zend_hash_index_find(fields->value.ht, i, (void **)&tmp) == FAILURE) {
Add the fallowing to line 631:
field = *val;
repeate this method for the other references to function zend_hash_index_find, in dbase_create and
it'll work just fine.
It looks like something has changed between PHP3 and PHP4, which must of broke the function.
Config line used: ./configure --with-mysql --with-apxs --enable-dbase --disable-debug