Changeset: 55c8ae35c4c2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55c8ae35c4c2
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        sql/common/sql_types.c
        sql/test/sys-schema/Tests/systemfunctions.stable.out
        sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
Branch: typing
Log Message:

Added 'abs' and 'sign' back on intervals


diffs (125 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
@@ -5442,9 +5442,9 @@ stdout of test 'MAL-signatures` in direc
 [ "batmtime",  "dayofyear",    "command 
batmtime.dayofyear(X_1:bat[:date]):bat[:int] ",        
"MTIMEdate_extract_dayofyear_bulk;",    ""      ]
 [ "batmtime",  "decade",       "command 
batmtime.decade(X_1:bat[:date]):bat[:int] ",   
"MTIMEdate_extract_decade_bulk;",       ""      ]
 [ "batmtime",  "decade",       "command 
batmtime.decade(X_1:bat[:timestamp]):bat[:int] ",      
"MTIMEtimestamp_decade_bulk;",  ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:bat[:date]):bat[:int] ",     "MTIMEdate_diff_bulk;", ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:date, 
X_2:bat[:date]):bat[:int] ",   "MTIMEdate_diff_bulk_p1;",      ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:date):bat[:int] ",   "MTIMEdate_diff_bulk_p2;",      ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:bat[:date]):bat[:lng] ",     "MTIMEdate_diff_bulk;", ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:date, 
X_2:bat[:date]):bat[:lng] ",   "MTIMEdate_diff_bulk_p1;",      ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:date):bat[:lng] ",   "MTIMEdate_diff_bulk_p2;",      ""      ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:daytime], 
X_2:bat[:daytime]):bat[:lng] ",       "MTIMEdaytime_diff_msec_bulk;", ""      ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:daytime, 
X_2:bat[:daytime]):bat[:lng] ",     "MTIMEdaytime_diff_msec_bulk_p1;",      ""  
    ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:daytime], 
