summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-04-28 14:11:20 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-04-28 14:11:20 -0400
commit029c68e636b8c635ffd35b7a38947be2e3b6e0cf (patch)
treee6a4edd016510f79ead0f9f083021e0f09d8e26a /test/sql/test_selectable.py
parent7fdaac7b2910b5612420378519b9f60d4649daff (diff)
downloadsqlalchemy-029c68e636b8c635ffd35b7a38947be2e3b6e0cf.tar.gz
ensure SelectState.all_selected_columns not memoized as a generator
This regression was found from #6261 before release of 1.4.12 Fixes: #6261 Fixes: #6394 Change-Id: I4c2c5da02dbcf5c2cea26c81d3521de892ef428e
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index 2403db7c9..b54ef02fd 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -590,6 +590,17 @@ class SelectableTest(
"table1.col3, table1.colx FROM table1) AS anon_1",
)
+ def test_scalar_subquery_from_subq_same_source(self):
+ s1 = select(table1.c.col1)
+
+ for i in range(2):
+ stmt = s1.subquery().select().scalar_subquery()
+ self.assert_compile(
+ stmt,
+ "(SELECT anon_1.col1 FROM "
+ "(SELECT table1.col1 AS col1 FROM table1) AS anon_1)",
+ )
+
def test_type_coerce_preserve_subq(self):
class MyType(TypeDecorator):
impl = Integer