summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-08-22 17:18:48 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-08-22 17:19:45 -0400
commit469931514a1517dde82ba56f780c3007c66d5943 (patch)
tree436a4138904e98f7a7dfb1297b582357784af1fa /test/dialect/postgresql/test_compiler.py
parent52a3f5b7635583ae6feb084b1db654b9c65caec2 (diff)
downloadsqlalchemy-469931514a1517dde82ba56f780c3007c66d5943.tar.gz
Propagate **kw in postgresql distinct on compilation
Fixed bug in PostgreSQL dialect where compiler keyword arguments such as ``literal_binds=True`` were not being propagated to a DISTINCT ON expression. Fixes: #4325 Change-Id: I9949387dceb7fabe889799f42e92423572368b29
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 5c4d72c67..6133ab482 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -1571,6 +1571,13 @@ class DistinctOnTest(fixtures.TestBase, AssertsCompiledSQL):
"SELECT DISTINCT ON (t.a) t.id, t.a, t.b FROM t"
)
+ def test_literal_binds(self):
+ self.assert_compile(
+ select([self.table]).distinct(self.table.c.a == 10),
+ "SELECT DISTINCT ON (t.a = 10) t.id, t.a, t.b FROM t",
+ literal_binds=True
+ )
+
def test_query_plain(self):
sess = Session()
self.assert_compile(