Changeset: b8296c326365 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8296c326365
Modified Files:
        .bumpversion.cfg
        .hgtags
        MonetDB.spec
        NT/monetdb_config.h.in
        NT/rules.msc
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/mapilib/mapi.rc
        clients/odbc/driver/driver.rc
        clients/odbc/winsetup/setup.rc
        configure.ag
        debian/changelog
        gdk/libbat.rc
        libversions
        monetdb5/modules/atoms/mtime.c
        monetdb5/tools/libmonetdb5.rc
        sql/backends/monet5/UDF/pyapi3/connection3.c
        sql/backends/monet5/UDF/pyapi3/convert_loops.h
        sql/backends/monet5/UDF/pyapi3/formatinput3.c
        sql/backends/monet5/UDF/pyapi3/pyapi3.c
        sql/backends/monet5/UDF/pyapi3/pyheader.h
        sql/backends/monet5/UDF/pyapi3/pytypes3.c
        sql/backends/monet5/UDF/pyapi3/type_conversion.h
        sql/backends/monet5/UDF/pyapi3/type_conversion3.c
        sql/backends/monet5/sql.mal
        sql/backends/monet5/sql_user.c
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/subquery/Tests/subquery6.sql
        testing/malcheck.py
Branch: scoping
Log Message:

Merged with default


