Package: banshee / 2.6.2-6.1

Fix-sqlite-likelihood_support-detection.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Roderich Schupp <roderich.schupp@gmail.com>
Date: Fri, 1 Apr 2016 00:23:15 +0800
Subject: Fix sqlite likelihood_support detection

"SELECT sqlite_version () >= '3.8.1'" does not return 1 when
sqlite_version () is 3.10.x and above.

Origin: https://bugzilla.gnome.org/attachment.cgi?id=318944
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=740879
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1534971
---
 src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs b/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs
index 3ae0728..d9d5529 100644
--- a/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs
+++ b/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs
@@ -56,7 +56,11 @@ namespace Banshee.Database
         public bool LikelihoodSupport {
             get {
                 if (!likelihood_support.HasValue) {
-                    likelihood_support = Query<bool> ("SELECT sqlite_version () >= '3.8.1'");
+                    // emulate the SQLITE_VERSION_NUMBER macro
+                    string[] v = Query<string> ("SELECT sqlite_version ()").Split ('.');
+                    likelihood_support = (Int32.Parse (v[0]) * 1000000 +
+                                          Int32.Parse (v[1]) * 1000 +
+                                          Int32.Parse (v[2])) >= 3008001;
                 }
                 return likelihood_support.Value;
             }