Changeset: 5a1883841229 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a1883841229
Modified Files:
common/stream/stream.h
sql/backends/monet5/Tests/cfunction00.sql
sql/backends/monet5/Tests/cfunction01.sql
sql/backends/monet5/sql_cquery.c
Branch: trails
Log Message:
Another Windows compilation fix.
diffs (79 lines):
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -171,7 +171,7 @@ stream_export stream *append_wstream(con
stream_export stream *open_rastream(const char *filename);
/* open any file with any mode */
-stream *open_rastream_and_create(const char *filename);
+stream_export stream *open_rastream_and_create(const char *filename);
/* open in ascii stream in write mode*/
stream_export stream *open_wastream(const char *filename);
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
@@ -12,12 +12,13 @@ begin
END;
select * from functions where name ='aggr00';
--- a continuous procedure can be called like any other procedure
-start continuous aggr00();
+-- to call a continuous function in the scheduler, we must pass the keyword
"function" explicitly
+start continuous function aggr00();
select aggr00(); #should return 1
select aggr00(); #should return 2
+stop continuous function aggr00();
drop function aggr00;
--factory factories.aggr00():int; #[0] (0) 0
diff --git a/sql/backends/monet5/Tests/cfunction01.sql
b/sql/backends/monet5/Tests/cfunction01.sql
--- a/sql/backends/monet5/Tests/cfunction01.sql
+++ b/sql/backends/monet5/Tests/cfunction01.sql
@@ -18,7 +18,7 @@ select * from functions where name ='agg
-- a continuous function can be called used like any other function?
select aggr01(); -- causes error
-start continuous aggr01();
+start continuous function aggr01();
insert into ftmp values(1),(1);
select aggr01(); #should return 2
@@ -32,6 +32,6 @@ select aggr01(); #should return 6
call cquery.wait(1000);
select aggr01(); #should return 6
-stop continuous aggr01();
+stop continuous function aggr01();
drop function aggr01;
drop table ftmp;
diff --git a/sql/backends/monet5/sql_cquery.c b/sql/backends/monet5/sql_cquery.c
--- a/sql/backends/monet5/sql_cquery.c
+++ b/sql/backends/monet5/sql_cquery.c
@@ -476,7 +476,8 @@ CQregister(Client cntxt, MalBlkPtr mb, M
CQnode *pnew;
mvc* sqlcontext = ((backend *) cntxt->sqlcontext)->mvc;
char* err_message = (sqlcontext && sqlcontext->continuous &
mod_continuous_function) ? "function" : "procedure";
- int i, j, cycles = sqlcontext ? sqlcontext->cycles : DEFAULT_CP_CYCLES;
+ int i, j, cycles = sqlcontext ? sqlcontext->cycles : DEFAULT_CP_CYCLES,
+ is_function = strcmp(err_message, "function") == 0;
lng heartbeats = sqlcontext ? sqlcontext->heartbeats :
DEFAULT_CP_HEARTBEAT;
(void) pci;
@@ -490,6 +491,14 @@ CQregister(Client cntxt, MalBlkPtr mb, M
goto finish;
}
+ /*if(is_function) {
+ q = newStmt(mb, userRef, cq->name);
+ if (!q) {
+ msg =
createException(SQL,"cquery.register",SQLSTATE(HY001) MAL_MALLOC_FAIL);
+ goto finish;
+ }
+ }*/
+
/* extract the actual procedure call and check for duplicate*/
for(i = 1; i< mb->stop; i++){
sig= getInstrPtr(mb,i);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list