Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce54eff

Browse files
authored
Merge pull request #898 from opendba/develop
fix/ORA-00907 when comparing ref cursors with BINARY_... columns
2 parents 67be0f4 + 6538063 commit ce54eff

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ create or replace package body ut_compound_data_helper is
231231
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('DATE','TIMESTAMP','TIMESTAMP WITH TIME ZONE',
232232
'TIMESTAMP WITH LOCAL TIME ZONE') then
233233
l_col_type := 'VARCHAR2(50)';
234-
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('INTERVAL DAY TO SECOND','INTERVAL YEAR TO MONTH') then
234+
elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type in ('INTERVAL DAY TO SECOND',
235+
'INTERVAL YEAR TO MONTH', 'BINARY_FLOAT', 'BINARY_DOUBLE') then
235236
l_col_type := a_data_info.column_type;
236237
else
237238
l_col_type := a_data_info.column_type

test/ut3_user/expectations/test_expectations_cursor.pkb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,28 @@ create or replace package body test_expectations_cursor is
8282
ut3.ut.reset_nls;
8383
end;
8484

85+
procedure success_on_same_data_float
86+
as
87+
l_expected sys_refcursor;
88+
l_actual sys_refcursor;
89+
begin
90+
-- Arrange
91+
ut3.ut.set_nls;
92+
open l_expected for
93+
select cast(3.14 as binary_double) as pi_double,
94+
cast(3.14 as binary_float) as pi_float
95+
from dual;
96+
open l_actual for
97+
select cast(3.14 as binary_double) as pi_double,
98+
cast(3.14 as binary_float) as pi_float
99+
from dual;
100+
--Act
101+
ut3.ut.expect( l_actual ).to_equal( l_expected );
102+
--Assert
103+
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
104+
ut3.ut.reset_nls;
105+
end;
106+
85107
procedure success_on_empty
86108
as
87109
l_expected sys_refcursor;

test/ut3_user/expectations/test_expectations_cursor.pks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ create or replace package test_expectations_cursor is
1717
--%test(Gives success for identical data)
1818
procedure success_on_same_data;
1919

20+
--%test(Gives success for identical data with floats)
21+
procedure success_on_same_data_float;
22+
2023
--%test(Gives success when both cursors are empty)
2124
procedure success_on_empty;
2225

0 commit comments

Comments
 (0)