Changeset: bfe0e5050225 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bfe0e5050225
Modified Files:
gdk/gdk_bat.mx
Branch: Mar2011
Log Message:
Property setting fix.
Try this (in MIL):
var a := new(void,int).seqbase(0@0).append(1).append(2).append(3).revert();
a := a.append(2);
a.print();
a.info().find("tkey").print();
Without the fix, this would result in the last statement incorrectly
claiming that the tail column is "key". The print shows that it isn't
(two 2's).
diffs (35 lines):
diff --git a/gdk/gdk_bat.mx b/gdk/gdk_bat.mx
--- a/gdk/gdk_bat.mx
+++ b/gdk/gdk_bat.mx
@@ -1434,6 +1434,13 @@
}
}
}
+ if (b->tkey == TRUE && cmp <= 0) {
+ /* cmp==0: definitely not key,
+ * cmd<0: we don't know */
+ b->T->nokey[0] = i - 1;
+ b->T->nokey[1] = i;
+ b->tkey = bm->hkey = b->tdense = FALSE;
+ }
} else if (b->tsorted == (bit) GDK_SORTED_REV) {
ptr prv = BUNtail(bi, p - 1);
@@ -1442,8 +1449,15 @@
b->T->nosorted_rev = i;
b->tsorted = FALSE;
}
- }
- if (b->tkey == TRUE && cmp <= 0) {
+ if (b->tkey == TRUE && cmp >= 0) {
+ /* cmp==0: definitely not key,
+ * cmd>0: we don't know */
+ b->T->nokey[0] = i - 1;
+ b->T->nokey[1] = i;
+ b->tkey = bm->hkey = b->tdense = FALSE;
+ }
+ } else if (b->tkey == TRUE) {
+ /* we don't know anything, so unset key */
b->T->nokey[0] = i - 1;
b->T->nokey[1] = i;
b->tkey = bm->hkey = b->tdense = FALSE;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list