]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Corrected the is_subquery() check based on recent changes. Excluded the test_in_filte...
authorMichael Trier <mtrier@gmail.com>
Tue, 21 Oct 2008 02:46:43 +0000 (02:46 +0000)
committerMichael Trier <mtrier@gmail.com>
Tue, 21 Oct 2008 02:46:43 +0000 (02:46 +0000)
lib/sqlalchemy/sql/compiler.py
test/sql/query.py

index 2072d5a272d90f8823d491ca95f05e65f822c2de..51664d64e966dff7626a0c3a0d171b6b70ba4d00 100644 (file)
@@ -180,7 +180,7 @@ class DefaultCompiler(engine.Compiled):
             return meth(obj, **kwargs)
 
     def is_subquery(self):
-        return self.stack and self.stack[-1].get('from')
+        return self.stack and len(self.stack) > 1 and self.stack[-1].get('from')
 
     def construct_params(self, params=None):
         """return a dictionary of bind parameter keys and values"""
index 4d52c276498e3abcd5193ae94d5996843fc932fe..4decf3b687b3e251c54fbb2cdd10a8efe197faa4 100644 (file)
@@ -590,7 +590,7 @@ class QueryTest(TestBase):
         r = s.execute(search_key=None).fetchall()
         assert len(r) == 0
 
-    @testing.fails_on('firebird', 'maxdb', 'oracle')
+    @testing.fails_on('firebird', 'maxdb', 'oracle', 'mssql')
     def test_in_filtering_advanced(self):
         """test the behavior of the in_() function when comparing against an empty collection."""