Changeset: adb26456c0e2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=adb26456c0e2
Modified Files:
sql/backends/monet5/UDF/udf.c
Branch: default
Log Message:
Make the example headless
diffs (35 lines):
diff --git a/sql/backends/monet5/UDF/udf.c b/sql/backends/monet5/UDF/udf.c
--- a/sql/backends/monet5/UDF/udf.c
+++ b/sql/backends/monet5/UDF/udf.c
@@ -86,8 +86,8 @@ UDFBATreverse_(BAT **ret, BAT *src)
"tail-type of input BAT must be TYPE_str");
}
- /* allocate result BAT */
- bn = BATnew(src->htype, TYPE_str, BATcount(src), TRANSIENT);
+ /* allocate void-headed result BAT */
+ bn = BATnew(TYPE_void, TYPE_str, BATcount(src), TRANSIENT);
if (bn == NULL) {
throw(MAL, "batudf.reverse", MAL_MALLOC_FAIL);
}
@@ -100,8 +100,6 @@ UDFBATreverse_(BAT **ret, BAT *src)
BATloop(src, p, q) {
char *tr = NULL, *err = NULL;
- /* get original head & tail value */
- ptr h = BUNhead(li, p);
const char *t = (const char *) BUNtail(li, p);
/* revert tail value */
@@ -115,9 +113,8 @@ UDFBATreverse_(BAT **ret, BAT *src)
/* assert logical sanity */
assert(tr != NULL);
- /* insert original head and reversed tail in result BAT */
- /* BUNins() takes care of all necessary administration */
- BUNins(bn, h, tr, FALSE);
+ /* append reversed tail in result BAT */
+ BUNappend(bn, tr, FALSE);
/* free memory allocated in UDFreverse_() */
GDKfree(tr);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list