Skip to content

Commit 1b21b56

Browse files
devnexencmb69
authored andcommitted
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
1 parent 8f9f308 commit 1b21b56

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

ext/sqlite3/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if (PHP_SQLITE3 != "no") {
88

99
AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
1010
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function");
11+
AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "have sqlite3_expanded_sql function");
1112
} else {
1213
WARNING("sqlite3 not enabled; libraries and/or headers not found");
1314
}

ext/sqlite3/config0.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if test $PHP_SQLITE3 != "no"; then
1515
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
1616
], [], [$SQLITE3_SHARED_LIBADD])
1717

18+
PHP_CHECK_LIBRARY(sqlite3, sqlite3_expanded_sql, [
19+
AC_DEFINE(HAVE_SQLITE3_EXPANDED_SQL, 1, [have sqlite3_expanded_sql function])
20+
], [], [$SQLITE3_SHARED_LIBADD])
21+
1822
PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
1923
[],
2024
[AC_DEFINE(SQLITE_OMIT_LOAD_EXTENSION, 1, [have sqlite3 with extension support])],

ext/sqlite3/sqlite3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ PHP_METHOD(sqlite3stmt, getSQL)
16511651
}
16521652

16531653
if (expanded) {
1654-
#if SQLITE_VERSION_NUMBER >= 3014000
1654+
#ifdef HAVE_SQLITE3_EXPANDED_SQL
16551655
char *sql = sqlite3_expanded_sql(stmt_obj->stmt);
16561656
RETVAL_STRING(sql);
16571657
sqlite3_free(sql);

0 commit comments

Comments
 (0)