From: Ilia Alshanetsky Date: Sun, 11 Jan 2004 21:18:29 +0000 (+0000) Subject: MFH: Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option). X-Git-Tag: php-4.3.5RC1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bea9ba8fc21299e1e825af05894065fd4f033b7e;p=php MFH: Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option). --- diff --git a/NEWS b/NEWS index 2cf4ca84b1..98c779abe7 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP 4 NEWS - Added a warning when creating temp stream fails with ftp_(n)list(). (Sara) - Fixed header handler in NSAPI SAPI module (header->replace was ignored, send_default_content_type now sends value from php.ini). (Uwe Schindler) +- Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option). (Ilia) - Fixed bug #26847 (memory leak in mail() when to/subject contain only spaces). (Ilia) - Fixed bug #26777 (ext/interbase: Let DB handle NULL params). (Ard) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 8aa2795b95..2e36950051 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4283,8 +4283,11 @@ PHPAPI int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, smart_str_appendc(&querystr, ';'); smart_str_0(&querystr); - if (do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) + if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) { ret = SUCCESS; + } else if (opt & PGSQL_DML_STRING) { + ret = SUCCESS; + } cleanup: if (var_converted) { @@ -4376,8 +4379,11 @@ PHPAPI int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, smart_str_appendc(&querystr, ';'); smart_str_0(&querystr); - if (do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) + if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) { ret = SUCCESS; + } else if (opt & PGSQL_DML_STRING) { + ret = SUCCESS; + } cleanup: if (!(opt & PGSQL_DML_NO_CONV)) {