Changeset: 2f3922dcda74 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f3922dcda74
Added Files:
        sql/backends/monet5/bam/default_schema.dia
        sql/backends/monet5/bam/default_schema.png
        sql/backends/monet5/bam/metadata.dia
        sql/backends/monet5/bam/metadata.png
        sql/backends/monet5/bam/paired_schema.dia
        sql/backends/monet5/bam/paired_schema.png
        sql/test/BugTracker-2014/Tests/case-sqrt.Bug-3627.sql
        sql/test/BugTracker-2014/Tests/case-sqrt.Bug-3627.stable.err
        sql/test/BugTracker-2014/Tests/case-sqrt.Bug-3627.stable.out
        sql/test/BugTracker-2014/Tests/column-with-comma.Bug-3616.sql
        sql/test/BugTracker-2014/Tests/column-with-comma.Bug-3616.stable.err
        sql/test/BugTracker-2014/Tests/column-with-comma.Bug-3616.stable.out
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_atoms.h
        gdk/gdk_batop.c
        gdk/gdk_bbp.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/mtime.h
        monetdb5/modules/mal/sysmon.c
        sql/backends/monet5/sql_result.c
        sql/jdbc/tests/Tests/Test_PSsqldata.stable.out
        sql/server/rel_select.c
        sql/test/BugTracker-2014/Tests/All
Branch: transaction-replication
Log Message:

Merge with default branch


diffs (truncated from 6483 to 300 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.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1253,7 +1253,7 @@ gdk_export bte ATOMelmshift(int sz);
                                break;                                  \
                        }                                               \
                } else {                                                \
-                       ATOMputFIX((b)->HT->type, (b)->HT->vheap, (p), v); \
+                       ATOMputFIX((b)->HT->type, (p), v);              \
                }                                                       \
        } while (0)
 #define Hputvalue(b, p, v, copyall)    HTputvalue(b, p, v, copyall, H)
@@ -1301,7 +1301,7 @@ gdk_export bte ATOMelmshift(int sz);
                                break;                                  \
                        }                                               \
                } else {                                                \
-                       ATOMreplaceFIX((b)->HT->type, (b)->HT->vheap, (p), v); \
+                       ATOMreplaceFIX((b)->HT->type, (p), v);          \
                }                                                       \
        } while (0)
 #define Hreplacevalue(b, p, v)         HTreplacevalue(b, p, v, H)
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -244,7 +244,7 @@ gdk_export const ptr ptr_nil;
                if ((*BATatoms[type].atomPut)(heap, dst, src) == 0)     \
                        goto bunins_failed;                             \
        } while (0)
-#define ATOMputFIX(type, heap, dst, src)                               \
+#define ATOMputFIX(type, dst, src)                                     \
        do {                                                            \
                int t_ = (type);                                        \
                void *d_ = (dst);                                       \
@@ -290,7 +290,7 @@ gdk_export const ptr ptr_nil;
                *d_ = loc_;                                             \
                ATOMfix(t_, s_);                                        \
        } while (0)
-#define ATOMreplaceFIX(type, heap, dst, src)                           \
+#define ATOMreplaceFIX(type, dst, src)                                 \
        do {                                                            \
                int t_ = (type);                                        \
                void *d_ = (dst);                                       \
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/backends/monet5/bam/default_schema.dia 
b/sql/backends/monet5/bam/default_schema.dia
new file mode 100644
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..682ce8e1628447e46f8f8dd2955adcac4bcf49ef
GIT binary patch
literal 1422
zc$@)_1#$WxiwFP!000021MOUGZ=*O6{@!1KsI;HD1lXiWw%e}SJ>71ly<Mr-`-~iL
zh_8;F+9qwj+;2bgk{2K(0TSA#MrtKsn8zMJo*AZ7zI=TiV{Hl<N0eOZmSO4|Brf$3
z@h|m%?*IJQ)4yJweDM(YEPs3k#+rPB@bK(X9|<w}+-f~NJsEh$fuPL5C@?r|{Rc1x
zEh*H}uTC^=Re=Wt2(Kkqfe;K00s%Dw#_&=f0QbRXG$5WHOC@qH#gu7NfG_paVRY!N
zL`^HDXM^qu@Zo?#@KCJUlt;f`MfC)-tlIH}awJ8>Y?2cx&=dY%kx8Vu6e9lB>2>=w
z9#V2)scYRp3qiyfFdvaTj<gMq4PhHS+qR`KI{jYX?6$ks+$QDW2F=3ZX5m<~aELn-
z$^-*Q<RJ%?VhBi#Dp&xk<8T*XNwH1SsxgZp5`u0S{}5ol%LL-fi``as=lTqJn>TJs
zqCm?N^2Eq_K9IR$?Xv@EpCXP17_J*VB4TgqXZul~U7g5#FCVYThFDu+c<_3#13Trz
zgC8Id@+~w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nmvo=TY*Igx=%o2{}~T%D~ZR(fufp*6)JNP=<lwwW8k
z@}9Nfo>^l|AP|(%w0qxY8R<BRyp2|1Be1B-Q-&&Qzfn}KFcSVH!(qTf0pBpqiho%k
zo&y-8PsMYx?V73`42i#ai8^&5wvwPC0vCXZ*!wvi<Ze+#+^Ss?59hKSht$S-@w#rQ
zf@UXE=j-hT>QX{vz?GQ+&$*uY9c=`Nm&{Ah=#xv@@~+&k`OvfGVJmsq$~@f8e|su3
cq-@d?pGTjWx;jaHhwAF&f3BbKDyvce082o?{{R30

diff --git a/sql/backends/monet5/bam/default_schema.png 
b/sql/backends/monet5/bam/default_schema.png
new file mode 100644
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f1aa49a5c4c81e2e3babd7aa127fe5df45701854
GIT binary patch
literal 54296
zc$}oX1yq%7x9`0W1yni&=|(|8N;;&GZb3p3q`MoXB_#xu5RgU?kZz<)3F!{$7Nj|I
z`MmG9_jmTU_jkrP_wX662UgtIyypDR-+#^fHbhxb8tVq>4Fm##B`YJLia?;QAP^`6
z7+2sYI}Oe%@E59sn5;Sm2FApk(k%S%bz2#22LuA=Bl16#kLF=62n01kR^pMmYtqJ)
zo2Y`>C1Pi}eEU>P@;Qg>dt7GqcOehCKat1=J~C#kX(p)&dmGllpGlf77DKNcts4+)
zhM_Gct7_KoTr)L8_5Czu#%;T9YRlWkQ{<92c|U1cu;RnMSD!=5H5vrsh?b9^pF^|=
z|JE(W)do@oB8vXDEHUDr;|C|-+4r$hliuE5hNpxG1a6ttM0v8Xm(D;YLhOO-&g{^T
zx@<hGOrmdky1uIFw#{Ysyfqxg#tc=oC<tHPm6a8lY79}{*w|QVOB6)?RSu5JnMY{V
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to