Skip to content

Commit

Permalink
Merge pull request #898 from opendba/develop
Browse files Browse the repository at this point in the history
fix/ORA-00907 when comparing ref cursors with BINARY_... columns
  • Loading branch information
lwasylow committed Apr 7, 2019
2 parents 67be0f4 + 6538063 commit ce54eff
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/expectations/data_values/ut_compound_data_helper.pkb
Expand Up @@ -231,7 +231,8 @@ create or replace package body ut_compound_data_helper is
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('DATE','TIMESTAMP','TIMESTAMP WITH TIME ZONE',
'TIMESTAMP WITH LOCAL TIME ZONE') then
l_col_type := 'VARCHAR2(50)';
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('INTERVAL DAY TO SECOND','INTERVAL YEAR TO MONTH') then
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('INTERVAL DAY TO SECOND',
'INTERVAL YEAR TO MONTH', 'BINARY_FLOAT', 'BINARY_DOUBLE') then
l_col_type := a_data_info.column_type;
else
l_col_type := a_data_info.column_type
Expand Down
22 changes: 22 additions & 0 deletions test/ut3_user/expectations/test_expectations_cursor.pkb
Expand Up @@ -82,6 +82,28 @@ create or replace package body test_expectations_cursor is
ut3.ut.reset_nls;
end;

procedure success_on_same_data_float
as
l_expected sys_refcursor;
l_actual sys_refcursor;
begin
-- Arrange
ut3.ut.set_nls;
open l_expected for
select cast(3.14 as binary_double) as pi_double,
cast(3.14 as binary_float) as pi_float
from dual;
open l_actual for
select cast(3.14 as binary_double) as pi_double,
cast(3.14 as binary_float) as pi_float
from dual;
--Act
ut3.ut.expect( l_actual ).to_equal( l_expected );
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
ut3.ut.reset_nls;
end;

procedure success_on_empty
as
l_expected sys_refcursor;
Expand Down
3 changes: 3 additions & 0 deletions test/ut3_user/expectations/test_expectations_cursor.pks
Expand Up @@ -17,6 +17,9 @@ create or replace package test_expectations_cursor is
--%test(Gives success for identical data)
procedure success_on_same_data;

--%test(Gives success for identical data with floats)
procedure success_on_same_data_float;

--%test(Gives success when both cursors are empty)
procedure success_on_empty;

Expand Down

0 comments on commit ce54eff

Please sign in to comment.