Bug #59375 [Wfx->ReO]: BLOB inserts broken
| From: | tpunt@php.net | Date: | Sat, 01 Apr 2017 21:22:53 +0000 |
| Subject: | Bug #59375 [Wfx->ReO]: BLOB inserts broken | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208263@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=59375&edit=1
ID: 59375
Updated by: tpunt@php.net
Reported by: kraven at kraven dot org
Summary: BLOB inserts broken
-Status: Wont fix
+Status: Re-Opened
Type: Bug
-Package: *General Issues
+Package: PDO DBlib
Operating System: Linux or Windows
PHP Version: 5.2.13
Block user comment: N
Private report: N
New Comment:
It's no longer apart a PECL extension...
Previous Comments:
------------------------------------------------------------------------
[2017-04-01 21:20:45] tpunt@php.net
Due to this extension not seeing any activity since 2005, this issue will not be fixed. We are
therefore closing this now.
------------------------------------------------------------------------
[2010-08-19 08:34:52] kraven at kraven dot org
Description:
------------
BLOB inserts are broken. A syntax error will get thrown because of improper encoding of the binary
stream.
Reproduce code:
---------------
COVER_IMAGE = VARBINARY(max)
EXCERPT = VARCHAR(max)
ID = INT
$blob_path = TESTS_BASE_DIR . '/etc/lob/propel.gif';
$clob_path = TESTS_BASE_DIR . '/etc/lob/tin_drum.txt';
$sql = "INSERT INTO media (COVER_IMAGE,EXCERPT,BOOK_ID) VALUES (:p1,:p2,:p3)";
$stmt = $this->con->prepare($sql);
$fileStream = fopen($blob_path, 'r');
$stmt->bindParam(':p1', $fileStream, PDO::PARAM_LOB);
$stmt->bindValue(':p2', file_get_contents($clob_path), PDO::PARAM_STR);
$stmt->bindValue(':p3', 5, PDO::PARAM_INT);
$stmt->execute();
fclose($fileStream);
Actual result:
--------------
PDOException: SQLSTATE[HY000]: General error: 10007 Incorrect syntax near 'GIF89aÈ'.
[10007] (severity 5) [(null)]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=59375&edit=1