public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: PATCH: To fix the issue where cast function causes freeze (pgAdmin4)
Date: Thu, 14 Jul 2016 14:36:17 +0530
Message-ID: <CAKKotZS+kv3fQGF0iKneCq17ZQ5PeGAtK0UrE1zVTNtfy9c14Q@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi,

PFA patch to fix the issue where if user use cast function and it causes
freeze in query tool.
(RM#1438)

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM_1438.patch (1.0K, 3-RM_1438.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 5fb07c3..6c8e582 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


view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: PATCH: To fix the issue where cast function causes freeze (pgAdmin4)
  In-Reply-To: <CAKKotZS+kv3fQGF0iKneCq17ZQ5PeGAtK0UrE1zVTNtfy9c14Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox