From d15dfac60f6b3f8c5407dc29659e6c39d583cfd6 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Fri, 15 Jul 2016 12:59:01 +0100 Subject: [PATCH] FIx a hang in the query tool that could occur if a column type couldn't be determined. Fixes #1438 --- .../tools/sqleditor/templates/sqleditor/js/sqleditor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index db0498bd7..d3455e6c5 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -1525,7 +1525,14 @@ define( col_type = ''; label_text.innerText = c.name; - var type = pg_types[c.type_code][0]; + var type = pg_types[c.type_code] ? + pg_types[c.type_code][0] : + // This is the case where user might + // have use casting so we will use type + // returned by cast function + pg_types[pg_types.length - 1][0] ? + pg_types[pg_types.length - 1][0] : 'unknown'; + if (!is_primary_key) col_type += ' ' + type; else