From 32dfdc0dd3347e55b38883340ee8d020d000e16b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 20 Jan 2019 20:12:36 +0100 Subject: [PATCH] Check if ALTER is supported --- README | 2 +- meson.build | 2 +- zathura/database-sqlite.c | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README b/README index 3efa341..60273c1 100644 --- a/README +++ b/README @@ -15,7 +15,7 @@ The following dependencies are required: The following dependencies are optional: -* sqlite3 (>= 3.5.9): splite3 database backend +* sqlite3 (>= 3.6.23): splite3 database backend * libmagic from file(1): for mime-type detection * libsynctex from TeXLive: SyncTeX support * libseccomp: sandbox support diff --git a/meson.build b/meson.build index ec7ecd9..b4372a8 100644 --- a/meson.build +++ b/meson.build @@ -68,7 +68,7 @@ flags = cc.get_supported_arguments(flags) # optional dependencies additional_sources = [] -sqlite = dependency('sqlite3', version: '>=3.5.9', required: get_option('sqlite')) +sqlite = dependency('sqlite3', version: '>=3.6.23', required: get_option('sqlite')) synctex = dependency('synctex', required: get_option('synctex')) magic = cc.find_library('magic', required: get_option('magic')) seccomp = dependency('libseccomp', required: get_option('seccomp')) diff --git a/zathura/database-sqlite.c b/zathura/database-sqlite.c index 1b17acb..9fe4899 100644 --- a/zathura/database-sqlite.c +++ b/zathura/database-sqlite.c @@ -251,6 +251,13 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool if (new_db == true) return; +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS + if (sqlite3_compileoption_used("SQLITE_OMIT_ALTERTABLE") == 1) { + girara_error("sqlite3 built without support for ALTER, cannot update database"); + return; + } +#endif + bool all_updates_ok = true; if (database_version < 1) {