summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql')
-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