summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-03-13 00:04:38 +0000
committerStanislav Malyshev <stas@php.net>2007-03-13 00:04:38 +0000
commitc3e4a2854a1eb075c2d059ec69b9e3a83a49cd20 (patch)
tree5b4acd6e0534495d3d8afdaee3570271faf963e4 /ext/odbc
parent81f99c721b2589134d69c501b9e691a10bac87d0 (diff)
downloadphp-git-c3e4a2854a1eb075c2d059ec69b9e3a83a49cd20.tar.gz
fix odbc resource handling, patch by Dave Lawson
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/php_odbc.c9
-rw-r--r--ext/odbc/php_odbc_includes.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index d82e0efaa1..2c2b0b7978 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -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);
}
/* }}} */
@@ -1335,12 +1334,10 @@ 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);
}
/* }}} */
@@ -2044,7 +2041,7 @@ PHP_FUNCTION(odbc_free_result)
result->values = NULL;
}
- zend_list_delete(result->id);
+ zend_list_delete(Z_LVAL_PP(pv_res));
RETURN_TRUE;
}
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index d812621148..fc5bb47a28 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -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;