From cc97724ced32f3d2fc4e4666fa4dcd4e67b0ef01 Mon Sep 17 00:00:00 2001 From: stefan Date: Mon, 16 Feb 2009 20:53:40 +0000 Subject: [PATCH] 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 --- roundup/backends/rdbms_common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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, -- 2.30.2