Changeset: 7340349a9416 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7340349a9416
Modified Files:
gdk/gdk_batop.c
Branch: Feb2013
Log Message:
BATmergecand(): back-ported changesets 7627cd8f6c2f dc1bc740fbf8 8dc547a39b12,
i.e., handling empty input BATs
diffs (18 lines):
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -2232,7 +2232,13 @@ BATmergecand(BAT *a, BAT *b)
assert(a->T->nonil);
assert(b->T->nonil);
- /* XXX we could return a if b is empty (and v.v.) */
+ /* we can return a if b is empty (and v.v.) */
+ if ( BATcount(a) == 0){
+ return BATcopy(b, b->htype, b->ttype, 0);
+ }
+ if ( BATcount(b) == 0){
+ return BATcopy(a, a->htype, a->ttype, 0);
+ }
bn = BATnew(TYPE_void, TYPE_oid, BATcount(a) + BATcount(b));
if (bn == NULL)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list