ID:               44504
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cei at yourshop dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PostgreSQL related
 Operating System: FreeBSD 6.3 amd64, i386
 PHP Version:      5.2.5
 New Comment:

See:
- http://docs.php.net/pg-escape-bytea
- http://www.postgresql.org/docs/current/static/datatype-binary.html


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

[2008-03-22 15:56:42] cei at yourshop dot com

Description:
------------
INSERT into BYTEA provokes: WARNING: nonstandard use of \\ in a string
literal

./configure  --prefix=/usr/local/httpd-2.2.8-php-5.2.5/libexec
--with-config-file-path=/etc/httpd --with-apxs2=/usr/local/httpd-2.2.
8-php-5.2.5/sbin/apxs --with-zlib-dir=/usr/local
--with-pgsql=/usr/local/postgresql-8.2.7
--with-db4=/usr/local/BerkeleyDB.4.6 --with-pcre-regex --with-curl
--with-gd --with-jpeg-dir=/usr/
local --with-png-dir=/usr/local --without-mysql --without-sqlite
--without-pear --disable-ipv6 --disable-cgi --disable-all
--enable-session --enable-cli

Reproduce code:
---------------
CREATE TABLE t_bytea ( s_bytea BYTEA );

<?php
$conn = pg_connect("dbname=test user=test password=test");
$data = pg_escape_bytea(serialize('\0 some bytea data'));
        pg_query($conn, "INSERT INTO t_bytea VALUES('{$data}')");
?>


Expected result:
----------------
Insertion of the bytea data which actually happens, BUT there's
permanently the two lines in the PostgreSQL errorlog:

WARNING:  nonstandard use of \\ in a string literal at character 28
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.



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


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

Reply via email to