public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM5845] Free query windows hard capped to 1000 results sometimes
Date: Mon, 21 Sep 2020 13:36:47 +0530
Message-ID: <CAM9w-_kOfGC0zQKkaXoHA1yYvzmbv_jYyK07dJBfAv_EgE1cMw@mail.gmail.com> (raw)

Hi Hackers,

Attached is the patch to fix the issue where the query tool is not fetching
more than 1000 rows. The issue occurs only when a table does not have any
primary key.

Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM5845.patch (1.6K, 3-RM5845.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py b/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
index 013c05da8..99c8fe53d 100644
--- a/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
+++ b/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
@@ -75,17 +75,16 @@ def is_query_resultset_updatable(conn, sql_path):
         is_resultset_updatable = has_oids or (primary_keys is not None and
                                               len(primary_keys) != 0)
 
-        if is_resultset_updatable:
-            column_types = get_columns_types(columns_info=columns_info,
-                                             table_oid=table_oid,
-                                             conn=conn,
-                                             has_oids=has_oids,
-                                             is_query_tool=True)
-            return True, has_oids, primary_keys, \
-                pk_names, table_oid, column_types
-        else:
+        if not is_resultset_updatable:
             _set_all_columns_not_editable(columns_info=columns_info)
-            return return_not_updatable()
+
+        column_types = get_columns_types(columns_info=columns_info,
+                                         table_oid=table_oid,
+                                         conn=conn,
+                                         has_oids=has_oids,
+                                         is_query_tool=True)
+        return is_resultset_updatable, has_oids, primary_keys, \
+            pk_names, table_oid, column_types
     else:
         raise InternalServerError(SERVER_CONNECTION_CLOSED)
 


view thread (2+ 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: [pgAdmin][RM5845] Free query windows hard capped to 1000 results sometimes
  In-Reply-To: <CAM9w-_kOfGC0zQKkaXoHA1yYvzmbv_jYyK07dJBfAv_EgE1cMw@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