| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -300,8 +300,8 @@ create or replace package body ut_compound_data_helper is | |||
| 300 | 300 | ut_utils.append_to_clob(a_partition_stmt,' row_number() over (partition by '||l_partition_tmp||' order by '||l_partition_tmp||' ) '); | |
| 301 | 301 | ||
| 302 | 302 | if a_pk_table.count > 0 then | |
| 303 | - -- If key defined do the join or these and where on diffrences | ||
| 304 | - a_join_by_stmt := ut_utils.table_to_clob(l_join_by_list, ' and '); | ||
| 303 | + -- If key defined do the join or these and where on diffrences as well as on duplicate number when rows are same. | ||
| 304 | + a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_join_by_list, ' and '); | ||
| 305 | 305 | elsif a_unordered then | |
| 306 | 306 | -- If no key defined do the join on all columns | |
| 307 | 307 | a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_equal_list, ' and '); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2950,5 +2950,47 @@ Rows: [ 2 differences ] | |||
| 2950 | 2950 | ); | |
| 2951 | 2951 | end; | |
| 2952 | 2952 | ||
| 2953 | + procedure cr_joinby_compare_issue_1293 is | ||
| 2954 | + l_actual sys_refcursor; | ||
| 2955 | + l_expected sys_refcursor; | ||
| 2956 | + begin | ||
| 2957 | + --Arrange | ||
| 2958 | + open l_expected for | ||
| 2959 | + select 'FOO' username, 12 from dual union all | ||
| 2960 | + select 'TEST' username, -600 user_id from dual | ||
| 2961 | + order by 1 desc; | ||
| 2962 | + open l_actual for | ||
| 2963 | + select 'FOO' username, 12 from dual union all | ||
| 2964 | + select 'TEST' username, -600 user_id from dual union all | ||
| 2965 | + -- DUPLICATE!!! | ||
| 2966 | + select 'TEST' username, -600 user_id from dual | ||
| 2967 | + order by 1 asc; | ||
| 2968 | + --Act | ||
| 2969 | + ut3_develop.ut.expect(l_actual).to_equal(l_expected).join_by('USERNAME'); | ||
| 2970 | + --Assert | ||
| 2971 | + ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0); | ||
| 2972 | + end; | ||
| 2973 | + | ||
| 2974 | + procedure cr_not_joinby_comp_issue_1293 is | ||
| 2975 | + l_actual sys_refcursor; | ||
| 2976 | + l_expected sys_refcursor; | ||
| 2977 | + begin | ||
| 2978 | + --Arrange | ||
| 2979 | + open l_expected for | ||
| 2980 | + select 'FOO' username, 12 from dual union all | ||
| 2981 | + select 'TEST' username, -600 user_id from dual | ||
| 2982 | + order by 1 desc; | ||
| 2983 | + open l_actual for | ||
| 2984 | + select 'FOO' username, 12 from dual union all | ||
| 2985 | + select 'TEST' username, -600 user_id from dual union all | ||
| 2986 | + -- DUPLICATE!!! | ||
| 2987 | + select 'TEST' username, -600 user_id from dual | ||
| 2988 | + order by 1 asc; | ||
| 2989 | + --Act | ||
| 2990 | + ut3_develop.ut.expect(l_actual).to_equal(l_expected); | ||
| 2991 | + --Assert | ||
| 2992 | + ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_be_greater_than(0); | ||
| 2993 | + end; | ||
| 2994 | + | ||
| 2953 | 2995 | end; | |
| 2954 | 2996 | / | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -485,5 +485,11 @@ create or replace package test_expectations_cursor is | |||
| 485 | 485 | --%test( Multiple failures reported correctly - Issue #998 ) | |
| 486 | 486 | procedure multiple_cursor_expectations; | |
| 487 | 487 | ||
| 488 | + --%test( Compares cursors with duplicate rows using join by - Issue #1293 ) | ||
| 489 | + procedure cr_joinby_compare_issue_1293; | ||
| 490 | + | ||
| 491 | + --%test( Compares cursors with duplicate rows - Issue #1293 ) | ||
| 492 | + procedure cr_not_joinby_comp_issue_1293; | ||
| 493 | + | ||
| 488 | 494 | end; | |
| 489 | 495 | / | |
| Back | FazBrowse Home | New Git URL |
0 commit comments