Changeset: a2fb7cee717e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2fb7cee717e
Modified Files:
gdk/gdk_align.c
gdk/gdk_select.c
Branch: default
Log Message:
Fix property setting.
When creating a view that only consists of part of a column, we can't
be sure that the nils in the parent are also in the view, so we must
clear the nil property.
When selecting, we know that the result doesn't contain any nils,
unless we specifically selected the nils.
diffs (33 lines):
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -291,6 +291,10 @@ VIEWcreate_(BAT *h, BAT *t, int slice_vi
bn->U->capacity = t->U->capacity;
if (t->U->first > 0)
bn->T->heap.base += t->U->first * t->T->width;
+ if (bn->U->count < t->U->count) {
+ /* we can't be sure anymore there are nils */
+ bn->T->nil = 0;
+ }
}
if (hp)
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -672,6 +672,15 @@ BAT_select_(BAT *b, const void *tl, cons
BBPunfix(bn1->batCacheid);
bn1 = NULL;
}
+ if (th == NULL && !anti && BATcount(bn) > 0 &&
+ ATOMcmp(b->ttype, tl, ATOMnilptr(b->ttype)) == 0) {
+ /* this was the only way to get nils, so we
+ * have nils if there are any values at all */
+ bn->T->nil = 1;
+ } else {
+ /* we can't have nils */
+ bn->T->nonil = 1;
+ }
} else {
/* we want to return a [any_1,nil] BAT */
if (map) {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list