diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-25 21:14:54 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-03-25 21:14:54 +0000 |
commit | f7afe052907c9343640e5e2569a47d62aa2328a5 (patch) | |
tree | cf85e9c48a2118c899e74c6bc68e9500408044a4 /lib/sqlalchemy/ansisql.py | |
parent | d4800b86d18429d193ce86efbb39089bc63d9b9e (diff) | |
download | sqlalchemy-f7afe052907c9343640e5e2569a47d62aa2328a5.tar.gz |
removed all "tablename + '_' + columname" code and replaced with column._label, to take
advantage of column labeling rules
bind param compilation,when it unique-ifys the name of bind params, maintains the length
of the bind parameter name instead of appending to it
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r-- | lib/sqlalchemy/ansisql.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py index 322af1562..f13a7b84f 100644 --- a/lib/sqlalchemy/ansisql.py +++ b/lib/sqlalchemy/ansisql.py @@ -262,7 +262,10 @@ class ANSICompiler(sql.Compiled): # redefine the generated name of the bind param in the case # that we have multiple conflicting bind parameters. while self.binds.setdefault(key, bindparam) is not bindparam: - key = "%s_%d" % (bindparam.key, count) + # insure the name doesn't expand the length of the string + # in case we're at the edge of max identifier length + tag = "_%d" % count + key = bindparam.key[0 : len(bindparam.key) - len(tag)] + tag count += 1 bindparam.key = key self.strings[bindparam] = self.bindparam_string(key) |