Changeset: 37ea437d22c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37ea437d22c4
Removed Files:
        sql/test/rdf/Tests/q8_v_small.reqtests
        sql/test/rdf/Tests/q8_v_small.sql
        sql/test/rdf/Tests/q8_v_small.stable.err
        sql/test/rdf/Tests/q8_v_small.stable.out
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        gdk/gdk.h
        gdk/gdk_bat.c
        gdk/gdk_system.c
        gdk/gdk_tracer.c
        gdk/gdk_tracer.h
        gdk/gdk_utils.c
        monetdb5/modules/atoms/json.c
        monetdb5/modules/mal/mal_mapi.c
        monetdb5/modules/mal/mkey.c
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/wlc.mal
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/sqlcatalog.mal
        sql/backends/monet5/wlr.mal
        sql/include/sql_relation.h
        sql/rel.txt
        sql/scripts/22_clients.sql
        sql/server/rel_dump.c
        sql/server/rel_optimizer.c
        sql/server/rel_propagate.c
        sql/server/rel_psm.c
        sql/server/rel_rel.c
        sql/server/rel_rel.h
        sql/server/rel_select.c
        sql/server/rel_unnest.c
        sql/server/rel_updates.c
        sql/server/sql_atom.c
        sql/server/sql_semantic.c
        sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.timeout
        sql/test/BugTracker-2015/Tests/window_function_crash.Bug-3861.sql
        sql/test/BugTracker-2015/Tests/window_function_crash.Bug-3861.stable.err
        sql/test/BugTracker-2015/Tests/window_function_crash.Bug-3861.stable.out
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/json/Tests/jsonvalidity.Bug-3753.sql
        sql/test/json/Tests/jsonvalidity.Bug-3753.stable.out
        sql/test/merge-partitions/Tests/mergepart20.sql
        sql/test/merge-partitions/Tests/mergepart20.stable.out
        sql/test/miscellaneous/Tests/simple_selects.sql
        sql/test/miscellaneous/Tests/simple_selects.stable.out
        sql/test/rdf/Tests/All
        sql/test/rdf/Tests/q8_v.stable.err
        sql/test/rdf/Tests/q8_v.stable.out
        sql/test/rdf/Tests/q8_v.timeout
        sql/test/subquery/Tests/correlated.stable.err
        sql/test/subquery/Tests/subquery.sql
        sql/test/subquery/Tests/subquery.stable.err
        sql/test/subquery/Tests/subquery.stable.out
        sql/test/subquery/Tests/subquery3.sql
        sql/test/subquery/Tests/subquery3.stable.err
        sql/test/subquery/Tests/subquery4.sql
        sql/test/subquery/Tests/subquery4.stable.err
        sql/test/subquery/Tests/subquery4.stable.out
        sql/test/sys-schema/Tests/systemfunctions.stable.out
        sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
Branch: default
Log Message:

Merge branch 'master' into local_atom_strings


