From: stefan Date: Mon, 16 Feb 2009 20:53:40 +0000 (+0000) Subject: Fuse multiple DELETE calls into one for multilinks. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc97724ced32f3d2fc4e4666fa4dcd4e67b0ef01;p=roundup.git Fuse multiple DELETE calls into one for multilinks. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4131 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index f88d8ca..4b3b480 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -944,11 +944,11 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): # XXX numeric ids self.sql(sql, (int(nodeid), int(addid))) if remove: - sql = 'delete from %s where nodeid=%s and linkid=%s'%(tn, - self.arg, self.arg) - for removeid in remove: - # XXX numeric ids - self.sql(sql, (int(nodeid), int(removeid))) + s = ','.join([self.arg]*len(remove)) + sql = 'delete from %s where nodeid=%s and linkid in (%s)'%(tn, + self.arg, s) + # XXX numeric ids + self.sql(sql, [int(nodeid)] + remove) sql_to_hyperdb_value = { hyperdb.String : str,