Changeset: ae78754f6569 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ae78754f6569 Modified Files: clients/Tests/exports.stable.out gdk/gdk_batop.c gdk/gdk_bbp.c monetdb5/modules/atoms/mtime.c monetdb5/modules/atoms/mtime.h monetdb5/modules/mal/sysmon.c sql/jdbc/tests/Tests/Test_PSsqldata.stable.out Branch: default Log Message:
Merge with Oct2014 branch. diffs (229 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1658,7 +1658,7 @@ str MTIMEtime_add_msec_interval_wrap(day str MTIMEtime_sub_msec_interval_wrap(daytime *ret, const daytime *t, const lng *msec); str MTIMEtimestamp(timestamp *ret, const int *sec); str MTIMEtimestamp2timestamp(timestamp *ret, const timestamp *src); -str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msecs); +str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msec); str MTIMEtimestamp_add_month_interval_lng_wrap(timestamp *ret, const timestamp *t, const lng *months); str MTIMEtimestamp_add_month_interval_wrap(timestamp *ret, const timestamp *t, const int *months); str MTIMEtimestamp_bulk(bat *ret, bat *bid); @@ -1678,7 +1678,7 @@ str MTIMEtimestamp_extract_daytime_defau str MTIMEtimestamp_fromstr(timestamp *ret, const char *const *d); str MTIMEtimestamp_hours(int *ret, const timestamp *t); str MTIMEtimestamp_inside_dst(bit *ret, const timestamp *p, const tzone *z); -str MTIMEtimestamp_lng(timestamp *ret, const lng *msecs); +str MTIMEtimestamp_lng(timestamp *ret, const lng *msec); str MTIMEtimestamp_lng_bulk(bat *ret, bat *bid); str MTIMEtimestamp_milliseconds(int *ret, const timestamp *t); str MTIMEtimestamp_minutes(int *ret, const timestamp *t); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -76,7 +76,7 @@ unshare_string_heap(BAT *b) * it makes sense to just quickly copy the whole string heap instead * of inserting individual strings. See the comments in the code for * more information. */ -static BAT * +static gdk_return insert_string_bat(BAT *b, BAT *n, int append, int force) { BATiter ni; /* iterator */ @@ -95,7 +95,7 @@ insert_string_bat(BAT *b, BAT *n, int ap assert(b->htype == TYPE_void || b->htype == TYPE_oid); if (n->batCount == 0) - return b; + return GDK_SUCCEED; ni = bat_iterator(n); hp = NULL; tp = NULL; @@ -139,7 +139,7 @@ insert_string_bat(BAT *b, BAT *n, int ap toff = 0; } else if (b->T->vheap->parentid != bid && unshare_string_heap(b) == GDK_FAIL) { - return NULL; + return GDK_FAIL; } } if (toff == ~(size_t) 0 && n->batCount > 1024) { @@ -379,13 +379,13 @@ insert_string_bat(BAT *b, BAT *n, int ap b->tvarsized = 1; b->ttype = TYPE_str; } - return b; + return GDK_SUCCEED; bunins_failed: if (toff != ~(size_t) 0) { b->tvarsized = 1; b->ttype = TYPE_str; } - return NULL; + return GDK_FAIL; } /* @@ -558,7 +558,8 @@ BATins(BAT *b, BAT *n, bit force) !GDK_ELIMDOUBLES(n->T->vheap) && b->T->vheap->hashash == n->T->vheap->hashash && VIEWtparent(n) == 0) { - b = insert_string_bat(b, n, 0, force); + if (insert_string_bat(b, n, 0, force) == GDK_FAIL) + return NULL; } else if (b->htype == TYPE_void) { if (!ATOMvarsized(b->ttype) && BATatoms[b->ttype].atomFix == NULL && @@ -766,8 +767,7 @@ BATappend(BAT *b, BAT *n, bit force) (b->batCount == 0 || !GDK_ELIMDOUBLES(b->T->vheap)) && !GDK_ELIMDOUBLES(n->T->vheap) && b->T->vheap->hashash == n->T->vheap->hashash) { - b = insert_string_bat(b, n, 1, force); - if (b == NULL) + if (insert_string_bat(b, n, 1, force) == GDK_FAIL) return NULL; } else if (b->htype == TYPE_void) { if (!ATOMvarsized(b->ttype) && diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -2118,17 +2118,18 @@ incref(bat i, int logical, int lock) MT_lock_unset(&GDKswapLock(i), "BBPincref"); return 0; } - /* parent BATs are not relevant for logical refs */ - hp = logical ? 0 : bs->B.H->heap.parentid; - tp = logical ? 0 : bs->B.T->heap.parentid; - hvp = logical || bs->B.H->vheap == 0 || bs->B.H->vheap->parentid == i ? 0 : bs->B.H->vheap->parentid; - tvp = logical || bs->B.T->vheap == 0 || bs->B.T->vheap->parentid == i ? 0 : bs->B.T->vheap->parentid; assert(BBP_refs(i) + BBP_lrefs(i) || BBP_status(i) & (BBPDELETED | BBPSWAPPED)); - if (logical) + if (logical) { + /* parent BATs are not relevant for logical refs */ + hp = tp = hvp = tvp = 0; refs = ++BBP_lrefs(i); - else { + } else { + hp = bs->B.H->heap.parentid; + tp = bs->B.T->heap.parentid; + hvp = bs->B.H->vheap == 0 || bs->B.H->vheap->parentid == i ? 0 : bs->B.H->vheap->parentid; + tvp = bs->B.T->vheap == 0 || bs->B.T->vheap->parentid == i ? 0 : bs->B.T->vheap->parentid; refs = ++BBP_refs(i); if (refs == 1 && (hp || tp || hvp || tvp)) { /* If this is a view, we must load the parent diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c --- a/monetdb5/modules/atoms/mtime.c +++ b/monetdb5/modules/atoms/mtime.c @@ -1153,22 +1153,22 @@ daytime_add(daytime *ret, const daytime /* returns the timestamp that comes 'milliseconds' after 'value'. */ str -MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msecs) +MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msec) { - if (!ts_isnil(*v) && *msecs != lng_nil) { - int days = (int) (*msecs / (24 * 60 * 60 * 1000)); - - ret->msecs = (int) (v->msecs + (*msecs - ((lng) days) * (24 * 60 * 60 * 1000))); + if (!ts_isnil(*v) && *msec != lng_nil) { + int day = (int) (*msec / (24 * 60 * 60 * 1000)); + + ret->msecs = (int) (v->msecs + (*msec - ((lng) day) * (24 * 60 * 60 * 1000))); ret->days = v->days; if (ret->msecs >= (24 * 60 * 60 * 1000)) { - days++; + day++; ret->msecs -= (24 * 60 * 60 * 1000); } else if (ret->msecs < 0) { - days--; + day--; ret->msecs += (24 * 60 * 60 * 1000); } - if (days) { - MTIMEdate_adddays(&ret->days, &ret->days, &days); + if (day) { + MTIMEdate_adddays(&ret->days, &ret->days, &day); if (ret->days == int_nil) { *ret = *timestamp_nil; } diff --git a/monetdb5/modules/atoms/mtime.h b/monetdb5/modules/atoms/mtime.h --- a/monetdb5/modules/atoms/mtime.h +++ b/monetdb5/modules/atoms/mtime.h @@ -75,15 +75,20 @@ typedef int daytime; * @- timestamp * Timestamp is implemented as a record that contains a date and a time (GMT). */ -typedef struct { +typedef union { + lng alignment; + struct { #ifndef WORDS_BIGENDIAN - daytime msecs; - date days; + daytime p_msecs; + date p_days; #else - date days; - daytime msecs; + date p_days; + daytime p_msecs; #endif + } payload; } timestamp; +#define msecs payload.p_msecs +#define days payload.p_days /* * @- rule @@ -172,7 +177,7 @@ mtime_export str MTIMEdate_adddays(date mtime_export str MTIMEdate_addmonths(date *ret, const date *v, const int *delta); mtime_export str MTIMEdate_diff(int *ret, const date *v1, const date *v2); mtime_export str MTIMEdate_diff_bulk(bat *ret, const bat *bid1, const bat *bid2); -mtime_export str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msecs); +mtime_export str MTIMEtimestamp_add(timestamp *ret, const timestamp *v, const lng *msec); mtime_export str MTIMEtimestamp_diff(lng *ret, const timestamp *v1, const timestamp *v2); mtime_export str MTIMEtimestamp_diff_bulk(bat *ret, const bat *bid1, const bat *bid2); mtime_export str MTIMEtimestamp_inside_dst(bit *ret, const timestamp *p, const tzone *z); @@ -228,7 +233,7 @@ mtime_export str MTIMEunix_epoch(timesta mtime_export str MTIMEepoch2int(int *res, const timestamp *ts); mtime_export str MTIMEtimestamp(timestamp *ret, const int *sec); mtime_export str MTIMEtimestamp_bulk(bat *ret, bat *bid); -mtime_export str MTIMEtimestamp_lng(timestamp *ret, const lng *msecs); +mtime_export str MTIMEtimestamp_lng(timestamp *ret, const lng *msec); mtime_export str MTIMEtimestamp_lng_bulk(bat *ret, bat *bid); mtime_export str MTIMEruleDef0(rule *ret, const int *m, const int *d, const int *w, const int *h, const int *mint); mtime_export str MTIMEruleDef1(rule *ret, const int *m, const char * const *dnme, const int *w, const int *h, const int *mint); diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c --- a/monetdb5/modules/mal/sysmon.c +++ b/monetdb5/modules/mal/sysmon.c @@ -49,8 +49,8 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, (void) mb; tag = BATnew(TYPE_void, TYPE_lng, 256, TRANSIENT); user = BATnew(TYPE_void, TYPE_str, 256, TRANSIENT); - started = BATnew(TYPE_void, TYPE_lng, 256, TRANSIENT); - estimate = BATnew(TYPE_void, TYPE_lng, 256, TRANSIENT); + started = BATnew(TYPE_void, TYPE_timestamp, 256, TRANSIENT); + estimate = BATnew(TYPE_void, TYPE_timestamp, 256, TRANSIENT); progress = BATnew(TYPE_void, TYPE_int, 256, TRANSIENT); activity = BATnew(TYPE_void, TYPE_str, 256, TRANSIENT); oids = BATnew(TYPE_void, TYPE_oid, 256, TRANSIENT); diff --git a/sql/jdbc/tests/Tests/Test_PSsqldata.stable.out b/sql/jdbc/tests/Tests/Test_PSsqldata.stable.out --- a/sql/jdbc/tests/Tests/Test_PSsqldata.stable.out +++ b/sql/jdbc/tests/Tests/Test_PSsqldata.stable.out @@ -53,11 +53,11 @@ Ready. 0. false false 1. 2 parameters: 2 1. - type 1111 + type 12 typename inet classname nl.cwi.monetdb.jdbc.types.INET 2. - type 1111 + type 12 typename url classname nl.cwi.monetdb.jdbc.types.URL 1. 172.5.5.5/24 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list