Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etnMs-0002Ek-9B for pgadmin-hackers@arkaria.postgresql.org; Thu, 08 Mar 2018 04:41:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1etnMq-0003CS-Bm for pgadmin-hackers@arkaria.postgresql.org; Thu, 08 Mar 2018 04:41:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etnMq-0003CI-6C for pgadmin-hackers@lists.postgresql.org; Thu, 08 Mar 2018 04:41:24 +0000 Received: from mail-ot0-x22e.google.com ([2607:f8b0:4003:c0f::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1etnMi-0003hW-37 for pgadmin-hackers@postgresql.org; Thu, 08 Mar 2018 04:41:23 +0000 Received: by mail-ot0-x22e.google.com with SMTP id 95so4294126ote.5 for ; Wed, 07 Mar 2018 20:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4C6DekaypbOBrem2hBbKpppDf2g/aUdm7dWukZgWNgo=; b=jOGwyVm7bJB1hqObDCHbJZWA4QVYIzuPcQJR/uGhzPQUjeazaXoHpFNAUiebXt1Tl6 8WGpiFueb+k3kH582B4soW1Fje/ur4OKhulkndXza7VQ/1M0C+s4bTPbGS7oR5p3/Tp4 COD1qb/PfrlI4WHVWQVImgOtzIxtInrIAITL2c1i2TiZ4fAuXn0b2o8WSqOY9Et+KVre yGH+2svusJIxNxcDtH1ZnCeQkUCz3PzMHAE96rBe3ZdHI5Hq1KgQ5FRru1qMdQaHftUs qPBVXSsn7nsEQ3c/3j+yiBUtIvrTkOfSb5hZUZefY3DMK8Km5tHeUrXeePpbyQFCMJgY 1N8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4C6DekaypbOBrem2hBbKpppDf2g/aUdm7dWukZgWNgo=; b=jRebakQzoEyuhrgSmtMW8UGNrmTKjLQ9Ha+kgd/fJf9xEnrB5G/kgSDiK5QtkXQxBY pcK8qnwsWh5qqBBdHuoS2UTB4lMoQzCEzZaxFPb/pFM6DxGdf8q2vYTixuKIgKsArVKJ WvE8duHPg9Lwj0r6ZqsicVdhWIZtWaCZy15FNyss7G8fWPMUIY2Gf23x4RFgFTe6R+v2 mveFL5fS85aL36MMHlcO2a4g3r4JgGB6ZlKuSQjgKV4l1onMXoGi20kBZ8A8MXgqvbTh +ryh8NQ42YhDIlyPzezsuWN3I06V6LARpdpShH9NlmZRtHAcwyG5hPkNm3ufLLk0zkmE /dPw== X-Gm-Message-State: APf1xPCw0npQAIc0l0TO+l/WKgpiEA/ke82zLbQFx3M8xRchHBt5Q9Z8 jEfXIBvWWzZkl5mFzIqn+gAShxRkA0A8Axtq374DKQ== X-Google-Smtp-Source: AG47ELuvw03C1WJkRyRKnTCmoFhfHTbPQ7o3rQwLCrFNEkvQ7fG2EwtNyH3J2Zx86n1gtPQ63uYswm5J5HEg0OkEDkU= X-Received: by 10.157.48.73 with SMTP id w9mr18213678otd.391.1520484073570; Wed, 07 Mar 2018 20:41:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.203.154 with HTTP; Wed, 7 Mar 2018 20:41:13 -0800 (PST) In-Reply-To: References: From: Khushboo Vashi Date: Thu, 8 Mar 2018 10:11:13 +0530 Message-ID: Subject: Re: pgAdmin 4 commit: Support EXPLAIN on Greenplum. Fixes #3097 To: Joao Pedro De Almeida Pereira Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="001a113db6fa1795f40566df49df" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113db6fa1795f40566df49df Content-Type: text/plain; charset="UTF-8" Hi Joao, In the test_start_running_query.py, 2 static methods (is_begin_required_for_sql_query and is_rollback_statement_required) of StartRunningQuery class were used directly without @patch. Due to this, in all the cases, the original value of them doesn't restore. To fix this, I have sent the patch in another thread, to restore its original state, but I wonder if we can use these methods with @patch. Thanks, Khushboo On Fri, Feb 9, 2018 at 5:24 PM, Dave Page wrote: > Support EXPLAIN on Greenplum. Fixes #3097 > > - Extract SQLEditor.execute and SQLEditor._poll into their own files and > add test around them > - Extract SQLEditor backend functions that start executing query to their > own files and add tests around it > - Move the Explain SQL from the front-end and now pass the Explain plan > parameters as a JSON object in the start query call. > - Extract the compile_template_name into a function that can be used by > the different places that try to select the version of the template and the > server type > > Branch > ------ > master > > Details > ------- > https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h= > e16a95275336529a734bf0066889e39cc8ef0662 > Author: Joao Pedro De Almeida Pereira > > Modified Files > -------------- > .../databases/schemas/tables/tests/test_utils.py | 0 > web/pgadmin/static/js/sqleditor/execute_query.js | 287 ++++ > .../js/sqleditor/is_new_transaction_required.js | 14 + > .../static/js/sqleditor/query_tool_actions.js | 33 +- > web/pgadmin/tools/sqleditor/__init__.py | 396 +---- > web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 227 +-- > .../sqleditor/sql/10_plus/explain_plan.sql | 23 + > .../sqleditor/sql/9.2_plus/explain_plan.sql | 20 + > .../sqleditor/sql/default/explain_plan.sql | 17 + > .../sqleditor/sql/gpdb_5.0_plus/explain_plan.sql | 5 + > web/pgadmin/tools/sqleditor/tests/__init__.py | 8 + > .../sqleditor/tests/test_explain_plan_templates.py | 152 ++ > .../test_extract_sql_from_network_parameters.py | 59 + > .../tools/sqleditor/tests/test_start_query_tool.py | 38 + > web/pgadmin/tools/sqleditor/utils/__init__.py | 14 + > .../sqleditor/utils/apply_explain_plan_wrapper.py | 24 + > .../tools/sqleditor/utils/constant_definition.py | 32 + > .../tools/sqleditor/utils/is_begin_required.py | 169 ++ > .../tools/sqleditor/utils/start_running_query.py | 172 ++ > .../tools/sqleditor/utils/tests/__init__.py | 8 + > .../utils/tests/test_apply_explain_plan_wrapper.py | 121 ++ > .../utils/tests/test_start_running_query.py | 445 +++++ > .../utils/update_session_grid_transaction.py | 18 + > web/pgadmin/utils/compile_template_name.py | 17 + > .../utils/tests/test_compile_template_name.py | 34 + > web/pgadmin/utils/versioned_template_loader.py | 2 +- > web/regression/javascript/fake_endpoints.js | 6 +- > .../javascript/sqleditor/execute_query_spec.js | 1702 > ++++++++++++++++++++ > .../sqleditor/is_new_transaction_required_spec.js | 65 + > .../sqleditor/query_tool_actions_spec.js | 141 +- > 30 files changed, 3670 insertions(+), 579 deletions(-) > > --001a113db6fa1795f40566df49df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Joao,

In the=C2=A0test_st= art_running_query.py, 2 static methods (is_begin_required= _for_sql_query and is_rollback_statement_required)=
of StartRunningQuery class were use= d directly without @patch. Due to this, in all the cases,= the original value of them doesn't restore.

To fix this, I have sent the patch in an= other thread, to restore its original state, but I wonder if we can use the= se methods with @patch.

<= span style=3D"color:rgb(0,0,0);font-family:monospace;font-size:12px;white-s= pace:pre">Thanks,
Khushboo

On F= ri, Feb 9, 2018 at 5:24 PM, Dave Page <dpage@pgadmin.org> wr= ote:
Support EXPLAIN on Greenplum. Fixes = #3097

=C2=A0- Extract SQLEditor.execute and SQLEditor._poll into their own files = and add test around them
=C2=A0- Extract SQLEditor backend functions that start executing query to t= heir own files and add tests around it
=C2=A0- Move the Explain SQL from the front-end and now pass the Explain pl= an parameters as a JSON object in the start query call.
=C2=A0- Extract the compile_template_name into a function that can be used = by the different places that try to select the version of the template and = the server type

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=3Dpgadmin4.git;a=3Dcommitdiff;h=3De16a95275336529a734bf0066889e39cc8ef0662
Author: Joao Pedro De Almeida Pereira <jdealmeidapereira@pivotal.io>

Modified Files
--------------
.../databases/schemas/tables/tests/test_utils.py=C2=A0 =C2=A0|=C2=A0 = =C2=A0 0
web/pgadmin/static/js/sqleditor/execute_query.js=C2=A0 =C2=A0|=C2=A0 2= 87 ++++
.../js/sqleditor/is_new_transaction_required.js=C2=A0 =C2=A0 |=C2=A0 = =C2=A014 +
.../static/js/sqleditor/query_tool_actions.js=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A033 +-
web/pgadmin/tools/sqleditor/__init__.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 396 +----
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |=C2=A0 227 +--
.../sqleditor/sql/10_plus/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A023 +
.../sqleditor/sql/9.2_plus/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A020 +
.../sqleditor/sql/default/explain_plan.sql=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A017 +
.../sqleditor/sql/gpdb_5.0_plus/explain_plan.sql=C2=A0 =C2=A0|=C2=A0 = =C2=A0 5 +
web/pgadmin/tools/sqleditor/tests/__init__.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A0 8 +
.../sqleditor/tests/test_explain_plan_templates.py |=C2=A0 152 ++
.../test_extract_sql_from_network_parameters.py=C2=A0 =C2=A0 |=C2=A0 = =C2=A059 +
.../tools/sqleditor/tests/test_start_query_tool.py |=C2=A0 =C2=A038 +<= br> web/pgadmin/tools/sqleditor/utils/__init__.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A014 +
.../sqleditor/utils/apply_explain_plan_wrapper.py=C2=A0 |=C2=A0 =C2=A0= 24 +
.../tools/sqleditor/utils/constant_definition.py=C2=A0 =C2=A0|=C2=A0 = =C2=A032 +
.../tools/sqleditor/utils/is_begin_required.py=C2=A0 =C2=A0 =C2=A0|=C2= =A0 169 ++
.../tools/sqleditor/utils/start_running_query.py=C2=A0 =C2=A0|=C2=A0 1= 72 ++
.../tools/sqleditor/utils/tests/__init__.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A0 8 +
.../utils/tests/test_apply_explain_plan_wrapper.py |=C2=A0 121 ++
.../utils/tests/test_start_running_query.py=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 445 +++++
.../utils/update_session_grid_transaction.py=C2=A0 =C2=A0 =C2=A0 =C2= =A0|=C2=A0 =C2=A018 +
web/pgadmin/utils/compile_template_name.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A017 +
.../utils/tests/test_compile_template_name.py=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 =C2=A034 +
web/pgadmin/utils/versioned_template_loader.py=C2=A0 =C2=A0 =C2=A0|=C2= =A0 =C2=A0 2 +-
web/regression/javascript/fake_endpoints.js=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 =C2=A0 6 +-
.../javascript/sqleditor/execute_query_spec.js=C2=A0 =C2=A0 =C2=A0| 17= 02 ++++++++++++++++++++
.../sqleditor/is_new_transaction_required_spec.js=C2=A0 |=C2=A0 =C2=A0= 65 +
.../sqleditor/query_tool_actions_spec.js=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0|=C2=A0 141 +-
30 files changed, 3670 insertions(+), 579 deletions(-)


--001a113db6fa1795f40566df49df--