From: madamjak at pobox dot sk
Operating system: Solaris 2.8
PHP version: 5.0.5
PHP Bug Type: Informix related
Bug description: BYTE input and output problem
Description:
------------
I want to put and get binary data to column type of binary BLOB (not Smart
BLOB). When I put binary data that contain bytes with ASCII code between
127-255 into BLOB column and after this I get this same data from this
same BLOB column this data are changed. These changes are probably same as
changes for codepages transformation. My aplication works in Slovak
locales. When I put binary data into this BYTE column from PC by MS Access
and get by php function ifx_get_blob the data was correct.
Reproduce code:
---------------
<?php
// creating persistent connection to Informix ver 10.0
// lines deleted
$upfile='//usr//local//apache//htdocs//test//upload//asci_input.txt';
echo $upfile.'<BR>';
$blobid = ifx_create_blob(1, 1, $upfile);
$blobidarray[] = $blobid;
$resid = ifx_query ("INSERT INTO test (ID, OBJEKT)
VALUES(0,?)", $link,
$blobidarray);
if (! $resid)
{
// echo ".... Error messages ...";
die;
}
$sqlca = ifx_getsqlca ($resid);
$serial_value = $sqlca["sqlerrd1"];
$resid = ifx_query ("SELECT * FROM test WHERE ID='$serial_value'",
$link);
$row = ifx_fetch_row ($resid, "NEXT");
$obsah = ifx_get_blob($row[objekt]);
$fp = FOpen("//usr//local//apache//htdocs//test//upload//asci_output.txt",
"wb+") or
die("I can not create file");
FWrite($fp, $obsah);
Fclose($fp);
?>
Expected result:
----------------
I except that ascii_input.txt and ascii_output.txt have to have same
content.
Actual result:
--------------
Content of ascii_input.txt and ascii_output.txt is different. Bytes with
ascii codes are changed.
--
Edit bug report at http://bugs.php.net/?id=34586&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34586&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34586&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34586&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34586&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34586&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34586&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34586&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34586&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34586&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34586&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34586&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34586&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34586&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34586&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34586&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34586&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34586&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34586&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34586&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34586&r=mysqlcfg