Skip to content

Feature/1082 failure when comparing nested objects #1179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 29, 2022
Prev Previous commit
Next Next commit
Fixing issue when a hash was tried to be generated on the null value …
…from XML extract causing to fail. Please see #1098

Resolve a situation where a more than two levels of nesting were causing ambiguity on the column name for hash.
E.g.
<OBJ1><FIRST><VAL><TEST>
<OBJ1><SECOND><VAL><TEST>
Was taking into hash consideration only parent.
  • Loading branch information
lwasylow committed Jan 26, 2022
commit 3c3d32055457a9c4ab36e61cc79179a536e2f8aa
6 changes: 4 additions & 2 deletions source/core/ut_utils.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -882,12 +882,14 @@ create or replace package body ut_utils is

function get_hash(a_data raw, a_hash_type binary_integer := dbms_crypto.hash_sh1) return t_hash is
begin
return dbms_crypto.hash(a_data, a_hash_type);
--We cannot run hash on null
return case when a_data is null then null else dbms_crypto.hash(a_data, a_hash_type) end;
end;

function get_hash(a_data clob, a_hash_type binary_integer := dbms_crypto.hash_sh1) return t_hash is
begin
return dbms_crypto.hash(a_data, a_hash_type);
--We cannot run hash on null
return case when a_data is null then null else dbms_crypto.hash(a_data, a_hash_type) end;
end;

function qualified_sql_name(a_name varchar2) return varchar2 is
Expand Down
5 changes: 3 additions & 2 deletions source/expectations/data_values/ut_cursor_column.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ create or replace type body ut_cursor_column as
a_access_path||'/'||self.xml_valid_name
end; --Access path used for XMLTABLE query
self.filter_path := '/'||self.access_path; --Filter path will differ from access path in anydata type
--Transformed name needs to be build on full access path to avoid ambiguity when there is 3 or more levels of nesting.
self.transformed_name := case when length(self.xml_valid_name) > 30 then
'"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name)||'"'
'"'||ut_compound_data_helper.get_fixed_size_hash(self.access_path)||'"'
when self.parent_name is null then
'"'||self.xml_valid_name||'"'
else
'"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name)||'"'
'"'||ut_compound_data_helper.get_fixed_size_hash(self.access_path)||'"'
end; --when is nestd we need to hash name to make sure we dont exceed 30 char
self.column_type := a_col_type; --column type e.g. user_defined , varchar2
self.column_schema := a_col_schema_name; -- schema name
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy