Don't error-out when run-time libsqlite is older than build-time libsqlite
authorMike Hommey <glandium@debian.org>
Mon, 5 Apr 2010 15:58:23 +0000 (17:58 +0200)
committerCarsten Schoenert <c.schoenert@t-online.de>
Fri, 4 Aug 2023 17:48:57 +0000 (18:48 +0100)
In Debian, we have shlibs to handle this.

Gbp-Pq: Topic debian-hacks
Gbp-Pq: Name Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch

storage/mozStorageService.cpp

index 20c9601862bdca29d00dabf84417e70913e08a14..cb5c9051e1fe44627be38c8a3ee70841a094ecbf 100644 (file)
@@ -167,6 +167,33 @@ already_AddRefed<Service> Service::getSingleton() {
     return do_AddRef(gService);
   }
 
+#if 0
+  // Ensure that we are using the same version of SQLite that we compiled with
+  // or newer.  Our configure check ensures we are using a new enough version
+  // at compile time.
+  if (SQLITE_VERSION_NUMBER > ::sqlite3_libversion_number() ||
+      !::sqlite3_compileoption_used("SQLITE_SECURE_DELETE") ||
+      !::sqlite3_compileoption_used("SQLITE_THREADSAFE=1") ||
+      !::sqlite3_compileoption_used("SQLITE_ENABLE_FTS3") ||
+      !::sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY") ||
+      !::sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB")) {
+    nsCOMPtr<nsIPromptService> ps(do_GetService(NS_PROMPTSERVICE_CONTRACTID));
+    if (ps) {
+      nsAutoString title, message;
+      title.AppendLiteral("SQLite Version Error");
+      message.AppendLiteral(
+          "The application has been updated, but the SQLite "
+          "library wasn't updated properly and the application "
+          "cannot run. Please try to launch the application again. "
+          "If that should still fail, please try reinstalling "
+          "it, or contact the support of where you got the "
+          "application from.");
+      (void)ps->Alert(nullptr, title.get(), message.get());
+    }
+    MOZ_CRASH("SQLite Version Error");
+  }
+#endif
+
   // The first reference to the storage service must be obtained on the
   // main thread.
   NS_ENSURE_TRUE(NS_IsMainThread(), nullptr);