[build] check for sqlite3_drop_modules

Fixes #1053
This commit is contained in:
Tim Stack 2022-09-10 10:37:04 -07:00
parent b2b300c7c8
commit 664f45f641
6 changed files with 21 additions and 7 deletions

View File

@ -1,6 +1,6 @@
# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Sat Sep 10 09:23:23 PDT 2022
# from AX_AM_MACROS_STATIC on Sat Sep 10 10:36:17 PDT 2022
# Code coverage

View File

@ -106,6 +106,15 @@ AC_DEFUN([LNAV_WITH_SQLITE3],
AC_SUBST(HAVE_SQLITE3_ERROR_OFFSET)
AC_CHECK_FUNC(sqlite3_drop_modules,
HAVE_SQLITE3_DROP_MODULES=1
AC_DEFINE([HAVE_SQLITE3_DROP_MODULES], [1],
[Have the sqlite3_drop_modules function]
)
)
AC_SUBST(HAVE_SQLITE3_DROP_MODULES)
AS_VAR_SET(CFLAGS, $saved_CFLAGS)
AS_VAR_SET(CPPFLAGS, $saved_CPPFLAGS)
AS_VAR_SET(LDFLAGS, $saved_LDFLAGS)

View File

@ -2,11 +2,11 @@
#define HAVE_PCRE_H
#define HAVE_NCURSESW_CURSES_H
#define HAVE_ARCHIVE_H 1
#define HAVE_BZLIB_H 1
#define HAVE_BZLIB_H 1
#define HAVE_LIBCURL
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T @
#cmakedefine VCS_PACKAGE_STRING "@VCS_PACKAGE_STRING@"
@ -24,6 +24,8 @@
#define HAVE_SQLITE3_ERROR_OFFSET
#define HAVE_SQLITE3_DROP_MODULES
#define _XOPEN_SOURCE_EXTENDED 1
#define PACKAGE_BUGREPORT "lnav@googlegroups.com"

View File

@ -2116,8 +2116,9 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
nullptr,
nullptr);
}
#if defined(HAVE_SQLITE3_DROP_MODULES)
sqlite3_drop_modules(lnav_data.ld_db.in(), nullptr);
#endif
lnav_data.ld_db.reset();
});

View File

@ -282,7 +282,9 @@ const std::unordered_map<unsigned char, const char*> sql_constraint_names = {
{SQLITE_INDEX_CONSTRAINT_LIMIT, "LIMIT"},
{SQLITE_INDEX_CONSTRAINT_OFFSET, "OFFSET"},
#endif
#if defined(SQLITE_INDEX_CONSTRAINT_FUNCTION)
{SQLITE_INDEX_CONSTRAINT_FUNCTION, "function"},
#endif
};
std::multimap<std::string, help_text*> sqlite_function_help;

View File

@ -524,7 +524,7 @@ sql_encode(sqlite3_value* value, encode_algo algo)
auto_mem<char> retval(curl_free);
retval = curl_easy_escape(get_curl_easy(), blob, blob_len);
return retval;
return std::move(retval);
}
#endif
}
@ -558,7 +558,7 @@ sql_encode(sqlite3_value* value, encode_algo algo)
auto_mem<char> retval(curl_free);
retval = curl_easy_escape(get_curl_easy(), text, text_len);
return retval;
return std::move(retval);
}
#endif
}
@ -604,7 +604,7 @@ sql_decode(string_fragment str, encode_algo algo)
retval = curl_easy_unescape(
get_curl_easy(), str.data(), str.length(), nullptr);
return retval;
return std::move(retval);
}
#endif
}