Skip to content

Commit 035bb67

Browse files
committed
pl/isql language that support function and procedure.
refine the comments.
1 parent 5ea6eab commit 035bb67

14 files changed

Lines changed: 421 additions & 438 deletions

‎src/pl/plisql/src/expected/plisql_nested_subproc.out‎

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ INFO: 529
204204
--print we are in main function
205205
--res = 45 a square function assign 11
206206
--
207-
--there originial not like oracle
207+
--the originial not like oracle
208208
--for out argmuments
209209
do $$
210210
declare
@@ -447,7 +447,7 @@ begin
447447
end;$$ language plisql;
448448
INFO: 23
449449
INFO: xiexie
450-
-- test subproc function'argument has default value
450+
-- test that subproc function'argument has default value
451451
--test ok
452452
--print 529
453453
do $$
@@ -788,7 +788,7 @@ begin
788788
end; $$ language plisql;
789789
INFO: text mds2=abc
790790
INFO: 529
791-
---global variable the name as local variable
791+
---global variable has the name as local variable
792792
--test ok
793793
create or replace function test_subproc_func(a in out integer) returns integer AS
794794
$$
@@ -836,7 +836,7 @@ INFO: 101
836836

837837
drop function test_subproc_func(integer);
838838
set ivorysql.allow_out_parameter_const = false;
839-
--function the name as global variable
839+
--function has the name as global variable
840840
--test failed
841841
do $$
842842
declare
@@ -890,8 +890,8 @@ end; $$ language plisql;
890890
INFO: var=(1,101)
891891
INFO: var2 = (2,102)
892892
--ok
893-
--this because out parameter we have don't handle
894-
-- so it doesn't like oracle
893+
--this is because we don't handle out parameter,
894+
-- so it is not like oracle
895895
-- test out name=must be assign to null
896896
-- test_out.test_out name=must be assign to null
897897
-- name1= must be assign to null
@@ -929,7 +929,7 @@ INFO: test out name=must be assign to null
929929
INFO: test_out.test_out name=must be assign to null
930930
INFO: name1=must be assign to null
931931
INFO: declare name=must be assign to null
932-
---schema function and subproc function as the same name
932+
---schema function and subproc function has the same name
933933
create or replace function test_subproc(id integer) returns integer
934934
AS $$
935935
declare
@@ -990,7 +990,7 @@ drop function test_subproc(integer);
990990
---subproc function return object_type
991991
create type test_subproc_type as (id integer,name varchar(23));
992992
--test ok
993-
--print var1=(23, "a object type")
993+
--print var1=(23, "an object type")
994994
do $$
995995
declare
996996
var1 test_subproc_type;
@@ -1000,16 +1000,16 @@ declare
10001000
var1 test_subproc_type;
10011001
begin
10021002
var1.id := 23;
1003-
var1.name := 'a object type';
1003+
var1.name := 'an object type';
10041004
return var1;
10051005
end;
10061006
begin
10071007
var1 := test_subproc(23);
10081008
raise info 'var1=%', var1;
10091009
end;$$ language plisql;
1010-
INFO: var1=(23,"a object type")
1010+
INFO: var1=(23,"an object type")
10111011
--print id = (1, "welcome to beiing")
1012-
--print var1=(23, "a object type")
1012+
--print var1=(23, "an object type")
10131013
do $$
10141014
declare
10151015
var1 test_subproc_type;
@@ -1019,7 +1019,7 @@ declare
10191019
var1 test_subproc_type;
10201020
begin
10211021
var1.id := 23;
1022-
var1.name := 'a object type';
1022+
var1.name := 'an object type';
10231023
raise info 'id = %',id;
10241024
return var1;
10251025
end;
@@ -1030,7 +1030,7 @@ BEGIN
10301030
raise info 'var1=%', var1;
10311031
end;$$ language plisql;
10321032
INFO: id = (1,"welcome to beiing")
1033-
INFO: var1=(23,"a object type")
1033+
INFO: var1=(23,"an object type")
10341034
drop type test_subproc_type;
10351035
--test function and procedure properties
10361036
--test ok
@@ -1967,7 +1967,7 @@ end; $$ language plisql;
19671967
ERROR: duplicate declaration at or near ";"
19681968
LINE 4: procedure mds(id integer);
19691969
^
1970-
--only declare but no define raise error
1970+
--only declare but no definition, raise error
19711971
do $$
19721972
DECLARE
19731973
var1 integer;
@@ -1989,7 +1989,7 @@ end; $$ language plisql;
19891989
ERROR: A subprogram body must be defined for the forward declaration of mds
19901990
LINE 4: function mds(id integer) return integer;
19911991
^
1992-
--define before declare faield
1992+
--define before declare failed
19931993
do $$
19941994
declare
19951995
function mds(id integer) return integer IS
@@ -2104,9 +2104,9 @@ INFO: proc3
21042104
INFO: proc3 out 2
21052105
--
21062106
--
2107-
-- subproc function support polymorphic type
2107+
-- subproc function supports polymorphic type
21082108
--
2109-
--point raise error others is ok
2109+
--point raise error, others is ok
21102110
do $$
21112111
DECLARE
21122112
var1 integer;
@@ -2368,8 +2368,7 @@ BEGIN
23682368
raise info '%,%',duplic(int4range(42,49), NULL,NULL),duplic(int4range('23', '45'), NULL,NULL);
23692369
end; $$ language plisql;
23702370
INFO: (42,"{42,49}"),(23,"{23,45}")
2371-
--test extral
2372-
--error test_f is is out of scope
2371+
--error test_f is out of scope
23732372
do $$
23742373
declare
23752374
var1 integer;
@@ -2506,7 +2505,7 @@ begin
25062505
end; $$ language plisql;
25072506
INFO: var1=23
25082507
INFO: var1 = 24
2509-
--oracle raise error,but we success
2508+
--oracle raise error,but we succeed
25102509
do $$
25112510
declare
25122511
var1 integer;
@@ -2531,7 +2530,7 @@ declare
25312530
begin
25322531
var1 := test_f(23);
25332532
end; $$ language plisql;
2534-
--oracle raiser error,but we sucess
2533+
--oracle raiser error,but we succeed
25352534
create or replace function test_f(id integer) returns integer as
25362535
$$
25372536
declare
@@ -2735,7 +2734,7 @@ declare
27352734
begin
27362735
var1 := test_f();
27372736
end;$$ language plisql;
2738-
--dynamic include subproc function ok var1=25
2737+
--dynamically include subproc function ok var1=25
27392738
do $$
27402739
declare
27412740
var1 integer;
@@ -2898,7 +2897,7 @@ end; $$ language plisql;
28982897
ERROR: Only schema-level programs allow AUTHID at or near "definer"
28992898
LINE 4: procedure test_p(id integer) authid definer;
29002899
^
2901-
--oracle failed, but we sucess
2900+
--oracle failed, but we succeed
29022901
do $$
29032902
declare
29042903
var1 integer;
@@ -2951,7 +2950,7 @@ LINE 1: var1 := test_proc1(23)
29512950
HINT: To call a procedure, use CALL.
29522951
QUERY: var1 := test_proc1(23)
29532952
CONTEXT: PL/iSQL function inline_code_block line 11 at assignment
2954-
--surcess
2953+
--success
29552954
do $$
29562955
declare
29572956
var1 integer;
@@ -2985,7 +2984,7 @@ LINE 1: CALL test_func1(var1)
29852984
HINT: To call a function, use SELECT.
29862985
QUERY: CALL test_func1(var1)
29872986
CONTEXT: PL/iSQL function inline_code_block line 9 at CALL
2988-
--sucess
2987+
--success
29892988
do $$
29902989
declare
29912990
var1 integer;
@@ -3027,7 +3026,7 @@ declare
30273026
BEGIN
30283027
trigger := 1;
30293028
end; $$ language plisql;
3030-
--oracle failed,but we sucess
3029+
--oracle failed,but we succeed
30313030
do $$
30323031
DECLARE
30333032
type integer;
@@ -3049,7 +3048,7 @@ begin
30493048
end; $$ language plisql;
30503049
INFO: test_f
30513050
INFO: test_f
3052-
--oracle failed,but we success
3051+
--oracle failed,but we succeed
30533052
do $$
30543053
declare
30553054
var1 integer;
@@ -3232,7 +3231,6 @@ INFO: test_event_trigger: ddl_command_start CREATE TABLE
32323231
DROP event TRIGGER regress_event_trigger;
32333232
DROP FUNCTION test_event_trigger();
32343233
drop table test_subproc_system;
3235-
--requite documents example
32363234
--ok and print test_subprocproc and test_linefunc
32373235
do $$
32383236
declare
@@ -3705,7 +3703,7 @@ declare
37053703
end; $$ language plisql;
37063704
INFO: 24
37073705
INFO: 25.1
3708-
--oracle raise error,but we sucess
3706+
--oracle raise error,but we succeed
37093707
CREATE TABLE mds(id integer,name varchar2(256));
37103708
ERROR: relation "mds" already exists
37113709
do $$

0 commit comments

Comments
 (0)