]> granicus.if.org Git - php/commitdiff
Better fix for bug #44189
authorIlia Alshanetsky <iliaa@php.net>
Tue, 26 Feb 2008 00:13:57 +0000 (00:13 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 26 Feb 2008 00:13:57 +0000 (00:13 +0000)
ext/pdo/pdo_stmt.c
ext/pdo_pgsql/pgsql_statement.c

index 7b64cc4877bb9a7ba37984a4a724e5007326d44e..45b1b6c0e357c095b700ad839946a08611120524 100755 (executable)
@@ -166,10 +166,6 @@ static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_typ
 
        ht = stmt->bound_params;
 
-       if (ht && !stmt->bound_param_map) {
-               return 0;
-       }
-
 iterate:
        if (ht) {
                zend_hash_internal_pointer_reset(ht);
index 84af470f3c093d1828d5022fe516de082bad0648..7bd10a67e04012031336f89a1e5ecef01019c19b 100644 (file)
@@ -250,6 +250,9 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
                                return 1;
 
                        case PDO_PARAM_EVT_EXEC_PRE:
+                               if (!stmt->bound_param_map) {
+                                       return 0;
+                               }
                                if (!S->param_values) {
                                        S->param_values = ecalloc(
                                                        zend_hash_num_elements(stmt->bound_param_map),