[IMP] Added an assert on the alias length.

bzr revid: tde@openerp.com-20121207160933-1ivbkkv6tgg5a7x3
This commit is contained in:
Thibault Delavallée 2012-12-07 17:09:33 +01:00
parent a786f8406b
commit 9381a82715
1 changed files with 1 additions and 0 deletions

View File

@ -343,6 +343,7 @@ def generate_table_alias(src_table_alias, joined_tables=[]):
return ('%s' % alias, '%s' % _quote(alias))
for link in joined_tables:
alias += '__' + link[1]
assert len(alias) < 64, 'Table alias name %s is longer than the 64 characters size accepted by default in postgresql.' % (alias)
return ('%s' % alias, '%s as %s' % (_quote(joined_tables[-1][0]), _quote(alias)))