php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41429 working with filled blob fields failed
Submitted: 2007-05-18 11:21 UTC Modified: 2007-08-06 12:55 UTC
Votes:32
Avg. Score:5.0 ± 0.0
Reproduced:32 of 32 (100.0%)
Same Version:27 (84.4%)
Same OS:15 (46.9%)
From: idvis at seznam dot cz Assigned:
Status: Closed Package: InterBase related
PHP Version: 5.2.2 OS: WinXPPro, Win2000Pro
Private report: No CVE-ID: None
 [2007-05-18 11:21 UTC] idvis at seznam dot cz
Description:
------------
My opinioin to #41345 tony2001@php.net comment:

I think, that this is bug.
I have the similar experience - after upgrading from PHP 5.2.1
to PHP 5.2.2 I cannot work with filled blob fields.
Warnings: 
ibase_blob_info() - unrecognized BLOB field in ...

Downgrade back to 5.2.1 fixes the problem.
So I expect, that this is bug only in 5.2.2.

Tested on the following two cases:
1. Win2000Pro, Apache 2.3, php as ISAPI module, database Firebird 1.53
2. WinXPPro, Apache 2.4, php as CGI, database Firebird 1.53

Tom

Reproduce code:
---------------
  //... $con= ...  connecting to db was before....  
  $query=ibase_query($con,"SELECT SOMEBLOBFIELD FROM TB_WITHBLOB");
  $record=ibase_fetch_row($query);  
  $blobinfo = ibase_blob_info($record[0]); //<-- warning Warning: ibase_blob_info() [function.ibase-blob-info]: Unrecognized BLOB ID in ....   
  //some code bellow...


Expected result:
----------------
I expect no warning :-)

Actual result:
--------------
arning Warning: ibase_blob_info() [function.ibase-blob-info]: Unrecognized BLOB ID in...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-19 15:18 UTC] TQFA at hotmail dot com
Hi,

I agree with IDVIS, the Interbase Blob function seems to be unusable, I get the same error "Unrecognized BLOB....".

I had to revert back to PHP4 while in the process migrating my project to PHP5.

I'm using Windows XP + FB 2.0.1 + Xitami.

Please help :P
 [2007-05-20 23:59 UTC] cristiano dot soares at netwizard dot com dot br
Hi,

I'm migrating from 5.2.1 to 5.2.2 and I got the same error.

I'm using win2000 sp4 FB 2.0

Help us please
 [2007-05-24 19:39 UTC] chechelopez at gmail dot com
Same problem, this was really a headache
Please Help
 [2007-06-13 22:35 UTC] ilpochta at gmail dot com
Maybe this change http://cvs.php.net/viewvc.cgi/php-src/ext/interbase/ibase_blobs.c?r1=1.12&r2=1.13 broked ibase_blob_*() functionality?
 [2007-06-25 02:34 UTC] david at edumate dot com dot au
We have the same issue, after upgrading from 5.2.0 to 5.2.3.

Running in Apache 2, SuSE 10.2
 [2007-07-12 19:16 UTC] quipo@php.net
Confirmed. I can reproduce the bug too.
 [2007-07-12 20:49 UTC] kgbfernando at yahoo dot com dot br
PHP Bug? 

See below that the codes is differs from version 5.2.1 to earlier:


The PHP 5.2.1 code 

char *_php_ibase_quad_to_string(ISC_QUAD const qd) /* {{{ */
{
	char *result = (char *) emalloc(BLOB_ID_LEN+1);

	/* shortcut for most common case */
	if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) {
		sprintf(result, "0x%0*" LL_MASK "x", 16, *(ISC_UINT64*)(void *) &qd);
	} else {
		ISC_UINT64 res = ((ISC_UINT64) qd.gds_quad_high << 0x20) | qd.gds_quad_low;
		sprintf(result, "0x%0*" LL_MASK "x", 16, res);
	}
	result[BLOB_ID_LEN] = '\0';
	return result;
}
/* }}} */




The PHP 5.2.3 or 5.2.2

char *_php_ibase_quad_to_string(ISC_QUAD const qd) /* {{{ */
{
	char *result;

	/* shortcut for most common case */
	if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) {
		spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16, *(ISC_UINT64*)(void *) &qd);
	} else {
		ISC_UINT64 res = ((ISC_UINT64) qd.gds_quad_high << 0x20) | qd.gds_quad_low;
		spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16, res);
	}
	return result;
}
/* }}} */
 [2007-07-19 13:21 UTC] john dot cxh at gmail dot com
The temporary solution:

find php\ext\php_interbase.dll in php V5.2.1

copy this file to php5.2.3\ext\ overwrite the new version file

I am using php V5.2.3 + apache2.2.4 + WinxpProSP2

test it sucessfully
 [2007-08-03 09:52 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Should be fixed in the snap.
 [2007-08-03 10:33 UTC] idvis at seznam dot cz
I tried this snapshot
http://snaps.php.net/win32/php5.2-win32-latest.zip
and unfortunately I must say,
that the error is not solved.
The same problems, I described above,
"Unrecognized BLOB ID in...".

I still use temporary solution based on replacing php\ext\php_interbase.dll from php 5.2.1 version.

Tom
 [2007-08-03 18:02 UTC] tony2001@php.net
I don't know which snapshot you tried, but I'm afraid you were testing previous snap, no the NEXT one.
Please try the snap again.
 [2007-08-03 22:49 UTC] idvis at seznam dot cz
OK,

I downloaded snapshot today again,
then I tested it, and it seems 
the problem IS SOLVED and working with BLOB fields
is now OK again.

Thank you very much for your fix.
When we can expect new PHP release including this fix?
 [2007-08-06 12:55 UTC] tony2001@php.net
The very next release will incorporate this change.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat May 25 03:01:26 2019 UTC