Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package tracker for openSUSE:Factory checked 
in at 2024-03-08 18:08:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tracker (Old)
 and      /work/SRC/openSUSE:Factory/.tracker.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tracker"

Fri Mar  8 18:08:16 2024 rev:161 rq:1156042 version:3.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/tracker/tracker.changes  2023-09-28 
00:26:35.971064166 +0200
+++ /work/SRC/openSUSE:Factory/.tracker.new.1770/tracker.changes        
2024-03-08 18:08:18.296160158 +0100
@@ -1,0 +2,7 @@
+Wed Mar  6 10:50:26 UTC 2024 - Yifan Jiang <yfji...@suse.com>
+
+- Add patches to adapt SQLite 3.44 (glgo#GNOME/tracker#418):
+  + 0001-decouple-fts-initialization-from-ontologies.patch
+  + 0002-early-fts-initialization.patch  
+
+-------------------------------------------------------------------

New:
----
  0001-decouple-fts-initialization-from-ontologies.patch
  0002-early-fts-initialization.patch

BETA DEBUG BEGIN:
  New:- Add patches to adapt SQLite 3.44 (glgo#GNOME/tracker#418):
  + 0001-decouple-fts-initialization-from-ontologies.patch
  + 0002-early-fts-initialization.patch  
  New:  + 0001-decouple-fts-initialization-from-ontologies.patch
  + 0002-early-fts-initialization.patch  
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tracker.spec ++++++
--- /var/tmp/diff_new_pack.v4ga57/_old  2024-03-08 18:08:19.152192320 +0100
+++ /var/tmp/diff_new_pack.v4ga57/_new  2024-03-08 18:08:19.156192470 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package tracker
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 # Copyright (c) 2010 Luis Medinas, Portugal
 #
 # All modifications and additions to the file contributed by third parties
@@ -28,6 +28,10 @@
 Group:          Productivity/Other
 URL:            https://wiki.gnome.org/Projects/Tracker
 Source0:        
https://download.gnome.org/sources/tracker/3.6/%{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM 0001-decouple-fts-initialization-from-ontologies.patch 
glgo#GNOME/tracker#418 yfji...@suse.com -- Decouple FTS initialization from 
ongologies
+Patch0:         0001-decouple-fts-initialization-from-ontologies.patch
+# PATCH-FIX-UPSTREAM 0002-early-fts-initialization.patch 
glgo#GNOME/tracker#418 yfji...@suse.com -- Move FTS initialization to an 
earlier stage
+Patch1:         0002-early-fts-initialization.patch
 
 BuildRequires:  asciidoc
 BuildRequires:  fdupes

++++++ 0001-decouple-fts-initialization-from-ontologies.patch ++++++
>From 26c69a82ceb44d0f4311cb04d38bcd44b94634e2 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carl...@gnome.org>
Date: Thu, 7 Dec 2023 09:33:44 +0100
Subject: [PATCH] libtracker-sparql: Decouple FTS initialization from
 ontologies

Since we just need the FTS properties for fts:offsets being called
at runtime, we can pass the TrackerDataManager (that we know early
in startup) and let it figure out the FTS properties from there
when it's actually needed.

This is just the refactor to make that possible, there's no
functional changes in this commit.
---
 .../core/tracker-data-manager.c               | 13 +++--
 .../core/tracker-db-interface-sqlite.c        | 29 ++++++-----
 .../core/tracker-db-interface-sqlite.h        |  5 +-
 .../core/tracker-fts-tokenizer.c              | 48 +++++++++++++++++--
 .../core/tracker-fts-tokenizer.h              |  4 +-
 src/libtracker-sparql/core/tracker-fts.c      | 40 ----------------
 src/libtracker-sparql/core/tracker-fts.h      |  5 --
 7 files changed, 75 insertions(+), 69 deletions(-)

diff --git a/src/libtracker-sparql/core/tracker-data-manager.c 
b/src/libtracker-sparql/core/tracker-data-manager.c
index ef3497a834..f0797d642d 100644
--- a/src/libtracker-sparql/core/tracker-data-manager.c
+++ b/src/libtracker-sparql/core/tracker-data-manager.c
@@ -3863,11 +3863,14 @@ tracker_data_manager_init_fts (TrackerDataManager  
*manager,
                                gboolean             create,
                                GError             **error)
 {
-       return tracker_db_interface_sqlite_fts_init (iface,
-                                                    database,
-                                                    manager->ontologies,
-                                                    create,
-                                                    error);
+       if (!tracker_db_interface_sqlite_fts_init (iface, manager->flags, 
error))
+               return FALSE;
+       if (!create)
+               return TRUE;
+       return tracker_db_interface_sqlite_fts_create_table (iface,
+                                                            database,
+                                                            
manager->ontologies,
+                                                            error);
 }
 
 static gboolean
diff --git a/src/libtracker-sparql/core/tracker-db-interface-sqlite.c 
b/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
index c001c9aafc..05773bd3e5 100644
--- a/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
+++ b/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
@@ -37,6 +37,7 @@
 #include <libtracker-sparql/tracker-private.h>
 
 #include "tracker-fts.h"
+#include "tracker-fts-tokenizer.h"
 #include "tracker-collation.h"
 #include "tracker-db-interface-sqlite.h"
 #include "tracker-db-manager.h"
@@ -2027,20 +2028,26 @@ close_database (TrackerDBInterface *db_interface)
 }
 
 gboolean
-tracker_db_interface_sqlite_fts_init (TrackerDBInterface  *db_interface,
-                                      const gchar         *database,
-                                      TrackerOntologies   *ontologies,
-                                      gboolean             create,
-                                      GError             **error)
+tracker_db_interface_sqlite_fts_init (TrackerDBInterface     *db_interface,
+                                      TrackerDBManagerFlags   fts_flags,
+                                      GError                **error)
 {
-       GError *inner_error = NULL;
+       return tracker_tokenizer_initialize (db_interface->db,
+                                            db_interface,
+                                            fts_flags,
+                                            db_interface->user_data,
+                                            error);
+}
 
-       if (!tracker_fts_init_db (db_interface->db, db_interface,
-                                 db_interface->flags, ontologies, error))
-               return FALSE;
+gboolean
+tracker_db_interface_sqlite_fts_create_table (TrackerDBInterface  
*db_interface,
+                                              const gchar         *database,
+                                              TrackerOntologies   *ontologies,
+                                              GError             **error)
+{
+       GError *inner_error = NULL;
 
-       if (create &&
-           !tracker_fts_create_table (db_interface->db, database, "fts5",
+       if (!tracker_fts_create_table (db_interface->db, database, "fts5",
                                       ontologies,
                                       &inner_error)) {
                g_propagate_prefixed_error (error,
diff --git a/src/libtracker-sparql/core/tracker-db-interface-sqlite.h 
b/src/libtracker-sparql/core/tracker-db-interface-sqlite.h
index 64b0be2a78..cb779ea3c7 100644
--- a/src/libtracker-sparql/core/tracker-db-interface-sqlite.h
+++ b/src/libtracker-sparql/core/tracker-db-interface-sqlite.h
@@ -23,6 +23,7 @@
 #include "config.h"
 
 #include "tracker-db-interface.h"
+#include "tracker-db-manager.h"
 
 G_BEGIN_DECLS
 
@@ -46,9 +47,11 @@ TrackerDBInterface *tracker_db_interface_sqlite_new          
          (const gc
 gint64              tracker_db_interface_sqlite_get_last_insert_id     
(TrackerDBInterface       *interface);
 void                tracker_db_interface_sqlite_enable_shared_cache    (void);
 gboolean            tracker_db_interface_sqlite_fts_init               
(TrackerDBInterface       *interface,
+                                                                        
TrackerDBManagerFlags     fts_flags,
+                                                                        GError 
                 **error);
+gboolean            tracker_db_interface_sqlite_fts_create_table       
(TrackerDBInterface       *interface,
                                                                         const 
gchar              *database,
                                                                         
TrackerOntologies        *ontologies,
-                                                                        
gboolean                  create,
                                                                         GError 
                 **error);
 void                tracker_db_interface_sqlite_reset_collator         
(TrackerDBInterface       *interface);
 gboolean            tracker_db_interface_sqlite_wal_checkpoint         
(TrackerDBInterface       *interface,
diff --git a/src/libtracker-sparql/core/tracker-fts-tokenizer.c 
b/src/libtracker-sparql/core/tracker-fts-tokenizer.c
index 9cf71b99f0..2e6dd0591c 100644
--- a/src/libtracker-sparql/core/tracker-fts-tokenizer.c
+++ b/src/libtracker-sparql/core/tracker-fts-tokenizer.c
@@ -48,6 +48,7 @@ struct TrackerTokenizer {
 
 struct TrackerTokenizerFunctionData {
        TrackerDBInterface *interface;
+       TrackerDataManager *data_manager;
        gchar **property_names;
 };
 
@@ -169,6 +170,37 @@ offsets_tokenizer_func (void       *data,
        return SQLITE_OK;
 }
 
+static gboolean
+ensure_fts_properties (TrackerTokenizerFunctionData *data)
+{
+       TrackerOntologies *ontologies;
+       TrackerProperty **properties;
+       GArray *property_names;
+       guint i, len;
+
+       if (data->property_names)
+               return data->property_names[0] != NULL;
+
+       ontologies = tracker_data_manager_get_ontologies (data->data_manager);
+
+       property_names = g_array_new (TRUE, FALSE, sizeof (gchar *));
+       properties = tracker_ontologies_get_properties (ontologies, &len);
+
+       for (i = 0; i < len; i++) {
+               gchar *column;
+
+               if (!tracker_property_get_fulltext_indexed (properties[i]))
+                       continue;
+
+               column = g_strdup (tracker_property_get_name (properties[i]));
+               g_array_append_val (property_names, column);
+       }
+
+       data->property_names = (gchar **) g_array_free (property_names, FALSE);
+
+       return data->property_names[0] != NULL;
+}
+
 static void
 tracker_offsets_function (const Fts5ExtensionApi  *api,
                           Fts5Context             *fts_ctx,
@@ -189,6 +221,12 @@ tracker_offsets_function (const Fts5ExtensionApi  *api,
        }
 
        data = api->xUserData (fts_ctx);
+
+       if (!ensure_fts_properties (data)) {
+               sqlite3_result_null (ctx);
+               return;
+       }
+
        rc = api->xInstCount (fts_ctx, &n_hits);
 
        if (rc != SQLITE_OK) {
@@ -296,14 +334,14 @@ error:
 }
 
 static TrackerTokenizerFunctionData *
-tracker_tokenizer_function_data_new (TrackerDBInterface  *interface,
-                                     const gchar        **property_names)
+tracker_tokenizer_function_data_new (TrackerDBInterface *interface,
+                                     TrackerDataManager *data_manager)
 {
        TrackerTokenizerFunctionData *data;
 
        data = g_new0 (TrackerTokenizerFunctionData, 1);
        data->interface = interface;
-       data->property_names = g_strdupv ((gchar **) property_names);
+       data->data_manager = data_manager;
 
        return data;
 }
@@ -319,7 +357,7 @@ gboolean
 tracker_tokenizer_initialize (sqlite3                *db,
                               TrackerDBInterface     *interface,
                               TrackerDBManagerFlags   flags,
-                              const gchar           **property_names,
+                              TrackerDataManager     *data_manager,
                               GError                **error)
 {
        TrackerTokenizerData *data;
@@ -338,7 +376,7 @@ tracker_tokenizer_initialize (sqlite3                *db,
                               tracker_tokenizer_data_free);
 
        /* Offsets */
-       func_data = tracker_tokenizer_function_data_new (interface, 
property_names);
+       func_data = tracker_tokenizer_function_data_new (interface, 
data_manager);
        api->xCreateFunction (api, "tracker_offsets", func_data,
                              &tracker_offsets_function,
                              (GDestroyNotify) 
tracker_tokenizer_function_data_free);
diff --git a/src/libtracker-sparql/core/tracker-fts-tokenizer.h 
b/src/libtracker-sparql/core/tracker-fts-tokenizer.h
index 57bca46a56..76e0bbcbb9 100644
--- a/src/libtracker-sparql/core/tracker-fts-tokenizer.h
+++ b/src/libtracker-sparql/core/tracker-fts-tokenizer.h
@@ -22,7 +22,7 @@
 #include <sqlite3.h>
 #include <glib.h>
 
-#include "tracker-db-manager.h"
+#include "tracker-data-manager.h"
 
 #ifndef __TRACKER_FTS_TOKENIZER_H__
 #define __TRACKER_FTS_TOKENIZER_H__
@@ -30,7 +30,7 @@
 gboolean tracker_tokenizer_initialize (sqlite3                *db,
                                        TrackerDBInterface     *interface,
                                        TrackerDBManagerFlags   flags,
-                                       const gchar           **property_names,
+                                       TrackerDataManager     *data_manager,
                                        GError                **error);
 
 #endif /* __TRACKER_FTS_TOKENIZER_H__ */
diff --git a/src/libtracker-sparql/core/tracker-fts.c 
b/src/libtracker-sparql/core/tracker-fts.c
index 96ec9e9e76..f622855ee4 100644
--- a/src/libtracker-sparql/core/tracker-fts.c
+++ b/src/libtracker-sparql/core/tracker-fts.c
@@ -43,46 +43,6 @@ has_fts_properties (TrackerOntologies *ontologies)
        return FALSE;
 }
 
-static gchar **
-get_fts_properties (TrackerOntologies *ontologies)
-{
-       TrackerProperty **properties;
-       GArray *property_names;
-       guint i, len;
-
-       property_names = g_array_new (TRUE, FALSE, sizeof (gchar *));
-       properties = tracker_ontologies_get_properties (ontologies, &len);
-
-       for (i = 0; i < len; i++) {
-               gchar *column;
-
-               if (!tracker_property_get_fulltext_indexed (properties[i]))
-                       continue;
-
-               column = g_strdup (tracker_property_get_name (properties[i]));
-               g_array_append_val (property_names, column);
-       }
-
-       return (gchar **) g_array_free (property_names, FALSE);
-}
-
-gboolean
-tracker_fts_init_db (sqlite3                *db,
-                     TrackerDBInterface     *interface,
-                     TrackerDBManagerFlags   flags,
-                     TrackerOntologies      *ontologies,
-                     GError                **error)
-{
-       gchar **property_names;
-       gboolean retval;
-
-       property_names = get_fts_properties (ontologies);
-       retval = tracker_tokenizer_initialize (db, interface, flags, (const 
gchar **) property_names, error);
-       g_strfreev (property_names);
-
-       return retval;
-}
-
 gboolean
 tracker_fts_create_table (sqlite3            *db,
                           const gchar        *database,
diff --git a/src/libtracker-sparql/core/tracker-fts.h 
b/src/libtracker-sparql/core/tracker-fts.h
index 4370d3f667..cf3e1d9cbd 100644
--- a/src/libtracker-sparql/core/tracker-fts.h
+++ b/src/libtracker-sparql/core/tracker-fts.h
@@ -30,11 +30,6 @@
 
 G_BEGIN_DECLS
 
-gboolean    tracker_fts_init_db          (sqlite3                *db,
-                                          TrackerDBInterface     *interface,
-                                          TrackerDBManagerFlags   flags,
-                                          TrackerOntologies      *ontologies,
-                                          GError                **error);
 gboolean    tracker_fts_create_table     (sqlite3            *db,
                                           const gchar        *database,
                                           gchar              *table_name,
-- 
GitLab


++++++ 0002-early-fts-initialization.patch ++++++
>From 373535883c5b89fa1b3cd958274c36bdaf543db6 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carl...@gnome.org>
Date: Thu, 7 Dec 2023 10:16:16 +0100
Subject: [PATCH] libtracker-sparql: Move FTS initialization to an earlier
 stage

With SQLite >= 3.44.x, the check_integrity pragma may involve existing
virtual tables and their xIntegrity vmethod. This includes FTS5 tables,
so we need to set up the FTS5 tokenizer at an earlier stage, so that
possible integrity checks happening on startup have everything set up.

Closes: https://gitlab.gnome.org/GNOME/tracker/-/issues/418
---
 src/libtracker-sparql/core/tracker-data-manager.c | 2 --
 src/libtracker-sparql/core/tracker-db-manager.c   | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libtracker-sparql/core/tracker-data-manager.c 
b/src/libtracker-sparql/core/tracker-data-manager.c
index f0797d642d..dff6b66542 100644
--- a/src/libtracker-sparql/core/tracker-data-manager.c
+++ b/src/libtracker-sparql/core/tracker-data-manager.c
@@ -3863,8 +3863,6 @@ tracker_data_manager_init_fts (TrackerDataManager  
*manager,
                                gboolean             create,
                                GError             **error)
 {
-       if (!tracker_db_interface_sqlite_fts_init (iface, manager->flags, 
error))
-               return FALSE;
        if (!create)
                return TRUE;
        return tracker_db_interface_sqlite_fts_create_table (iface,
diff --git a/src/libtracker-sparql/core/tracker-db-manager.c 
b/src/libtracker-sparql/core/tracker-db-manager.c
index 6952af082b..8427ed71b7 100644
--- a/src/libtracker-sparql/core/tracker-db-manager.c
+++ b/src/libtracker-sparql/core/tracker-db-manager.c
@@ -783,6 +783,11 @@ tracker_db_manager_create_db_interface (TrackerDBManager  
*db_manager,
                return NULL;
        }
 
+       if (!tracker_db_interface_sqlite_fts_init (connection,
+                                                  db_manager->flags,
+                                                  error))
+               return FALSE;
+
        tracker_db_interface_set_max_stmt_cache_size (connection,
                                                      
TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT,
                                                      db_manager->s_cache_size);
-- 
GitLab

Reply via email to