From 014338030672cd91a1aa68b2b9b2fca21122b158 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 13 May 2022 01:41:39 +0200 Subject: [PATCH] help the query planner --- copyparty/httpcli.py | 2 +- copyparty/u2idx.py | 2 +- copyparty/up2k.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index eea1873d..6dccad48 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2413,7 +2413,7 @@ class HttpCli(object): continue w = r[0][:16] - q = "select k, v from mt where w = ? and k != 'x'" + q = "select k, v from mt where w = ? and +k != 'x'" try: for k, v in icur.execute(q, (w,)): taglist[k] = True diff --git a/copyparty/u2idx.py b/copyparty/u2idx.py index fbc784ea..4228e9fc 100644 --- a/copyparty/u2idx.py +++ b/copyparty/u2idx.py @@ -328,7 +328,7 @@ class U2idx(object): w = hit["w"] del hit["w"] tags = {} - q2 = "select k, v from mt where w = ? and k != 'x'" + q2 = "select k, v from mt where w = ? and +k != 'x'" for k, v2 in cur.execute(q2, (w,)): taglist[k] = True tags[k] = v2 diff --git a/copyparty/up2k.py b/copyparty/up2k.py index a3976147..0ea5d6ce 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -949,7 +949,7 @@ class Up2k(object): n_done += 1 for w in to_delete.keys(): - q = "delete from mt where w = ? and k = 't:mtp'" + q = "delete from mt where w = ? and +k = 't:mtp'" cur.execute(q, (w,)) to_delete = {} @@ -987,7 +987,7 @@ class Up2k(object): with self.mutex: done = self._flush_mpool(wcur) for w in done: - q = "delete from mt where w = ? and k = 't:mtp'" + q = "delete from mt where w = ? and +k = 't:mtp'" cur.execute(q, (w,)) cur.connection.commit() @@ -1115,7 +1115,7 @@ class Up2k(object): for k in tags.keys(): q = "delete from mt where w = ? and ({})".format( - " or ".join(["k = ?"] * len(tags)) + " or ".join(["+k = ?"] * len(tags)) ) args = [wark[:16]] + list(tags.keys()) write_cur.execute(q, tuple(args))