From: superfelo at yahoo dot com Operating system: Windows XP and 2003 PHP version: 5.2.2 PHP Bug Type: COM related Bug description: Error in COM Object results
Description: ------------ As it is possible to see bellow, a COM Object is opened, then Data Base is read by a Recordset and a OLE object is loaded in such Recordset. Later, using a GetChunk which is a Recordset function a number of bytes in OLE object is read but this function just result in the number of printable characters and it discards or ignore for instance, byte 0 or any other not printable character. In the second example, it is possible to see a function to read 20 bytes after a certain position. Now the problem is similar. The 20 bytes has been counted by the results are just printable characters of such 20 bytes. So, result is less than 20 character because not all 20 characters are printable. Reproduce code: --------------- $engine = new COM("DAO.DBEngine.35"); $engine->SystemDB = "c:\system.mda"; $engine->defaultuser = "admin"; $engine->defaultpassword = ""; $db = $engine->OpenDataBase("c:\bd.mdb"); $sqlstr = "SELECT DISTINCTROW tabla1.* FROM tabla1;" ; $rst = $db->OpenRecordset("RsConfig",$sqlstr); echo $rst->Fields["Campo1"]->GetChunk(1,20); //------------------------------------------------- $mstream = new COM("ADODB.Stream"); $mstream->Type = 1; // 'adTypeBinary $mstream->Open; $mstream->Write($rst->Fields["Campo1"]->Value); $mstream->position = 0; echo $mstream->Read(20); Expected result: ---------------- The actual number of bytes in a OLE object stored in a Recordset: This number of bytes of course, must include printable and not printable characters. Actual result: -------------- Just the number of printable characters. -- Edit bug report at http://bugs.php.net/?id=41388&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41388&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41388&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41388&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41388&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41388&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41388&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41388&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41388&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41388&r=support Expected behavior: http://bugs.php.net/fix.php?id=41388&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41388&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41388&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41388&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41388&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41388&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41388&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41388&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41388&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41388&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41388&r=mysqlcfg