Changeset: a5c8947c0c24 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a5c8947c0c24
Modified Files:
        common/stream/stream.c
        gdk/gdk_bbp.c
        gdk/gdk_interprocess.c
        sql/backends/monet5/Tests/pyapi17.stable.err
        sql/backends/monet5/Tests/pyapi17.stable.out
        sql/backends/monet5/UDF/pyapi/conversion.c
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/emit.c
Branch: default
Log Message:

Merge with Jul2017 branch.


diffs (159 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -3503,7 +3503,7 @@ bs_read(stream *ss, void *buf, size_t el
                        {
                                ssize_t i;
 
-                               fprintf(stderr, "RD %s %zd \"", ss->name, m);
+                               fprintf(stderr, "RD %s " SSZFMT " \"", 
ss->name, m);
                                for (i = 0; i < m; i++)
                                        if (' ' <= ((char *) buf)[i] &&
                                            ((char *) buf)[i] < 127)
@@ -4976,16 +4976,16 @@ getFileNo(stream *s)
 static ssize_t
 stream_blackhole_write(stream *s, const void *buf, size_t elmsize, size_t cnt)
 {
-       s = (stream *) s;
-       buf = (const void *) buf;
-       elmsize = (size_t) elmsize;
+       (void) s;
+       (void) buf;
+       (void) elmsize;
        return (ssize_t) cnt;
 }
 
 static void
 stream_blackhole_close(stream *s)
 {
-       s = (stream *) s;
+       (void) s;
        /* no resources to close */
 }
 
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3707,7 +3707,7 @@ BBPdiskscan(const char *parent, size_t b
 
                if (ok == FALSE || !persistent_bat(bid)) {
                        delete = TRUE;
-               } else if (strstr(p + 1, ".tmp")) {
+               } else if (strcmp(p + 1, "tmp") == 0) {
                        delete = 1;     /* throw away any .tmp file */
                } else if (strncmp(p + 1, "tail", 4) == 0) {
                        BAT *b = getdesc(bid);
diff --git a/gdk/gdk_interprocess.c b/gdk/gdk_interprocess.c
--- a/gdk/gdk_interprocess.c
+++ b/gdk/gdk_interprocess.c
@@ -84,7 +84,7 @@ GDKinitmmap(size_t id, size_t size, void
 
        assert(return_ptr != NULL);
 
-       GDKmmapfile(address, 100, id);
+       GDKmmapfile(address, sizeof(address), id);
 
        /* round up to multiple of GDK_mmap_pagesize with a
         * minimum of one
@@ -136,7 +136,7 @@ GDKreleasemmap(void *ptr, size_t size, s
        char address[100];
        char *path;
        int ret;
-       GDKmmapfile(address, 100, id);
+       GDKmmapfile(address, sizeof(address), id);
        if (GDKmunmap(ptr, size) != GDK_SUCCEED) {
                interprocess_create_error("Failure in GDKmunmap: %s", 
strerror(errno));
                return GDK_FAIL;
@@ -163,7 +163,7 @@ GDKreleasemmap(void *ptr, size_t size, s
 gdk_return
 GDKmmapfile(str buffer, size_t max, size_t id)
 {
-       snprintf(buffer, max, "pymmap%zu", id);
+       snprintf(buffer, max, "pymmap" SZFMT, id);
        return GDK_SUCCEED;
 }
 
diff --git a/sql/backends/monet5/Tests/pyapi17.stable.err 
b/sql/backends/monet5/Tests/pyapi17.stable.err
--- a/sql/backends/monet5/Tests/pyapi17.stable.err
+++ b/sql/backends/monet5/Tests/pyapi17.stable.err
@@ -33,8 +33,8 @@ stderr of test 'pyapi17` in directory 's
 
 MAPI  = (monetdb) /var/tmp/mtest-15243/.s.monetdb.38589
 QUERY = SELECT * FROM pyapi17();
-ERROR = !Error converting dict return value "a": MALException:pyapi.eval:An 
array of size 2 was returned, yet we expect a list of 1 columns. The result is 
invalid..
-MAPI  = (monetdb) /var/tmp/mtest-15243/.s.monetdb.38589
+ERROR = !Error converting dict return value "a": An array of size 2 was 
returned, yet we expect a list of 1 columns. The result is invalid..
+MAPI  = (monetdb) /var/tmp/mtest-18234/.s.monetdb.33641
 QUERY = SELECT * FROM pyapi17();
 ERROR = !Expected a return value with name "c", but this key was not present 
in the dictionary.
 MAPI  = (monetdb) /var/tmp/mtest-15243/.s.monetdb.38589
diff --git a/sql/backends/monet5/Tests/pyapi17.stable.out 
b/sql/backends/monet5/Tests/pyapi17.stable.out
--- a/sql/backends/monet5/Tests/pyapi17.stable.out
+++ b/sql/backends/monet5/Tests/pyapi17.stable.out
@@ -39,7 +39,7 @@ Ready.
 #      return retval
 #};
 #SELECT * FROM pyapi17();
-% .,   .,      .,      . # table_name
+% .L1, .L1,    .L1,    .L1 # table_name
 % a,   b,      c,      d # name
 % clob,        clob,   int,    boolean # type
 % 3,   3,      1,      5 # length
@@ -57,7 +57,7 @@ Ready.
 #      return retval
 #};
 #SELECT * FROM pyapi17();
-% .,   .,      .,      . # table_name
+% .L1, .L1,    .L1,    .L1 # table_name
 % a,   b,      c,      d # name
 % clob,        clob,   int,    boolean # type
 % 3,   3,      1,      5 # length
@@ -97,8 +97,8 @@ Ready.
 #      return retval
 #};
 #SELECT pyapi17(i) FROM integers;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
 % int # type
 % 2 # length
 [ 33   ]
diff --git a/sql/backends/monet5/UDF/pyapi/conversion.c 
b/sql/backends/monet5/UDF/pyapi/conversion.c
--- a/sql/backends/monet5/UDF/pyapi/conversion.c
+++ b/sql/backends/monet5/UDF/pyapi/conversion.c
@@ -493,7 +493,7 @@ PyObject *PyDict_CheckForConversion(PyOb
                        msg = createException(
                                MAL, "pyapi.eval",
                                SQLSTATE(PY000) "Error converting dict return 
value \"%s\": %s.",
-                               retcol_names[i], *return_message);
+                               retcol_names[i], 
getExceptionMessage(*return_message));
                        GDKfree(*return_message);
                        goto wrapup;
                }
diff --git a/sql/backends/monet5/UDF/pyapi/convert_loops.h 
b/sql/backends/monet5/UDF/pyapi/convert_loops.h
--- a/sql/backends/monet5/UDF/pyapi/convert_loops.h
+++ b/sql/backends/monet5/UDF/pyapi/convert_loops.h
@@ -109,7 +109,7 @@
                                /* If we are taking data from a MMAP file, set 
the filename to \
                                 * the absolute path */                         
               \
                                char address[100];                              
               \
-                               GDKmmapfile(address, 100, ret->mmap_id);        
               \
+                               GDKmmapfile(address, sizeof(address), 
ret->mmap_id);           \
                                bat->theap.filename =                           
               \
                                        GDKfilepath(NOFARM, BATDIR, address, 
"tmp");               \
                                ret->mmap_id = -1;                              
               \
diff --git a/sql/backends/monet5/UDF/pyapi/emit.c 
b/sql/backends/monet5/UDF/pyapi/emit.c
--- a/sql/backends/monet5/UDF/pyapi/emit.c
+++ b/sql/backends/monet5/UDF/pyapi/emit.c
@@ -67,8 +67,8 @@ PyObject *PyEmit_Emit(PyEmitObject *self
                                el_count = this_size;
                        } else if (el_count != this_size) {
                                PyErr_Format(
-                                       PyExc_TypeError, "Element %s has size 
%zu, but expected an "
-                                                                        
"element with size %zu",
+                                       PyExc_TypeError, "Element %s has size " 
SZFMT ", but expected an "
+                                                                        
"element with size " SZFMT,
                                        PyString_AsString(PyObject_Str(key)), 
this_size, el_count);
                                Py_DECREF(items);
                                return NULL;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to