Changeset: 3dba7fdc2658 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3dba7fdc2658 Modified Files: gdk/gdk_join.c Branch: default Log Message:
Check for max_one setting before adding a result. This prevents a crash in case the input does have multiple matches. diffs (34 lines): diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c --- a/gdk/gdk_join.c +++ b/gdk/gdk_join.c @@ -2380,6 +2380,10 @@ mergejoin(BAT **r1p, BAT **r2p, BAT *l, #define HASHLOOPBODY() \ do { \ + if (nr > 1 && max_one) { \ + GDKerror("more than one match"); \ + goto bailout; \ + } \ if (maybeextend(r1, r2, 1, lci->next, lci->ncand, maxsize) != GDK_SUCCEED) \ goto bailout; \ APPEND(r1, lo); \ @@ -2482,9 +2486,6 @@ mergejoin(BAT **r1p, BAT **r2p, BAT *l, } else { \ lskipped = BATcount(r1) > 0; \ } \ - } else if (nr > 1 && max_one) { \ - GDKerror("more than one match"); \ - goto bailout; \ } else if (only_misses) { \ lskipped = BATcount(r1) > 0; \ } else { \ @@ -2764,9 +2765,6 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B } else { lskipped = BATcount(r1) > 0; } - } else if (nr > 1 && max_one) { - GDKerror("more than one match"); - goto bailout; } else if (only_misses) { lskipped = BATcount(r1) > 0; } else { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list