public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM-7005]: On demand rows throws error if any cell edit saved
Date: Thu, 25 Nov 2021 12:17:24 +0530
Message-ID: <CAOBg0ANvZSPwgy4Lg6-ah=oTgou5A-PUj97yO=Y5X5M8TfWhVA@mail.gmail.com> (raw)

Hi Hackers,

Please find the attached patch for RM-7005:
<https://redmine.postgresql.org/issues/7005; On-demand rows throw an error
if any cell edit saved

-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Senior Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*


Attachments:

  [application/octet-stream] RM-7005.patch (1.3K, 3-RM-7005.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py
index 045c01bf..ef0994ee 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -560,7 +560,7 @@ def fetch(trans_id, fetch_all=None):
             status = 'Error'
         else:
             status = 'Success'
-            res_len = len(result)
+            res_len = len(result) if result else 0
             if fetch_row_cnt != -1 and res_len == ON_DEMAND_RECORD_COUNT:
                 has_more_rows = True
 
diff --git a/web/pgadmin/utils/driver/psycopg2/connection.py b/web/pgadmin/utils/driver/psycopg2/connection.py
index a2d1a873..535166ba 100644
--- a/web/pgadmin/utils/driver/psycopg2/connection.py
+++ b/web/pgadmin/utils/driver/psycopg2/connection.py
@@ -1113,7 +1113,6 @@ WHERE db.datname = current_database()""")
             formatted exception message
         """
         status, cur = self.__cursor()
-        self.row_count = 0
 
         if not status:
             return False, str(cur)
@@ -1164,8 +1163,6 @@ WHERE db.datname = current_database()""")
             )
             return False, errmsg
 
-        self.row_count = cur.rowcount
-
         return True, None
 
     def __attempt_execution_reconnect(self, fn, *args, **kwargs):


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][RM-7005]: On demand rows throws error if any cell edit saved
  In-Reply-To: <CAOBg0ANvZSPwgy4Lg6-ah=oTgou5A-PUj97yO=Y5X5M8TfWhVA@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