diffs (truncated from 782 to 300 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -6,6 +6,8 @@ tag = False
 [bumpversion:file:configure.ag]
 
 [bumpversion:file:MonetDB.spec]
+search = %global version {current_version}
+replace = %global version {new_version}
 
 [bumpversion:file:NT/rules.msc]
 
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -772,3 +772,6 @@ 0d51d6758f2b1f3f1804415545f8551a38da1848
 28480e096722b7f76ab021c0d16c68c6949f41b4 Jun2020_5
 0d51d6758f2b1f3f1804415545f8551a38da1848 Jun2020_release
 28480e096722b7f76ab021c0d16c68c6949f41b4 Jun2020_release
+80bd3e89c48032840f493a63d6c4c12ee6273b3d Jun2020_7
+28480e096722b7f76ab021c0d16c68c6949f41b4 Jun2020_release
+80bd3e89c48032840f493a63d6c4c12ee6273b3d Jun2020_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -984,6 +984,9 @@ fi
 %postun -p /sbin/ldconfig
 
 %changelog
+* Fri May 29 2020 Sjoerd Mullender <[email protected]> - 11.37.7-20200529
+- Rebuilt.
+
 * Tue May 26 2020 Sjoerd Mullender <[email protected]> - 11.37.5-20200526
 - Rebuilt.
 - BZ#6864: (I)LIKE with multiple % doen't find matches
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
@@ -9101,8 +9101,8 @@ stdout of test 'MAL-signatures` in direc
 [ "batcalc",   "hash", "command batcalc.hash(b:bat[:lng]):bat[:lng] ", 
"MKEYbathash;", ""      ]
 [ "batcalc",   "hash", "command batcalc.hash(b:bat[:oid]):bat[:lng] ", 
"MKEYbathash;", ""      ]
 [ "batcalc",   "hash", "command batcalc.hash(b:bat[:sht]):bat[:lng] ", 
"MKEYbathash;", ""      ]
-[ "batcalc",   "identity",     "command 
batcalc.identity(b:bat[:any_2]):bat[:oid] ",   "BATSQLidentity;",      "Returns 
the unique row identitfiers."  ]
-[ "batcalc",   "identity",     "pattern batcalc.identity(b:bat[:any_2], s:oid) 
(resb:bat[:oid], ns:oid) ",     "PBATSQLidentity;",     "Returns the unique row 
identitfiers."  ]
+[ "batcalc",   "identity",     "command 
batcalc.identity(b:bat[:any]):bat[:oid] ",     "BATSQLidentity;",      "Returns 
the unique row identitfiers."  ]
+[ "batcalc",   "identity",     "pattern batcalc.identity(b:bat[:any], s:oid) 
(resb:bat[:oid], ns:oid) ",       "PBATSQLidentity;",     "Returns the unique 
row identitfiers."  ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
b1:bat[:any_1], b2:bat[:any_1]):bat[:any_1] ", "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
b1:bat[:any_1], v2:any_1):bat[:any_1] ",       "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
v1:any_1, b2:bat[:any_1]):bat[:any_1] ",       "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
@@ -12836,7 +12836,7 @@ stdout of test 'MAL-signatures` in direc
 [ "calc",      "hash", "pattern calc.hash(v:lng):lng ",        "MKEYhash;",    
""      ]
 [ "calc",      "hash", "pattern calc.hash(v:oid):lng ",        "MKEYhash;",    
""      ]
 [ "calc",      "hash", "pattern calc.hash(v:sht):lng ",        "MKEYhash;",    
""      ]
-[ "calc",      "identity",     "command calc.identity(X_0:any_2):oid ",        
"SQLidentity;", "Returns a unique row identitfier."     ]
+[ "calc",      "identity",     "command calc.identity(X_0:any):oid ",  
"SQLidentity;", "Returns a unique row identitfier."     ]
 [ "calc",      "ifthenelse",   "pattern calc.ifthenelse(b:bit, t:any_1, 
f:any_1):any_1 ",      "CALCswitchbit;",       "If VALUE is true return MIDDLE 
else RIGHT"     ]
 [ "calc",      "index",        "command calc.index(v:str, u:bit):bte ",        
"STRindex_bte;",        "Return the offsets as an index bat"    ]
 [ "calc",      "index",        "command calc.index(v:str, u:bit):int ",        
"STRindex_int;",        "Return the offsets as an index bat"    ]
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
@@ -13139,8 +13139,8 @@ stdout of test 'MAL-signatures` in direc
 [ "batcalc",   "hge_noerror",  "pattern batcalc.hge_noerror(b:bat[:str], 
r:bat[:bit]):bat[:hge] ",     "CMDconvert_hge;",      "cast from str to hge"  ]
 [ "batcalc",   "hge_noerror",  "pattern batcalc.hge_noerror(b:bat[:str], 
s:bat[:oid]):bat[:hge] ",     "CMDconvert_hge;",      "cast from str to hge 
with candidates list"     ]
 [ "batcalc",   "hge_noerror",  "pattern batcalc.hge_noerror(b:bat[:str], 
s:bat[:oid], r:bat[:bit]):bat[:hge] ",        "CMDconvert_hge;",      "cast 
from str to hge with candidates list"     ]
-[ "batcalc",   "identity",     "command 
batcalc.identity(b:bat[:any_2]):bat[:oid] ",   "BATSQLidentity;",      "Returns 
the unique row identitfiers."  ]
-[ "batcalc",   "identity",     "pattern batcalc.identity(b:bat[:any_2], s:oid) 
(resb:bat[:oid], ns:oid) ",     "PBATSQLidentity;",     "Returns the unique row 
identitfiers."  ]
+[ "batcalc",   "identity",     "command 
batcalc.identity(b:bat[:any]):bat[:oid] ",     "BATSQLidentity;",      "Returns 
the unique row identitfiers."  ]
+[ "batcalc",   "identity",     "pattern batcalc.identity(b:bat[:any], s:oid) 
(resb:bat[:oid], ns:oid) ",       "PBATSQLidentity;",     "Returns the unique 
row identitfiers."  ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
b1:bat[:any_1], b2:bat[:any_1]):bat[:any_1] ", "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
b1:bat[:any_1], v2:any_1):bat[:any_1] ",       "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
 [ "batcalc",   "ifthenelse",   "pattern batcalc.ifthenelse(b:bat[:bit], 
v1:any_1, b2:bat[:any_1]):bat[:any_1] ",       "CMDifthen;",   "If-then-else 
operation to assemble a conditional result"       ]
@@ -18190,7 +18190,7 @@ stdout of test 'MAL-signatures` in direc
 [ "calc",      "hge",  "command calc.hge(s1:int, v:sht, d2:int, s2:int):hge ", 
"sht_dec2dec_hge;",     "cast decimal(sht) to decimal(hge) and check for 
overflow"      ]
 [ "calc",      "hge",  "command calc.hge(v:sht, digits:int, scale:int):hge ",  
"sht_num2dec_hge;",     "cast number to decimal(hge) and check for overflow"    
]
 [ "calc",      "hge",  "command calc.hge(v:str, digits:int, scale:int):hge ",  
"str_2dec_hge;",        "cast to dec(hge) and check for overflow"       ]
-[ "calc",      "identity",     "command calc.identity(X_0:any_2):oid ",        
"SQLidentity;", "Returns a unique row identitfier."     ]
+[ "calc",      "identity",     "command calc.identity(X_0:any):oid ",  
"SQLidentity;", "Returns a unique row identitfier."     ]
 [ "calc",      "ifthenelse",   "pattern calc.ifthenelse(b:bit, t:any_1, 
f:any_1):any_1 ",      "CALCswitchbit;",       "If VALUE is true return MIDDLE 
else RIGHT"     ]
 [ "calc",      "index",        "command calc.index(v:str, u:bit):bte ",        
"STRindex_bte;",        "Return the offsets as an index bat"    ]
 [ "calc",      "index",        "command calc.index(v:str, u:bit):int ",        
"STRindex_int;",        "Return the offsets as an index bat"    ]
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+monetdb (11.37.7) unstable; urgency=low
+
+  * Rebuilt.
+
+ -- Sjoerd Mullender <[email protected]>  Fri, 29 May 2020 12:21:47 +0200
+
 monetdb (11.37.5) unstable; urgency=low
 
   * Rebuilt.
diff --git a/libversions b/libversions
--- a/libversions
+++ b/libversions
@@ -36,13 +36,13 @@
 
 # version of the GDK library (subdirectory gdk; also includes
 # common/options and common/utils)
-GDK_VERSION=20:2:0
+GDK_VERSION=20:3:0
 
 # version of the MAPI library (subdirectory clients/mapilib)
 MAPI_VERSION=12:4:0
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
-MONETDB5_VERSION=29:2:0
+MONETDB5_VERSION=29:3:0
 
 # version of the STREAM library (subdirectory common/stream)
 STREAM_VERSION=13:5:0
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
@@ -768,28 +768,6 @@ MTIMElocal_timezone_msec(lng *ret)
        return MAL_SUCCEED;
 }
 
-str
-MTIMEstr_to_date(date *ret, const char *const *s, const char *const *format)
-{
-       struct tm tm = (struct tm) {0};
-       time_t t;
-
-       if (strNil(*s) || strNil(*format)) {
-               *ret = date_nil;
-               return MAL_SUCCEED;
-       }
-       t = time(NULL);
-       localtime_r(&t, &tm);
-       tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
-       if (strptime(*s, *format, &tm) == NULL)
-               throw(MAL, "mtime.str_to_date", "format '%s', doesn't match 
date '%s'",
-                         *format, *s);
-       *ret = date_create(tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
-       if (is_date_nil(*ret))
-               throw(MAL, "mtime.str_to_date", "bad date '%s'", *s);
-       return MAL_SUCCEED;
-}
-
 static str
 timestamp_to_str(str *ret, const timestamp *d, const char *const *format,
                                 const char *type, const char *malfunc)
@@ -825,44 +803,8 @@ timestamp_to_str(str *ret, const timesta
        return MAL_SUCCEED;
 }
 
-str
-MTIMEdate_to_str(str *ret, const date *d, const char *const *format)
-{
-       timestamp ts = timestamp_create(*d, 
timestamp_daytime(timestamp_current()));
-       return timestamp_to_str(ret, &ts, format, "date", "mtime.date_to_str");
-}
-
-str
-MTIMEstr_to_time(daytime *ret, const char *const *s, const char *const *format)
-{
-       struct tm tm = (struct tm) {0};
-       time_t t;
-
-       if (strNil(*s) || strNil(*format)) {
-               *ret = daytime_nil;
-               return MAL_SUCCEED;
-       }
-       t = time(NULL);
-       localtime_r(&t, &tm);
-       tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
-       if (strptime(*s, *format, &tm) == NULL)
-               throw(MAL, "mtime.str_to_time", "format '%s', doesn't match 
time '%s'",
-                         *format, *s);
-       *ret = daytime_create(tm.tm_hour, tm.tm_min, tm.tm_sec == 60 ? 59 : 
tm.tm_sec, 0);
-       if (is_daytime_nil(*ret))
-               throw(MAL, "mtime.str_to_time", "bad time '%s'", *s);
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEtime_to_str(str *ret, const daytime *d, const char *const *format)
-{
-       timestamp ts = timestamp_create(timestamp_date(timestamp_current()), 
*d);
-       return timestamp_to_str(ret, &ts, format, "time", "mtime.time_to_str");
-}
-
-str
-MTIMEstr_to_timestamp(timestamp *ret, const char *const *s, const char *const 
*format)
+static str
+str_to_timestamp(timestamp *ret, const char *const *s, const char *const 
*format, const char *type, const char *malfunc)
 {
        struct tm tm = (struct tm) {0};
        time_t t;
@@ -876,8 +818,8 @@ MTIMEstr_to_timestamp(timestamp *ret, co
        tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
        tm.tm_isdst = -1;
        if (strptime(*s, *format, &tm) == NULL)
-               throw(MAL, "mtime.str_to_timestamp",
-                         "format '%s', doesn't match timestamp '%s'", *format, 
*s);
+               throw(MAL, malfunc,
+                         "format '%s', doesn't match %s '%s'", *format, type, 
*s);
        *ret = timestamp_create(date_create(tm.tm_year + 1900,
                                                                                
tm.tm_mon + 1,
                                                                                
tm.tm_mday),
@@ -904,11 +846,53 @@ MTIMEstr_to_timestamp(timestamp *ret, co
                *ret = timestamp_add_usec(*ret, -tz * LL_CONSTANT(1000000));
        }
        if (is_timestamp_nil(*ret))
-               throw(MAL, "mtime.str_to_timestamp", "bad timestamp '%s'", *s);
+               throw(MAL, malfunc, "bad %s '%s'", type, *s);
+       return MAL_SUCCEED;
+}
+
+str
+MTIMEstr_to_date(date *ret, const char *const *s, const char *const *format)
+{
+       timestamp ts;
+       str msg = str_to_timestamp(&ts, s, format, "date", "mtime.str_to_date");
+       if (msg != MAL_SUCCEED)
+               return msg;
+       *ret = timestamp_date(ts);
        return MAL_SUCCEED;
 }
 
 str
+MTIMEdate_to_str(str *ret, const date *d, const char *const *format)
+{
+       timestamp ts = timestamp_create(*d, 
timestamp_daytime(timestamp_current()));
+       return timestamp_to_str(ret, &ts, format, "date", "mtime.date_to_str");
+}
+
+str
+MTIMEstr_to_time(daytime *ret, const char *const *s, const char *const *format)
+{
+       timestamp ts;
+       str msg = str_to_timestamp(&ts, s, format, "time", "mtime.str_to_time");
+       if (msg != MAL_SUCCEED)
+               return msg;
+       *ret = timestamp_daytime(ts);
+       return MAL_SUCCEED;
+}
+
+str
+MTIMEtime_to_str(str *ret, const daytime *d, const char *const *format)
+{
+       timestamp ts = timestamp_create(timestamp_date(timestamp_current()), 
*d);
+       return timestamp_to_str(ret, &ts, format, "time", "mtime.time_to_str");
+}
+
+str
+MTIMEstr_to_timestamp(timestamp *ret, const char *const *s, const char *const 
*format)
+{
+       return str_to_timestamp(ret, s, format, "timestamp", 
"mtime.str_to_timestamp");
+}
+
+str
 MTIMEtimestamp_to_str(str *ret, const timestamp *d, const char *const *format)
 {
        return timestamp_to_str(ret, d, format,
diff --git a/sql/backends/monet5/UDF/pyapi3/connection3.c 
b/sql/backends/monet5/UDF/pyapi3/connection3.c
--- a/sql/backends/monet5/UDF/pyapi3/connection3.c
+++ b/sql/backends/monet5/UDF/pyapi3/connection3.c
@@ -21,23 +21,8 @@ CREATE_SQL_FUNCTION_PTR(str, append_to_t
 static PyObject *_connection_execute(Py_ConnectionObject *self, PyObject *args)
 {
        char *query = NULL;
-#ifndef IS_PY3K
-       if (PyUnicode_CheckExact(args)) {
-               PyObject* str = PyUnicode_AsUTF8String(args);
-               if (!str) {
-                       PyErr_Format(PyExc_Exception, "Unicode failure.");
-                       return NULL;
-               }
-               query = GDKstrdup(((PyStringObject *)str)->ob_sval);
-               Py_DECREF(str);
-       } else
-#endif
        if (PyString_CheckExact(args)) {
-#ifndef IS_PY3K
-               query = GDKstrdup(((PyStringObject *)args)->ob_sval);
-#else
                query = GDKstrdup(PyUnicode_AsUTF8(args));
-#endif
        } else {
                PyErr_Format(PyExc_TypeError,
                                         "expected a query string, but got an 
object of type %s",
diff --git a/sql/backends/monet5/UDF/pyapi3/convert_loops.h 
b/sql/backends/monet5/UDF/pyapi3/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi3/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi3/convert_loops.h
@@ -463,7 +463,7 @@ convert_and_append(BAT* b, const char* t
                                                goto wrapup;                    
                       \
                                        }                                       
                   \
                                } else {                                        
               \
-                                       if (!string_copy(&data[(index_offset * 
ret->count + iu) *  \
+                                       if 
(!pyapi3_string_copy(&data[(index_offset * ret->count + iu) *  \
                                                                                
   ret->memory_size],                  \
                                                                         
utf8_string, ret->memory_size, false)) {  \
                                                msg = createException(MAL, 
"pyapi3.eval",              \
diff --git a/sql/backends/monet5/UDF/pyapi3/formatinput3.c 
b/sql/backends/monet5/UDF/pyapi3/formatinput3.c
--- a/sql/backends/monet5/UDF/pyapi3/formatinput3.c
+++ b/sql/backends/monet5/UDF/pyapi3/formatinput3.c
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to