public inbox for [email protected]
help / color / mirror / Atom feedFrom: Akshay Joshi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package
Date: Mon, 28 Jan 2019 18:02:53 +0530
Message-ID: <CANxoLDe5=7hu-K66nXcRHB2sQ84CjEGkBC8Fg=5FFepbh7vbbA@mail.gmail.com> (raw)
Hi Hackers,
Attached is the patch to fix RM 3927 "Unable to debug the procedure inside
package". Problem with the existing code is we assume that "PLDBGBREAK"
will be always found in the first element of the notification list.
In this patch we loop through the list and found the string. Apart from
that patch contains small fix to cancel the transaction of Query Tool when
panel is closed.
Please review it.
--
*Akshay Joshi*
*Sr. Software Architect *
*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
Attachments:
[application/octet-stream] RM_3927.patch (2.0K, 3-RM_3927.patch)
download | inline diff:
diff --git a/web/pgadmin/tools/datagrid/__init__.py b/web/pgadmin/tools/datagrid/__init__.py
index 709e164..4dfb7e7 100644
--- a/web/pgadmin/tools/datagrid/__init__.py
+++ b/web/pgadmin/tools/datagrid/__init__.py
@@ -402,6 +402,7 @@ def close(trans_id):
# Release the connection
if conn.connected():
+ # conn.cancel_transaction(cmd_obj.conn_id, cmd_obj.did)
manager.release(did=cmd_obj.did, conn_id=cmd_obj.conn_id)
# Remove the information of unique transaction id from the
diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py
index 9e5ff91..c9f1a4e 100644
--- a/web/pgadmin/tools/debugger/__init__.py
+++ b/web/pgadmin/tools/debugger/__init__.py
@@ -1301,20 +1301,22 @@ def messages(trans_id):
# From the above message we need to find out port number
# as "7" so below logic will find 7 as port number
# and attach listened to that port number
- offset = notify[0].find('PLDBGBREAK')
- str_len = len('PLDBGBREAK')
- str_len += 1
- tmpOffset = 0
- tmpFlag = False
+ port_found = False
+ for val in notify:
+ offset = val.find('PLDBGBREAK')
+ if offset < 0:
+ continue
- while notify[0][offset + str_len + tmpOffset].isdigit():
- status = 'Success'
- tmpFlag = True
- port_number = port_number + \
- notify[0][offset + str_len + tmpOffset]
- tmpOffset += 1
+ offset = offset + len('PLDBGBREAK') + 1
+ tmpOffset = 0
+
+ while val[offset + tmpOffset].isdigit():
+ status = 'Success'
+ port_found = True
+ port_number = port_number + val[offset + tmpOffset]
+ tmpOffset += 1
- if not tmpFlag:
+ if not port_found:
status = 'Busy'
else:
status = 'Busy'
view thread (5+ 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: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package
In-Reply-To: <CANxoLDe5=7hu-K66nXcRHB2sQ84CjEGkBC8Fg=5FFepbh7vbbA@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