diff options
| author | Wez Furlong <wez@php.net> | 2005-07-09 03:52:41 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2005-07-09 03:52:41 +0000 |
| commit | d3b653e97b5e226f1f3fad86bb5359557e06f875 (patch) | |
| tree | 003300d7035caeb19e327722d965aa70d043652b /ext/pdo/php_pdo_driver.h | |
| parent | 5fe5da90ea7bb3c5f88a9a077f09b18b681371aa (diff) | |
| download | php-git-d3b653e97b5e226f1f3fad86bb5359557e06f875.tar.gz | |
Added:
proto bool PDOStatement::closeCursor()
Closes the cursor, leaving the statement ready for re-execution.
The purpose of the function is to free up the connection to the server so that
other queries may be issued, but leaving the statement in a state that it can
be re-executed.
This is implemented either as an optional driver specific method (allowing for
maximum efficiency), or as the generic PDO fallback if no driver specific
function is installed.
The PDO generic fallback is semantically the same as writing the following code
in your PHP script:
do {
while ($stmt->fetch())
;
if (!$stmt->nextRowset())
break;
} while (true);
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
| -rwxr-xr-x | ext/pdo/php_pdo_driver.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index d0259e5b30..0f0b115ac1 100755 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -44,7 +44,7 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC); # define FALSE 0 #endif -#define PDO_DRIVER_API 20050708 +#define PDO_DRIVER_API 20050709 enum pdo_param_type { PDO_PARAM_NULL, @@ -367,6 +367,12 @@ typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, long colno, zval * to the caller. */ typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt TSRMLS_DC); +/* closes the active cursor on a statement, leaving the prepared + * statement ready for re-execution. Useful to explicitly state + * that you are done with a given rowset, without having to explicitly + * fetch all the rows. */ +typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt TSRMLS_DC); + struct pdo_stmt_methods { pdo_stmt_dtor_func dtor; pdo_stmt_execute_func executer; @@ -378,6 +384,7 @@ struct pdo_stmt_methods { pdo_stmt_get_attr_func get_attribute; pdo_stmt_get_column_meta_func get_column_meta; pdo_stmt_next_rowset_func next_rowset; + pdo_stmt_cursor_closer_func cursor_closer; }; /* }}} */ |
