From 4643b14a80bf1788bb5e990484efe50901980e7d Mon Sep 17 00:00:00 2001 From: Philipp Salvisberg Date: Tue, 2 Apr 2019 11:46:50 +0200 Subject: [PATCH 1/2] document how to avoid Oracle Bug 14402514 (see #891) --- docs/userguide/expectations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/userguide/expectations.md b/docs/userguide/expectations.md index a459454f2..5b8a3b08f 100644 --- a/docs/userguide/expectations.md +++ b/docs/userguide/expectations.md @@ -272,7 +272,9 @@ begin end; ``` -Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142) +Parameters `a_mask` and `a_escape_char` represent valid parameters of the [Oracle LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142). + +If you use Oracle Database version 11.2.0.4, you may run into Oracle Bug 14402514: WRONG RESULTS WITH LIKE ON CLOB USING ESCAPE CHARACTER. In this case we recommend to use `match` instead of `be_like`. ## be_not_null From 675ba70f05ebd9ff367f85d6a27bf9459a628130 Mon Sep 17 00:00:00 2001 From: Philipp Salvisberg Date: Tue, 2 Apr 2019 11:49:33 +0200 Subject: [PATCH 2/2] Fixes #891 - use to_match instead of to_be_like to avoid Oracle bug 14402514 on some 11.2.0.4 instances --- test/core/test_suite_builder.pkb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/core/test_suite_builder.pkb b/test/core/test_suite_builder.pkb index bd76e88d8..e6d21d969 100644 --- a/test/core/test_suite_builder.pkb +++ b/test/core/test_suite_builder.pkb @@ -608,11 +608,11 @@ create or replace package body test_suite_builder is --Act l_actual := invoke_builder_for_annotations(l_annotations, 'SOME_PACKAGE'); --Assert - ut.expect(l_actual).to_be_like('%%Annotation "--\%beforeall"%line 2%%', '\'); - ut.expect(l_actual).to_be_like('%%Annotation "--\%beforeeach"%line 3%%', '\'); - ut.expect(l_actual).to_be_like('%%Annotation "--\%aftereach"%line 4%%', '\'); - ut.expect(l_actual).to_be_like('%%Annotation "--\%afterall" cannot be used with "--\%test". Annotation ignored.' - ||'%at "UT3_TESTER.SOME_PACKAGE.DO_STUFF", line 5%%', '\'); + ut.expect(l_actual).to_match('(.*)()(.*)(Annotation "--%beforeall")(.*)(line 2)(.*)()(.*)', 'n'); + ut.expect(l_actual).to_match('(.*)()(.*)(Annotation "--%beforeeach")(.*)(line 3)(.*)()(.*)', 'n'); + ut.expect(l_actual).to_match('(.*)()(.*)(Annotation "--%aftereach")(.*)(line 4)(.*)()(.*)', 'n'); + ut.expect(l_actual).to_match('(.*)()(.*)(Annotation "--%afterall" cannot be used with "--%test". Annotation ignored.)' + ||'(.*)(at "UT3_TESTER.SOME_PACKAGE.DO_STUFF", line 5)(.*)()(.*)', 'n'); ut.expect(l_actual).not_to_be_like('%%'); ut.expect(l_actual).not_to_be_like('%%'); ut.expect(l_actual).not_to_be_like('%%'); @@ -1095,7 +1095,7 @@ create or replace package body test_suite_builder is --Act l_actual := invoke_builder_for_annotations(l_annotations, 'SOME_PACKAGE'); --Assert - ut.expect(l_actual).to_be_like('%Unsupported annotation "--\%bad_procedure_annotation". Annotation ignored.% line 2%', '\'); + ut.expect(l_actual).to_match('(.*)(Unsupported annotation "--%bad_procedure_annotation"\. Annotation ignored\.)(.*)( line 2)(.*)', 'n'); end; procedure test_bad_package_annotation is @@ -1111,7 +1111,7 @@ create or replace package body test_suite_builder is --Act l_actual := invoke_builder_for_annotations(l_annotations, 'SOME_PACKAGE'); --Assert - ut.expect(l_actual).to_be_like('%Unsupported annotation "--\%bad_package_annotation". Annotation ignored.% line 17%', '\'); + ut.expect(l_actual).to_match('(.*)(Unsupported annotation "--%bad_package_annotation"\. Annotation ignored\.)(.*)( line 17)(.*)', 'n'); end; end test_suite_builder;