summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2014-02-23 15:44:03 +0100
committerHelmut Grohne <helmut@subdivi.de>2014-02-23 15:44:03 +0100
commitb38f14ab3fb72ca1578d7e6bb09178e6fbebba76 (patch)
tree352aec2325d46597f944535e10615abf267f0968
parent332ac9eafb235443f163c606ced95dcbd615815e (diff)
downloaddebian-dedup-b38f14ab3fb72ca1578d7e6bb09178e6fbebba76.tar.gz
webapp: fix eqclass usage in package comparison
When comparing two packages, objects would be considered duplicates without considering whether the respective hash functions are comparable by checking their equivalence classes. The current set of hash functions does not expose this bug.
-rwxr-xr-xwebapp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/webapp.py b/webapp.py
index 665ac23..fd6d685 100755
--- a/webapp.py
+++ b/webapp.py
@@ -182,7 +182,7 @@ class Application(object):
entry = dict(filenames=set((filename,)), size=size, matches={})
files[hashvalue] = entry
- cur2.execute("SELECT fa.name, ha.hash, fb.name, filename FROM hash AS ha JOIN hash AS hb ON ha.hash = hb.hash JOIN content ON hb.cid = content.id JOIN function AS fa ON ha.fid = fa.id JOIN function AS fb ON hb.fid = fb.id WHERE ha.cid = ? AND pid = ?;",
+ cur2.execute("SELECT fa.name, ha.hash, fb.name, filename FROM hash AS ha JOIN hash AS hb ON ha.hash = hb.hash JOIN content ON hb.cid = content.id JOIN function AS fa ON ha.fid = fa.id JOIN function AS fb ON hb.fid = fb.id WHERE ha.cid = ? AND pid = ? AND fa.eqclass = fb.eqclass;",
(cid, pid2))
for func1, hashvalue, func2, filename in fetchiter(cur2):
entry["matches"].setdefault(filename, {})[func1, func2] = \