X_2:daytime):bat[:lng] ",     "MTIMEdaytime_diff_msec_bulk_p2;",      ""      ]
@@ -8038,7 +8038,7 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "dayofyear",    "command mtime.dayofyear(X_1:date):int ",       
"MTIMEdate_extract_dayofyear;", ""      ]
 [ "mtime",     "decade",       "command mtime.decade(X_1:date):int ",  
"MTIMEdate_extract_decade;",    ""      ]
 [ "mtime",     "decade",       "command mtime.decade(X_1:timestamp):int ",     
"MTIMEtimestamp_decade;",       ""      ]
-[ "mtime",     "diff", "command mtime.diff(X_1:date, X_2:date):int ",  
"MTIMEdate_diff;",      ""      ]
+[ "mtime",     "diff", "command mtime.diff(X_1:date, X_2:date):lng ",  
"MTIMEdate_diff;",      ""      ]
 [ "mtime",     "diff", "command mtime.diff(X_1:daytime, X_2:daytime):lng ",    
"MTIMEdaytime_diff_msec;",      ""      ]
 [ "mtime",     "diff", "command mtime.diff(X_1:timestamp, X_2:timestamp):lng 
",        "MTIMEtimestamp_diff_msec;",    ""      ]
 [ "mtime",     "epoch",        "command mtime.epoch(X_1:timestamp):int ",      
"MTIMEseconds_since_epoch;",    ""      ]
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
@@ -7642,9 +7642,9 @@ stdout of test 'MAL-signatures` in direc
 [ "batmtime",  "dayofyear",    "command 
batmtime.dayofyear(X_1:bat[:date]):bat[:int] ",        
"MTIMEdate_extract_dayofyear_bulk;",    ""      ]
 [ "batmtime",  "decade",       "command 
batmtime.decade(X_1:bat[:date]):bat[:int] ",   
"MTIMEdate_extract_decade_bulk;",       ""      ]
 [ "batmtime",  "decade",       "command 
batmtime.decade(X_1:bat[:timestamp]):bat[:int] ",      
"MTIMEtimestamp_decade_bulk;",  ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:bat[:date]):bat[:int] ",     "MTIMEdate_diff_bulk;", ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:date, 
X_2:bat[:date]):bat[:int] ",   "MTIMEdate_diff_bulk_p1;",      ""      ]
-[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:date):bat[:int] ",   "MTIMEdate_diff_bulk_p2;",      ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:bat[:date]):bat[:lng] ",     "MTIMEdate_diff_bulk;", ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:date, 
X_2:bat[:date]):bat[:lng] ",   "MTIMEdate_diff_bulk_p1;",      ""      ]
+[ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:date], 
X_2:date):bat[:lng] ",   "MTIMEdate_diff_bulk_p2;",      ""      ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:daytime], 
X_2:bat[:daytime]):bat[:lng] ",       "MTIMEdaytime_diff_msec_bulk;", ""      ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:daytime, 
X_2:bat[:daytime]):bat[:lng] ",     "MTIMEdaytime_diff_msec_bulk_p1;",      ""  
    ]
 [ "batmtime",  "diff", "command batmtime.diff(X_1:bat[:daytime], 
X_2:daytime):bat[:lng] ",     "MTIMEdaytime_diff_msec_bulk_p2;",      ""      ]
@@ -10934,7 +10934,7 @@ stdout of test 'MAL-signatures` in direc
 [ "mtime",     "dayofyear",    "command mtime.dayofyear(X_1:date):int ",       
"MTIMEdate_extract_dayofyear;", ""      ]
 [ "mtime",     "decade",       "command mtime.decade(X_1:date):int ",  
"MTIMEdate_extract_decade;",    ""      ]
 [ "mtime",     "decade",       "command mtime.decade(X_1:timestamp):int ",     
"MTIMEtimestamp_decade;",       ""      ]
-[ "mtime",     "diff", "command mtime.diff(X_1:date, X_2:date):int ",  
"MTIMEdate_diff;",      ""      ]
+[ "mtime",     "diff", "command mtime.diff(X_1:date, X_2:date):lng ",  
"MTIMEdate_diff;",      ""      ]
 [ "mtime",     "diff", "command mtime.diff(X_1:daytime, X_2:daytime):lng ",    
"MTIMEdaytime_diff_msec;",      ""      ]
 [ "mtime",     "diff", "command mtime.diff(X_1:timestamp, X_2:timestamp):lng 
",        "MTIMEtimestamp_diff_msec;",    ""      ]
 [ "mtime",     "epoch",        "command mtime.epoch(X_1:timestamp):int ",      
"MTIMEseconds_since_epoch;",    ""      ]
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -1597,10 +1597,13 @@ sqltypeinit( sql_allocator *sa)
        sql_create_func(sa, "xor", "calc", "xor", FALSE, FALSE, SCALE_FIX, 0, 
BIT, 2, BIT, BIT);
        sql_create_func(sa, "not", "calc", "not", FALSE, FALSE, SCALE_FIX, 0, 
BIT, 1, BIT);
 
+       /* functions for interval types */
        for (t = dates; *t != TME; t++) {
                sql_create_func(sa, "sql_sub", "calc", "-", FALSE, FALSE, 
SCALE_FIX, 0, *t, 2, *t, *t);
                sql_create_func(sa, "sql_add", "calc", "+", FALSE, FALSE, 
SCALE_FIX, 0, *t, 2, *t, *t);
                sql_create_func(sa, "sql_neg", "calc", "-", TRUE, FALSE, INOUT, 
0, *t, 1, *t);
+               sql_create_func(sa, "abs", "calc", "abs", FALSE, FALSE, 
SCALE_FIX, 0, *t, 1, *t);
+               sql_create_func(sa, "sign", "calc", "sign", FALSE, FALSE, 
SCALE_NONE, 0, BTE, 1, *t);
        }
 
        /* allow smaller types for arguments of mul/div */
diff --git a/sql/test/sys-schema/Tests/systemfunctions.stable.out 
b/sql/test/sys-schema/Tests/systemfunctions.stable.out
--- a/sql/test/sys-schema/Tests/systemfunctions.stable.out
+++ b/sql/test/sys-schema/Tests/systemfunctions.stable.out
@@ -106,6 +106,12 @@ stdout of test 'systemfunctions` in dire
 [ "sys",       ">=",   2,      "any",  ""      ]
 [ "sys",       "abbrev",       0,      "clob", "create function \"abbrev\" (p 
inet) returns clob\nexternal name inet.\"abbrev\";"      ]
 [ "sys",       "abbrev",       1,      "inet", ""      ]
