From c3a0453680d3816ee6de3223d768f45e8a46344d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 4 May 2012 18:40:55 -0400 Subject: - [bug] Quoting information is now passed along from a Column with quote=True when generating a same-named bound parameter to the bindparam() object, as is the case in generated INSERT and UPDATE statements, so that unknown reserved names can be fully supported. [ticket:2437] --- lib/sqlalchemy/sql/compiler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index a58da176c..05cc70aba 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -686,7 +686,7 @@ class SQLCompiler(engine.Compiled): self.binds[bindparam.key] = self.binds[name] = bindparam - return self.bindparam_string(name) + return self.bindparam_string(name, quote=bindparam.quote) def render_literal_bindparam(self, bindparam, **kw): value = bindparam.value @@ -756,7 +756,7 @@ class SQLCompiler(engine.Compiled): self.anon_map[derived] = anonymous_counter + 1 return derived + "_" + str(anonymous_counter) - def bindparam_string(self, name): + def bindparam_string(self, name, quote=None): if self.positional: self.positiontup.append(name) return self.bindtemplate % { @@ -1206,7 +1206,8 @@ class SQLCompiler(engine.Compiled): def _create_crud_bind_param(self, col, value, required=False): bindparam = sql.bindparam(col.key, value, - type_=col.type, required=required) + type_=col.type, required=required, + quote=col.quote) bindparam._is_crud = True return bindparam._compiler_dispatch(self) -- cgit v1.2.1