From 32027f5944244ff9dfc2f25bd7b875148517d0f4 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 12 Mar 2009 22:54:15 +0000 Subject: [PATCH] MFB: Fixed bug #47639 (pg_copy_from() WARNING: nonstandard use of \\ in a string literal) --- NEWS | 2 ++ ext/pgsql/pgsql.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1c1464016c..4e01019917 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2009, PHP 5.2.10 - Fixed memory corruptions while reading properties of zip files. (Ilia) +- Fixed bug #47639 (pg_copy_from() WARNING: nonstandard use of \\ in a string + literal). (Ilia) - Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware). (Ilia) - Fixed bug #47546 (Default value for limit parameter in explode is 0, not -1). (Kalle) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index e8518f6510..ad470dd7ea 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3469,7 +3469,7 @@ PHP_FUNCTION(pg_copy_from) ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); - spprintf(&query, 0, "COPY \"%s\" FROM STDIN DELIMITERS '%c' WITH NULL AS '%s'", table_name, *pg_delim, pg_null_as); + spprintf(&query, 0, "COPY \"%s\" FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as); while ((pgsql_result = PQgetResult(pgsql))) { PQclear(pgsql_result); } -- 2.40.0