Changeset: 6badcf38b0ec for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6badcf38b0ec
Modified Files:
        monetdb5/modules/mal/tablet.c
Branch: nested
Log Message:

handle empty multisets


diffs (20 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -419,7 +419,7 @@ output_multiset_sorted(char **buf, size_
        int *idp = (int*)Tloc(msid->c, pos);
        int first = 1;
 
-       if (msid->p) {
+       if (id >= 0 && msid->p) {
                while (pos > 0 && idp[-1] >= id) {
                        idp--;
                        pos--;
@@ -431,6 +431,7 @@ output_multiset_sorted(char **buf, size_
                (*buf)[fill++] = '\'';
        (*buf)[fill++] = '{';
        (*buf)[fill] = 0;
+       if (id >= 0)
        for (; *idp == id && fill > 0; idp++, msid->p++, pos++) {
                if (!first)
                        (*buf)[fill++] = ',';
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to