diffs (truncated from 4187 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
@@ -11572,6 +11572,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog",        "alter_add_value_partition",    "pattern 
sqlcatalog.alter_add_value_partition(sname:str, mtnme:str, psnme:str, 
ptnme:str, nills:int, update:int):void ",        
"SQLalter_add_value_partition;",        "Catalog operation 
alter_add_value_partition"   ]
 [ "sqlcatalog",        "alter_add_value_partition",    "pattern 
sqlcatalog.alter_add_value_partition(sname:str, mtnme:str, psnme:str, 
ptnme:str, nills:int, update:int, arg:any...):void ",    
"SQLalter_add_value_partition;",        "Catalog operation 
alter_add_value_partition"   ]
 [ "sqlcatalog",        "alter_del_table",      "pattern 
sqlcatalog.alter_del_table(sname:str, mtnme:str, psnme:str, ptnme:str, 
action:int):void ",     "SQLalter_del_table;",  "Catalog operation 
alter_del_table"     ]
+[ "sqlcatalog",        "alter_seq",    "pattern 
sqlcatalog.alter_seq(sname:str, seqname:str, seq:ptr, val:bat[:lng]):void ",   
"SQLalter_seq;",        "Catalog operation alter_seq"   ]
 [ "sqlcatalog",        "alter_seq",    "pattern 
sqlcatalog.alter_seq(sname:str, seqname:str, seq:ptr, val:lng):void ", 
"SQLalter_seq;",        "Catalog operation alter_seq"   ]
 [ "sqlcatalog",        "alter_set_table",      "pattern 
sqlcatalog.alter_set_table(sname:str, tnme:str, access:int):void ",    
"SQLalter_set_table;",  "Catalog operation alter_set_table"     ]
 [ "sqlcatalog",        "alter_table",  "pattern 
sqlcatalog.alter_table(sname:str, tname:str, tbl:ptr, action:int):void ",      
"SQLalter_table;",      "Catalog operation alter_table" ]
@@ -11789,6 +11790,7 @@ stdout of test 'MAL-signatures` in direc
 [ "wlc",       "alter_add_value_partition",    "pattern 
wlc.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int):void ",       "WLCgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlc",       "alter_add_value_partition",    "pattern 
wlc.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int, arg:str...):void ",   "WLCgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlc",       "alter_del_table",      "pattern wlc.alter_del_table(sname:str, 
mtnme:str, psnme:str, ptnme:str, action:int):void ",    "WLCgeneric;",  
"Catalog operation alter_del_table"     ]
+[ "wlc",       "alter_seq",    "pattern wlc.alter_seq(sname:str, seqname:str, 
seq:ptr, val:bat[:lng]):void ",  "WLCgeneric;",  "Catalog operation alter_seq"  
 ]
 [ "wlc",       "alter_seq",    "pattern wlc.alter_seq(sname:str, seqname:str, 
val:lng):void ", "WLCgeneric;",  "Catalog operation alter_seq"   ]
 [ "wlc",       "alter_set_table",      "pattern wlc.alter_set_table(sname:str, 
tnme:str, access:int):void ",   "WLCgeneric;",  "Catalog operation 
alter_set_table"     ]
 [ "wlc",       "alter_table",  "pattern wlc.alter_table(sname:str, tname:str, 
action:int):void ",      "WLCgeneric;",  "Catalog operation alter_table" ]
@@ -11858,6 +11860,7 @@ stdout of test 'MAL-signatures` in direc
 [ "wlr",       "alter_add_value_partition",    "pattern 
wlr.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int):void ",       "WLRgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlr",       "alter_add_value_partition",    "pattern 
wlr.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int, arg:str...):void ",   "WLRgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlr",       "alter_del_table",      "pattern wlr.alter_del_table(sname:str, 
mtnme:str, psnme:str, ptnme:str, action:int):void ",    "WLRgeneric;",  
"Catalog operation alter_del_table"     ]
+[ "wlr",       "alter_seq",    "pattern wlr.alter_seq(sname:str, seqname:str, 
seq:ptr, val:bat[:lng]):void ",  "WLRgeneric;",  "Catalog operation alter_seq"  
 ]
 [ "wlr",       "alter_seq",    "pattern wlr.alter_seq(sname:str, seqname:str, 
val:lng):void ", "WLRgeneric;",  "Catalog operation alter_seq"   ]
 [ "wlr",       "alter_set_table",      "pattern wlr.alter_set_table(sname:str, 
tnme:str, access:int):void ",   "WLRgeneric;",  "Catalog operation 
alter_set_table"     ]
 [ "wlr",       "alter_table",  "pattern wlr.alter_table(sname:str, tname:str, 
action:int):void ",      "WLRgeneric;",  "Catalog operation alter_table" ]
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
@@ -16016,6 +16016,7 @@ stdout of test 'MAL-signatures` in direc
 [ "sqlcatalog",        "alter_add_value_partition",    "pattern 
sqlcatalog.alter_add_value_partition(sname:str, mtnme:str, psnme:str, 
ptnme:str, nills:int, update:int):void ",        
"SQLalter_add_value_partition;",        "Catalog operation 
alter_add_value_partition"   ]
 [ "sqlcatalog",        "alter_add_value_partition",    "pattern 
sqlcatalog.alter_add_value_partition(sname:str, mtnme:str, psnme:str, 
ptnme:str, nills:int, update:int, arg:any...):void ",    
"SQLalter_add_value_partition;",        "Catalog operation 
alter_add_value_partition"   ]
 [ "sqlcatalog",        "alter_del_table",      "pattern 
sqlcatalog.alter_del_table(sname:str, mtnme:str, psnme:str, ptnme:str, 
action:int):void ",     "SQLalter_del_table;",  "Catalog operation 
alter_del_table"     ]
+[ "sqlcatalog",        "alter_seq",    "pattern 
sqlcatalog.alter_seq(sname:str, seqname:str, seq:ptr, val:bat[:lng]):void ",   
"SQLalter_seq;",        "Catalog operation alter_seq"   ]
 [ "sqlcatalog",        "alter_seq",    "pattern 
sqlcatalog.alter_seq(sname:str, seqname:str, seq:ptr, val:lng):void ", 
"SQLalter_seq;",        "Catalog operation alter_seq"   ]
 [ "sqlcatalog",        "alter_set_table",      "pattern 
sqlcatalog.alter_set_table(sname:str, tnme:str, access:int):void ",    
"SQLalter_set_table;",  "Catalog operation alter_set_table"     ]
 [ "sqlcatalog",        "alter_table",  "pattern 
sqlcatalog.alter_table(sname:str, tname:str, tbl:ptr, action:int):void ",      
"SQLalter_table;",      "Catalog operation alter_table" ]
@@ -16234,6 +16235,7 @@ stdout of test 'MAL-signatures` in direc
 [ "wlc",       "alter_add_value_partition",    "pattern 
wlc.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int):void ",       "WLCgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlc",       "alter_add_value_partition",    "pattern 
wlc.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int, arg:str...):void ",   "WLCgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlc",       "alter_del_table",      "pattern wlc.alter_del_table(sname:str, 
mtnme:str, psnme:str, ptnme:str, action:int):void ",    "WLCgeneric;",  
"Catalog operation alter_del_table"     ]
+[ "wlc",       "alter_seq",    "pattern wlc.alter_seq(sname:str, seqname:str, 
seq:ptr, val:bat[:lng]):void ",  "WLCgeneric;",  "Catalog operation alter_seq"  
 ]
 [ "wlc",       "alter_seq",    "pattern wlc.alter_seq(sname:str, seqname:str, 
val:lng):void ", "WLCgeneric;",  "Catalog operation alter_seq"   ]
 [ "wlc",       "alter_set_table",      "pattern wlc.alter_set_table(sname:str, 
tnme:str, access:int):void ",   "WLCgeneric;",  "Catalog operation 
alter_set_table"     ]
 [ "wlc",       "alter_table",  "pattern wlc.alter_table(sname:str, tname:str, 
action:int):void ",      "WLCgeneric;",  "Catalog operation alter_table" ]
@@ -16303,6 +16305,7 @@ stdout of test 'MAL-signatures` in direc
 [ "wlr",       "alter_add_value_partition",    "pattern 
wlr.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int):void ",       "WLRgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlr",       "alter_add_value_partition",    "pattern 
wlr.alter_add_value_partition(sname:str, mtnme:str, psnme:str, ptnme:str, 
nills:int, update:int, arg:str...):void ",   "WLRgeneric;",  "Catalog operation 
alter_add_value_partition"   ]
 [ "wlr",       "alter_del_table",      "pattern wlr.alter_del_table(sname:str, 
mtnme:str, psnme:str, ptnme:str, action:int):void ",    "WLRgeneric;",  
"Catalog operation alter_del_table"     ]
+[ "wlr",       "alter_seq",    "pattern wlr.alter_seq(sname:str, seqname:str, 
seq:ptr, val:bat[:lng]):void ",  "WLRgeneric;",  "Catalog operation alter_seq"  
 ]
 [ "wlr",       "alter_seq",    "pattern wlr.alter_seq(sname:str, seqname:str, 
val:lng):void ", "WLRgeneric;",  "Catalog operation alter_seq"   ]
 [ "wlr",       "alter_set_table",      "pattern wlr.alter_set_table(sname:str, 
tnme:str, access:int):void ",   "WLRgeneric;",  "Catalog operation 
alter_set_table"     ]
 [ "wlr",       "alter_table",  "pattern wlr.alter_table(sname:str, tname:str, 
action:int):void ",      "WLRgeneric;",  "Catalog operation alter_table" ]
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -520,7 +520,11 @@ typedef struct {
        size_t free;            /* index where free area starts. */
        size_t size;            /* size of the heap (bytes) */
        char *base;             /* base pointer in memory. */
+#if SIZEOF_VOID_P == 4
        char filename[32];      /* file containing image of the heap */
+#else
+       char filename[40];      /* file containing image of the heap */
+#endif
 
        bte farmid;             /* id of farm where heap is located */
        bool copied:1,          /* a copy of an existing map. */
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2093,8 +2093,8 @@ BATmode(BAT *b, bool transient)
 
 #ifdef NDEBUG
 /* assertions are disabled, turn failing tests into a message */
-//#undef assert
-//#define assert(test) ((void) ((test) || TRC_ERROR(BAT_, "Assertion `%s' 
failed\n", #test)))
+#undef assert
+#define assert(test)   ((void) ((test) || TRC_CRITICAL_ENDIF(BAT_, "Assertion 
`%s' failed\n", #test)))
 #endif
 
 /* Assert that properties are set correctly.
@@ -2136,6 +2136,7 @@ BATmode(BAT *b, bool transient)
 void
 BATassertProps(BAT *b)
 {
+       unsigned bbpstatus;
        BATiter bi = bat_iterator(b);
        BUN p, q;
        int (*cmpf)(const void *, const void *);
@@ -2151,9 +2152,7 @@ BATassertProps(BAT *b)
        assert(b->hseqbase <= GDK_oid_max); /* non-nil seqbase */
        assert(b->hseqbase + BATcount(b) <= GDK_oid_max);
 
-#ifndef NDEBUG
-       unsigned bbpstatus = BBP_status(b->batCacheid);
-#endif
+       bbpstatus = BBP_status(b->batCacheid);
        /* only at most one of BBPDELETED, BBPEXISTING, BBPNEW may be set */
        assert(((bbpstatus & BBPDELETED) != 0) +
               ((bbpstatus & BBPEXISTING) != 0) +
@@ -2214,9 +2213,7 @@ BATassertProps(BAT *b)
                                assert(b->tvheap->free <= b->tvheap->size);
                                assert(b->tvheap->free % SIZEOF_OID == 0);
                                if (b->tvheap->free > 0) {
-#ifndef NDEBUG
                                        const oid *oids = (const oid *) 
b->tvheap->base;
-#endif
                                        q = b->tvheap->free / SIZEOF_OID;
                                        assert(oids != NULL);
                                        assert(b->tseqbase + BATcount(b) + q <= 
GDK_oid_max);
@@ -2243,9 +2240,7 @@ BATassertProps(BAT *b)
                assert(b->tkey);
                assert(b->tnonil);
                if ((q = b->batCount) != 0) {
-#ifndef NDEBUG
                        const oid *o = (const oid *) Tloc(b, 0);
-#endif
                        assert(*o == b->tseqbase);
                        for (p = 1; p < q; p++)
                                assert(o[p - 1] + 1 == o[p]);
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -214,10 +214,17 @@ MT_thread_init(void)
 {
        if (threadslot == TLS_OUT_OF_INDEXES) {
                threadslot = TlsAlloc();
-               if (threadslot == TLS_OUT_OF_INDEXES)
+               if (threadslot == TLS_OUT_OF_INDEXES) {
+                       char errmsg[256];
+                       FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 
GetLastError(), 0, errmsg, sizeof(errmsg), NULL);
+                       TRC_CRITICAL(GDK, "Creating thread-local slot for 
thread failed: %s\n", errmsg);
                        return false;
+               }
                mainthread.tid = GetCurrentThreadId();
                if (TlsSetValue(threadslot, &mainthread) == 0) {
+                       char errmsg[256];
+                       FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 
GetLastError(), 0, errmsg, sizeof(errmsg), NULL);
+                       TRC_CRITICAL(GDK, "Setting thread-local value failed: 
%s\n", errmsg);
                        TlsFree(threadslot);
                        threadslot = TLS_OUT_OF_INDEXES;
                        return false;
@@ -386,12 +393,24 @@ join_detached_threads(void)
 int
 MT_create_thread(MT_Id *t, void (*f) (void *), void *arg, enum MT_thr_detach 
d, const char *threadname)
 {
-       struct winthread *w = malloc(sizeof(*w));
-
-       if (w == NULL)
-               return -1;
+       struct winthread *w;
 
        join_threads();
+       if (threadname == NULL) {
+               TRC_CRITICAL(GDK, "Thread must have a name\n");
+               return -1;
+       }
+       if (strlen(threadname) >= sizeof(w->threadname)) {
+               TRC_CRITICAL(GDK, "Thread's name is too large\n");
+               return -1;
+       }
+
+       w = malloc(sizeof(*w));
+       if (w == NULL) {
+               TRC_ERROR(GDK, "Cannot allocate memory\n");
+               return -1;
+       }
+
        *w = (struct winthread) {
                .func = f,
                .data = arg,
@@ -405,13 +424,18 @@ MT_create_thread(MT_Id *t, void (*f) (vo
        w->hdl = CreateThread(NULL, THREAD_STACK_SIZE, thread_starter, w,
                              0, &w->tid);
        if (w->hdl == NULL) {
+               char errmsg[256];
+               FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
+                             0, errmsg, sizeof(errmsg), NULL);
                LeaveCriticalSection(&winthread_cs);
+               free(w);
+               TRC_ERROR(GDK, "Failed to create thread: %s\n", errmsg);
                return -1;
        }
+       /* must not fail after this: the thread has been started */
        w->next = winthreads;
        winthreads = w;
        LeaveCriticalSection(&winthread_cs);
-       /* must not fail after this: the thread has been started */
        *t = (MT_Id) w->tid;
        return 0;
 }
@@ -534,12 +558,12 @@ MT_thread_init(void)
        int ret;
 
        if ((ret = pthread_key_create(&threadkey, NULL)) != 0) {
-               TRC_ERROR(GDK, "Creating specific key for thread failed: %s\n", 
strerror(ret));
+               TRC_CRITICAL(GDK, "Creating specific key for thread failed: 
%s\n", strerror(ret));
                return false;
        }
        mainthread.tid = pthread_self();
        if ((ret = pthread_setspecific(threadkey, &mainthread)) != 0) {
-               TRC_ERROR(GDK, "Setting specific value failed: %s\n", 
strerror(ret));
+               TRC_CRITICAL(GDK, "Setting specific value failed: %s\n", 
strerror(ret));
        }
        return true;
 }
@@ -723,16 +747,14 @@ MT_create_thread(MT_Id *t, void (*f) (vo
        pthread_attr_t attr;
        int ret;
        struct posthread *p;
-       size_t tlen;
 
        join_threads();
        if (threadname == NULL) {
-               TRC_ERROR(GDK, "Thread must have a name\n");
+               TRC_CRITICAL(GDK, "Thread must have a name\n");
                return -1;
        }
-       tlen = strlen(threadname);
-       if (tlen >= sizeof(p->threadname)) {
-               TRC_ERROR(GDK, "Thread's name is too large\n");
+       if (strlen(threadname) >= sizeof(p->threadname)) {
+               TRC_CRITICAL(GDK, "Thread's name is too large\n");
                return -1;
        }
        if ((ret = pthread_attr_init(&attr)) != 0) {
@@ -746,7 +768,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
        }
        p = malloc(sizeof(struct posthread));
        if (p == NULL) {
-               TRC_ERROR(GDK, "Cannot allocate memory: %s\n", strerror(errno));
+               TRC_ERROR(GDK, "Cannot allocate memory\n");
                pthread_attr_destroy(&attr);
                return -1;
        }
@@ -758,7 +780,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
        };
        ATOMIC_INIT(&p->exited, 0);
 
-       memcpy(p->threadname, threadname, tlen + 1);
+       strcpy_len(p->threadname, threadname, sizeof(p->threadname));
 #ifdef HAVE_PTHREAD_SIGMASK
        sigset_t new_mask, orig_mask;
        (void) sigfillset(&new_mask);
@@ -772,6 +794,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
        ret = pthread_create(&p->tid, &attr, thread_starter, p);
        if (ret != 0) {
                TRC_ERROR(GDK, "Cannot start thread: %s\n", strerror(ret));
+               free(p);
                ret = -1;
        } else {
                /* must not fail after this: the thread has been started */
@@ -779,6 +802,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
                posthreads = p;
        }
        pthread_mutex_unlock(&posthread_lock);
+       (void) pthread_attr_destroy(&attr); /* not interested in errors */
 #ifdef HAVE_PTHREAD_SIGMASK
        MT_thread_sigmask(&orig_mask, NULL);
 #endif
diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c
--- a/gdk/gdk_tracer.c
+++ b/gdk/gdk_tracer.c
@@ -75,7 +75,7 @@ const char *LEVEL_STR[] = {
  */
 // Exception
 #define GDK_TRACER_EXCEPTION(MSG, ...)                                 \
-       mnstr_printf(GDKstdout,                                         \
+       fprintf(stderr,                                                 \
                     "%s "                                              \
                     "%-"MXW"s "                                        \
                     "%"MXW"s:%d "                                      \
@@ -122,31 +122,6 @@ static gdk_return
 }
 
 
-// Candidate for 'gnu_printf' format attribute 
[-Werror=suggest-attribute=format]
-static int _GDKtracer_fill_tracer(gdk_tracer *sel_tracer, const char *fmt, 
va_list va)
-       __attribute__((__format__(__printf__, 2, 0)));
-
-static int
-_GDKtracer_fill_tracer(gdk_tracer *sel_tracer, const char *fmt, va_list va)
-{
-       size_t fmt_len = strlen(fmt);
-       int bytes_written = 0;
-
-       // vsnprintf(char *str, size_t count, ...) -> including null 
terminating character
-       bytes_written = vsnprintf(sel_tracer->buffer 
+sel_tracer->allocated_size, BUFFER_SIZE - sel_tracer->allocated_size, fmt, va);
-       // Add \n if it doesn't exist
-       if (bytes_written && fmt[fmt_len - 1] != '\n')
-               bytes_written += snprintf(sel_tracer->buffer 
+sel_tracer->allocated_size, BUFFER_SIZE - sel_tracer->allocated_size, "\n");
-
-       // Let GDKtracer_log to know about the failure
-       if (bytes_written < 0)
-               return -1;
-
-       // vsnprintf returned value -> does not include the null terminating 
character
-       return bytes_written++;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to