@@ -119,8 +119,6 @@ create or replace package body ut_compound_data_helper is
119119 || case when a_order_enforced then q'[
120120 --column position is not matching (both when excluded extra/missing columns as well as when they are included)
121121 or (a_pos_nn != e_pos_nn and exp_col_pos != act_col_pos)]'
122- else
123- null
124122 end ||q'[
125123 order by exp_col_pos, act_col_pos]'
126124 bulk collect into l_results using a_expected, a_actual;
@@ -426,34 +424,34 @@ create or replace package body ut_compound_data_helper is
426424 end if;
427425 l_sql := q'[
428426 with
429- exp_rows as(
430- select
431- exp_data_id, extract( exp_item_data, :column_path ) exp_item_data, item_no, diff_id
432- from ut_compound_data_diff_tmp
433- where diff_id = :diff_id
434- and exp_data_id = :self_guid
435- ),
436- act_rows as (
437- select
438- act_data_id, extract( act_item_data, :column_path ) act_item_data, item_no, diff_id
439- from ut_compound_data_diff_tmp ucd
440- where diff_id = :diff_id
441- and ucd.act_data_id = :other_guid
442- ),
443427 exp_cols as (
444428 select
445- exp_item_data, exp_data_id, item_no rn, rownum col_no, diff_id,
429+ i. exp_item_data, i. exp_data_id, i. item_no rn, rownum col_no, i. diff_id,
446430 s.column_value col, s.column_value.getRootElement() col_name,
447- nvl(s.column_value.getclobval(),empty_clob()) col_val
448- from exp_rows i,
431+ nvl( s.column_value.getclobval(), empty_clob() ) col_val
432+ from (
433+ select
434+ ucd.exp_data_id, extract( ucd.exp_item_data, :column_path ) exp_item_data,
435+ ucd.item_no, ucd.diff_id
436+ from ut_compound_data_diff_tmp ucd
437+ where ucd.diff_id = :diff_id
438+ and ucd.exp_data_id = :self_guid
439+ ) i,
449440 table( xmlsequence( extract( i.exp_item_data, :extract_path ) ) ) s
450441 ),
451442 act_cols as (
452443 select
453- act_item_data, act_data_id, item_no rn, rownum col_no, diff_id,
444+ i. act_item_data, i. act_data_id, i. item_no rn, rownum col_no, i. diff_id,
454445 s.column_value col, s.column_value.getRootElement() col_name,
455- nvl(s.column_value.getclobval(),empty_clob()) col_val
456- from act_rows i,
446+ nvl( s.column_value.getclobval(), empty_clob() ) col_val
447+ from (
448+ select
449+ ucd.act_data_id, extract( ucd.act_item_data, :column_path ) act_item_data,
450+ ucd.item_no, ucd.diff_id
451+ from ut_compound_data_diff_tmp ucd
452+ where ucd.diff_id = :diff_id
453+ and ucd.act_data_id = :other_guid
454+ ) i,
457455 table( xmlsequence( extract( i.act_item_data, :extract_path ) ) ) s
458456 ),
459457 data_diff as (
@@ -496,7 +494,8 @@ create or replace package body ut_compound_data_helper is
496494 col_name
497495 from ( ]'
498496 || case when a_unordered then q'[
499- select u.rn, u.diff_type, u.diffed_row,
497+ select /*+ no_unnest */
498+ u.rn, u.diff_type, u.diffed_row,
500499 replace(
501500 extract( case when i.exp_data_id is null then i.act_item_data else i.exp_item_data end, :join_by ).getclobval(),
502501 chr(10)
@@ -551,9 +550,8 @@ create or replace package body ut_compound_data_helper is
551550 end;
552551 execute immediate l_sql
553552 bulk collect into l_results
554- using l_exp_extract_xpath, a_diff_id, a_expected_dataset_guid,
555- l_act_extract_xpath, a_diff_id, a_actual_dataset_guid,
556- a_extract_path, a_extract_path,
553+ using l_exp_extract_xpath, a_diff_id, a_expected_dataset_guid, a_extract_path,
554+ l_act_extract_xpath, a_diff_id, a_actual_dataset_guid, a_extract_path,
557555 l_join_xpath, l_join_xpath, l_join_xpath, a_diff_id;
558556 return l_results;
559557 end;
0 commit comments