Changeset: 818c7f062014 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=818c7f062014
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        sql/backends/monet5/sql.mal
        sql/backends/monet5/sql_datetrunc.c
        sql/test/BugTracker-2019/Tests/date_trunc.sql
        sql/test/BugTracker-2019/Tests/date_trunc.stable.out
        sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql
        sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out
        sql/test/pg_regress/Tests/alter_table.stable.err
        sql/test/pg_regress/Tests/boolean.stable.err
        sql/test/pg_regress/Tests/date.sql
        sql/test/pg_regress/Tests/date.stable.err
        sql/test/pg_regress/Tests/date.stable.out
        sql/test/pg_regress/Tests/float4.stable.err
        sql/test/pg_regress/Tests/horology.stable.err
        sql/test/pg_regress/Tests/interval.stable.out.int128
        sql/test/pg_regress/Tests/timestamp.sql
        sql/test/pg_regress/Tests/timestamp.stable.err
        sql/test/pg_regress/Tests/timestamp.stable.out
        sql/test/pg_regress/Tests/timestamptz.sql
        sql/test/pg_regress/Tests/timestamptz.stable.err
        sql/test/pg_regress/Tests/timestamptz.stable.out
        sql/test/pg_regress/Tests/without_oid.stable.out
        testing/Mtest.py.in
Branch: default
Log Message:

Merge with Apr2019 branch.


