Ensure that text larger than underlying field size should not be truncated automatically. Fixes #5210

This commit is contained in:
navnath gadakh
2020-04-16 14:39:31 +05:30
committed by Akshay Joshi
parent 0dd1cb3fc1
commit c0a2f1f24d
3 changed files with 98 additions and 20 deletions

View File

@@ -452,9 +452,6 @@ def poll(trans_id):
for col_type in types:
if col_type['oid'] == col_info['type_code']:
typname = col_type['typname']
typname = compose_type_name(col_info, typname)
col_info['type_name'] = typname
# Using characters %, (, ) in the argument names is not
@@ -529,22 +526,6 @@ def poll(trans_id):
)
def compose_type_name(col_info, typname):
# If column is of type character, character[],
# character varying and character varying[]
# then add internal size to it's name for the
# correct sql query.
if col_info['internal_size'] >= 0:
if typname == 'character' or typname == 'character varying':
typname = typname + '(' + str(col_info['internal_size']) + ')'
elif typname == 'character[]' or typname == 'character varying[]':
typname = '{}({})[]'.format(
typname[:-2],
str(col_info['internal_size'])
)
return typname
@blueprint.route(
'/fetch/<int:trans_id>', methods=["GET"], endpoint='fetch'
)