[arch-commits] Commit in tracker/trunk (2 files)

Jan Steffens heftig at archlinux.org
Sat Mar 27 18:10:44 UTC 2021


    Date: Saturday, March 27, 2021 @ 18:10:44
  Author: heftig
Revision: 411121

2.3.6+7+gb27396252-1

Added:
  tracker/trunk/0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch
Modified:
  tracker/trunk/PKGBUILD

---------------------------------------------------------+
 0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch |   56 ++++++++++++++
 PKGBUILD                                                |   18 +++-
 2 files changed, 69 insertions(+), 5 deletions(-)

Added: 0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch
===================================================================
--- 0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch	                        (rev 0)
+++ 0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch	2021-03-27 18:10:44 UTC (rev 411121)
@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg at gnome.org>
+Date: Sun, 21 Mar 2021 17:38:48 +0100
+Subject: [PATCH] libtracker-data: Workaround SQLite 3.35.x bug
+
+The optimization for UNION ALLs inside JOINs had another unexpected
+victim:
+
+  SELECT * { GRAPH ?g { ?a ... OPTIONAL { ?a ... } } }
+
+Does now break when matching the graph between both sides of the
+LEFT JOIN caused by OPTIONAL, making all other values coming from
+the right hand side come back empty. Make it sure this specific case
+is ineligible for query flattening optimizations by adding a LIMIT
+clause on the right hand side of the LEFT JOIN. This brings back
+correct over fast.
+
+This workaround should be revisited when a SQLite fix is available.
+---
+ src/libtracker-data/tracker-sparql.c | 22 +++++++++++++++++++++-
+ 1 file changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
+index e36d2341e..60e50c611 100644
+--- a/src/libtracker-data/tracker-sparql.c
++++ b/src/libtracker-data/tracker-sparql.c
+@@ -3170,8 +3170,28 @@ translate_OptionalGraphPattern (TrackerSparql  *sparql,
+ 
+ 	_call_rule (sparql, NAMED_RULE_GroupGraphPattern, error);
+ 
+-	if (do_join)
++	if (do_join) {
++		/* FIXME: This is a workaround for SQLite 3.35.x, where
++		 * the optimization on UNION ALLs inside JOINs (Point 8c in
++		 * the 3.35.0 release notes) break in this very specific
++		 * case:
++		 *
++		 *   SELECT * { GRAPH ?g { ?a ... OPTIONAL { ?a ... } } }
++		 *
++		 * This is a workaround to make this one case ineligible
++		 * for query flattening optimizations, specifically make
++		 * it fall through case 8 in the list at
++		 * https://sqlite.org/optoverview.html#flattening,
++		 * "The subquery does not use LIMIT or the outer query is not
++		 * a join.", we will now meet both here.
++		 *
++		 * This should be evaluated again in future SQLite versions.
++		 */
++		if (tracker_token_get_variable (&sparql->current_state.graph))
++			_append_string (sparql, "LIMIT -1 ");
++
+ 		_append_string (sparql, ") ");
++	}
+ 
+ 	return TRUE;
+ }

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-03-27 18:09:58 UTC (rev 411120)
+++ PKGBUILD	2021-03-27 18:10:44 UTC (rev 411121)
@@ -3,8 +3,8 @@
 # Contributor: Alexander Fehr <pizzapunk gmail com>
 
 pkgname=tracker
-pkgver=2.3.6
-pkgrel=3
+pkgver=2.3.6+7+gb27396252
+pkgrel=1
 pkgdesc="Desktop-neutral user information store, search tool and indexer"
 url="https://wiki.gnome.org/Projects/Tracker"
 arch=(x86_64)
@@ -15,9 +15,11 @@
 checkdepends=(python-gobject python-dbus)
 provides=(libtracker-{control,miner,sparql}-2.0.so)
 groups=(gnome)
-_commit=5c27e06e6600122d4e2dc7a133e1b3149e76e4de  # tags/2.3.6^0
-source=("git+https://gitlab.gnome.org/GNOME/tracker.git#commit=$_commit")
-sha256sums=('SKIP')
+_commit=b2739625209c564192b339814264084046e1cf17  # tracker-2.3
+source=("git+https://gitlab.gnome.org/GNOME/tracker.git#commit=$_commit"
+        0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch)
+sha256sums=('SKIP'
+            '00885d437f9257dbba0acad7bae0b9827c1ea09e3ff32727e3217469f3662920')
 
 pkgver() {
   cd $pkgname
@@ -26,6 +28,12 @@
 
 prepare() {
   cd $pkgname
+
+  # https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/382
+  git apply -3 ../0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch
+
+  # test crashes meson: https://github.com/mesonbuild/meson/issues/8591
+  sed -i '/tracker-steroids/d' tests/meson.build
 }
 
 build() {



More information about the arch-commits mailing list