ID:               42089
 Comment by:       gran_magno at hotmail dot com
 Reported By:      anita dot sobreira at gmail dot com
 Status:           No Feedback
 Bug Type:         InterBase related
 Operating System: fedora 6
 PHP Version:      5.2.3
 New Comment:

>From Alex El Magno - Brazil [EMAIL PROTECTED]
It is the code and message - function.ibase-blob-open ... : 
<?
// $connect =
ibase_connect('db/CEP.GDB','meulogin','minhasenha','ISO8859_1', '100',
'1') // ISO8859_1
 $connect = ibase_connect('db/CEP.GDB','mycode','mypassord')
  or exit("<b>Phodeu!</b>&nbsp;-&nbsp;Falha na conexão $ibase"); //  
die("Falha na conexão");
 $tabela = "projeto";
 $select="SELECT * FROM $tabela";
 if(!$result=ibase_query($connect,$select))
  {exit("<h1>Phodeu!</h1><br> $select <br> errcode:
".ibase_errcode(void)."<BR> _errmsg:".ibase_errmsg(void));
  }
 $ncol=ibase_num_fields($result);
 $tipo=array();
 for($i=0;$i<$ncol;$i++)        
  {$col_info = ibase_field_info($result, $i);
   $tipo[]=$col_info['type'];
  }
 echo " <table align=\"center\" border=\"1\"
background=\"images/fundo_blue_02.gif\">\n";
 $count=0; 
 while ($row = ibase_fetch_object($result))
  {echo " <TR>\n";
   $values="";
   for($i=0;$i<$ncol;$i++)        
    {$col_info = ibase_field_info($result, $i);
     if($tipo[$i]=='BLOB')
      {$conteudo=$row->$col_info[0];
/* 
       $blob   = ibase_blob_info($row->$col_info['name']);
       $handle = ibase_blob_open($row-$col_info['name']);
       $conteudo=ibase_blob_get($handle, $blob[0]);
*/
      }   
     else   
       $conteudo=$row->$col_info['name'];        
     echo "  <TD>$conteudo</TD>\n";
    }
   $count++; // $count=$count+1;
   echo "<td>$count - $insert$values)</td></TR>\n";
  }
 echo " </table>\n";
 ibase_free_result($result);
 ibase_close($connect); 
?>

Warning: ibase_blob_open() [function.ibase-blob-open]: String is not a
BLOB ID in E:\Documents and Settings\magno\htdocs\cep\2.php on line 27

Warning: ibase_blob_get(): supplied argument is not a valid Interbase
blob resource in E:\Documents and Settings\magno\htdocs\cep\2.php on
line 28
  M 1 MARILENE RODRIGUES CHANG AP


Previous Comments:
------------------------------------------------------------------------

[2008-11-28 15:55:39] BenjaminSchwarze at TheUnknownOnes dot net

Patch:

--- ibase_blobs.c_orig  2008-11-28 16:43:59.000000000 +0100
+++ ibase_blobs.c       2008-11-28 16:44:52.000000000 +0100
@@ -78,7 +78,7 @@

        /* 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);
+               spprintf(&result,  BLOB_ID_LEN+1, "0x%0*x%0*x", 8, 
qd.gds_quad_low, 8, qd.gds_quad_high);
        } 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);

------------------------------------------------------------------------

[2008-11-26 08:34:00] BenjaminSchwarze at theunknownones dot net

Dont know where to post the solution. Thats i'll try this way.

Solution: 
- get the sources of your php-version
- in ext/interbase/ibase_blobs.c search the function 
"_php_ibase_quad_to_string"
- replace the line "spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK 
"x", 16, *(ISC_UINT64*)(void *) &qd);" with "spprintf(&result, 
BLOB_ID_LEN+1, "0x%0*x%0*x", 8, qd.gds_quad_low, 8, 
qd.gds_quad_high);"
- compile the interbase module (./configure --with-
interbase=shared,/opt/firebird)
- copy the module (modules/interbase.so) to /usr/lib64/php/modules
- try it ... should work

This worked for me.
My System: Fedora Core 8 64bit, php 5.2.6, Firebird 2.1

------------------------------------------------------------------------

[2008-11-05 09:01:05] tinon at 21cn dot com

slove this problem,php,please!

------------------------------------------------------------------------

[2008-08-27 22:22:22] milan dot tomes at seznam dot cz

I'm having these problems too on Windows XP (32bit) with Firebird 2.1.
When I tried to use php_interbase.dll from version 5.2.1 everything
works fine. 5.2.3 & 5.2.6 are not working.

------------------------------------------------------------------------

[2008-07-19 22:18:28] voev at vilex dot cc

This bug really persists in 64 bit linux.
(on Linux-32 works)

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/42089

-- 
Edit this bug report at http://bugs.php.net/?id=42089&edit=1

Reply via email to