Changeset: 4088dd5099a6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4088dd5099a6
Modified Files:
        monetdb5/extras/rapi/Tests/All
        monetdb5/extras/rapi/rapi.c
        sql/backends/monet5/Tests/All
        sql/backends/monet5/Tests/rapi14.sql
Branch: default
Log Message:

R Integration: Fail without crashing on projections without parameters


diffs (51 lines):

diff --git a/monetdb5/extras/rapi/Tests/All b/monetdb5/extras/rapi/Tests/All
--- a/monetdb5/extras/rapi/Tests/All
+++ b/monetdb5/extras/rapi/Tests/All
@@ -7,3 +7,4 @@ HAVE_LIBR?rapi05
 HAVE_LIBR?rapi06
 HAVE_LIBR?rapi07
 HAVE_LIBR?rapi08
+HAVE_LIBR?rapi09
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -615,6 +615,12 @@ str RAPIeval(Client cntxt, MalBlkPtr mb,
        for (i = 0; i < pci->retc; i++) {
                SEXP ret_col = VECTOR_ELT(retval, i);
                int bat_type = ATOMstorage(getColumnType(getArgType(mb,pci,i)));
+               if (bat_type == TYPE_any || bat_type == TYPE_void) {
+                       getArgType(mb,pci,i) = bat_type;
+                       msg = createException(MAL, "rapi.eval",
+                                                                         
"Unknown return value, possibly projecting with no parameters.");
+                       goto wrapup;
+               }
                cnt = (BUN) ret_rows;
 
                // hand over the vector into a BAT
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -12,6 +12,8 @@ HAVE_LIBR?rapi07
 HAVE_LIBR?rapi09
 HAVE_LIBR?rapi10
 HAVE_LIBR?rapi12
+HAVE_LIBR?rapi13
+HAVE_LIBR?rapi14
 
 # should this work?
 #inlineUDF
diff --git a/sql/backends/monet5/Tests/rapi14.sql 
b/sql/backends/monet5/Tests/rapi14.sql
--- a/sql/backends/monet5/Tests/rapi14.sql
+++ b/sql/backends/monet5/Tests/rapi14.sql
@@ -10,8 +10,9 @@ language R
 };
 
 SELECT rapi14() FROM dval;
-DROP FUNCTION rapi14;
-DROP TABLE dval;
+
+--DROP FUNCTION rapi14;
+--DROP TABLE dval;
 
 ROLLBACK;
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to