public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table
@ 2016-09-16 10:14 Surinder Kumar <[email protected]>
  2016-09-16 14:41 ` Re: [pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table Dave Page <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Surinder Kumar @ 2016-09-16 10:14 UTC (permalink / raw)
  To: pgadmin-hackers

Hi

*Issues fixed:*

1) Creating a m-view with *definition* and then updating view with* new
definition,* it results into an error *"No results to fetch"*.

2) When definition of m-view is updated, it creates a new m-view with
different OID, but it wasn't updating the old OID with new OID of tree node
in tree view. thus on switching to another tab (e.g.: sql), it throws
message *"Cannot find materialized view"*.

Please find attached patch and review.

Thanks,
Surinder Kumar


-- 
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] RM1595.patch (2.5K, 3-RM1595.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
index e8a375e..b60e462 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
@@ -536,7 +536,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
         try:
             SQL, name = self.getSQL(gid, sid, data, vid)
             SQL = SQL.strip('\n').strip(' ')
-            status, res = self.conn.execute_scalar(SQL)
+            status, res = self.conn.execute_void(SQL)
             if not status:
                 return internal_server_error(errormsg=res)

diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js
index e278717..151d05b 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -1140,16 +1140,24 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
           }.bind(ctx),
           updateNode = function() {
             if (
-              this.i && this.d && this.new._id == this.d._id &&
-              this.new._type == this.d._type
+              this.i && this.d && this.new._type == this.d._type
             ) {
-              // Found the currect
-              _.extend(this.d, this.new._id);
-              this.t.setLabel(ctx.i, {label: this.new.label});
-              this.t.addIcon(ctx.i, {icon: this.new.icon});
-              this.t.setId(ctx.id, {id: this.new.id});
-              this.t.openPath(this.i);
-              this.t.select(this.i);
+              var _id = this.d._id;
+              if (this.new._id != this.d._id) {
+                // Found the new oid, update its node_id
+                var node_data = this.t.itemData(ctx.i);
+                node_data._id = _id = this.new._id;
+              }
+              if (this.new._id == _id) {
+                // Found the currect
+                _.extend(this.d, this.new._id);
+                this.t.setLabel(ctx.i, {label: this.new.label});
+                this.t.addIcon(ctx.i, {icon: this.new.icon});
+                this.t.setId(ctx.id, {id: this.new.id});
+                this.t.openPath(this.i);
+                this.t.deselect(this.i);
+                this.t.select(this.i);
+              }
             }
             var success = this.o && this.o.success;
             if (success && typeof(success) == 'function') {


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table
  2016-09-16 10:14 [pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table Surinder Kumar <[email protected]>
@ 2016-09-16 14:41 ` Dave Page <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-09-16 14:41 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Fri, Sep 16, 2016 at 11:14 AM, Surinder Kumar
<[email protected]> wrote:
> Hi
>
> Issues fixed:
>
> 1) Creating a m-view with definition and then updating view with new
> definition, it results into an error "No results to fetch".
>
> 2) When definition of m-view is updated, it creates a new m-view with
> different OID, but it wasn't updating the old OID with new OID of tree node
> in tree view. thus on switching to another tab (e.g.: sql), it throws
> message "Cannot find materialized view".
>
> Please find attached patch and review.
>
> Thanks,
> Surinder Kumar
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-09-16 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 10:14 [pgAdmin4][Patch]: RM1595 - "no results to fetch error" displayed if modify definition with other table Surinder Kumar <[email protected]>
2016-09-16 14:41 ` Dave Page <[email protected]>

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