diff --git a/source/expectations/data_values/ut_compound_data_helper.pkb b/source/expectations/data_values/ut_compound_data_helper.pkb index ee01819d6..e6665bd10 100644 --- a/source/expectations/data_values/ut_compound_data_helper.pkb +++ b/source/expectations/data_values/ut_compound_data_helper.pkb @@ -91,41 +91,44 @@ create or replace package body ut_compound_data_helper is l_results tt_column_diffs; begin l_column_filter := get_columns_row_filter(a_exclude_xpath, a_include_xpath); + --CARDINALITY hints added to address issue: https://github.com/utPLSQL/utPLSQL/issues/752 l_sql := q'[ with expected_cols as ( select :a_expected as item_data from dual ), actual_cols as ( select :a_actual as item_data from dual ), - expected_cols_info as ( + expected_cols_info as ( select e.*, replace(expected_type,'VARCHAR2','CHAR') expected_type_compare from ( - SELECT rownum expected_pos, - xt.name expected_name, - xt.type expected_type - FROM (select ]'||l_column_filter||q'[ from expected_cols ucd) x, - XMLTABLE('/ROW/*' - PASSING x.item_data - COLUMNS - name VARCHAR2(4000) PATH '@xml_valid_name', - type VARCHAR2(4000) PATH '/' - ) xt - ) e + select /*+ CARDINALITY(xt 100) */ + rownum expected_pos, + xt.name expected_name, + xt.type expected_type + from (select ]'||l_column_filter||q'[ from expected_cols ucd) x, + xmltable( + '/ROW/*' + passing x.item_data + columns + name varchar2(4000) PATH '@xml_valid_name', + type varchar2(4000) PATH '/' + ) xt + ) e ), actual_cols_info as ( select a.*, replace(actual_type,'VARCHAR2','CHAR') actual_type_compare - from ( - SELECT rownum actual_pos, - xt.name actual_name, - xt.type actual_type - FROM (select ]'||l_column_filter||q'[ from actual_cols ucd) x, - XMLTABLE('/ROW/*' - PASSING x.item_data - COLUMNS - name VARCHAR2(4000) PATH '@xml_valid_name', - type VARCHAR2(4000) PATH '/' - ) xt - ) a + from (select /*+ CARDINALITY(xt 100) */ + rownum actual_pos, + xt.name actual_name, + xt.type actual_type + from (select ]'||l_column_filter||q'[ from actual_cols ucd) x, + xmltable('/ROW/*' + passing x.item_data + columns + name varchar2(4000) path '@xml_valid_name', + type varchar2(4000) path '/' + ) xt + ) a ), joined_cols as ( select e.*, a.*,