php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44504 bytea - nonstandard use of \\ in a string literal
Submitted: 2008-03-22 15:56 UTC Modified: 2008-03-23 11:07 UTC
From: cei at yourshop dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 5.2.5 OS: FreeBSD 6.3 amd64, i386
Private report: No CVE-ID: None
 [2008-03-22 15:56 UTC] 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'\\'.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 03:01:29 2024 UTC