Fixed an issue where the DB restriction check was not working for the collection node. Fixes #7453

This commit is contained in:
Nikhil Mohite 2022-06-15 11:09:06 +05:30 committed by Akshay Joshi
parent 3297546e0a
commit 99c7a50fd6
4 changed files with 21 additions and 20 deletions

View File

@ -25,13 +25,14 @@ WHERE
db.datistemplate = {{show_user_defined_templates}} AND
{% endif %}
{% if did %}
db.oid = {{ did|qtLiteral }}::OID{% else %}{% if name %}
db.datname = {{ name|qtLiteral }}::text{% else %}
db.oid > {{ last_system_oid|qtLiteral }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}{% endif %}
db.oid = {{ did|qtLiteral }}::OID
{% endif %}
{% if db_restrictions %}
AND
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
ORDER BY datname;

View File

@ -30,14 +30,14 @@ FROM pg_catalog.pg_database db
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
)
WHERE {% if did %}
db.oid = {{ did|qtLiteral }}::OID{% else %}{% if name %}
db.datname = {{ name|qtLiteral }}::text{% else %}
db.oid > {{ last_system_oid|qtLiteral }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}{% endif %}
db.oid = {{ did|qtLiteral }}::OID
{% endif %}
{% if db_restrictions %}
AND
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
AND db.datistemplate in (false, {{show_system_objects}})

View File

@ -37,14 +37,14 @@ FROM pg_catalog.pg_database db
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
)
WHERE {% if did %}
db.oid = {{ did|qtLiteral }}::OID{% else %}{% if name %}
db.datname = {{ name|qtLiteral }}::text{% else %}
db.oid > {{ last_system_oid|qtLiteral }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}{% endif %}
db.oid = {{ did|qtLiteral }}::OID
{% endif %}
{% if db_restrictions %}
AND
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
AND db.datistemplate in (false, {{show_system_objects}})

View File

@ -21,14 +21,14 @@ FROM pg_catalog.pg_database db
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
)
WHERE {% if did %}
db.oid = {{ did|qtLiteral }}::OID{% else %}{% if name %}
db.datname = {{ name|qtLiteral }}::text{% else %}
db.oid > {{ last_system_oid|qtLiteral }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}{% endif %}
db.oid = {{ did|qtLiteral }}::OID
{% endif %}
{% if db_restrictions %}
AND
{% if did %}AND{% endif %}
db.datname in ({{db_restrictions}})
{% elif not did%}
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
{% endif %}
ORDER BY datname;