Changeset: 3fee6bf876ff for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3fee6bf876ff
Added Files:
        monetdb5/modules/kernel/batmtime.mal
Removed Files:
        monetdb5/modules/kernel/batmtime.mx
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/mtime.h
        monetdb5/modules/atoms/mtime.mal
        monetdb5/modules/kernel/Makefile.ag
Branch: default
Log Message:

Use gdk_calc for mtime comparisons, batmtime is now just a mail file.


diffs (truncated from 1668 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
@@ -1759,60 +1759,6 @@ void MSresetInstructions(MalBlkPtr mb, i
 void MSresetVariables(Client cntxt, MalBlkPtr mb, MalStkPtr glb, int start);
 void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout);
 void MSserveClient(void *dummy);
-str MTIMEbat_date_EQ(int *ret, int *l, int *r);
-str MTIMEbat_date_EQ_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_GE(int *ret, int *l, int *r);
-str MTIMEbat_date_GE_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_GT(int *ret, int *l, int *r);
-str MTIMEbat_date_GT_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_LE(int *ret, int *l, int *r);
-str MTIMEbat_date_LE_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_LT(int *ret, int *l, int *r);
-str MTIMEbat_date_LT_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_NEQ(int *ret, int *l, int *r);
-str MTIMEbat_date_NEQ_cst(int *ret, int *l, date *cst);
-str MTIMEbat_date_cst_EQ(int *ret, date *cst, int *l);
-str MTIMEbat_date_cst_GE(int *ret, date *cst, int *l);
-str MTIMEbat_date_cst_GT(int *ret, date *cst, int *l);
-str MTIMEbat_date_cst_LE(int *ret, date *cst, int *l);
-str MTIMEbat_date_cst_LT(int *ret, date *cst, int *l);
-str MTIMEbat_date_cst_NEQ(int *ret, date *cst, int *l);
-str MTIMEbat_daytime_EQ(int *ret, int *l, int *r);
-str MTIMEbat_daytime_EQ_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_GE(int *ret, int *l, int *r);
-str MTIMEbat_daytime_GE_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_GT(int *ret, int *l, int *r);
-str MTIMEbat_daytime_GT_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_LE(int *ret, int *l, int *r);
-str MTIMEbat_daytime_LE_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_LT(int *ret, int *l, int *r);
-str MTIMEbat_daytime_LT_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_NEQ(int *ret, int *l, int *r);
-str MTIMEbat_daytime_NEQ_cst(int *ret, int *l, daytime *cst);
-str MTIMEbat_daytime_cst_EQ(int *ret, daytime *cst, int *l);
-str MTIMEbat_daytime_cst_GE(int *ret, daytime *cst, int *l);
-str MTIMEbat_daytime_cst_GT(int *ret, daytime *cst, int *l);
-str MTIMEbat_daytime_cst_LE(int *ret, daytime *cst, int *l);
-str MTIMEbat_daytime_cst_LT(int *ret, daytime *cst, int *l);
-str MTIMEbat_daytime_cst_NEQ(int *ret, daytime *cst, int *l);
-str MTIMEbat_timestamp_EQ(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_EQ_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_GE(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_GE_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_GT(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_GT_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_LE(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_LE_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_LT(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_LT_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_NEQ(int *ret, int *l, int *r);
-str MTIMEbat_timestamp_NEQ_cst(int *ret, int *l, timestamp *cst);
-str MTIMEbat_timestamp_cst_EQ(int *ret, timestamp *cst, int *l);
-str MTIMEbat_timestamp_cst_GE(int *ret, timestamp *cst, int *l);
-str MTIMEbat_timestamp_cst_GT(int *ret, timestamp *cst, int *l);
-str MTIMEbat_timestamp_cst_LE(int *ret, timestamp *cst, int *l);
-str MTIMEbat_timestamp_cst_LT(int *ret, timestamp *cst, int *l);
-str MTIMEbat_timestamp_cst_NEQ(int *ret, timestamp *cst, int *l);
 str MTIMEcompute_rule_foryear(date *ret, rule *val, int *year);
 str MTIMEcurrent_date(date *d);
 str MTIMEcurrent_date(date *d);
@@ -1821,12 +1767,6 @@ str MTIMEcurrent_time(daytime *t);
 str MTIMEcurrent_timestamp(timestamp *t);
 str MTIMEcurrent_timestamp(timestamp *t);
 str MTIMEdate2date(date *ret, date *src);
-str MTIMEdate_EQ(bit *ret, date *v, date *w);
-str MTIMEdate_GE(bit *ret, date *v, date *w);
-str MTIMEdate_GT(bit *ret, date *v, date *w);
-str MTIMEdate_LE(bit *ret, date *v, date *w);
-str MTIMEdate_LT(bit *ret, date *v, date *w);
-str MTIMEdate_NEQ(bit *ret, date *v, date *w);
 str MTIMEdate_add_msec_interval_lng_wrap(date *ret, date *t, lng *msec);
 str MTIMEdate_add_sec_interval_wrap(date *ret, date *t, int *sec);
 str MTIMEdate_adddays(date *ret, date *v, int *delta);
@@ -1845,11 +1785,6 @@ str MTIMEdate_extract_weekofyear(int *re
 str MTIMEdate_extract_year(int *ret, date *v);
 str MTIMEdate_extract_year_bulk(int *ret, int *bid);
 str MTIMEdate_fromstr(date *ret, str *s);
-str MTIMEdate_isnil(bit *ret, date *v);
-str MTIMEdate_max(date *ret, date *v, date *w);
-str MTIMEdate_max_no_nil(date *ret, date *v, date *w);
-str MTIMEdate_min(date *ret, date *v, date *w);
-str MTIMEdate_min_no_nil(date *ret, date *v, date *w);
 str MTIMEdate_sub_msec_interval_lng_wrap(date *ret, date *t, lng *msec);
 str MTIMEdate_sub_sec_interval_wrap(date *ret, date *t, int *sec);
 str MTIMEdate_tostr(str *ret, date *d);
@@ -1859,12 +1794,6 @@ str MTIMEdaytime1(daytime *ret, int *h);
 str MTIMEdaytime2(daytime *ret, int *h, int *m);
 str MTIMEdaytime2daytime(daytime *ret, daytime *src);
 str MTIMEdaytime3(daytime *ret, int *h, int *m, int *s);
-str MTIMEdaytime_EQ(bit *ret, daytime *v, daytime *w);
-str MTIMEdaytime_GE(bit *ret, daytime *v, daytime *w);
-str MTIMEdaytime_GT(bit *ret, daytime *v, daytime *w);
-str MTIMEdaytime_LE(bit *ret, daytime *v, daytime *w);
-str MTIMEdaytime_LT(bit *ret, daytime *v, daytime *w);
-str MTIMEdaytime_NEQ(bit *ret, daytime *v, daytime *w);
 str MTIMEdaytime_create(daytime *ret, int *hour, int *min, int *sec, int 
*msec);
 str MTIMEdaytime_extract_hours(int *ret, daytime *v);
 str MTIMEdaytime_extract_hours_bulk(int *ret, int *bid);
@@ -1877,11 +1806,6 @@ str MTIMEdaytime_extract_seconds_bulk(in
 str MTIMEdaytime_extract_sql_seconds(int *ret, daytime *v);
 str MTIMEdaytime_extract_sql_seconds_bulk(int *ret, int *bid);
 str MTIMEdaytime_fromstr(daytime *ret, str *s);
-str MTIMEdaytime_isnil(bit *ret, daytime *v);
-str MTIMEdaytime_max(daytime *ret, daytime *v, daytime *w);
-str MTIMEdaytime_max_no_nil(daytime *ret, daytime *v, daytime *w);
-str MTIMEdaytime_min(daytime *ret, daytime *v, daytime *w);
-str MTIMEdaytime_min_no_nil(daytime *ret, daytime *v, daytime *w);
 str MTIMEdaytime_tostr(str *ret, daytime *d);
 str MTIMEepilogue(void);
 str MTIMEepoch(timestamp *ret);
@@ -1920,12 +1844,10 @@ str MTIMEtime_add_msec_interval_wrap(day
 str MTIMEtime_sub_msec_interval_wrap(daytime *ret, daytime *t, lng *msec);
 str MTIMEtimestamp(timestamp *ret, int *sec);
 str MTIMEtimestamp2timestamp(timestamp *ret, timestamp *src);
-str MTIMEtimestamp_EQ(bit *retval, timestamp *val1, timestamp *val2);
 str MTIMEtimestamp_GE(bit *retval, timestamp *val1, timestamp *val2);
 str MTIMEtimestamp_GT(bit *retval, timestamp *val1, timestamp *val2);
 str MTIMEtimestamp_LE(bit *retval, timestamp *val1, timestamp *val2);
 str MTIMEtimestamp_LT(bit *retval, timestamp *val1, timestamp *val2);
-str MTIMEtimestamp_NEQ(bit *retval, timestamp *val1, timestamp *val2);
 str MTIMEtimestamp_add(timestamp *ret, timestamp *v, lng *msecs);
 str MTIMEtimestamp_add_month_interval_wrap(timestamp *ret, timestamp *t, int 
*months);
 str MTIMEtimestamp_create(timestamp *ret, date *d, daytime *t, tzone *z);
@@ -1940,13 +1862,8 @@ str MTIMEtimestamp_extract_daytime_defau
 str MTIMEtimestamp_fromstr(timestamp *ret, str *d);
 str MTIMEtimestamp_hours(int *ret, timestamp *t);
 str MTIMEtimestamp_inside_dst(bit *ret, timestamp *p, tzone *z);
-str MTIMEtimestamp_isnil(bit *retval, timestamp *val);
 str MTIMEtimestamp_lng(timestamp *ret, lng *msecs);
-str MTIMEtimestamp_max(timestamp *ret, timestamp *v, timestamp *w);
-str MTIMEtimestamp_max_no_nil(timestamp *ret, timestamp *v, timestamp *w);
 str MTIMEtimestamp_milliseconds(int *ret, timestamp *t);
-str MTIMEtimestamp_min(timestamp *ret, timestamp *v, timestamp *w);
-str MTIMEtimestamp_min_no_nil(timestamp *ret, timestamp *v, timestamp *w);
 str MTIMEtimestamp_minutes(int *ret, timestamp *t);
 str MTIMEtimestamp_month(int *ret, timestamp *t);
 str MTIMEtimestamp_seconds(int *ret, timestamp *t);
@@ -1966,7 +1883,6 @@ str MTIMEtzone_get_local(tzone *z);
 str MTIMEtzone_isnil(bit *retval, tzone *val);
 str MTIMEtzone_set_local(int res, tzone *z);
 str MTIMEtzone_tostr(str *s, tzone *ret);
-str MTIMEunaryISNIL(int *ret, int *bid);
 str MTIMEunix_epoch(timestamp *ret);
 str OCTOPUSbidding(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str OCTOPUSconnect(str *c, str *dbname);
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
@@ -1653,232 +1653,6 @@ MTIMEtimestamp2timestamp(timestamp *ret,
        return MAL_SUCCEED;
 }
 
-/*
- * The comparison implementations are relatively straightforward.
- */
-
-str
-MTIMEdate_isnil(bit *ret, date *v)
-{
-       *ret = (*v == date_nil);
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_min(date *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = date_nil;
-       else
-               *ret = *v < *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_max(date *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = date_nil;
-       else
-               *ret = *v > *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_min_no_nil(date *ret, date *v, date *w)
-{
-       if (*v == date_nil)
-               *ret = *w;
-       else if (*w == date_nil)
-               *ret = *v;
-       else
-               *ret = *v < *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_max_no_nil(date *ret, date *v, date *w)
-{
-       if (*v == date_nil)
-               *ret = *w;
-       else if (*w == date_nil)
-               *ret = *v;
-       else
-               *ret = *v > *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_EQ(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v == *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_NEQ(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v != *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_LT(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v < *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_LE(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v <= *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_GT(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v > *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdate_GE(bit *ret, date *v, date *w)
-{
-       if (*v == date_nil || *w == date_nil)
-               *ret = bit_nil;
-       else
-               *ret = *v >= *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdaytime_isnil(bit *ret, daytime *v)
-{
-       *ret = (*v == daytime_nil);
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdaytime_min(daytime *ret, daytime *v, daytime *w)
-{
-       if (*v == daytime_nil || *w == daytime_nil)
-               *ret = daytime_nil;
-       else
-               *ret = *v < *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdaytime_max(daytime *ret, daytime *v, daytime *w)
-{
-       if (*v == daytime_nil || *w == daytime_nil)
-               *ret = daytime_nil;
-       else
-               *ret = *v > *w ? *v : *w;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEdaytime_min_no_nil(daytime *ret, daytime *v, daytime *w)
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to