]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 11 Jan 2004 21:18:29 +0000 (21:18 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 11 Jan 2004 21:18:29 +0000 (21:18 +0000)
NEWS
ext/pgsql/pgsql.c

diff --git a/NEWS b/NEWS
index 2cf4ca84b1459e383658cb91d2bce0a27ee37383..98c779abe7bfd5c3863026150e20c3434e10a1a4 100644 (file)
--- 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)
index 8aa2795b953078199dc47e577f6d465ae05546f8..2e369500511b4bfabe7b344d0c78de37b0945596 100644 (file)
@@ -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)) {