]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fixed very hard-to-reproduce issue where by the FROM clause of Query
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Nov 2007 00:52:49 +0000 (00:52 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Nov 2007 00:52:49 +0000 (00:52 +0000)
    could get polluted by certain generative calls [ticket:852]

CHANGES
lib/sqlalchemy/orm/query.py

diff --git a/CHANGES b/CHANGES
index d337995f2f60d82b9ad9720af1e8a3885a09eb0a..e8b94b21cc930976b8d91b20b18765db99948ea4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -109,6 +109,9 @@ CHANGES
   - Added proxying of save_or_update, __contains__ and __iter__ methods for
     scoped sessions.
 
+  - fixed very hard-to-reproduce issue where by the FROM clause of Query
+    could get polluted by certain generative calls [ticket:852]
+    
 - dialects
 
   - Added experimental support for MaxDB (versions >= 7.6.03.007 only).
index 2029dd3bee2ec3e0d51f2921106e30fde2e429ad..c8a1f9cf86c36be036e66123a800813a1c750089 100644 (file)
@@ -770,12 +770,6 @@ class Query(object):
         context = QueryContext(self)
         from_obj = self._from_obj
 
-        alltables = []
-        for l in [sql_util.TableFinder(x) for x in from_obj]:
-            alltables += l
-
-        if self.table not in alltables:
-            from_obj.append(self.table)
         if self._nestable(**self._select_args()):
             s = sql.select([self.table], whereclause, from_obj=from_obj, **self._select_args()).alias('getcount').count()
         else:
@@ -833,13 +827,6 @@ class Query(object):
         if self.select_mapper.single and self.select_mapper.polymorphic_on is not None and self.select_mapper.polymorphic_identity is not None:
             whereclause = sql.and_(whereclause, self.select_mapper.polymorphic_on.in_(*[m.polymorphic_identity for m in self.select_mapper.polymorphic_iterator()]))
 
-        alltables = []
-        for l in [sql_util.TableFinder(x) for x in from_obj]:
-            alltables += l
-
-        if self.table not in alltables:
-            from_obj.append(self.table)
-
         context.from_clauses = from_obj
         
         # give all the attached properties a chance to modify the query