]> granicus.if.org Git - php/commitdiff
- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)
authorFelipe Pena <felipe@php.net>
Tue, 20 Apr 2010 15:59:01 +0000 (15:59 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 20 Apr 2010 15:59:01 +0000 (15:59 +0000)
  Patch by: cbandy at jbandy dot com

NEWS
ext/pgsql/pgsql.c

diff --git a/NEWS b/NEWS
index a19e1228434b18438e7d9e9b0c16f344b47e0cd4..1c65adef2152c1ab496a464b28370e5d87a9c860 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PHP                                                                        NEWS
   (Felipe)
 - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string
   literal). (cbandy at jbandy dot com)
+- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename
+  argument). (cbandy at jbandy dot com)
 - Fixed bug #51445 (var_dump() invalid/slow *RECURSION* detection). (Felipe)
 - Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains
   timezone). (Adam)
index 807ed3074b5a38ac1346d6076a97b791837659c7..39fbfa6b87c7eb3b95a3222eb4d2da9f7fc803c8 100644 (file)
@@ -3342,11 +3342,7 @@ PHP_FUNCTION(pg_copy_to)
                free_pg_null = 1;
        }
 
-       if (memchr(table_name, '.', table_name_len)) {
-               spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
-       } else {
-               spprintf(&query, 0, "COPY \"%s\" TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
-       }
+       spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
 
        while ((pgsql_result = PQgetResult(pgsql))) {
                PQclear(pgsql_result);
@@ -3478,7 +3474,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 E'%c' WITH NULL AS E'%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);
        }