Update of /cvsroot/monetdb/MonetDB5/src/modules/atoms
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15123/src/modules/atoms

Modified Files:
      Tag: MonetDB_5-2
        mtime.mx 
Log Message:
Missing functions, needed in SQL compilation


Index: mtime.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/atoms/mtime.mx,v
retrieving revision 1.98
retrieving revision 1.98.6.1
diff -u -d -r1.98 -r1.98.6.1
--- mtime.mx    26 May 2007 10:30:28 -0000      1.98
+++ mtime.mx    27 Oct 2007 08:18:33 -0000      1.98.6.1
@@ -198,6 +198,12 @@
 command calc.isnil(v:@1):bit 
 address [EMAIL PROTECTED]
 comment "Nil test for @1 value";
+command calc.min(v:@1,w:@1):@1 
+address [EMAIL PROTECTED]
+comment "Minimum test for @1 value";
+command calc.max(v:@1,w:@1):@1 
+address [EMAIL PROTECTED]
+comment "Minimum test for @1 value";
 @mal
 
 @+ Date atom
@@ -958,6 +964,8 @@
 mtime_export str MTIMEtimestamp_diff(lng *ret, timestamp *v1, timestamp *v2);
 mtime_export str MTIMEtimestamp_inside_dst(bit *ret, timestamp *p, tzone *z);
 mtime_export str MTIMEtimestamp_isnil(bit *retval, timestamp *val);
+mtime_export str MTIMEtimestamp_min(timestamp *ret, timestamp *v, timestamp 
*w);
+mtime_export str MTIMEtimestamp_max(timestamp *ret, timestamp *v, timestamp 
*w);
 mtime_export str MTIMEtimestamp_EQ(bit *retval, timestamp *val1, timestamp 
*val2);
 mtime_export str MTIMEtimestamp_NEQ(bit *retval, timestamp *val1, timestamp 
*val2);
 
@@ -2821,6 +2829,8 @@
 }
 @= compareDefAll
 mtime_export str [EMAIL PROTECTED](bit *ret, @1 *v);
+mtime_export str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w);
+mtime_export str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w);
            @:compareDef(EQ,==,@1)@
            @:compareDef(NEQ,!=,@1)@
            @:compareDef(LT,<,@1)@
@@ -2832,6 +2842,20 @@
        *ret= *v == @1_nil;
        return MAL_SUCCEED;
 }
+str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w){
+       if( *v== @1_nil || *w== @1_nil)
+                       *ret= @1_nil;
+       else
+               *ret= *v<*w ? *v: *w;
+       return MAL_SUCCEED;
+}
+str [EMAIL PROTECTED](@1 *ret, @1 *v, @1 *w){
+       if( *v== @1_nil || *w== @1_nil)
+                       *ret= @1_nil;
+       else
+               *ret= *v<*w ? *v: *w;
+       return MAL_SUCCEED;
+}
            @:compareImpl(EQ,==,@1)@
            @:compareImpl(NEQ,!=,@1)@
            @:compareImpl(LT,<,@1)@
@@ -3271,6 +3295,31 @@
 }
 
 str
+MTIMEtimestamp_min(timestamp *ret, timestamp *v, timestamp *w)
+{
+       if (ts_isnil(*v) || ts_isnil(*w))
+               *ret = *ts_nilptr;
+       else 
+       if( v->days < w->days || (v->days == w->days && v->msecs < w->msecs))
+               *ret= *v;
+       else
+               *ret= *w;
+       return MAL_SUCCEED;
+}
+str
+MTIMEtimestamp_max(timestamp *ret, timestamp *v, timestamp *w)
+{
+       if (ts_isnil(*v) || ts_isnil(*w))
+               *ret = *ts_nilptr;
+       else 
+       if( !( v->days < w->days || (v->days == w->days && v->msecs < 
w->msecs)))
+               *ret= *v;
+       else
+               *ret= *w;
+       return MAL_SUCCEED;
+}
+
+str
 MTIMEtimestamp_EQ(bit *retval, timestamp *val1, timestamp *val2)
 {
        if (ts_isnil(*val1) || ts_isnil(*val2))


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to