diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-10-13 12:15:58 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-10-13 12:15:58 +0200 |
commit | 87392eff1a3b06cad2449dca8dc90942f3721900 (patch) | |
tree | 970dc65c3ad435c63052a652763ae7bfaa7d24e5 /ext/sqlite3 | |
parent | be2ddc6b6575da0b8e7ed235464f7e23c71674c7 (diff) | |
download | php-git-87392eff1a3b06cad2449dca8dc90942f3721900.tar.gz |
Require SQLite ≥ 3.5.0 for ext/sqlite3 and ext/pdo_sqlite
It is possible to pass flags when opening an SQLite database. For
Sqlite < 3.5.0 these are ignored, since `sqlite3_open` doesn't support
flags. Neither a warning or notice is raised in this case, nor is this
behavior documented in the PHP manual. Instead of fixing it either
way, we lift the requirement to SQLite 3.5.0 (released on 2007-09-04)
instead of the former SQLite 3.3.9 (released on 2007-01-04).
Diffstat (limited to 'ext/sqlite3')
-rw-r--r-- | ext/sqlite3/config0.m4 | 6 | ||||
-rw-r--r-- | ext/sqlite3/sqlite3.c | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4 index 6d6fb88f55..98495da300 100644 --- a/ext/sqlite3/config0.m4 +++ b/ext/sqlite3/config0.m4 @@ -33,14 +33,14 @@ if test $PHP_SQLITE3 != "no"; then AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org]) fi - AC_MSG_CHECKING([for SQLite 3.3.9+]) - PHP_CHECK_LIBRARY(sqlite3, sqlite3_prepare_v2, [ + AC_MSG_CHECKING([for SQLite 3.5.0+]) + PHP_CHECK_LIBRARY(sqlite3, sqlite3_open_v2, [ AC_MSG_RESULT(found) PHP_ADD_LIBRARY_WITH_PATH(sqlite3, $SQLITE3_DIR/$PHP_LIBDIR, SQLITE3_SHARED_LIBADD) PHP_ADD_INCLUDE($SQLITE3_DIR/include) ],[ AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please install SQLite 3.3.9 first or check libsqlite3 is present]) + AC_MSG_ERROR([Please install SQLite 3.5.0 first or check libsqlite3 is present]) ],[ -L$SQLITE3_DIR/$PHP_LIBDIR -lm ]) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index c91aec17cd..2abf99f4eb 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -131,11 +131,7 @@ PHP_METHOD(sqlite3, open) fullpath = filename; } -#if SQLITE_VERSION_NUMBER >= 3005000 rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL); -#else - rc = sqlite3_open(fullpath, &(db_obj->db)); -#endif if (rc != SQLITE_OK) { zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", #ifdef HAVE_SQLITE3_ERRSTR |