]> granicus.if.org Git - php/commitdiff
Fix for missing errmsg in test 005
authorArd Biesheuvel <abies@php.net>
Tue, 12 Aug 2003 10:02:25 +0000 (10:02 +0000)
committerArd Biesheuvel <abies@php.net>
Tue, 12 Aug 2003 10:02:25 +0000 (10:02 +0000)
ext/interbase/interbase.c

index 176e12a72ec6ccb423e388a141df9f99afd98a16..976d42df74cbe6ac9f1128ae7227ce19a957d33d 100644 (file)
@@ -2468,8 +2468,6 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
        ibase_result *ib_result;
        XSQLVAR *var;
        
-       RESET_ERRMSG;
-       
        switch (ZEND_NUM_ARGS()) {
                case 1:
                        if (ZEND_NUM_ARGS() == 1 && zend_get_parameters_ex(1, &result_arg) == FAILURE) {
@@ -2490,14 +2488,11 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
 
        ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, "InterBase result", le_result);
 
-       if (ib_result->out_sqlda == NULL) {
-               _php_ibase_module_error("Trying to fetch results from a non-select query");
+       if (ib_result->out_sqlda == NULL || !ib_result->has_more_rows) {
                RETURN_FALSE;
-       }
-       
-       if (!ib_result->has_more_rows) {
-               RETURN_FALSE;
-       }
+       } /* might have been because of an error */
+
+       RESET_ERRMSG;
        
        array_init(return_value);