1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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
This commit is contained in:
David Carlier
2020-08-15 14:11:51 +01:00
committed by Christoph M. Becker
parent 8f9f308bb9
commit 1b21b56074
3 changed files with 6 additions and 1 deletions

View File

@@ -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");
}

View File

@@ -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])],

View File

@@ -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);