iliaa Wed Oct 4 23:53:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo_pgsql config.m4 pgsql_driver.c /php-src NEWS Log: Added support for character sets in PDO quote() method for PostgreSQL 8.1.4 and higher. http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/config.m4?r1=1.13&r2=1.13.4.1&diff_format=u Index: php-src/ext/pdo_pgsql/config.m4 diff -u php-src/ext/pdo_pgsql/config.m4:1.13 php-src/ext/pdo_pgsql/config.m4:1.13.4.1 --- php-src/ext/pdo_pgsql/config.m4:1.13 Wed Jul 27 02:51:01 2005 +++ php-src/ext/pdo_pgsql/config.m4 Wed Oct 4 23:53:36 2006 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.13 2005/07/27 02:51:01 wez Exp $ +dnl $Id: config.m4,v 1.13.4.1 2006/10/04 23:53:36 iliaa Exp $ dnl if test "$PHP_PDO" != "no"; then @@ -82,6 +82,7 @@ old_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR" AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 or later])) + AC_CHECK_LIB(pq, PQescapeStringConn, AC_DEFINE(HAVE_PQESCAPE_CONN,1,[PostgreSQL 8.1.4 or later])) AC_CHECK_LIB(pq, PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later])) AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq under windows])) AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL])) http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.53.2.14.2.2&r2=1.53.2.14.2.3&diff_format=u Index: php-src/ext/pdo_pgsql/pgsql_driver.c diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.2 php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.3 --- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.2 Tue Sep 19 15:45:21 2006 +++ php-src/ext/pdo_pgsql/pgsql_driver.c Wed Oct 4 23:53:36 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql_driver.c,v 1.53.2.14.2.2 2006/09/19 15:45:21 iliaa Exp $ */ +/* $Id: pgsql_driver.c,v 1.53.2.14.2.3 2006/10/04 23:53:36 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -322,13 +322,20 @@ (*quoted)[*quotedlen] = '\0'; free(escaped); break; - default: - *quoted = emalloc(2*unquotedlen + 3); + default: { + pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; + + *quoted = safe_emalloc(2, unquotedlen, 3); (*quoted)[0] = '\''; +#ifndef HAVE_PQESCAPE_CONN *quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen); +#else + *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL); +#endif (*quoted)[*quotedlen + 1] = '\''; (*quoted)[*quotedlen + 2] = '\0'; *quotedlen += 2; + } } return 1; } @@ -355,7 +362,11 @@ size_t l = strlen(name); name_escaped = safe_emalloc(l, 2, 1); +#ifndef HAVE_PQESCAPE_CONN PQescapeString(name_escaped, name, l); +#else + PQescapeStringConn(H->server, name_escaped, name, l, NULL); +#endif spprintf(&q, 0, "SELECT CURRVAL('%s')", name_escaped); res = PQexec(H->server, q); efree(name_escaped); http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.285&r2=1.2027.2.547.2.286&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.285 php-src/NEWS:1.2027.2.547.2.286 --- php-src/NEWS:1.2027.2.547.2.285 Wed Oct 4 23:27:03 2006 +++ php-src/NEWS Wed Oct 4 23:53:36 2006 @@ -5,6 +5,8 @@ - Added ability to make SOAP call userspace PHP<->XML converters. (Dmitry) - Added support for character sets in pg_escape_string() for PostgreSQL 8.1.4 and higher. (Ilia) +- Added support for character sets in PDO quote() method for PostgreSQL + 8.1.4 and higher. (Ilia) - Fixed infinite loop when a wrong color index is given to imagefill (Pierre) - Fixed mess with CGI/CLI -d option (now it works with cgi; constants are working exactly like in php.ini; with FastCGI -d affects all requests).
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php