diff options
author | Wez Furlong <wez@php.net> | 2005-02-09 07:00:00 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2005-02-09 07:00:00 +0000 |
commit | 211206b2e4a68323f42a5a3b67b8de58245b75d0 (patch) | |
tree | db6a9593c4a055c0ffe9fe83eb3f3dce0bd1dd5b /ext/pdo_sqlite/sqlite_driver.c | |
parent | f6aa8f5d90bdde718ca0d0aa0293ec7145d57928 (diff) | |
download | php-git-211206b2e4a68323f42a5a3b67b8de58245b75d0.tar.gz |
Add PDO_ATTR_TIMEOUT support.
Fix PECL Bug #3391
Diffstat (limited to 'ext/pdo_sqlite/sqlite_driver.c')
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 8ba33d1dd9..c51e68ad3d 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -232,6 +232,18 @@ static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_valu return 1; } +static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) +{ + pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; + + switch (attr) { + case PDO_ATTR_TIMEOUT: + convert_to_long(val); + sqlite3_busy_timeout(H->db, Z_LVAL_P(val) * 1000); + return 1; + } +} + static PHP_FUNCTION(sqlite_create_function) { /* TODO: implement this stuff */ @@ -261,7 +273,7 @@ static struct pdo_dbh_methods sqlite_methods = { sqlite_handle_begin, sqlite_handle_commit, sqlite_handle_rollback, - NULL, /* set_attribute */ + pdo_sqlite_set_attr, pdo_sqlite_last_insert_id, pdo_sqlite_fetch_error_func, pdo_sqlite_get_attribute, |