[tracker/wip/carlosg/no-update-from] libtracker-data: Avoid "UPDATE ... FROM ..." SQL syntax
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/no-update-from] libtracker-data: Avoid "UPDATE ... FROM ..." SQL syntax
- Date: Mon, 21 Jun 2021 18:40:50 +0000 (UTC)
commit e36f74cdc3e948c9137ae5d2c91c0883005f3f7d
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 21 20:05:36 2021 +0200
libtracker-data: Avoid "UPDATE ... FROM ..." SQL syntax
This syntax is relatively recent (new in SQLite 3.33.0), and unnecessary
here. Use a different update syntax that does not require it, and can run
on older versions of SQLite.
Fixes: https://gitlab.gnome.org/GNOME/tracker/-/issues/307
src/libtracker-data/tracker-data-manager.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 775f561a0..f3104b980 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -4859,9 +4859,9 @@ tracker_data_manager_copy_graph (TrackerDataManager *manager,
tracker_db_interface_execute_query (iface,
&inner_error,
"UPDATE \"%s\".Refcount AS B "
- "SET Refcount = B.Refcount + A.Refcount "
- "FROM (SELECT ID, Refcount FROM \"%s\".Refcount) AS A "
- "WHERE B.ID = A.ID",
+ "SET Refcount = Refcount + "
+ "(SELECT Refcount FROM \"%s\".Refcount AS A "
+ "WHERE B.ID = A.ID)",
destination, source);
out:
if (inner_error) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]