Fixed extra parentheses issue around joins for Views. Fixes #6061
parent
c933771016
commit
a92595012f
|
@ -25,5 +25,6 @@ Bug fixes
|
||||||
| `Issue #6046 <https://redmine.postgresql.org/issues/6046>`_ - Fixed an issue where the state of the Save File icon does not match the dirty editor indicator.
|
| `Issue #6046 <https://redmine.postgresql.org/issues/6046>`_ - Fixed an issue where the state of the Save File icon does not match the dirty editor indicator.
|
||||||
| `Issue #6047 <https://redmine.postgresql.org/issues/6047>`_ - Fixed an issue where the dirty indicator stays active even if all changes were undone.
|
| `Issue #6047 <https://redmine.postgresql.org/issues/6047>`_ - Fixed an issue where the dirty indicator stays active even if all changes were undone.
|
||||||
| `Issue #6058 <https://redmine.postgresql.org/issues/6058>`_ - Ensure that the rename panel should be disabled when the SQL file opened in the query tool.
|
| `Issue #6058 <https://redmine.postgresql.org/issues/6058>`_ - Ensure that the rename panel should be disabled when the SQL file opened in the query tool.
|
||||||
|
| `Issue #6061 <https://redmine.postgresql.org/issues/6061>`_ - Fixed extra parentheses issue around joins for Views.
|
||||||
| `Issue #6065 <https://redmine.postgresql.org/issues/6065>`_ - Fixed accessibility issues in schema diff module.
|
| `Issue #6065 <https://redmine.postgresql.org/issues/6065>`_ - Fixed accessibility issues in schema diff module.
|
||||||
| `Issue #6084 <https://redmine.postgresql.org/issues/6084>`_ - Fixed TypeError exception in schema diff when selected any identical object.
|
| `Issue #6084 <https://redmine.postgresql.org/issues/6084>`_ - Fixed TypeError exception in schema diff when selected any identical object.
|
||||||
|
|
|
@ -15,7 +15,7 @@ SELECT
|
||||||
nsp.nspname as schema,
|
nsp.nspname as schema,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
description AS comment,
|
description AS comment,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
{# ============= Checks if it is system view ================ #}
|
{# ============= Checks if it is system view ================ #}
|
||||||
{% if vid and datlastsysoid %}
|
{% if vid and datlastsysoid %}
|
||||||
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
||||||
|
|
|
@ -15,7 +15,7 @@ SELECT
|
||||||
nsp.nspname as schema,
|
nsp.nspname as schema,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
description AS comment,
|
description AS comment,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
{# ============= Checks if it is system view ================ #}
|
{# ============= Checks if it is system view ================ #}
|
||||||
{% if vid and datlastsysoid %}
|
{% if vid and datlastsysoid %}
|
||||||
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
||||||
|
|
|
@ -8,7 +8,7 @@ SELECT
|
||||||
description AS comment,
|
description AS comment,
|
||||||
c.reltablespace AS spcoid,
|
c.reltablespace AS spcoid,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
array_to_string(c.relacl::text[], ', ') AS acl,
|
array_to_string(c.relacl::text[], ', ') AS acl,
|
||||||
{#=============Checks if it is system view================#}
|
{#=============Checks if it is system view================#}
|
||||||
{% if vid and datlastsysoid %}
|
{% if vid and datlastsysoid %}
|
||||||
|
|
|
@ -8,7 +8,7 @@ SELECT
|
||||||
(CASE WHEN length(spc.spcname::text) > 0 THEN spc.spcname ELSE 'pg_default' END) as spcname,
|
(CASE WHEN length(spc.spcname::text) > 0 THEN spc.spcname ELSE 'pg_default' END) as spcname,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
description As comment,
|
description As comment,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
nsp.nspname AS schema,
|
nsp.nspname AS schema,
|
||||||
array_to_string(c.relacl::text[], ', ') AS acl,
|
array_to_string(c.relacl::text[], ', ') AS acl,
|
||||||
{#=============Checks if it is system view================#}
|
{#=============Checks if it is system view================#}
|
||||||
|
|
|
@ -11,7 +11,7 @@ SELECT
|
||||||
c.relispopulated AS ispopulated,
|
c.relispopulated AS ispopulated,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
array_to_string(c.relacl::text[], ', ') AS acl,
|
array_to_string(c.relacl::text[], ', ') AS acl,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
{# ===== Checks if it is system view ===== #}
|
{# ===== Checks if it is system view ===== #}
|
||||||
{% if vid and datlastsysoid %}
|
{% if vid and datlastsysoid %}
|
||||||
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
||||||
|
|
|
@ -12,7 +12,7 @@ SELECT
|
||||||
c.relispopulated AS ispopulated,
|
c.relispopulated AS ispopulated,
|
||||||
pg_get_userbyid(c.relowner) AS owner,
|
pg_get_userbyid(c.relowner) AS owner,
|
||||||
array_to_string(c.relacl::text[], ', ') AS acl,
|
array_to_string(c.relacl::text[], ', ') AS acl,
|
||||||
pg_get_viewdef(c.oid) AS definition,
|
pg_get_viewdef(c.oid, true) AS definition,
|
||||||
{# ===== Checks if it is system view ===== #}
|
{# ===== Checks if it is system view ===== #}
|
||||||
{% if vid and datlastsysoid %}
|
{% if vid and datlastsysoid %}
|
||||||
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
|
||||||
|
|
|
@ -85,6 +85,10 @@ class ViewsGetTestCase(BaseTestGenerator):
|
||||||
test_result_data = self.expected_data["test_result_data"]
|
test_result_data = self.expected_data["test_result_data"]
|
||||||
if bool(test_result_data):
|
if bool(test_result_data):
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
|
if self.server['type'] == 'pg':
|
||||||
|
self.assertIn(test_result_data["pg_definition"],
|
||||||
|
response_data['definition'])
|
||||||
|
else:
|
||||||
self.assertIn(test_result_data["definition"],
|
self.assertIn(test_result_data["definition"],
|
||||||
response_data['definition'])
|
response_data['definition'])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -164,7 +164,8 @@
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
"error_msg": null,
|
"error_msg": null,
|
||||||
"test_result_data": {
|
"test_result_data": {
|
||||||
"definition": " SELECT\n CASE\n WHEN ((pg_db.datistemplate = false) AND (pg_db.datallowconn = true) AND ((pg_db.datconnlimit = '-1'::integer) OR (pg_db.datacl IS NULL))) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;"
|
"definition": " SELECT\n CASE\n WHEN ((pg_db.datistemplate = false) AND (pg_db.datallowconn = true) AND ((pg_db.datconnlimit = '-1'::integer) OR (pg_db.datacl IS NULL))) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;",
|
||||||
|
"pg_definition": " SELECT\n CASE\n WHEN pg_db.datistemplate = false AND pg_db.datallowconn = true AND (pg_db.datconnlimit = '-1'::integer OR pg_db.datacl IS NULL) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"is_list": false
|
"is_list": false
|
||||||
|
@ -463,7 +464,8 @@
|
||||||
"status_code": 200,
|
"status_code": 200,
|
||||||
"error_msg": null,
|
"error_msg": null,
|
||||||
"test_result_data": {
|
"test_result_data": {
|
||||||
"definition": " SELECT\n CASE\n WHEN ((pg_db.datistemplate = false) AND (pg_db.datallowconn = true) AND ((pg_db.datconnlimit = '-1'::integer) OR (pg_db.datacl IS NULL))) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;"
|
"definition": " SELECT\n CASE\n WHEN ((pg_db.datistemplate = false) AND (pg_db.datallowconn = true) AND ((pg_db.datconnlimit = '-1'::integer) OR (pg_db.datacl IS NULL))) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;",
|
||||||
|
"pg_definition": " SELECT\n CASE\n WHEN pg_db.datistemplate = false AND pg_db.datallowconn = true AND (pg_db.datconnlimit = '-1'::integer OR pg_db.datacl IS NULL) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"is_list": false
|
"is_list": false
|
||||||
|
|
Loading…
Reference in New Issue