From:             zakirov at rain dot ifmo dot ru
Operating system: FreeBSD, Windows
PHP version:      5.2.0
PHP Bug Type:     MySQLi related
Bug description:  BLOB objects are fetched badly via prepared statements

Description:
------------
Data stored in MySQL 4.1 database as LONGBLOB object is fetched badly when
prepared statement mechanism is used. Binded result is likely a heap of
internal PHP data.

Reproduce code:
---------------
MySQL:

CREATE TABLE Upload (
  ID              INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  Content         LONGBLOB NOT NULL,
  PRIMARY KEY (ID)
) Type=InnoDB CHARACTER SET 'latin1';


PHP:

- store some content (e.g. file) to table Upload

- fetch stored content via prepared statement:
...
$stmt = $conn->prepare('select Content from Upload where ID=?');
$stmt->bind_param('i',$id);
$stmt->execute();
$stmt->bind_result($Content1);
$stmt->fetch();
$stmt->close();
...

- compare stored and fetched content

Expected result:
----------------
Stored content.

Actual result:
--------------
Heap of internal PHP data.

-- 
Edit bug report at http://bugs.php.net/?id=40277&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40277&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40277&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40277&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40277&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40277&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40277&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40277&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40277&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40277&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40277&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40277&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40277&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40277&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40277&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40277&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40277&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40277&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40277&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40277&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40277&r=mysqlcfg

Reply via email to