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

Skip to content

Commit a517c65

Browse files
authored
Merge pull request #953 from utPLSQL/feature/bugfix_long_column_names
Added test to confirm that long column names are suported in 3.1.7
2 parents 0b02973 + 713e3aa commit a517c65

4 files changed

Lines changed: 49 additions & 4 deletions

File tree

.travis/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.2$ ]]; then
2424
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
2525
set feedback off
2626
set verify off
27+
whenever sqlerror exit failure rollback
2728
2829
@uninstall_all.sql $UT3_OWNER
2930
whenever sqlerror exit failure rollback

source/uninstall_objects.sql

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
set echo off
2+
set serverout on
3+
declare
4+
procedure drop_if_exists(a_object_type varchar2, a_object_name varchar2) is
5+
l_count integer;
6+
begin
7+
select count(1)
8+
into l_count
9+
from all_objects
10+
where owner = sys_context('USERENV','CURRENT_SCHEMA')
11+
and object_type = a_object_type
12+
and object_name = a_object_name;
13+
if l_count > 0 then
14+
execute immediate 'drop '||a_object_type||' '||a_object_name;
15+
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' dropped.');
16+
else
17+
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' was not dropped, '||lower(a_object_type)||' does not exist.');
18+
end if;
19+
end;
20+
begin
21+
drop_if_exists('TRIGGER', 'UT_TRIGGER_ANNOTATION_PARSING');
22+
drop_if_exists('SYNONYM','UT3_TRIGGER_ALIVE');
23+
end;
24+
/
125
set echo on
226

3-
drop trigger ut_trigger_annotation_parsing;
4-
5-
drop synonym ut3_trigger_alive;
6-
727
drop synonym be_between;
828

929
drop synonym have_count;

test/ut3_user/expectations/test_expectations_cursor.pkb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2843,5 +2843,26 @@ Check the query and data for errors.';
28432843
ut3.ut.expect(v_actual).to_equal(v_expected).exclude('ID');
28442844
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
28452845
end;
2846+
2847+
procedure compare_long_column_names is
2848+
l_actual sys_refcursor;
2849+
l_expected sys_refcursor;
2850+
begin
2851+
-- populate actual
2852+
$if dbms_db_version.version = 12 and dbms_db_version.release >= 2 or dbms_db_version.version > 12 $then
2853+
open l_actual for
2854+
select rownum as id, '1' some_column_with_a_pretty_long_enough_name from dual;
2855+
2856+
open l_expected for
2857+
select rownum as id, '1' some_column_with_a_pretty_long_enough_name from dual;
2858+
2859+
ut3.ut.expect(l_actual).to_equal(l_expected).include('ID,SOME_COLUMN_WITH_A_PRETTY_LONG_ENOUGH_NAME').join_by('ID');
2860+
--Assert
2861+
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
2862+
$else
2863+
null;
2864+
$end
2865+
end;
2866+
28462867
end;
28472868
/

test/ut3_user/expectations/test_expectations_cursor.pks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,5 +462,8 @@ create or replace package test_expectations_cursor is
462462
--%test( Mixed column order exclusion )
463463
procedure uc_columns_exclude;
464464

465+
--%test(Compares cursors with long column names - Issue #952 )
466+
procedure compare_long_column_names;
467+
465468
end;
466469
/

0 commit comments

Comments
 (0)