#38403 [Bgs]: unable to quote \0 to sql strings
| From: | neta at abcb dot it | Date: | Thu, 10 Aug 2006 17:18:36 +0000 |
| Subject: | #38403 [Bgs]: unable to quote \0 to sql strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100660@lists.php.net to get a copy of this message | ||
ID: 38403
User updated by: neta at abcb dot it
Reported By: neta at abcb dot it
Status: Bogus
Bug Type: PDO related
Operating System: OSX/NetBSD/FreeBSD
PHP Version: 5.1.4
New Comment:
update: i just realized that libpq's PQescapeString() *cannot*
handle \0 in the middle of a string.
This is not PDO's fault.
My apologies.
Previous Comments:
------------------------------------------------------------------------
[2006-08-10 16:53:45] tony2001@php.net
Use PDO::quote() to quote binary data before inserting it to the DB.
------------------------------------------------------------------------
[2006-08-09 21:05:12] neta at abcb dot it
Description:
------------
Sending TEXT data to PostgreSQL a database, the string gets
truncated at the first occurrence of \0.
Reproduce code:
---------------
Just try to INSERT "abc\0def" into a TEXT field.
Expected result:
----------------
'abc'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38403&edit=1