diffs (truncated from 763 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
@@ -11676,8 +11676,8 @@ Ready.
 [ "sql",       "cume_dist",    "pattern sql.cume_dist(b:any_1, p:bit, 
o:bit):dbl ",    "SQLcume_dist;",        "return the accumulated distribution 
of the number of rows per group to the total number of partition rows"     ]
 [ "sql",       "current_time", "pattern sql.current_time():daytime ",  
"SQLcurrent_daytime;",  "Get the clients current daytime"       ]
 [ "sql",       "current_timestamp",    "pattern 
sql.current_timestamp():timestamp ",   "SQLcurrent_timestamp;",        "Get the 
clients current timestamp"     ]
-[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:bat[:timestamp]):bat[:timestamp] ",        "bat_date_trunc;",      "Truncate 
a timestamp to (millenium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)" ]
-[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:timestamp):timestamp ",    "date_trunc;",  "Truncate a timestamp to 
(millenium, century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)" ]
+[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:bat[:timestamp]):bat[:timestamp] ",        "bat_date_trunc;",      "Truncate 
a timestamp to (millennium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)"        ]
+[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:timestamp):timestamp ",    "date_trunc;",  "Truncate a timestamp to 
(millennium, century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)"        ]
 [ "sql",       "db_users",     "pattern sql.db_users():bat[:str] ",    
"db_users_wrap;",       "return table of users with sql scenario"       ]
 [ "sql",       "dec_round",    "command sql.dec_round(v:bte, r:bte):bte ",     
"bte_dec_round_wrap;",  "round off the value v to nearests multiple of r"       
]
 [ "sql",       "dec_round",    "command sql.dec_round(v:dbl, r:dbl):dbl ",     
"dbl_dec_round_wrap;",  "round off the value v to nearests multiple of r"       
]
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
@@ -16089,8 +16089,8 @@ Ready.
 [ "sql",       "cume_dist",    "pattern sql.cume_dist(b:any_1, p:bit, 
o:bit):dbl ",    "SQLcume_dist;",        "return the accumulated distribution 
of the number of rows per group to the total number of partition rows"     ]
 [ "sql",       "current_time", "pattern sql.current_time():daytime ",  
"SQLcurrent_daytime;",  "Get the clients current daytime"       ]
 [ "sql",       "current_timestamp",    "pattern 
sql.current_timestamp():timestamp ",   "SQLcurrent_timestamp;",        "Get the 
clients current timestamp"     ]
-[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:bat[:timestamp]):bat[:timestamp] ",        "bat_date_trunc;",      "Truncate 
a timestamp to (millenium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)" ]
-[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:timestamp):timestamp ",    "date_trunc;",  "Truncate a timestamp to 
(millenium, century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)" ]
+[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:bat[:timestamp]):bat[:timestamp] ",        "bat_date_trunc;",      "Truncate 
a timestamp to (millennium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)"        ]
+[ "sql",       "date_trunc",   "command sql.date_trunc(scale:str, 
v:timestamp):timestamp ",    "date_trunc;",  "Truncate a timestamp to 
(millennium, century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)"        ]
 [ "sql",       "db_users",     "pattern sql.db_users():bat[:str] ",    
"db_users_wrap;",       "return table of users with sql scenario"       ]
 [ "sql",       "dec_round",    "command sql.dec_round(v:bte, r:bte):bte ",     
"bte_dec_round_wrap;",  "round off the value v to nearests multiple of r"       
]
 [ "sql",       "dec_round",    "command sql.dec_round(v:dbl, r:dbl):dbl ",     
"dbl_dec_round_wrap;",  "round off the value v to nearests multiple of r"       
]
diff --git a/sql/backends/monet5/sql.mal b/sql/backends/monet5/sql.mal
--- a/sql/backends/monet5/sql.mal
+++ b/sql/backends/monet5/sql.mal
@@ -914,11 +914,11 @@ comment "cast daytime to daytime and che
 
 command sql.date_trunc( scale:str, v:bat[:timestamp]):bat[:timestamp] 
 address bat_date_trunc
-comment "Truncate a timestamp to (millenium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)";
+comment "Truncate a timestamp to (millennium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)";
 
 command sql.date_trunc( scale:str, v:timestamp):timestamp 
 address date_trunc
-comment "Truncate a timestamp to (millenium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)";
+comment "Truncate a timestamp to (millennium, 
century,decade,year,quarter,month,week,day,hour,minute,second, 
milliseconds,microseconds)";
 
 pattern current_time() :daytime
 address SQLcurrent_daytime
diff --git a/sql/backends/monet5/sql_datetrunc.c 
b/sql/backends/monet5/sql_datetrunc.c
--- a/sql/backends/monet5/sql_datetrunc.c
+++ b/sql/backends/monet5/sql_datetrunc.c
@@ -12,7 +12,7 @@
 
 #define date_trunc_time_loop(NAME, DIVISOR)                            \
        do {                                                            \
-               if  ( strcmp(*scale, NAME) == 0){                       \
+               if  ( strcasecmp(*scale, NAME) == 0){                   \
                        for( ; lo < hi; lo++)                           \
                                if (is_timestamp_nil(bt[lo])) {         \
                                        dt[lo] = *timestamp_nil;        \
@@ -28,19 +28,19 @@ static inline bool
 truncate_check(const char *scale)
 {
        return
-               strcmp(scale, "millenium") == 0 ||
-               strcmp(scale, "century") == 0  ||
-               strcmp(scale, "decade") == 0 ||
-               strcmp(scale, "year") == 0 ||
-               strcmp(scale, "quarter" ) == 0 ||
-               strcmp(scale, "month") == 0 ||
-               strcmp(scale, "week") == 0 ||
-               strcmp(scale, "day") == 0  ||
-               strcmp(scale, "hour") == 0 ||
-               strcmp(scale, "minute") == 0 ||
-               strcmp(scale, "second") == 0 ||
-               strcmp(scale, "milliseconds") == 0 ||
-               strcmp(scale, "microseconds") == 0;
+               strcasecmp(scale, "millennium") == 0 ||
+               strcasecmp(scale, "century") == 0  ||
+               strcasecmp(scale, "decade") == 0 ||
+               strcasecmp(scale, "year") == 0 ||
+               strcasecmp(scale, "quarter" ) == 0 ||
+               strcasecmp(scale, "month") == 0 ||
+               strcasecmp(scale, "week") == 0 ||
+               strcasecmp(scale, "day") == 0  ||
+               strcasecmp(scale, "hour") == 0 ||
+               strcasecmp(scale, "minute") == 0 ||
+               strcasecmp(scale, "second") == 0 ||
+               strcasecmp(scale, "milliseconds") == 0 ||
+               strcasecmp(scale, "microseconds") == 0;
 }
 
 str
@@ -78,7 +78,7 @@ bat_date_trunc(bat *res, const str *scal
        date_trunc_time_loop("minute", 1000 * 60);
        date_trunc_time_loop("hour", 1000 * 60 * 24);
 
-       if  ( strcmp(*scale, "day") == 0){
+       if  ( strcasecmp(*scale, "day") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -89,7 +89,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "week") == 0){
+       if  ( strcasecmp(*scale, "week") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -104,7 +104,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "month") == 0){
+       if  ( strcasecmp(*scale, "month") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -117,7 +117,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "quarter") == 0){
+       if  ( strcasecmp(*scale, "quarter") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -131,7 +131,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "year") == 0){
+       if  ( strcasecmp(*scale, "year") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -144,7 +144,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "decade") == 0){
+       if  ( strcasecmp(*scale, "decade") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -158,7 +158,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "century") == 0){
+       if  ( strcasecmp(*scale, "century") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -172,7 +172,7 @@ bat_date_trunc(bat *res, const str *scal
                        }
        }
 
-       if  ( strcmp(*scale, "millenium") == 0){
+       if  ( strcasecmp(*scale, "millennium") == 0){
                for( ; lo < hi; lo++)
                        if (is_timestamp_nil(bt[lo])) {
                                dt[lo] = *timestamp_nil;
@@ -200,7 +200,7 @@ bat_date_trunc(bat *res, const str *scal
 
 #define date_trunc_single_time(NAME, DIVISOR)                          \
        do {                                                            \
-               if  ( strcmp(*scale, NAME) == 0){                       \
+               if  ( strcasecmp(*scale, NAME) == 0){                   \
                        ts = *bt;                                       \
                        ts.msecs = (ts.msecs / (DIVISOR)) * (DIVISOR);  \
                        *dt = ts;                                       \
@@ -228,13 +228,13 @@ date_trunc(timestamp *dt, const str *sca
        date_trunc_single_time("minute", 1000 * 60);
        date_trunc_single_time("hour", 1000 * 60 * 24);
 
-       if  ( strcmp(*scale, "day") == 0){
+       if  ( strcasecmp(*scale, "day") == 0){
                ts = *bt;
                ts.msecs = 0;
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "week") == 0){
+       if  ( strcasecmp(*scale, "week") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -244,7 +244,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "month") == 0){
+       if  ( strcasecmp(*scale, "month") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -252,7 +252,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "quarter") == 0){
+       if  ( strcasecmp(*scale, "quarter") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -261,7 +261,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "year") == 0){
+       if  ( strcasecmp(*scale, "year") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -269,7 +269,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "decade") == 0){
+       if  ( strcasecmp(*scale, "decade") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -278,7 +278,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "century") == 0){
+       if  ( strcasecmp(*scale, "century") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
@@ -287,7 +287,7 @@ date_trunc(timestamp *dt, const str *sca
                *dt = ts;
        }
 
-       if  ( strcmp(*scale, "millenium") == 0){
+       if  ( strcasecmp(*scale, "millennium") == 0){
                ts = *bt;
                ts.msecs = 0;
                MTIMEdate_extract_ymd(&y, &m, &d, &ts.days);
diff --git a/sql/test/BugTracker-2019/Tests/date_trunc.sql 
b/sql/test/BugTracker-2019/Tests/date_trunc.sql
--- a/sql/test/BugTracker-2019/Tests/date_trunc.sql
+++ b/sql/test/BugTracker-2019/Tests/date_trunc.sql
@@ -13,4 +13,4 @@ select date_trunc('quarter', timestamp '
 select date_trunc('year', timestamp '2119-02-17 02:08:12.345678');
 select date_trunc('decade', timestamp '2119-02-17 02:08:12.345678');
 select date_trunc('century', timestamp '2119-02-17 02:08:12.345678');
-select date_trunc('millenium', timestamp '2119-02-17 02:08:12.345678');
+select date_trunc('millennium', timestamp '2119-02-17 02:08:12.345678');
diff --git a/sql/test/BugTracker-2019/Tests/date_trunc.stable.out 
b/sql/test/BugTracker-2019/Tests/date_trunc.stable.out
--- a/sql/test/BugTracker-2019/Tests/date_trunc.stable.out
+++ b/sql/test/BugTracker-2019/Tests/date_trunc.stable.out
@@ -102,7 +102,7 @@ Ready.
 % timestamp # type
 % 26 # length
 [ 2101-01-01 00:00:00.000000   ]
-#select date_trunc('millenium', timestamp '2119-02-17 02:08:12.345678');
+#select date_trunc('millennium', timestamp '2119-02-17 02:08:12.345678');
 % .L2 # table_name
 % L2 # name
 % timestamp # type
diff --git a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql 
b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql
--- a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql
+++ b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.sql
@@ -17,5 +17,5 @@ select date_trunc('quarter', t) from dt_
 select date_trunc('year', t) from dt_tmp;
 select date_trunc('decade', t) from dt_tmp;
 select date_trunc('century', t) from dt_tmp;
-select date_trunc('millenium', t) from dt_tmp;
+select date_trunc('millennium', t) from dt_tmp;
 rollback;
diff --git a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out 
b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out
--- a/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out
+++ b/sql/test/BugTracker-2019/Tests/date_trunc_bulk.stable.out
@@ -119,7 +119,7 @@ Ready.
 % 26 # length
 [ 2101-01-01 00:00:00.000000   ]
 [ NULL ]
-#select date_trunc('millenium', t) from dt_tmp;
+#select date_trunc('millennium', t) from dt_tmp;
 % .L2 # table_name
 % L2 # name
 % timestamp # type
diff --git a/sql/test/pg_regress/Tests/alter_table.stable.err 
b/sql/test/pg_regress/Tests/alter_table.stable.err
--- a/sql/test/pg_regress/Tests/alter_table.stable.err
+++ b/sql/test/pg_regress/Tests/alter_table.stable.err
@@ -477,11 +477,11 @@ ERROR = !syntax error, unexpected IDENT 
 CODE  = 42000
 MAPI  = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
 QUERY = alter table atacc1 alter a set storage plain;
-ERROR = !syntax error, unexpected IDENT, expecting STRING or sqlNULL in: 
"alter table atacc1 alter a set storage plain"
+ERROR = !syntax error, unexpected IDENT, expecting STRING or USTRING or 
sqlNULL in: "alter table atacc1 alter a set storage plain"
 CODE  = 42000
 MAPI  = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
 QUERY = alter table atacc1 alter "........pg.dropped.1........" set storage 
plain;
-ERROR = !syntax error, unexpected IDENT, expecting STRING or sqlNULL in: 
"alter table atacc1 alter "........pg.dropped.1........" set storage plain"
+ERROR = !syntax error, unexpected IDENT, expecting STRING or USTRING or 
sqlNULL in: "alter table atacc1 alter "........pg.dropped.1........" set 
storage plain"
 CODE  = 42000
 MAPI  = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to