[rql2sql] fix regression introduced in 8018:f01c80513274 leading to bad execution of DELETE queries
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 25 Oct 2011 18:22:19 +0200
changeset 8020 52e250f307b6
parent 8019 eb83c52ffa0c
child 8021 25fbfd84529f
[rql2sql] fix regression introduced in 8018:f01c80513274 leading to bad execution of DELETE queries
server/ssplanner.py
--- a/server/ssplanner.py	Tue Oct 25 18:21:45 2011 +0200
+++ b/server/ssplanner.py	Tue Oct 25 18:22:19 2011 +0200
@@ -232,7 +232,7 @@
         select.append_selected(rhs.copy(select))
         select.set_where(relation.copy(select))
         if rqlst.where is not None:
-            select.set_where(rqlst.where.copy(select))
+            select.add_restriction(rqlst.where.copy(select))
         if getattr(rqlst, 'having', None):
             select.set_having([x.copy(select) for x in rqlst.having])
         return self._select_plan(plan, select, rqlst.solutions)