summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ansisql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-01-08 07:11:51 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-01-08 07:11:51 +0000
commit976b55b08c00716034d827ac27f51796bfeddd0a (patch)
tree5f087cf909f41b46e01fa4b24b57bb7924ed575e /lib/sqlalchemy/ansisql.py
parent66b5aee37ce2be2fa851ad0c835f68c4c71cf959 (diff)
downloadsqlalchemy-976b55b08c00716034d827ac27f51796bfeddd0a.tar.gz
key/value params on execute() are based off the from objects, not the select list
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r--lib/sqlalchemy/ansisql.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py
index 92db3b1ba..f0e0203e9 100644
--- a/lib/sqlalchemy/ansisql.py
+++ b/lib/sqlalchemy/ansisql.py
@@ -278,25 +278,24 @@ class ANSICompiler(sql.Compiled):
whereclause = select.whereclause
- # look at our own parameters, see if they
- # are all present in the form of BindParamClauses. if
- # not, then append to the above whereclause column conditions
- # matching those keys
- if self.parameters is not None:
- revisit = False
- for c in inner_columns.values():
- if sql.is_column(c) and self.parameters.has_key(c.key) and not self.binds.has_key(c.key):
- value = self.parameters[c.key]
- else:
- continue
- clause = c==value
- clause.accept_visitor(self)
- whereclause = sql.and_(clause, whereclause)
- self.visit_compound(whereclause)
-
froms = []
for f in select.froms:
+ if self.parameters is not None:
+ # look at our own parameters, see if they
+ # are all present in the form of BindParamClauses. if
+ # not, then append to the above whereclause column conditions
+ # matching those keys
+ for c in f.columns:
+ if sql.is_column(c) and self.parameters.has_key(c.key) and not self.binds.has_key(c.key):
+ value = self.parameters[c.key]
+ else:
+ continue
+ clause = c==value
+ clause.accept_visitor(self)
+ whereclause = sql.and_(clause, whereclause)
+ self.visit_compound(whereclause)
+
# special thingy used by oracle to redefine a join
w = self.get_whereclause(f)
if w is not None: