diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-12 20:04:55 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-12 20:04:55 -0400 |
commit | 9bc9d5c1068be878118202259add3c2e1bcec0cb (patch) | |
tree | 9e611c162b83debad6c70b5436c61630546c2872 /test/dialect/postgresql/test_compiler.py | |
parent | eabf41b392ac042228765c9b95138522e44365e7 (diff) | |
download | sqlalchemy-9bc9d5c1068be878118202259add3c2e1bcec0cb.tar.gz |
- Fixed bug in default compiler plus those of postgresql, mysql, and
mssql to ensure that any literal SQL expression values are
rendered directly as literals, instead of as bound parameters,
within a CREATE INDEX statement. [ticket:2742]
- don't need expression_as_ddl(); literal_binds and include_table
take care of this functionality.
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 11661b11f..858f3e763 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -173,6 +173,16 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): 'USING hash (data)', dialect=postgresql.dialect()) + def test_create_index_literals(self): + m = MetaData() + tbl = Table('testtbl', m, Column('data', Integer)) + + idx1 = Index('test_idx1', tbl.c.data + 5) + self.assert_compile( + schema.CreateIndex(idx1), + "CREATE INDEX test_idx1 ON testtbl (data + 5)" + ) + def test_exclude_constraint_min(self): m = MetaData() tbl = Table('testtbl', m, |