Skip to content
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

fix/ORA-00907 when comparing ref cursors with BINARY_... columns #898

Merged
merged 4 commits into from Apr 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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