diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-04-28 16:02:59 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-04-28 16:02:59 -0400 |
commit | ac52239b328f6dc573fdfb9acbbc7d5d528fa982 (patch) | |
tree | c72c4a48deb76ad807629cc574c0fa6048ca348a /lib/sqlalchemy/sql/compiler.py | |
parent | 0783cb9337ad7711d216cc7e7b79e6fa6d4bbef1 (diff) | |
download | sqlalchemy-ac52239b328f6dc573fdfb9acbbc7d5d528fa982.tar.gz |
- Fixed bug where the truncation of long labels in SQL could produce
a label that overlapped another label that is not truncated; this
because the length threshhold for truncation was greater than
the portion of the label that remains after truncation. These
two values have now been made the same; label_length - 6.
The effect here is that shorter column labels will be "truncated"
where they would not have been truncated before.
fixes #3396
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 91b677a0e..c9c7fd2a1 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1133,7 +1133,7 @@ class SQLCompiler(Compiled): anonname = name.apply_map(self.anon_map) - if len(anonname) > self.label_length: + if len(anonname) > self.label_length - 6: counter = self.truncated_names.get(ident_class, 1) truncname = anonname[0:max(self.label_length - 6, 0)] + \ "_" + hex(counter)[2:] |