MonetDB: default - Merge with Dec2023 branch.
Changeset: 85413ad9ca49 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/85413ad9ca49 Branch: default Log Message: Merge with Dec2023 branch. diffs (12 lines): diff --git a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py --- a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py +++ b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py @@ -1,7 +1,7 @@ import pymonetdb, sys, threading, os query = ''' -select count(*) from tables; +--select count(*) from tables; create table t1(i int); insert into t1 values(1); insert into t1 values(2); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: balanced_union - Adjust test with proper plan and value...
Changeset: 8d0524bf1f63 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/8d0524bf1f63 Modified Files: sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.test Branch: balanced_union Log Message: Adjust test with proper plan and values check diffs (61 lines): diff --git a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.test b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.test --- a/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.test +++ b/sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.test @@ -40,30 +40,38 @@ FROM ( FROM v,p ) AS tmp +query IR rowsort +select * from r + +0 +2.283 +1 +1.005 +2 +0.900 + query T nosort PLAN select * from r project ( | project ( -| | project ( -| | | crossproduct ( -| | | | table("sys"."v") [ "v"."a1" UNIQUE, "v"."a2" ], -| | | | project ( -| | | | | crossproduct ( -| | | | | | project ( -| | | | | | | select ( -| | | | | | | | table("sys"."input_double") [ "input_double"."a1" UNIQUE, "input_double"."a2" UNIQUE ] -| | | | | | | ) [ ("input_double"."a1" UNIQUE) = (varchar "latitude") ] -| | | | | | ) [ "input_double"."a2" UNIQUE as "tmp_2"."a2" ], -| | | | | | project ( -| | | | | | | select ( -| | | | | | | | table("sys"."input_double") [ "input_double"."a1" UNIQUE, "input_double"."a2" UNIQUE ] -| | | | | | | ) [ ("input_double"."a1" UNIQUE) = (varchar "longitude") ] -| | | | | | ) [ "input_double"."a2" UNIQUE as "tmp_3"."a2" ] -| | | | | ) [ ] -| | | | ) [ "sys"."st_point"("tmp_2"."a2", "tmp_3"."a2") as "a1" ] -| | | ) [ ] -| | ) [ "v"."a1", "v"."a2", "a1" as "p"."a1" ] +| | crossproduct ( +| | | table("sys"."v") [ "v"."a1" UNIQUE, "v"."a2" ], +| | | project ( +| | | | crossproduct ( +| | | | | project ( +| | | | | | select ( +| | | | | | | table("sys"."input_double") [ "input_double"."a1" UNIQUE, "input_double"."a2" UNIQUE ] +| | | | | | ) [ ("input_double"."a1" UNIQUE) = (varchar "latitude") ] +| | | | | ) [ "input_double"."a2" UNIQUE as "tmp_2"."a2" ], +| | | | | project ( +| | | | | | select ( +| | | | | | | table("sys"."input_double") [ "input_double"."a1" UNIQUE, "input_double"."a2" UNIQUE ] +| | | | | | ) [ ("input_double"."a1" UNIQUE) = (varchar "longitude") ] +| | | | | ) [ "input_double"."a2" UNIQUE as "tmp_3"."a2" ] +| | | | ) [ ] +| | | ) [ "sys"."st_point"("tmp_2"."a2", "tmp_3"."a2") as "p"."a1" ] +| | ) [ ] | ) [ "v"."a1" as "a1", "sys"."st_distance"("v"."a2", "p"."a1") as "prob" ] ) [ "a1" as "r"."a1", "prob" as "r"."prob" ] ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - pass on mapi error when ODBC connect fails
Changeset: 5d3a42c1af00 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5d3a42c1af00 Modified Files: clients/odbc/driver/SQLConnect.c Branch: default Log Message: pass on mapi error when ODBC connect fails More useful than a generic 'couldn't connect' message. diffs (12 lines): diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c --- a/clients/odbc/driver/SQLConnect.c +++ b/clients/odbc/driver/SQLConnect.c @@ -251,7 +251,7 @@ MNDBConnect(ODBCDbc *dbc, } if (mid == NULL || mapi_error(mid)) { /* Client unable to establish connection */ - addDbcError(dbc, "08001", NULL, 0); + addDbcError(dbc, "08001", mid ? mapi_error_str(mid) : NULL, 0); rc = SQL_ERROR; /* clean up */ if (mid) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Compatibility with pymonetdb 1.8.1.
Changeset: bdde5951e4b0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/bdde5951e4b0 Modified Files: sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py Branch: Dec2023 Log Message: Compatibility with pymonetdb 1.8.1. diffs (12 lines): diff --git a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py --- a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py +++ b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py @@ -1,7 +1,7 @@ import pymonetdb, sys, threading, os query = ''' -select count(*) from tables; +--select count(*) from tables; create table t1(i int); insert into t1 values(1); insert into t1 values(2); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: check - merge with default
Changeset: 94f72926051f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/94f72926051f Modified Files: sql/storage/store.c Branch: check Log Message: merge with default diffs (truncated from 1070 to 300 lines): diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -85,6 +85,7 @@ function(monetdb_configure_defines) check_symbol_exists("getopt_long" "getopt.h" HAVE_GETOPT_LONG) cmake_pop_check_state() check_function_exists("getrlimit" HAVE_GETRLIMIT) + check_function_exists("gettid" HAVE_GETTID) check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) check_function_exists("getuid" HAVE_GETUID) check_symbol_exists("gmtime_r" "time.h" HAVE_GMTIME_R) diff --git a/common/utils/matomic.h b/common/utils/matomic.h --- a/common/utils/matomic.h +++ b/common/utils/matomic.h @@ -18,7 +18,6 @@ * The following operations are defined: * ATOMIC_VAR_INIT -- initializer for the variable (not necessarily atomic!); * ATOMIC_INIT -- initialize the variable (not necessarily atomic!); - * ATOMIC_DESTROY -- destroy the variable * ATOMIC_GET -- return the value of a variable; * ATOMIC_SET -- set the value of a variable; * ATOMIC_XCG -- set the value of a variable, return original value; @@ -114,7 +113,6 @@ typedef unsigned long ATOMIC_BASE_TYPE; #endif #define ATOMIC_INIT(var, val) atomic_init(var, (ATOMIC_BASE_TYPE) (val)) -#define ATOMIC_DESTROY(var)((void) 0) #define ATOMIC_GET(var)((ATOMIC_BASE_TYPE) *(var)) #define ATOMIC_SET(var, val) (*(var) = (ATOMIC_BASE_TYPE) (val)) #define ATOMIC_XCG(var, val) atomic_exchange(var, (ATOMIC_BASE_TYPE) (val)) @@ -173,7 +171,6 @@ typedef __declspec(align(8)) volatile AT #define ATOMIC_VAR_INIT(val) (val) #define ATOMIC_INIT(var, val) (*(var) = (val)) -#define ATOMIC_DESTROY(var)((void) 0) #if SIZEOF_SIZE_T == 8 @@ -276,7 +273,6 @@ typedef volatile ATOMIC_BASE_TYPE ATOMIC #define ATOMIC_VAR_INIT(val) (val) #define ATOMIC_INIT(var, val) (*(var) = (val)) -#define ATOMIC_DESTROY(var)((void) 0) #define ATOMIC_GET(var)((ATOMIC_BASE_TYPE) __atomic_load_n(var, __ATOMIC_SEQ_CST)) #define ATOMIC_SET(var, val) __atomic_store_n(var, (ATOMIC_BASE_TYPE) (val), __ATOMIC_SEQ_CST) diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -258,6 +258,7 @@ BATmaterialize(BAT *b, BUN cap) .farmid = BBPselectfarm(b->batRole, TYPE_oid, offheap), .parentid = b->batCacheid, .dirty = true, + .refs = ATOMIC_VAR_INIT(1), }; settailname(tail, BBP_physical(b->batCacheid), TYPE_oid, 0); if (HEAPalloc(tail, cap, sizeof(oid)) != GDK_SUCCEED) { @@ -273,7 +274,6 @@ BATmaterialize(BAT *b, BUN cap) for (p = 0; p < q; p++) x[p] = t++; } - ATOMIC_INIT(&tail->refs, 1); /* point of no return */ MT_lock_set(&b->theaplock); assert((ATOMIC_GET(&b->theap->refs) & HEAPREFS) > 0); diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -74,6 +74,7 @@ BATcreatedesc(oid hseq, int tt, bool hea *h = (Heap) { .farmid = BBPselectfarm(role, tt, offheap), .dirty = true, + .refs = ATOMIC_VAR_INIT(1), }; if (ATOMneedheap(tt)) { @@ -84,6 +85,7 @@ BATcreatedesc(oid hseq, int tt, bool hea *vh = (Heap) { .farmid = BBPselectfarm(role, tt, varheap), .dirty = true, + .refs = ATOMIC_VAR_INIT(1), }; } } @@ -124,13 +126,11 @@ BATcreatedesc(oid hseq, int tt, bool hea if (bn->theap) { bn->theap->parentid = bn->batCacheid; - ATOMIC_INIT(&bn->theap->refs, 1); const char *nme = BBP_physical(bn->batCacheid); settailname(bn->theap, nme, tt, width); if (bn->tvheap) { bn->tvheap->parentid = bn->batCacheid; - ATOMIC_INIT(&bn->tvheap->refs, 1); strconcat_len(bn->tvheap->filename, sizeof(bn->tvheap->filename), nme, ".theap", NULL); @@ -603,6 +603,7 @@ BATclear(BAT *b, bool force) .parentid = b->tvheap->parentid, .dirty = true, .hasfile = b->tvheap->hasfile, + .refs = ATOMIC_VAR_INIT(1), }; strcpy_len(th->filename, b->tvheap->filename, sizeof(th->filename)); if (ATOMheap(b->ttype, th, 0)
MonetDB: check - serialize used columns
Changeset: d4f871ae47a4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/d4f871ae47a4 Modified Files: sql/server/rel_basetable.c sql/server/rel_schema.c Branch: check Log Message: serialize used columns diffs (29 lines): diff --git a/sql/server/rel_basetable.c b/sql/server/rel_basetable.c --- a/sql/server/rel_basetable.c +++ b/sql/server/rel_basetable.c @@ -567,9 +567,9 @@ rel_base_dump_exps( stream *fout, sql_re } } if (rel_base_is_used(ba, i)) { - mnstr_printf(fout, "%s\"%s\".\"%%TID\"", comma?", ":"", t->base.name); + mnstr_printf(fout, "%s\"%s\".\"%%TID%%\"", comma?", ":"", t->base.name); if (ba->name) - mnstr_printf(fout, " as \"%s\".\"%%TID\"", ba->name); + mnstr_printf(fout, " as \"%s\".\"%%TID%%\"", ba->name); comma = 1; } i++; diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -410,7 +410,9 @@ str serialize_check_plan(sql_query *quer exp_kind ek = {type_value, card_value, FALSE}; sql_rel* rel = rel_basetable(sql, t, t->base.name); sql_exp *e = rel_logical_value_exp(query, &rel, s->data.sym, sql_sel, ek); - rel = rel_project_exp(sql, e); + list *pexps = sa_list(sql->sa); + pexps = append(pexps, e); + rel = rel_project(sql->sa, rel, pexps); str check = rel2str(sql, rel); return check; } ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: check - iterate over all columns in table
Changeset: 5a15e450142e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5a15e450142e Modified Files: sql/backends/monet5/rel_bin.c Branch: check Log Message: iterate over all columns in table diffs (26 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4931,12 +4931,10 @@ sql_insert_check(backend *be, sql_key *k inserts = rel_copy(sql, inserts, 1); list* exps = inserts->exps; - sql_subtype *bt = sql_bind_localtype("bit"); - - for (n = key->columns->h, m = exps->h; n && m; + for (n = ol_first_node(key->t->columns), m = exps->h; n && m; n = n->next, m = m->next) { sql_exp *i = m->data; - sql_column *c = ((sql_kc*) n->data)->c; + sql_column *c = n->data; i->alias.rname= sa_strdup(sql->sa, c->t->base.name); i->alias.name= sa_strdup(sql->sa, c->base.name); } @@ -4945,6 +4943,7 @@ sql_insert_check(backend *be, sql_key *k sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, sa_list(sql->sa)); rel->l = inserts; stmt* s = subrel_bin(be, rel, refs); + sql_subtype *bt = sql_bind_localtype("bit"); s = stmt_uselect(be, column(be, s), stmt_atom(be, atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1); sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR, true, true); s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merge with Dec2023 branch.
Changeset: 2b1939405e38 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/2b1939405e38 Modified Files: cmake/monetdb-defines.cmake gdk/gdk_system.c monetdb5/mal/mal_dataflow.c monetdb_config.h.in Branch: default Log Message: Merge with Dec2023 branch. diffs (193 lines): diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -85,6 +85,7 @@ function(monetdb_configure_defines) check_symbol_exists("getopt_long" "getopt.h" HAVE_GETOPT_LONG) cmake_pop_check_state() check_function_exists("getrlimit" HAVE_GETRLIMIT) + check_function_exists("gettid" HAVE_GETTID) check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) check_function_exists("getuid" HAVE_GETUID) check_symbol_exists("gmtime_r" "time.h" HAVE_GMTIME_R) diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -52,6 +52,8 @@ #include "mutils.h" +static ATOMIC_TYPE GDKthreadid = ATOMIC_VAR_INIT(1); + #ifdef LOCK_STATS ATOMIC_TYPE GDKlockcnt = ATOMIC_VAR_INIT(0); @@ -218,6 +220,9 @@ static struct mtthread { HANDLE hdl; DWORD wtid; #endif +#ifdef HAVE_GETTID + pid_t lwptid; +#endif MT_Id tid; uintptr_t sp; char *errbuf; @@ -227,6 +232,7 @@ struct mtthread mainthread = { .threadname = "main thread", .exited = ATOMIC_VAR_INIT(0), .refs = 1, + .tid = 1, }; #ifdef HAVE_PTHREAD_H static pthread_mutex_t posthread_lock = PTHREAD_MUTEX_INITIALIZER; @@ -285,9 +291,22 @@ dump_threads(void) MT_Cond *cn = t->condwait; struct mtthread *jn = t->joinwait; int pos = snprintf(buf, sizeof(buf), - "%s, tid %zu, %"PRIu32" free bats, waiting for %s%s, working on %.200s", + "%s, tid %zu, " +#ifdef HAVE_PTHREAD_H + "Thread 0x%lx, " +#endif +#ifdef HAVE_GETTID + "LWP %ld, " +#endif + "%"PRIu32" free bats, waiting for %s%s, working on %.200s", t->threadname, t->tid, +#ifdef HAVE_PTHREAD_H + (long) t->hdl, +#endif +#ifdef HAVE_GETTID + (long) t->lwptid, +#endif t->freebats.nfreebats, lk ? "lock " : sm ? "semaphore " : cn ? "condvar " : jn ? "thread " : "", lk ? lk->name : sm ? sm->name : cn ? cn->name : jn ? jn->threadname : "nothing", @@ -329,6 +348,9 @@ MT_thread_init(void) { if (thread_initialized) return true; +#ifdef HAVE_GETTID + mainthread.lwptid = gettid(); +#endif #ifdef HAVE_PTHREAD_H int ret; @@ -356,7 +378,6 @@ MT_thread_init(void) } InitializeCriticalSection(&winthread_cs); #endif - mainthread.tid = (MT_Id) &mainthread; mainthread.next = NULL; mtthreads = &mainthread; thread_initialized = true; @@ -365,8 +386,6 @@ MT_thread_init(void) bool MT_thread_register(void) { - MT_Id mtid; - assert(thread_initialized); if (!thread_initialized) return false; @@ -386,7 +405,6 @@ MT_thread_register(void) if (self == NULL) return false; - mtid = (MT_Id) self; *self = (struct mtthread) { .detached = false, #ifdef HAVE_PTHREAD_H @@ -395,7 +413,7 @@ MT_thread_register(void) .wtid = GetCurrentThreadId(), #endif .refs = 1, - .tid = mtid, + .tid = (MT_Id) ATOMIC_INC(&GDKthreadid), .exited = ATOMIC_VAR_INIT(0), }; snprintf(self->threadname, sizeof(self->threadname), "foreign %zu", self->tid); @@ -735,6 +753,9 @@ thread_starter(void *arg) struct mtthread *self = (struct mtthread *) arg; void *data = self->data; +#ifdef HAVE_GETTID + self->lwptid = gettid(); +#endif #ifdef HAVE_PTHREAD_H #ifdef HAVE_PTHREAD_SETNAME_NP /* name can be at most 16 chars including \0 */ @@ -848,7 +869,6 @@ int MT_create_thread(MT_Id *t, void (*f) (void *), void *arg, enum MT_thr_detach d, const char *threadname) { struct mtthread *self; - MT_Id mtid; assert(thread_initialized); join_threads(); @@ -882,7 +902,6 @@ MT_create_thread(MT_Id *t, void (*f) (vo #endif return -1; } - mtid = (MT_Id) self; *self = (struct mtthread) { .func = f, @@ -890,7 +909,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo .waiting = false, .detached = (d == MT_THR_DETACHED), .refs = 1, - .tid = mtid, + .tid = (MT_Id) ATOMIC_INC(&GDKthreadid),
MonetDB: Dec2023 - Add a cast.
Changeset: ace6995d64e0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/ace6995d64e0 Modified Files: gdk/gdk_system.c Branch: Dec2023 Log Message: Add a cast. diffs (21 lines): diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -414,7 +414,7 @@ MT_thread_register(void) .wtid = GetCurrentThreadId(), #endif .refs = 1, - .tid = ATOMIC_INC(&GDKthreadid), + .tid = (MT_Id) ATOMIC_INC(&GDKthreadid), }; snprintf(self->threadname, sizeof(self->threadname), "foreign %zu", self->tid); ATOMIC_INIT(&self->exited, 0); @@ -910,7 +910,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo .waiting = false, .detached = (d == MT_THR_DETACHED), .refs = 1, - .tid = ATOMIC_INC(&GDKthreadid), + .tid = (MT_Id) ATOMIC_INC(&GDKthreadid), }; MT_lock_set(&thread_init_lock); /* remember the list of callback functions we need to call for ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org