Changeset: f61eff359100 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f61eff359100 Added Files: monetdb5/optimizer/Tests/factory01.malC Modified Files: sql/backends/monet5/Tests/cfunction00.sql Branch: trails Log Message:
A simple factory test This seems not to use the alias optimizer properly diffs (76 lines): diff --git a/monetdb5/optimizer/Tests/factory01.malC b/monetdb5/optimizer/Tests/factory01.malC new file mode 100644 --- /dev/null +++ b/monetdb5/optimizer/Tests/factory01.malC @@ -0,0 +1,51 @@ +factory user.factory06(Aparam:int):int; + X_3 := Aparam; + yield factory06:int := X_3; + X_4 := Aparam; + X_5 := calc.lng(X_4); + X_8:lng := calc.+(X_5, 1:lng); + X_9 := calc.int(X_8); + Aparam:int := X_9; + X_10 := Aparam; + yield factory06:int := X_10; + X_11 := Aparam; + X_12 := calc.lng(X_11); + X_14:lng := calc.+(X_12, 1:lng); + X_15 := calc.int(X_14); + Aparam:int := X_15; + yield factory06:int := Aparam; + return factory06:int; +end user.factory06; + +i:= factory06(1); +io.print(i); +j:= factory06(1); +io.print(j); +k:= factory06(1); +io.print(k); + +factory user.factory06a(Aparam:int):int; + yield factory06a:int := Aparam; + X_5 := calc.lng(Aparam); + X_8:lng := calc.+(X_5, 1:lng); + X_9 := calc.int(X_8); + Aparam:int := X_9; + yield factory06a:int := Aparam; + X_12 := calc.lng(Aparam); + X_14:lng := calc.+(X_12, 1:lng); + X_15 := calc.int(X_14); + Aparam:int := X_15; + yield factory06a:int := Aparam; + return factory06a:int := Aparam; +end user.factory06a; + +i:= factory06a(1); +io.print(i); +j:= factory06a(1); +io.print(j); +k:= factory06a(1); +io.print(k); + +mdb.List("user","factory06"); +optimizer.aliases("user","factory06"); +mdb.List("user","factory06"); diff --git a/sql/backends/monet5/Tests/cfunction00.sql b/sql/backends/monet5/Tests/cfunction00.sql --- a/sql/backends/monet5/Tests/cfunction00.sql +++ b/sql/backends/monet5/Tests/cfunction00.sql @@ -6,7 +6,7 @@ begin while (true) do set s = s + 1; - return s ; --yield s; + yield s; end while; return s; END; @@ -15,6 +15,7 @@ select * from functions where name ='agg -- to call a continuous function in the scheduler, we must pass the keyword "function" explicitly start continuous function aggr00(); +call cquery.wait(1000); #give it time to start select aggr00(); #should return 1 select aggr00(); #should return 2 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list