+[ "sys",       "abs",  0,      "month_interval",       "abs"   ]
+[ "sys",       "abs",  1,      "month_interval",       ""      ]
+[ "sys",       "abs",  0,      "day_interval", "abs"   ]
+[ "sys",       "abs",  1,      "day_interval", ""      ]
+[ "sys",       "abs",  0,      "sec_interval", "abs"   ]
+[ "sys",       "abs",  1,      "sec_interval", ""      ]
 [ "sys",       "abs",  0,      "oid",  "abs"   ]
 [ "sys",       "abs",  1,      "oid",  ""      ]
 [ "sys",       "abs",  0,      "tinyint",      "abs"   ]
@@ -3614,6 +3620,12 @@ stdout of test 'systemfunctions` in dire
 [ "sys",       "shutdown",     0,      "tinyint",      "create procedure 
sys.shutdown(delay tinyint, force bool)\nexternal name sql.shutdown;" ]
 [ "sys",       "shutdown",     1,      "boolean",      ""      ]
 [ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "month_interval",       ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "day_interval", ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "sec_interval", ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
 [ "sys",       "sign", 1,      "oid",  ""      ]
 [ "sys",       "sign", 0,      "tinyint",      "sign"  ]
 [ "sys",       "sign", 1,      "tinyint",      ""      ]
diff --git a/sql/test/sys-schema/Tests/systemfunctions.stable.out.int128 
b/sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
--- a/sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
+++ b/sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
@@ -109,6 +109,12 @@ stdout of test 'systemfunctions` in dire
 [ "sys",       ">=",   2,      "any",  ""      ]
 [ "sys",       "abbrev",       0,      "clob", "create function \"abbrev\" (p 
inet) returns clob\nexternal name inet.\"abbrev\";"      ]
 [ "sys",       "abbrev",       1,      "inet", ""      ]
+[ "sys",       "abs",  0,      "month_interval",       "abs"   ]
+[ "sys",       "abs",  1,      "month_interval",       ""      ]
+[ "sys",       "abs",  0,      "day_interval", "abs"   ]
+[ "sys",       "abs",  1,      "day_interval", ""      ]
+[ "sys",       "abs",  0,      "sec_interval", "abs"   ]
+[ "sys",       "abs",  1,      "sec_interval", ""      ]
 [ "sys",       "abs",  0,      "oid",  "abs"   ]
 [ "sys",       "abs",  1,      "oid",  ""      ]
 [ "sys",       "abs",  0,      "tinyint",      "abs"   ]
@@ -4046,6 +4052,12 @@ stdout of test 'systemfunctions` in dire
 [ "sys",       "shutdown",     0,      "tinyint",      "create procedure 
sys.shutdown(delay tinyint, force bool)\nexternal name sql.shutdown;" ]
 [ "sys",       "shutdown",     1,      "boolean",      ""      ]
 [ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "month_interval",       ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "day_interval", ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
+[ "sys",       "sign", 1,      "sec_interval", ""      ]
+[ "sys",       "sign", 0,      "tinyint",      "sign"  ]
 [ "sys",       "sign", 1,      "oid",  ""      ]
 [ "sys",       "sign", 0,      "tinyint",      "sign"  ]
 [ "sys",       "sign", 1,      "tinyint",      ""      ]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to