From 00cec7c0884b6d5d5389a0cb88badd264fa9bedd Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Tue, 21 Oct 2008 02:46:43 +0000 Subject: [PATCH] Corrected the is_subquery() check based on recent changes. Excluded the test_in_filtering_advanced test for mssql. --- lib/sqlalchemy/sql/compiler.py | 2 +- test/sql/query.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.""" -- 2.47.3