- Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument)

Patch by: cbandy at jbandy dot com
This commit is contained in:
Felipe Pena 2010-04-20 15:59:01 +00:00
parent 336e957951
commit 1efc049863
2 changed files with 4 additions and 6 deletions

2
NEWS
View File

@ -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.)

View 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);
}