summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_select.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/sql/test_select.py b/test/sql/test_select.py
index ad4b4db95..7979fd200 100644
--- a/test/sql/test_select.py
+++ b/test/sql/test_select.py
@@ -9,6 +9,7 @@ from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
+from sqlalchemy import true
from sqlalchemy import tuple_
from sqlalchemy import union
from sqlalchemy.sql import column
@@ -77,6 +78,29 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
"WHERE mytable.myid = myothertable.otherid",
)
+ @testing.combinations(
+ (
+ lambda tbl: select().select_from(tbl).where(tbl.c.id == 123),
+ "SELECT FROM tbl WHERE tbl.id = :id_1",
+ ),
+ (lambda tbl: select().where(true()), "SELECT WHERE 1 = 1"),
+ (
+ lambda tbl: select()
+ .select_from(tbl)
+ .where(tbl.c.id == 123)
+ .exists(),
+ "EXISTS (SELECT FROM tbl WHERE tbl.id = :id_1)",
+ ),
+ )
+ def test_select_no_columns(self, stmt, expected):
+ """test #9440"""
+
+ tbl = table("tbl", column("id"))
+
+ stmt = testing.resolve_lambda(stmt, tbl=tbl)
+
+ self.assert_compile(stmt, expected)
+
def test_new_calling_style_clauseelement_thing_that_has_iter(self):
class Thing:
def __clause_element__(self):