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 /lib/sqlalchemy/sql/util.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 'lib/sqlalchemy/sql/util.py')
| -rw-r--r-- | lib/sqlalchemy/sql/util.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 2a5c2e277..bf07716c8 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -254,26 +254,6 @@ class _repr_params(object): return repr(self.params) -def expression_as_ddl(clause): - """Given a SQL expression, convert for usage in DDL, such as - CREATE INDEX and CHECK CONSTRAINT. - - Converts bind params into quoted literals, column identifiers - into detached column constructs so that the parent table - identifier is not included. - - """ - def repl(element): - if isinstance(element, BindParameter): - return literal_column(_quote_ddl_expr(element.value)) - elif isinstance(element, ColumnClause) and \ - element.table is not None: - col = ColumnClause(element.name) - return col - else: - return None - - return visitors.replacement_traverse(clause, {}, repl) def adapt_criterion_to_null(crit, nulls): |
