]> 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 02e29d4d8103816fd1145cf2e5560fdd165177aa..85316bab20fb2cb4ae25cf2e9ab9ed0c847923e0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,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 #51590 (JSON_ERROR_UTF8 is undefined). (Felipe)
 - Fixed bug #51577 (Uninitialized memory reference with oci_bind_array_by_name)
   (Oracle Corp.)
index 5fbfd5870e3066325b87e5a475eef2bee033acbb..70e9d0bda23d72e7bb694dc5c754616fdbcaf755 100644 (file)
@@ -3765,11 +3765,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);
@@ -3901,7 +3897,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);
        }