diff --git a/docs/en_US/release_notes_7_0.rst b/docs/en_US/release_notes_7_0.rst index 7b530ae19..bd8ee6733 100644 --- a/docs/en_US/release_notes_7_0.rst +++ b/docs/en_US/release_notes_7_0.rst @@ -35,3 +35,4 @@ Bug fixes | `Issue #5775 `_ - Display the 'No menu available for this object' message if the selected tree node does not have any options. | `Issue #5833 `_ - Fixed an issue where user MFA entry was not getting delete after deleting a user. | `Issue #5874 `_ - Make "using" and "with check" fields a textarea in the RLS policy. + | `Issue #5904 `_ - Fixed an issue where the count query should not be triggered when the estimated count is less than zero. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui.js index eba22f94f..12f5264c9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui.js @@ -79,13 +79,13 @@ export default class RowSecurityPolicySchema extends BaseUISchema { }, { id: 'using', label: gettext('Using'), deps: ['using', 'event'], - type: 'multiline', disabled: obj.disableUsingField, + type: 'sql', disabled: obj.disableUsingField, mode: ['create', 'edit', 'properties'], control: 'sql', visible: true, group: gettext('Commands'), }, { id: 'withcheck', label: gettext('With check'), deps: ['withcheck', 'event'], - type: 'multiline', mode: ['create', 'edit', 'properties'], + type: 'sql', mode: ['create', 'edit', 'properties'], control: 'sql', visible: true, group: gettext('Commands'), disabled: obj.disableWithCheckField, }, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py index ab0ddf6f9..c1d990d7f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py @@ -612,14 +612,14 @@ class BaseTableView(PGChildNodeView, BasePartitionTable, VacuumSettings): # version 9.5 and above BaseTableView._check_rlspolicy_support(res) + # If estimated_row_count is zero or -1 then set the row count to 0 + if not estimated_row_count or estimated_row_count < 0: + res['rows'][0]['rows_cnt'] = 0 # If estimated rows are greater than threshold then - if estimated_row_count and \ - estimated_row_count > table_row_count_threshold: + elif estimated_row_count > table_row_count_threshold: res['rows'][0]['rows_cnt'] = str(table_row_count_threshold) + '+' - # If estimated rows is lower than threshold then calculate the count - elif estimated_row_count and \ - table_row_count_threshold >= estimated_row_count: + elif 0 < estimated_row_count <= table_row_count_threshold: sql = render_template( "/".join( [self.table_template_path, 'get_table_row_count.sql'] @@ -633,10 +633,6 @@ class BaseTableView(PGChildNodeView, BasePartitionTable, VacuumSettings): res['rows'][0]['rows_cnt'] = count - # If estimated_row_count is zero then set the row count with same - elif not estimated_row_count: - res['rows'][0]['rows_cnt'] = estimated_row_count - # Fetch privileges sql = render_template("/".join([self.table_template_path, self._ACL_SQL]),