Changeset: 52af8bfa1916 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=52af8bfa1916
Added Files:
        gdk/gdk_time.c
        gdk/gdk_time.h
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        gdk/Makefile.ag
        gdk/gdk.h
        gdk/gdk_atoms.c
        gdk/gdk_logger.c
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_type.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/mtime.h
        monetdb5/modules/atoms/mtime.mal
        monetdb5/modules/atoms/mtime_analytic.c
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/oltp.c
        monetdb5/modules/mal/querylog.c
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/sysmon.c
        monetdb5/modules/mal/wlc.c
        monetdb5/optimizer/opt_querylog.c
        sql/backends/monet5/UDF/capi/capi.c
        sql/backends/monet5/UDF/pyapi3/emit3.c
        sql/backends/monet5/generator/generator.c
        sql/backends/monet5/sql.h
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_result.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_upgrades.c
        sql/scripts/17_temporal.sql
        sql/server/rel_exp.c
        sql/server/rel_optimizer.c
        sql/server/sql_atom.c
        sql/server/sql_qc.c
        sql/server/sql_qc.h
        sql/test/BugTracker/Tests/update_with_subselect.SF-1362771.sql
Branch: timezone
Log Message:

Moved implementation of date/daytime/timestamp to GDK.


diffs (truncated from 3321 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -10486,29 +10486,6 @@ stdout of test 'MAL-signatures` in direc
 [ "color",     "value",        "command color.value(c:color):flt ",    
"CLRvalue;",    "Extracts value component from a color atom"    ]
 [ "color",     "value",        "command color.value(c:color):int ",    
"CLRvalueInt;", "Extracts value component from a color atom"    ]
 [ "color",     "ycc",  "command color.ycc(y:int, cr:int, cb:int):color ",      
"CLRycc;",      "Converts an YCC triplets to a color atom"      ]
-[ "date",      "!=",   "pattern date.!=(v:date, w:date):bit ", "CMDvarNE;",    
"Equality of two dates" ]
-[ "date",      "!=",   "pattern date.!=(v:date, w:date, nil_matches:bit):bit 
",        "CMDvarNE;",    "Equality of two dates" ]
-[ "date",      "#fromstr",     "command date.#fromstr():void ",        
"date_fromstr;",        ""      ]
-[ "date",      "#tostr",       "command date.#tostr():void ",  "date_tostr;",  
""      ]
-[ "date",      "<",    "pattern date.<(v:date, w:date):bit ",  "CMDvarLT;",    
"Equality of two dates" ]
-[ "date",      "<=",   "pattern date.<=(v:date, w:date):bit ", "CMDvarLE;",    
"Equality of two dates" ]
-[ "date",      "==",   "pattern date.==(v:date, w:date):bit ", "CMDvarEQ;",    
"Equality of two dates" ]
-[ "date",      "==",   "pattern date.==(v:date, w:date, nil_matches:bit):bit 
",        "CMDvarEQ;",    "Equality of two dates" ]
-[ "date",      ">",    "pattern date.>(v:date, w:date):bit ",  "CMDvarGT;",    
"Equality of two dates" ]
-[ "date",      ">=",   "pattern date.>=(v:date, w:date):bit ", "CMDvarGE;",    
"Equality of two dates" ]
-[ "date",      "date", "command date.date(s:date):date ",      
"MTIMEdate_date;",      "Noop routine." ]
-[ "date",      "isnil",        "pattern date.isnil(v:date):bit ",      
"CMDvarISNIL;", "Nil test for date value"       ]
-[ "daytime",   "!=",   "pattern daytime.!=(v:daytime, w:daytime):bit ",        
"CMDvarNE;",    "Equality of two daytimes"      ]
-[ "daytime",   "!=",   "pattern daytime.!=(v:daytime, w:daytime, 
nil_matches:bit):bit ",       "CMDvarNE;",    "Equality of two daytimes"      ]
-[ "daytime",   "#fromstr",     "command daytime.#fromstr():void ",     
"daytime_tz_fromstr;",  ""      ]
-[ "daytime",   "#tostr",       "command daytime.#tostr():void ",       
"daytime_tostr;",       ""      ]
-[ "daytime",   "<",    "pattern daytime.<(v:daytime, w:daytime):bit ", 
"CMDvarLT;",    "Equality of two daytimes"      ]
-[ "daytime",   "<=",   "pattern daytime.<=(v:daytime, w:daytime):bit ",        
"CMDvarLE;",    "Equality of two daytimes"      ]
-[ "daytime",   "==",   "pattern daytime.==(v:daytime, w:daytime):bit ",        
"CMDvarEQ;",    "Equality of two daytimes"      ]
-[ "daytime",   "==",   "pattern daytime.==(v:daytime, w:daytime, 
nil_matches:bit):bit ",       "CMDvarEQ;",    "Equality of two daytimes"      ]
-[ "daytime",   ">",    "pattern daytime.>(v:daytime, w:daytime):bit ", 
"CMDvarGT;",    "Equality of two daytimes"      ]
-[ "daytime",   ">=",   "pattern daytime.>=(v:daytime, w:daytime):bit ",        
"CMDvarGE;",    "Equality of two daytimes"      ]
-[ "daytime",   "isnil",        "pattern daytime.isnil(v:daytime):bit ",        
"CMDvarISNIL;", "Nil test for daytime value"    ]
 [ "factories", "getArrival",   "command factories.getArrival():bat[:timestamp] 
",      "FCTgetArrival;",       "Retrieve the time stamp the last call was 
made."       ]
 [ "factories", "getCaller",    "command factories.getCaller():int ",   
"FCTgetCaller;",        "Retrieve the unique identity of the factory caller."   
]
 [ "factories", "getDeparture", "command 
factories.getDeparture():bat[:timestamp] ",    "FCTgetDeparture;",     
"Retrieve the time stamp the last answer was returned." ]
@@ -11116,6 +11093,9 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "diff", "command mtime.diff(val1:date, val2:date):int ",        
"MTIMEdate_diff;",      "returns the number of days\n\tbetween 'val1' and 
'val2'."      ]
 [ "mtime",     "diff", "command mtime.diff(val1:daytime, val2:daytime):lng ",  
"MTIMEdaytime_diff_msec;",      "returns the number of msec between 'val1' and 
'val2'." ]
 [ "mtime",     "diff", "command mtime.diff(val1:timestamp, val2:timestamp):lng 
",      "MTIMEtimestamp_diff_msec;",    "returns the number of 
milliseconds\n\tbetween 'val1' and 'val2'."      ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:timestamp):int ",        
"MTIMEseconds_since_epoch;",    "unix-time (epoch) support: seconds since 
epoch"        ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:lng):timestamp ",        
"MTIMEtimestamp_frommsec;",     "convert milli seconds since epoch into a 
timestamp"    ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:int):timestamp ",        
"MTIMEtimestamp_fromsecond;",   "convert seconds since epoch into a timestamp"  
]
 [ "mtime",     "hours",        "command mtime.hours(h:daytime):int ",  
"MTIMEdaytime_extract_hours;",  "extracts hour from daytime"    ]
 [ "mtime",     "hours",        "command mtime.hours(msecs:lng):int ",  
"MTIMEsql_hours;",      ""      ]
 [ "mtime",     "hours",        "command mtime.hours(t:timestamp):int ",        
"MTIMEtimestamp_hours;",        ""      ]
@@ -11126,7 +11106,6 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "month",        "command mtime.month(d:date):int ",     
"MTIMEdate_extract_month;",     "extracts month from date"      ]
 [ "mtime",     "month",        "command mtime.month(months:int):int ", 
"MTIMEsql_month;",      ""      ]
 [ "mtime",     "month",        "command mtime.month(t:timestamp):int ",        
"MTIMEtimestamp_month;",        ""      ]
-[ "mtime",     "prelude",      "command mtime.prelude():void ",        
"MTIMEprelude;",        ""      ]
 [ "mtime",     "quarter",      "command mtime.quarter(d:date):int ",   
"MTIMEdate_extract_quarter;",   "extracts quarter from date"    ]
 [ "mtime",     "quarter",      "command mtime.quarter(t:timestamp):int ",      
"MTIMEtimestamp_quarter;",      ""      ]
 [ "mtime",     "seconds",      "command mtime.seconds(msecs:lng):int ",        
"MTIMEsql_seconds;",    ""      ]
@@ -11687,20 +11666,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sysmon",    "stop", "pattern sysmon.stop(id:int):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
 [ "sysmon",    "stop", "pattern sysmon.stop(id:lng):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
 [ "sysmon",    "stop", "pattern sysmon.stop(id:sht):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
-[ "timestamp", "!=",   "pattern timestamp.!=(v:timestamp, w:timestamp):bit ",  
"CMDvarNE;",    "Equality of two timestamps"    ]
-[ "timestamp", "!=",   "pattern timestamp.!=(v:timestamp, w:timestamp, 
nil_matches:bit):bit ", "CMDvarNE;",    "Equality of two timestamps"    ]
-[ "timestamp", "#fromstr",     "command timestamp.#fromstr():void ",   
"timestamp_fromstr;",   ""      ]
-[ "timestamp", "#tostr",       "command timestamp.#tostr():void ",     
"timestamp_tostr;",     ""      ]
-[ "timestamp", "<",    "pattern timestamp.<(v:timestamp, w:timestamp):bit ",   
"CMDvarLT;",    "Equality of two timestamps"    ]
-[ "timestamp", "<=",   "pattern timestamp.<=(v:timestamp, w:timestamp):bit ",  
"CMDvarLE;",    "Equality of two timestamps"    ]
-[ "timestamp", "==",   "pattern timestamp.==(v:timestamp, w:timestamp):bit ",  
"CMDvarEQ;",    "Equality of two timestamps"    ]
-[ "timestamp", "==",   "pattern timestamp.==(v:timestamp, w:timestamp, 
nil_matches:bit):bit ", "CMDvarEQ;",    "Equality of two timestamps"    ]
-[ "timestamp", ">",    "pattern timestamp.>(v:timestamp, w:timestamp):bit ",   
"CMDvarGT;",    "Equality of two timestamps"    ]
-[ "timestamp", ">=",   "pattern timestamp.>=(v:timestamp, w:timestamp):bit ",  
"CMDvarGE;",    "Equality of two timestamps"    ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:timestamp):int ",    
"MTIMEseconds_since_epoch;",    "unix-time (epoch) support: seconds since 
epoch"        ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:lng):timestamp ",    
"MTIMEtimestamp_frommsec;",     "convert milli seconds since epoch into a 
timestamp"    ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:int):timestamp ",    
"MTIMEtimestamp_fromsecond;",   "convert seconds since epoch into a timestamp"  
]
-[ "timestamp", "isnil",        "pattern timestamp.isnil(v:timestamp):bit ",    
"CMDvarISNIL;", "Nil test for timestamp value"  ]
 [ "tokenizer", "append",       "command tokenizer.append(u:str):oid ", 
"TKNZRappend;", "tokenize a new string and append it to the tokenizer 
(duplicate elimination is performed)"     ]
 [ "tokenizer", "close",        "command tokenizer.close():void ",      
"TKNZRclose;",  "close the current tokenizer store"     ]
 [ "tokenizer", "depositFile",  "command tokenizer.depositFile(fnme:str):void 
",        "TKNZRdepositFile;",    "batch insertion from a file of strings to 
tokenize, each string is separated by a new line"    ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -14892,29 +14892,6 @@ stdout of test 'MAL-signatures` in direc
 [ "color",     "value",        "command color.value(c:color):flt ",    
"CLRvalue;",    "Extracts value component from a color atom"    ]
 [ "color",     "value",        "command color.value(c:color):int ",    
"CLRvalueInt;", "Extracts value component from a color atom"    ]
 [ "color",     "ycc",  "command color.ycc(y:int, cr:int, cb:int):color ",      
"CLRycc;",      "Converts an YCC triplets to a color atom"      ]
-[ "date",      "!=",   "pattern date.!=(v:date, w:date):bit ", "CMDvarNE;",    
"Equality of two dates" ]
-[ "date",      "!=",   "pattern date.!=(v:date, w:date, nil_matches:bit):bit 
",        "CMDvarNE;",    "Equality of two dates" ]
-[ "date",      "#fromstr",     "command date.#fromstr():void ",        
"date_fromstr;",        ""      ]
-[ "date",      "#tostr",       "command date.#tostr():void ",  "date_tostr;",  
""      ]
-[ "date",      "<",    "pattern date.<(v:date, w:date):bit ",  "CMDvarLT;",    
"Equality of two dates" ]
-[ "date",      "<=",   "pattern date.<=(v:date, w:date):bit ", "CMDvarLE;",    
"Equality of two dates" ]
-[ "date",      "==",   "pattern date.==(v:date, w:date):bit ", "CMDvarEQ;",    
"Equality of two dates" ]
-[ "date",      "==",   "pattern date.==(v:date, w:date, nil_matches:bit):bit 
",        "CMDvarEQ;",    "Equality of two dates" ]
-[ "date",      ">",    "pattern date.>(v:date, w:date):bit ",  "CMDvarGT;",    
"Equality of two dates" ]
-[ "date",      ">=",   "pattern date.>=(v:date, w:date):bit ", "CMDvarGE;",    
"Equality of two dates" ]
-[ "date",      "date", "command date.date(s:date):date ",      
"MTIMEdate_date;",      "Noop routine." ]
-[ "date",      "isnil",        "pattern date.isnil(v:date):bit ",      
"CMDvarISNIL;", "Nil test for date value"       ]
-[ "daytime",   "!=",   "pattern daytime.!=(v:daytime, w:daytime):bit ",        
"CMDvarNE;",    "Equality of two daytimes"      ]
-[ "daytime",   "!=",   "pattern daytime.!=(v:daytime, w:daytime, 
nil_matches:bit):bit ",       "CMDvarNE;",    "Equality of two daytimes"      ]
-[ "daytime",   "#fromstr",     "command daytime.#fromstr():void ",     
"daytime_tz_fromstr;",  ""      ]
-[ "daytime",   "#tostr",       "command daytime.#tostr():void ",       
"daytime_tostr;",       ""      ]
-[ "daytime",   "<",    "pattern daytime.<(v:daytime, w:daytime):bit ", 
"CMDvarLT;",    "Equality of two daytimes"      ]
-[ "daytime",   "<=",   "pattern daytime.<=(v:daytime, w:daytime):bit ",        
"CMDvarLE;",    "Equality of two daytimes"      ]
-[ "daytime",   "==",   "pattern daytime.==(v:daytime, w:daytime):bit ",        
"CMDvarEQ;",    "Equality of two daytimes"      ]
-[ "daytime",   "==",   "pattern daytime.==(v:daytime, w:daytime, 
nil_matches:bit):bit ",       "CMDvarEQ;",    "Equality of two daytimes"      ]
-[ "daytime",   ">",    "pattern daytime.>(v:daytime, w:daytime):bit ", 
"CMDvarGT;",    "Equality of two daytimes"      ]
-[ "daytime",   ">=",   "pattern daytime.>=(v:daytime, w:daytime):bit ",        
"CMDvarGE;",    "Equality of two daytimes"      ]
-[ "daytime",   "isnil",        "pattern daytime.isnil(v:daytime):bit ",        
"CMDvarISNIL;", "Nil test for daytime value"    ]
 [ "factories", "getArrival",   "command factories.getArrival():bat[:timestamp] 
",      "FCTgetArrival;",       "Retrieve the time stamp the last call was 
made."       ]
 [ "factories", "getCaller",    "command factories.getCaller():int ",   
"FCTgetCaller;",        "Retrieve the unique identity of the factory caller."   
]
 [ "factories", "getDeparture", "command 
factories.getDeparture():bat[:timestamp] ",    "FCTgetDeparture;",     
"Retrieve the time stamp the last answer was returned." ]
@@ -15538,6 +15515,9 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "diff", "command mtime.diff(val1:date, val2:date):int ",        
"MTIMEdate_diff;",      "returns the number of days\n\tbetween 'val1' and 
'val2'."      ]
 [ "mtime",     "diff", "command mtime.diff(val1:daytime, val2:daytime):lng ",  
"MTIMEdaytime_diff_msec;",      "returns the number of msec between 'val1' and 
'val2'." ]
 [ "mtime",     "diff", "command mtime.diff(val1:timestamp, val2:timestamp):lng 
",      "MTIMEtimestamp_diff_msec;",    "returns the number of 
milliseconds\n\tbetween 'val1' and 'val2'."      ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:timestamp):int ",        
"MTIMEseconds_since_epoch;",    "unix-time (epoch) support: seconds since 
epoch"        ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:lng):timestamp ",        
"MTIMEtimestamp_frommsec;",     "convert milli seconds since epoch into a 
timestamp"    ]
+[ "mtime",     "epoch",        "command mtime.epoch(t:int):timestamp ",        
"MTIMEtimestamp_fromsecond;",   "convert seconds since epoch into a timestamp"  
]
 [ "mtime",     "hours",        "command mtime.hours(h:daytime):int ",  
"MTIMEdaytime_extract_hours;",  "extracts hour from daytime"    ]
 [ "mtime",     "hours",        "command mtime.hours(msecs:lng):int ",  
"MTIMEsql_hours;",      ""      ]
 [ "mtime",     "hours",        "command mtime.hours(t:timestamp):int ",        
"MTIMEtimestamp_hours;",        ""      ]
@@ -15548,7 +15528,6 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "month",        "command mtime.month(d:date):int ",     
"MTIMEdate_extract_month;",     "extracts month from date"      ]
 [ "mtime",     "month",        "command mtime.month(months:int):int ", 
"MTIMEsql_month;",      ""      ]
 [ "mtime",     "month",        "command mtime.month(t:timestamp):int ",        
"MTIMEtimestamp_month;",        ""      ]
-[ "mtime",     "prelude",      "command mtime.prelude():void ",        
"MTIMEprelude;",        ""      ]
 [ "mtime",     "quarter",      "command mtime.quarter(d:date):int ",   
"MTIMEdate_extract_quarter;",   "extracts quarter from date"    ]
 [ "mtime",     "quarter",      "command mtime.quarter(t:timestamp):int ",      
"MTIMEtimestamp_quarter;",      ""      ]
 [ "mtime",     "seconds",      "command mtime.seconds(msecs:lng):int ",        
"MTIMEsql_seconds;",    ""      ]
@@ -16131,20 +16110,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sysmon",    "stop", "pattern sysmon.stop(id:int):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
 [ "sysmon",    "stop", "pattern sysmon.stop(id:lng):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
 [ "sysmon",    "stop", "pattern sysmon.stop(id:sht):void ",    "SYSMONstop;",  
"Stop a single query a.s.a.p."  ]
-[ "timestamp", "!=",   "pattern timestamp.!=(v:timestamp, w:timestamp):bit ",  
"CMDvarNE;",    "Equality of two timestamps"    ]
-[ "timestamp", "!=",   "pattern timestamp.!=(v:timestamp, w:timestamp, 
nil_matches:bit):bit ", "CMDvarNE;",    "Equality of two timestamps"    ]
-[ "timestamp", "#fromstr",     "command timestamp.#fromstr():void ",   
"timestamp_fromstr;",   ""      ]
-[ "timestamp", "#tostr",       "command timestamp.#tostr():void ",     
"timestamp_tostr;",     ""      ]
-[ "timestamp", "<",    "pattern timestamp.<(v:timestamp, w:timestamp):bit ",   
"CMDvarLT;",    "Equality of two timestamps"    ]
-[ "timestamp", "<=",   "pattern timestamp.<=(v:timestamp, w:timestamp):bit ",  
"CMDvarLE;",    "Equality of two timestamps"    ]
-[ "timestamp", "==",   "pattern timestamp.==(v:timestamp, w:timestamp):bit ",  
"CMDvarEQ;",    "Equality of two timestamps"    ]
-[ "timestamp", "==",   "pattern timestamp.==(v:timestamp, w:timestamp, 
nil_matches:bit):bit ", "CMDvarEQ;",    "Equality of two timestamps"    ]
-[ "timestamp", ">",    "pattern timestamp.>(v:timestamp, w:timestamp):bit ",   
"CMDvarGT;",    "Equality of two timestamps"    ]
-[ "timestamp", ">=",   "pattern timestamp.>=(v:timestamp, w:timestamp):bit ",  
"CMDvarGE;",    "Equality of two timestamps"    ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:timestamp):int ",    
"MTIMEseconds_since_epoch;",    "unix-time (epoch) support: seconds since 
epoch"        ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:lng):timestamp ",    
"MTIMEtimestamp_frommsec;",     "convert milli seconds since epoch into a 
timestamp"    ]
-[ "timestamp", "epoch",        "command timestamp.epoch(t:int):timestamp ",    
"MTIMEtimestamp_fromsecond;",   "convert seconds since epoch into a timestamp"  
]
-[ "timestamp", "isnil",        "pattern timestamp.isnil(v:timestamp):bit ",    
"CMDvarISNIL;", "Nil test for timestamp value"  ]
 [ "tokenizer", "append",       "command tokenizer.append(u:str):oid ", 
"TKNZRappend;", "tokenize a new string and append it to the tokenizer 
(duplicate elimination is performed)"     ]
 [ "tokenizer", "close",        "command tokenizer.close():void ",      
"TKNZRclose;",  "close the current tokenizer store"     ]
 [ "tokenizer", "depositFile",  "command tokenizer.depositFile(fnme:str):void 
",        "TKNZRdepositFile;",    "batch insertion from a file of strings to 
tokenize, each string is separated by a new line"    ]
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
@@ -439,6 +439,30 @@ BAT *canditer_slice(struct canditer *ci,
 BAT *canditer_slice2(struct canditer *ci, BUN lo1, BUN hi1, BUN lo2, BUN hi2);
 int closedir(DIR *dir);
 char *ctime_r(const time_t *restrict, char *restrict);
+date date_add_day(date dt, int days);
+date date_add_month(date dt, int months);
+date date_create(int year, int month, int day);
+int date_day(date dt);
+int date_dayofweek(date dt);
+int date_dayofyear(date dt);
+int date_diff(date d1, date d2);
+ssize_t date_fromstr(const char *buf, size_t *len, date **d, bool external);
+int date_month(date dt);
+ssize_t date_tostr(str *buf, size_t *len, const date *val, bool external);
+int date_weekofyear(date dt);
+int date_year(date dt);
+daytime daytime_add_usec(daytime tm, lng usec);
+daytime daytime_add_usec_modulo(daytime tm, lng usec);
+daytime daytime_create(int hour, int minute, int second, int usec);
+ssize_t daytime_fromstr(const char *buf, size_t *len, daytime **d, bool 
external);
+int daytime_hour(daytime tm);
+int daytime_min(daytime tm);
+ssize_t daytime_precision_tostr(str *buf, size_t *len, const daytime dt, int 
precision, bool external);
+int daytime_sec(daytime tm);
+int daytime_sec_usec(daytime tm);
+ssize_t daytime_tostr(str *buf, size_t *len, const daytime *val, bool 
external);
+ssize_t daytime_tz_fromstr(const char *buf, size_t *len, daytime **d, bool 
external);
+int daytime_usec(daytime tm);
 ssize_t dblFromStr(const char *src, size_t *len, dbl **dst, bool external);
 ssize_t dblToStr(str *dst, size_t *len, const dbl *src, bool external);
 const dbl dbl_nil;
@@ -514,6 +538,21 @@ ssize_t shtToStr(str *dst, size_t *len, 
 const sht sht_nil;
 ssize_t strFromStr(const char *restrict src, size_t *restrict len, str 
*restrict dst, bool external);
 const char str_nil[2];
+timestamp timestamp_add_month(timestamp t, int m);
+timestamp timestamp_add_usec(timestamp t, lng usec);
+timestamp timestamp_create(date dt, daytime tm);
+timestamp timestamp_current(void);
+date timestamp_date(timestamp t);
+daytime timestamp_daytime(timestamp t);
+lng timestamp_diff(timestamp t1, timestamp t2);
+timestamp timestamp_fromdate(date dt);
+ssize_t timestamp_fromstr(const char *buf, size_t *len, timestamp **d, bool 
external);
+timestamp timestamp_fromtime(time_t timeval);
+timestamp timestamp_fromusec(lng usec);
+ssize_t timestamp_precision_tostr(str *buf, size_t *len, timestamp val, int 
precision, bool external);
+ssize_t timestamp_tostr(str *buf, size_t *len, const timestamp *val, bool 
external);
+ssize_t timestamp_tz_fromstr(const char *buf, size_t *len, timestamp **ret, 
bool external);
+const timestamp unixepoch;
 gdk_return void_inplace(BAT *b, oid id, const void *val, bool force) 
__attribute__((__warn_unused_result__));
 int win_mkdir(const char *, const int mode);
 int win_rename(const char *, const char *);
@@ -1588,7 +1627,6 @@ str MTIMEdaytime_fromseconds(daytime *re
 str MTIMEdaytime_fromseconds_bulk(bat *ret, bat *bid);
 str MTIMEdaytime_fromstr(daytime *ret, const char *const *s);
 str MTIMElocal_timezone_msec(lng *ret);
-str MTIMEprelude(void *ret);
 str MTIMEseconds_since_epoch(int *ret, const timestamp *t);
 str MTIMEsql_day(lng *ret, const lng *msecs);
 str MTIMEsql_hours(int *ret, const lng *msecs);
@@ -1934,11 +1972,8 @@ str TRNtrans_abort(Client cntxt, MalBlkP
 str TRNtrans_clean(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str TRNtrans_commit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 int TYPE_blob;
-int TYPE_date;
-int TYPE_daytime;
 int TYPE_identifier;
 int TYPE_json;
-int TYPE_timestamp;
 int TYPE_xml;
 ssize_t URLfromString(const char *src, size_t *len, str *u, bool external);
 str URLgetAnchor(str *retval, url *val);
@@ -2149,30 +2184,6 @@ str crossRef;
 str cume_distRef;
 str dataflowRef;
 str dateRef;
-date date_add_day(date dt, int days);
-date date_add_month(date dt, int months);
-date date_create(int year, int month, int day);
-int date_day(date dt);
-int date_dayofweek(date dt);
-int date_dayofyear(date dt);
-int date_diff(date d1, date d2);
-ssize_t date_fromstr(const char *buf, size_t *len, date **d, bool external);
-int date_month(date dt);
-ssize_t date_tostr(str *buf, size_t *len, const date *val, bool external);
-int date_weekofyear(date dt);
-int date_year(date dt);
-daytime daytime_add_usec(daytime tm, lng usec);
-daytime daytime_add_usec_modulo(daytime tm, lng usec);
-daytime daytime_create(int hour, int minute, int second, int usec);
-ssize_t daytime_fromstr(const char *buf, size_t *len, daytime **d, bool 
external);
-int daytime_hour(daytime tm);
-int daytime_min(daytime tm);
-ssize_t daytime_precision_tostr(str *buf, size_t *len, const daytime dt, int 
precision, bool external);
-int daytime_sec(daytime tm);
-int daytime_sec_usec(daytime tm);
-ssize_t daytime_tostr(str *buf, size_t *len, const daytime *val, bool 
external);
-ssize_t daytime_tz_fromstr(const char *buf, size_t *len, daytime **d, bool 
external);
-int daytime_usec(daytime tm);
 str dblRef;
 str deblockdataflow(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int 
first, int size);
@@ -2687,20 +2698,6 @@ str thetajoinRef;
 str thetaselectRef;
 str tidRef;
 str timestampRef;
-timestamp timestamp_add_month(timestamp t, int m);
-timestamp timestamp_add_usec(timestamp t, lng usec);
-timestamp timestamp_create(date dt, daytime tm);
-timestamp timestamp_current(void);
-date timestamp_date(timestamp t);
-daytime timestamp_daytime(timestamp t);
-lng timestamp_diff(timestamp t1, timestamp t2);
-timestamp timestamp_fromdate(date dt);
-ssize_t timestamp_fromstr(const char *buf, size_t *len, timestamp **d, bool 
external);
-timestamp timestamp_fromtime(time_t timeval);
-timestamp timestamp_fromusec(lng usec);
-ssize_t timestamp_precision_tostr(str *buf, size_t *len, timestamp val, int 
precision, bool external);
-ssize_t timestamp_tostr(str *buf, size_t *len, const timestamp *val, bool 
external);
-ssize_t timestamp_tz_fromstr(const char *buf, size_t *len, timestamp **ret, 
bool external);
 void traceFunction(COMPONENT comp, MalBlkPtr mb, MalStkPtr stk, int flg);
 void traceInstruction(COMPONENT comp, MalBlkPtr mb, MalStkPtr stk, InstrPtr p, 
int flg);
 str transactionRef;
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -32,6 +32,7 @@ lib_gdk = {
                gdk_group.c \
                gdk_imprints.c gdk_imprints.h \
                gdk_join.c gdk_project.c \
+               gdk_time.c gdk_time.h \
                gdk_unique.c \
                gdk_interprocess.c gdk_interprocess.h \
                gdk_firstn.c \
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -482,6 +482,9 @@ enum {
 #ifdef HAVE_HGE
        TYPE_hge,
 #endif
+       TYPE_date,
+       TYPE_daytime,
+       TYPE_timestamp,
        TYPE_str,
        TYPE_any = 255,         /* limit types to <255! */
 };
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -22,6 +22,7 @@
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to