From: Michael Trier Date: Tue, 21 Oct 2008 02:46:43 +0000 (+0000) Subject: Corrected the is_subquery() check based on recent changes. Excluded the test_in_filte... X-Git-Tag: rel_0_5rc3~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00cec7c0884b6d5d5389a0cb88badd264fa9bedd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Corrected the is_subquery() check based on recent changes. Excluded the test_in_filtering_advanced test for mssql. --- diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 2072d5a272..51664d64e9 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -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""" diff --git a/test/sql/query.py b/test/sql/query.py index 4d52c27649..4decf3b687 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -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."""