]> granicus.if.org Git - php/commitdiff
Fixed bug #47639 (pg_copy_from() WARNING: nonstandard use of \\ in a string
authorIlia Alshanetsky <iliaa@php.net>
Thu, 12 Mar 2009 22:53:37 +0000 (22:53 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 12 Mar 2009 22:53:37 +0000 (22:53 +0000)
literal)

ext/pgsql/pgsql.c

index 5a10f3a8c72e474c7274474bbed83808fc00b7a5..ab3def0d35671ec16dd0b8eecf4767007853113e 100644 (file)
@@ -3889,7 +3889,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);
        }