Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature/1042 add and to tags #1250

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

Merged
merged 35 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0daab33
Checkpoint
lwasylow Mar 28, 2023
adbc76e
Address too long identified in 11g.
lwasylow Mar 28, 2023
1478b0d
Adding validation for tag expression
lwasylow Mar 29, 2023
b5ad747
Comment out to see why its failing.
lwasylow Mar 29, 2023
06cb054
Revert "Comment out to see why its failing."
lwasylow Mar 29, 2023
e87d39f
Adding validate function, with no calls
lwasylow Mar 29, 2023
97537de
Remove a & from text
lwasylow Mar 29, 2023
2a0f99a
Extra changes and added tests
lwasylow Mar 31, 2023
5b46140
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Mar 31, 2023
b30688c
Address sonar coverage issues.
lwasylow Apr 1, 2023
0c41a0f
Adding tests covering exception of invalid tags
lwasylow Apr 1, 2023
543685d
Removing that , we will not implement that, there is no benefit at th…
lwasylow Apr 1, 2023
0d3cfa1
Removing force
lwasylow Apr 1, 2023
20e3177
Changing to use Dijkstra algorithm to parse infix notation into postf…
lwasylow Apr 10, 2023
f51cc99
Missing slash at end of type
lwasylow Apr 10, 2023
4b8e2ab
Cleanup.
lwasylow Apr 10, 2023
84e8684
Update tests after removed function
lwasylow Apr 10, 2023
2e7a766
Tidy up tests
lwasylow Apr 10, 2023
cbdf83a
Added ut_stack to uninstall
lwasylow Apr 10, 2023
436eb5b
Addressing test failures and sonar smells
lwasylow Apr 11, 2023
3d77514
Update name
lwasylow Apr 11, 2023
bf6959f
Update tests and code
lwasylow Apr 11, 2023
d8233ff
fixing typo in docs
lwasylow Apr 12, 2023
bd860f6
Removed unused variable
lwasylow Apr 12, 2023
313d5e9
Stage 1 Resolving PR comments
lwasylow Apr 13, 2023
02a071c
Separate tag logic.
lwasylow Apr 13, 2023
b8b66ee
Fix uninstall
lwasylow Apr 14, 2023
077fdb1
Various PR fixe
lwasylow Apr 14, 2023
01e5364
Update tests and code
lwasylow Apr 15, 2023
dc0b4a6
Addressing changes via PR review.
lwasylow Apr 18, 2023
ef1c02b
Update docs
lwasylow Apr 18, 2023
1551ea5
Adding any and none
lwasylow Apr 25, 2023
9dee7e0
Update docs
lwasylow Apr 26, 2023
beb9a3a
Resolving PR
lwasylow Apr 27, 2023
46ffe73
Update note
lwasylow Apr 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding validate function, with no calls
  • Loading branch information
lwasylow committed Mar 29, 2023
commit e87d39f992da9ff7fdb0cb2b653f6fc0380c6def
61 changes: 61 additions & 0 deletions 61 source/core/ut_utils.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,67 @@ create or replace package body ut_utils is
return l_result;
end;

function valid_tag_expression(a_tags in varchar2) return number is
t_left_side ut_varchar2_list := ut_varchar2_list('|','&',',');
t_right_side ut_varchar2_list := ut_varchar2_list('!','-');
l_left_side_expression varchar2(100) := '[|&,]';
l_left_side_regex varchar(400) := '([^|&,]*)[|&,](.*)';
l_left_side varchar2(4000);

l_rigth_side_expression varchar2(100) := '[!-]';
l_right_side_regex varchar(400) := '([!-])([^!-].*)';
l_right_side varchar2(4000);

l_tags varchar2(4000) := a_tags;
l_result number :=1;
begin
--Validate that we have closed up all brackets
if regexp_count(l_tags,'\(') <> regexp_count(l_tags,'\)') then
l_result := 0;
end if;

--Remove brackets as we dont evaluate expression only validate.
l_tags := replace(replace(l_tags,'('),')');

--Check if there are any left side operators for first in order from left to right
if regexp_count(l_tags,l_left_side_expression) > 0 then
--Extract left part of operator and remaining of string to right
l_left_side := regexp_replace(l_tags,l_left_side_regex,'\1');
l_right_side := regexp_replace(l_tags,l_left_side_regex,'\2');

--If left side is null that means that we used left side operator without
-- left and right e.g. &test
if l_left_side is null then
l_result := 0;
else
--Extract right side from left side expression if there is any !-
--Remove first negation tag to see if there is double negation
l_left_side := regexp_replace(l_left_side,l_right_side_regex,'\2');
end if;


--check that on right side there is no extra negation
if regexp_count(l_left_side,l_rigth_side_expression) > 0 then
l_result := 0;
end if;

--Now process right side of string
if l_right_side is not null then
l_result := least(l_result,valid_tag_expression(l_right_side));
else
l_result := 0;
end if;
else
--We just process single tag.
l_left_side := l_tags;
l_left_side := regexp_replace(l_left_side,l_right_side_regex,'\2');
if regexp_count(l_left_side,l_rigth_side_expression) > 0 then
l_result := 0;
end if;
end if;

return l_result;
end;

end ut_utils;
/
7 changes: 6 additions & 1 deletion 7 source/core/ut_utils.pks
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ create or replace package ut_utils authid definer is
* Return value of interval in plain english
*/
function interval_to_text(a_interval yminterval_unconstrained) return varchar2;


/*
* Return number 1 or 0 if the list of tags is valid expression
*/
function valid_tag_expression(a_tags in varchar2) return number;

end ut_utils;
/
Morty Proxy This is a proxified and sanitized view of the page, visit original site.