ID:               44629
 Updated by:       [EMAIL PROTECTED]
 Reported By:      lapo at lapo dot it
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: *
 PHP Version:      5.2.5
 New Comment:

PDO_PARAM_LOB accepts a resource or a string.

Not sure why another type is needed, though the fix is only in 5.3+.


Previous Comments:
------------------------------------------------------------------------

[2008-04-03 14:13:31] lapo at lapo dot it

Description:
------------
While PHP strings support \0s in them, SQLite3 doesn't accept them in
text fields, only in blob fields.
A possible work-around, thanks to the closed bug #41135, is to write to
a memory stream and use PDO::PARAM_LOB, but that seems a bit overkill
for very small "string" values such as the binary form of PHP's sha1().
I think the best solution could be to scan a PDO::PARAM_STR value for
zeros and in that case use sqlite3_bind_blob just as if it was a
PDO::PARAM_LOB.
Or maybe (a little cleaner) create a (non-large) PDO::PARAM_BINARY.
Using streams is certainly the best approach for LOB, but I think it's
overkill for non-large-OBs.

Tell me what of the two solutions the PHP team would prefer to adopt
and I can eventually produce a patch.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44629&edit=1

Reply via email to