summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-01-09 22:17:59 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2018-01-12 13:01:26 -0500
commit7402987fd218c42ed2a909a5031186d2b702bb88 (patch)
treea418897eb557bbdad09878aa7dcc2e2aab7dfb3a /test/sql/test_compiler.py
parent127ead7452f326509cde38fcf7c9f38f69d9ae0a (diff)
downloadsqlalchemy-7402987fd218c42ed2a909a5031186d2b702bb88.tar.gz
Make column-level collation quoting dialect-specific
Fixed regression in 1.2 where newly repaired quoting of collation names in :ticket:`3785` breaks SQL Server, which explicitly does not understand a quoted collation name. Whether or not mixed-case collation names are quoted or not is now deferred down to a dialect-level decision so that each dialect can prepare these identifiers directly. Change-Id: Iaf0a8123d9bf4711219e320896bb28c5d2649304 Fixes: #4154
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 988230ac5..25eb2b24b 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -1450,6 +1450,25 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
[]).compile,
dialect=empty_in_dialect)
+ def test_collate(self):
+ # columns clause
+ self.assert_compile(
+ select([column('x').collate('bar')]),
+ "SELECT x COLLATE bar AS anon_1"
+ )
+
+ # WHERE clause
+ self.assert_compile(
+ select([column('x')]).where(column('x').collate('bar') == 'foo'),
+ "SELECT x WHERE (x COLLATE bar) = :param_1"
+ )
+
+ # ORDER BY clause
+ self.assert_compile(
+ select([column('x')]).order_by(column('x').collate('bar')),
+ "SELECT x ORDER BY x COLLATE bar"
+ )
+
def test_literal(self):
self.assert_compile(select([literal('foo')]),