#44504 [NEW]: bytea - nonstandard use of \\ in a string literal

From: Date: Sat, 22 Mar 2008 15:56:43 +0000
Subject: #44504 [NEW]: bytea - nonstandard use of \\ in a string literal
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123541@lists.php.net to get a copy of this message
From: cei at yourshop dot com Operating system: FreeBSD 6.3 amd64, i386 PHP version: 5.2.5 PHP Bug Type: PostgreSQL related Bug description: bytea - nonstandard use of \\ in a string literal 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 bug report at http://bugs.php.net/?id=44504&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44504&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44504&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44504&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44504&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44504&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44504&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44504&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44504&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44504&r=support Expected behavior: http://bugs.php.net/fix.php?id=44504&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44504&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44504&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44504&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44504&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44504&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44504&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44504&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44504&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44504&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44504&r=mysqlcfg

« previous php.bugs (#123541) next »