be aware of scrollable cursors; sqlite doesn't support them

This commit is contained in:
Wez Furlong 2005-01-12 06:08:59 +00:00
parent 4d5c40cd9a
commit c77bd71315
2 changed files with 8 additions and 1 deletions

View file

@ -123,6 +123,12 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len,
stmt->driver_data = S; stmt->driver_data = S;
stmt->methods = &sqlite_stmt_methods; stmt->methods = &sqlite_stmt_methods;
if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) {
H->einfo.errcode = SQLITE_ERROR;
pdo_sqlite_error(dbh);
return 0;
}
i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail); i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail);
if (i == SQLITE_OK) { if (i == SQLITE_OK) {
return 1; return 1;

View file

@ -122,7 +122,8 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
return 1; return 1;
} }
static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC) static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
enum pdo_fetch_orientation ori, long offset TSRMLS_DC)
{ {
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
int i; int i;