]> granicus.if.org Git - php/commitdiff
MFB: fix odbc resource handling, patch by Dave Lawson
authorStanislav Malyshev <stas@php.net>
Tue, 13 Mar 2007 00:12:08 +0000 (00:12 +0000)
committerStanislav Malyshev <stas@php.net>
Tue, 13 Mar 2007 00:12:08 +0000 (00:12 +0000)
ext/odbc/php_odbc.c
ext/odbc/php_odbc_includes.h

index b242d111da9fdcf62d71f701b5a7df24f6bb8ca5..20a8a1f6279b07278bc09b744f2ad927fc930dd0 100644 (file)
@@ -915,11 +915,10 @@ PHP_FUNCTION(odbc_prepare)
        } else {
                result->values = NULL;
        }
-       result->id = zend_list_insert(result, le_result);       
        zend_list_addref(conn->id);
        result->conn_ptr = conn;
        result->fetched = 0;
-       RETURN_RESOURCE(result->id);
+       ZEND_REGISTER_RESOURCE(return_value, result, le_result);  
 }
 /* }}} */
 
@@ -1328,12 +1327,11 @@ PHP_FUNCTION(odbc_exec)
        } else {
                result->values = NULL;
        }
-       result->id = zend_list_insert(result, le_result);
        zend_list_addref(conn->id);
        result->conn_ptr = conn;
        result->fetched = 0;
        
-       RETURN_RESOURCE(result->id);
+       ZEND_REGISTER_RESOURCE(return_value, result, le_result);
 }
 /* }}} */
 
@@ -2037,7 +2035,7 @@ PHP_FUNCTION(odbc_free_result)
                result->values = NULL;
        }
                        
-       zend_list_delete(result->id);
+       zend_list_delete(Z_LVAL_PP(pv_res));
        
        RETURN_TRUE;
 }
index d8126211480a0e23d1ab4b4818925e0b534cc530..fc5bb47a28784325e61e7df8512af1ed8614230f 100644 (file)
@@ -236,7 +236,6 @@ typedef struct odbc_result_value {
 
 typedef struct odbc_result {
        ODBC_SQL_STMT_T stmt;
-       int id;
        odbc_result_value *values;
        SWORD numcols;
        SWORD numparams;