diff --git a/docs/en_US/release_notes_4_27.rst b/docs/en_US/release_notes_4_27.rst index a000bd8da..55d46394a 100644 --- a/docs/en_US/release_notes_4_27.rst +++ b/docs/en_US/release_notes_4_27.rst @@ -22,6 +22,7 @@ Bug fixes | `Issue #5739 `_ - Ensure that the import/export feature should work with SSH Tunnel. | `Issue #5802 `_ - Remove maximum length on the password field in the server dialog. | `Issue #5807 `_ - Fixed an issue where a column is renamed and then removed, then the drop SQL query takes the wrong column name. +| `Issue #5826 `_ - Fixed an issue where schema diff is showing identical table as different due to default vacuum settings. | `Issue #5830 `_ - Fixed reverse engineering SQL where parenthesis is not properly arranged for View/MView definition. | `Issue #5839 `_ - Ensure that multiple extensions can be dropped from the properties tab. | `Issue #5841 `_ - Fixed an issue where the server is not able to connect using the service. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py index 566d4086d..fde28cff1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py @@ -22,7 +22,8 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare): table_keys_to_ignore = ['oid', 'schema', 'edit_types', 'attnum', 'col_type', 'references', 'reltuples', 'oid-2', 'rows_cnt', 'seqrelid', 'atttypid', 'elemoid', - 'hastoasttable', 'relhassubclass', 'relacl_str'] + 'hastoasttable', 'relhassubclass', 'relacl_str', + 'setting'] constraint_keys_to_ignore = ['relname', 'nspname', 'parent_tbl', 'attrelid', 'adrelid', 'fknsp', 'confrelid', 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 fa2198cc1..539a06fe4 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 @@ -351,7 +351,7 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare): {'get': 'get_toast_table_vacuum'}] }) - keys_to_ignore = ['oid', 'schema', 'xmin', 'oid-2'] + keys_to_ignore = ['oid', 'schema', 'xmin', 'oid-2', 'setting'] def __init__(self, *args, **kwargs): """ diff --git a/web/pgadmin/tools/schema_diff/__init__.py b/web/pgadmin/tools/schema_diff/__init__.py index da5ec43aa..3d7327903 100644 --- a/web/pgadmin/tools/schema_diff/__init__.py +++ b/web/pgadmin/tools/schema_diff/__init__.py @@ -705,6 +705,7 @@ def compare_database_objects(**kwargs): if hasattr(view, 'compare'): msg = gettext('Comparing {0}'). \ format(gettext(view.blueprint.collection_label)) + app.logger.debug(msg) diff_model_obj.set_comparison_info(msg, total_percent) # Update the message and total percentage in session object update_session_diff_transaction(trans_id, session_obj, @@ -759,6 +760,7 @@ def compare_schema_objects(**kwargs): msg = gettext('Comparing {0} of schema \'{1}\''). \ format(gettext(view.blueprint.collection_label), gettext(schema_name)) + app.logger.debug(msg) diff_model_obj.set_comparison_info(msg, total_percent) # Update the message and total percentage in session object update_session_diff_transaction(trans_id, session_obj, diff --git a/web/pgadmin/tools/schema_diff/compare.py b/web/pgadmin/tools/schema_diff/compare.py index cc6aaf119..7faab26fc 100644 --- a/web/pgadmin/tools/schema_diff/compare.py +++ b/web/pgadmin/tools/schema_diff/compare.py @@ -10,10 +10,8 @@ """Schema diff object comparison.""" from flask import render_template -from flask_babelex import gettext from pgadmin.utils.driver import get_driver from config import PG_DEFAULT_DRIVER -from pgadmin.utils.ajax import internal_server_error from pgadmin.tools.schema_diff.directory_compare import compare_dictionaries diff --git a/web/pgadmin/tools/schema_diff/directory_compare.py b/web/pgadmin/tools/schema_diff/directory_compare.py index cbe357409..8e4837295 100644 --- a/web/pgadmin/tools/schema_diff/directory_compare.py +++ b/web/pgadmin/tools/schema_diff/directory_compare.py @@ -12,6 +12,7 @@ import copy import string from pgadmin.tools.schema_diff.model import SchemaDiffModel +from flask import current_app count = 1 @@ -227,6 +228,11 @@ def _get_identical_and_different_list(intersect_keys, source_dict, target_dict, get_source_target_oid(source_dict, target_dict, key) # Recursively Compare the two dictionary + current_app.logger.debug( + "Schema Diff: Source Dict: {0}".format(dict1[key])) + current_app.logger.debug( + "Schema Diff: Target Dict: {0}".format(dict2[key])) + if are_dictionaries_identical(dict1[key], dict2[key], ignore_whitespaces, ignore_keys): identical.append({ @@ -439,12 +445,17 @@ def are_dictionaries_identical(source_dict, target_dict, ignore_whitespaces, # If number of keys are different in source and target then # return False if len(src_only) != len(tar_only): + current_app.logger.debug("Schema Diff: Number of keys are different " + "in source and target") return False else: # If number of keys are same but key is not present in target then # return False for key in src_only: if key not in tar_only: + current_app.logger.debug( + "Schema Diff: Number of keys are same but key is not" + " present in target") return False for key in source_dict.keys(): @@ -492,6 +503,10 @@ def are_dictionaries_identical(source_dict, target_dict, ignore_whitespaces, continue if source_value != target_value: + current_app.logger.debug( + "Schema Diff: Object name: '{0}', Source Value: '{1}', " + "Target Value: '{2}', Key: '{3}'".format( + source_dict['name'], source_value, target_value, key)) return False return True