diff options
author | David Carlier <devnexen@gmail.com> | 2020-08-15 14:11:51 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-08-21 15:45:51 +0200 |
commit | 1b21b560741373638b8d1ffe2a4a672717cb6656 (patch) | |
tree | b9ea2e1a31d3e7cf9246d3b29c4bdff96dacee14 /ext/sqlite3 | |
parent | 8f9f308bb9098d4444be1217d483b5c2cce4df6b (diff) | |
download | php-git-1b21b560741373638b8d1ffe2a4a672717cb6656.tar.gz |
sqlite3 linkage issue on some systems/package combination fix.
Checking the version is not enough, the function might be available
but the symbols are not present still.
Closes GH-5993
Diffstat (limited to 'ext/sqlite3')
-rw-r--r-- | ext/sqlite3/config.w32 | 1 | ||||
-rw-r--r-- | ext/sqlite3/config0.m4 | 4 | ||||
-rw-r--r-- | ext/sqlite3/sqlite3.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32 index 41eccb5af9..ab54989e1c 100644 --- a/ext/sqlite3/config.w32 +++ b/ext/sqlite3/config.w32 @@ -8,6 +8,7 @@ if (PHP_SQLITE3 != "no") { AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support"); AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function"); + AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "have sqlite3_expanded_sql function"); } else { WARNING("sqlite3 not enabled; libraries and/or headers not found"); } diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4 index 0d607593b7..e83ec5f224 100644 --- a/ext/sqlite3/config0.m4 +++ b/ext/sqlite3/config0.m4 @@ -15,6 +15,10 @@ if test $PHP_SQLITE3 != "no"; then AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function]) ], [], [$SQLITE3_SHARED_LIBADD]) + PHP_CHECK_LIBRARY(sqlite3, sqlite3_expanded_sql, [ + AC_DEFINE(HAVE_SQLITE3_EXPANDED_SQL, 1, [have sqlite3_expanded_sql function]) + ], [], [$SQLITE3_SHARED_LIBADD]) + PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension, [], [AC_DEFINE(SQLITE_OMIT_LOAD_EXTENSION, 1, [have sqlite3 with extension support])], diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 80f57a4508..f4d8066ac8 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1651,7 +1651,7 @@ PHP_METHOD(sqlite3stmt, getSQL) } if (expanded) { -#if SQLITE_VERSION_NUMBER >= 3014000 +#ifdef HAVE_SQLITE3_EXPANDED_SQL char *sql = sqlite3_expanded_sql(stmt_obj->stmt); RETVAL_STRING(sql); sqlite3_free(sql); |