summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 3afd3fdc3..50664db16 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -415,7 +415,7 @@ class DefaultCompiler(engine.Compiled, visitors.ClauseVisitor):
if len(anonname) > self.dialect.max_identifier_length:
counter = self.generated_ids.get(ident_class, 1)
- truncname = name[0:self.dialect.max_identifier_length - 6] + "_" + hex(counter)[2:]
+ truncname = anonname[0:self.dialect.max_identifier_length - 6] + "_" + hex(counter)[2:]
self.generated_ids[ident_class] = counter + 1
else:
truncname = anonname