Require SQLite ≥ 3.7.4 for ext/sqlite3

`SQLite3::readOnly()` uses `sqlite3_stmt_readonly()` which is only
available as of libsqlite 3.7.4.  For older SQLite3 versions we return
always `false`, which can be confusing.  Instead of sticking with this
behavior, or even undefining the method for old SQLite3 versions, we
lift the requirements to SQLite 3.7.4 (released on 2010-12-08),
according to a respective discussion[1].

Since pdo_sqlite doesn't use `sqlite3_stmt_readonly()`, we stick with
the minimum requirement of SQLite 3.5.0.

[1] <https://github.com/php/php-src/pull/3614>
This commit is contained in:
Christoph M. Becker 2018-11-29 15:10:39 +01:00
parent 1674db8c40
commit a757ebb5b5
4 changed files with 7 additions and 8 deletions

View file

@ -1386,11 +1386,9 @@ PHP_METHOD(sqlite3stmt, readOnly)
SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
#if SQLITE_VERSION_NUMBER >= 3007004
if (sqlite3_stmt_readonly(stmt_obj->stmt)) {
RETURN_TRUE;
}
#endif
RETURN_FALSE;
}
/* }}} */