mirror of
https://github.com/sasjs/core.git
synced 2026-01-09 18:30:06 +00:00
fix: closes #329 by handling the case of unlocking a table that was never locked in mp_lockanytable.sas, also created a corresponding test plus an extra test to check for scope leakage. all.sas was regenerated.
This commit is contained in:
9
all.sas
9
all.sas
@@ -2914,7 +2914,7 @@ run;
|
|||||||
results. If it does not exist, it will be created, with the following format:
|
results. If it does not exist, it will be created, with the following format:
|
||||||
|TEST_DESCRIPTION:$256|TEST_RESULT:$4|TEST_COMMENTS:$256|
|
|TEST_DESCRIPTION:$256|TEST_RESULT:$4|TEST_COMMENTS:$256|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|User Provided description|PASS|Column &inds contained ALL columns|
|
|User Provided description|PASS|Dataset &inds contained ALL columns|
|
||||||
|
|
||||||
@version 9.2
|
@version 9.2
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@@ -2988,7 +2988,7 @@ run;
|
|||||||
results. If it does not exist, it will be created, with the following format:
|
results. If it does not exist, it will be created, with the following format:
|
||||||
|TEST_DESCRIPTION:$256|TEST_RESULT:$4|TEST_COMMENTS:$256|
|
|TEST_DESCRIPTION:$256|TEST_RESULT:$4|TEST_COMMENTS:$256|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|User Provided description|PASS|Column &inds contained ALL columns|
|
|User Provided description|PASS|Dataset &inds contained ALL columns|
|
||||||
|
|
||||||
|
|
||||||
<h4> Related Macros </h4>
|
<h4> Related Macros </h4>
|
||||||
@@ -10484,7 +10484,10 @@ run;
|
|||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
quit;
|
quit;
|
||||||
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
||||||
%if &status=LOCKED %then %do;
|
%if &sqlobs=0 %then %do;
|
||||||
|
%put %str(WAR)NING: &lib..&ds has never been locked!;
|
||||||
|
%end;
|
||||||
|
%else %if &status=LOCKED %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
putlog "&sysmacroname: unlocking &lib..&ds:";
|
putlog "&sysmacroname: unlocking &lib..&ds:";
|
||||||
run;
|
run;
|
||||||
|
|||||||
@@ -200,7 +200,10 @@ run;
|
|||||||
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
where LOCK_LIB ="&lib" and LOCK_DS="&ds";
|
||||||
quit;
|
quit;
|
||||||
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
%if &syscc>0 %then %put syscc=&syscc sqlrc=&sqlrc;
|
||||||
%if &status=LOCKED %then %do;
|
%if &sqlobs=0 %then %do;
|
||||||
|
%put %str(WAR)NING: &lib..&ds has never been locked!;
|
||||||
|
%end;
|
||||||
|
%else %if &status=LOCKED %then %do;
|
||||||
data _null_;
|
data _null_;
|
||||||
putlog "&sysmacroname: unlocking &lib..&ds:";
|
putlog "&sysmacroname: unlocking &lib..&ds:";
|
||||||
run;
|
run;
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
<h4> SAS Macros </h4>
|
<h4> SAS Macros </h4>
|
||||||
@li mp_lockanytable.sas
|
@li mp_lockanytable.sas
|
||||||
|
@li mp_assert.sas
|
||||||
@li mp_assertcols.sas
|
@li mp_assertcols.sas
|
||||||
@li mp_assertcolvals.sas
|
@li mp_assertcolvals.sas
|
||||||
|
@li mp_assertscope.sas
|
||||||
@li mp_coretable.sas
|
@li mp_coretable.sas
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@@ -61,3 +63,18 @@ run;
|
|||||||
desc=Ref is captured in unlock,
|
desc=Ref is captured in unlock,
|
||||||
test=ANYVAL
|
test=ANYVAL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/* attempt unlock of a table that was never locked */
|
||||||
|
|
||||||
|
%mp_lockanytable(UNLOCK,lib=no,ds=doesnotexist,ref=bye, ctl_ds=work.controller)
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(&syscc=0),
|
||||||
|
desc=Ability to unlock a table that was never locked,
|
||||||
|
outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
|
/* test for macro variable scope leakage */
|
||||||
|
%mp_assertscope(SNAPSHOT)
|
||||||
|
%mp_lockanytable(LOCK,lib=tmp,ds=testscope,ref=This Ref, ctl_ds=work.controller)
|
||||||
|
%mp_assertscope(COMPARE)
|
||||||
|
|||||||
Reference in New Issue
Block a user