#40277 [Opn->Fbk]: BLOB objects are fetched badly via prepared statements
| From: | tony2001@php.net | Date: | Mon, 29 Jan 2007 20:35:13 +0000 |
| Subject: | #40277 [Opn->Fbk]: BLOB objects are fetched badly via prepared statements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108203@lists.php.net to get a copy of this message | ||
ID: 40277
Updated by: tony2001@php.net
Reported By: zakirov at rain dot ifmo dot ru
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: FreeBSD, Windows
PHP Version: 5.2.0
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2007-01-29 20:20:04] zakirov at rain dot ifmo dot ru
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 this bug report at http://bugs.php.net/?id=40277&edit=1