MonetDB: default - Next lateral join crash. Looking into it
Changeset: c2cba6e898cd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/c2cba6e898cd Modified Files: sql/test/SQLancer/Tests/sqlancer22.test Branch: default Log Message: Next lateral join crash. Looking into it diffs (69 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer22.test b/sql/test/SQLancer/Tests/sqlancer22.test --- a/sql/test/SQLancer/Tests/sqlancer22.test +++ b/sql/test/SQLancer/Tests/sqlancer22.test @@ -21,7 +21,6 @@ as count FROM v2) as res 1 -# this one is right query I nosort SELECT 1 FROM v2 WHERE (SELECT 'a' FROM v1) <> ALL((SELECT 'b' FROM t2) UNION (SELECT 'c' FROM v1)) @@ -80,7 +79,6 @@ select 1 from mct20 inner join (select x on true and greatest(((select nort0.norc0) intersect (select true)), true) -# these are right query I nosort select rank() over (order by ((select mct20.c0) union all (select interval '1' day))) from mct20 @@ -195,7 +193,6 @@ SELECT vx.vc2 FROM vx JOIN (VALUES (1)) 2 -# this one is right query I nosort SELECT CAST(SUM(count) AS BIGINT) FROM (SELECT CAST(vx.vc0 >= ALL(SELECT t0.c0 FROM t0) AND 1 >= ALL(SELECT vx.vc1 FROM t0) AS INT) as count FROM vx JOIN (VALUES (1)) AS x(x) ON TRUE) as res @@ -220,7 +217,6 @@ SELECT vy.y FROM vy WHERE CAST(NOT EXIST 0 0 -# this one is right query I nosort SELECT CAST(SUM(count) AS BIGINT) FROM (SELECT CAST(CAST(NOT EXISTS (SELECT 1 FROM vx WHERE vy.y) AS BOOLEAN) AS INT) as count FROM vy) as res @@ -474,22 +470,12 @@ SAVEPOINT sp2 statement error SELECT TRUE FROM rt2 AS x RIGHT OUTER JOIN LATERAL (SELECT x.c0, TRUE FROM rt2) AS y(y,z) ON y.z - -1 -1 -1 -1 statement ok ROLLBACK TO SAVEPOINT sp2 statement error SELECT TRUE FROM rt2 AS x FULL OUTER JOIN LATERAL (SELECT x.c0, TRUE FROM rt2) AS y(y,z) ON y.z - -1 -1 -1 -1 statement ok ROLLBACK TO SAVEPOINT sp2 @@ -604,5 +590,10 @@ query I nosort SELECT 1 FROM t0 LEFT OUTER JOIN LATERAL (SELECT 2, (VALUES (3), (t0.c0))) AS x(x,y) ON x.x IN (SELECT x.x) +query I nosort +SELECT 1 FROM t0 LEFT OUTER JOIN LATERAL (SELECT DISTINCT 3 FROM t1 AS tx JOIN (SELECT 1) AS y(y) +ON tx.c0 > 2 OR t0.c0 > 3) AS x(x) ON (SELECT TRUE FROM t1) OR FALSE + + statement ok ROLLBACK ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Set new select relations as processed during ...
Changeset: 6ca9a842453b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6ca9a842453b Modified Files: sql/server/rel_optimizer.c sql/server/rel_propagate.c sql/server/rel_unnest.c sql/server/rel_updates.c Branch: default Log Message: Set new select relations as processed during optimization diffs (truncated from 421 to 300 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -1493,7 +1493,9 @@ rel_simplify_project_fk_join(mvc *sql, s } else { nr = rel_dup(r->r); } - return rel_select(sql->sa, nr, nje); + nr = rel_select(sql->sa, nr, nje); + set_processed(nr); + return nr; } static sql_rel * @@ -1568,7 +1570,9 @@ rel_simplify_count_fk_join(mvc *sql, sql } else { nr = rel_dup(r->r); } - return rel_select(sql->sa, nr, nje); + nr = rel_select(sql->sa, nr, nje); + set_processed(nr); + return nr; } /* @@ -4343,6 +4347,7 @@ rel_push_select_down(visitor *v, sql_rel sql_rel *l = rel_select(v->sql->sa, rel->l, NULL); l->exps = rel->exps; + set_processed(l); rel->exps = NULL; rel->l = l; v->changes++; @@ -4397,8 +4402,7 @@ rel_push_select_down(visitor *v, sql_rel /* push select through join */ if (is_select(rel->op) && r && is_join(r->op) && !rel_is_ref(r) && !is_single(r)){ - sql_rel *jl = r->l; - sql_rel *jr = r->r; + sql_rel *jl = r->l, *ojl = jl, *jr = r->r, *ojr = jr; int left = r->op == op_join || r->op == op_left; int right = r->op == op_join || r->op == op_right; @@ -4427,6 +4431,10 @@ rel_push_select_down(visitor *v, sql_rel } n = next; } + if (ojl != jl) + set_processed(jl); + if (ojr != jr) + set_processed(jr); } /* merge select and cross product ? */ @@ -4437,7 +4445,7 @@ rel_push_select_down(visitor *v, sql_rel if (exp_is_join(e, NULL) == 0) { if (!r->exps) - r->exps = new_exp_list(v->sql->sa); + r->exps = sa_list(v->sql->sa); append(r->exps, e); list_remove_node(exps, NULL, n); v->changes++; @@ -4447,31 +4455,29 @@ rel_push_select_down(visitor *v, sql_rel } if (is_select(rel->op) && r && r->op == op_project && !rel_is_ref(r) && !is_single(r)){ - sql_rel *pl = r->l; + sql_rel *pl = r->l, *opl = pl; /* we cannot push through window functions (for safety I disabled projects over DDL too) */ if (pl && pl->op != op_ddl && !exps_have_unsafe(r->exps, 0)) { /* introduce selects under the project (if needed) */ set_processed(pl); - if (pl && (is_select(pl->op) || is_join(pl->op) || is_semi(pl->op)) && !pl->exps) + if (!pl->exps) pl->exps = sa_list(v->sql->sa); for (n = exps->h; n;) { node *next = n->next; sql_exp *e = n->data, *ne = NULL; - if (e->type == e_cmp) { - ne = exp_push_down_prj(v->sql, e, r, pl); - - /* can we move it down */ - if (ne && ne != e && pl->exps) { - if (!(is_select(pl->op) && is_join(pl->op) && is_semi(pl->op)) || rel_is_ref(pl)) - r->l = pl = rel_select(v->sql->sa, pl, NULL); - rel_select_add_exp(v->sql->sa, pl, ne); - list_remove_node(exps, NULL, n); - v->changes++; - } + /* can we move it down */ + if (e->type == e_cmp && (ne = exp_push_down_prj(v->sql, e, r, pl)) && ne != e) { + if (!(is_select(pl->op) && is_join(pl->op) && is_semi(pl->op)) || rel_is_ref(pl)) + r->l = pl = rel_select(v->sql->sa, pl, NULL); + rel_select_add_exp(v->sql->sa, pl, ne); + list_remove_node(exps, NULL, n); +
MonetDB: Jan2022 - Jan2022-SP1 was released.
Changeset: 668e99355d53 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/668e99355d53 Modified Files: .hgtags Branch: Jan2022 Log Message: Jan2022-SP1 was released. diffs (8 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -752,3 +752,4 @@ 9fbec5dab8167d2189582fbe75e5f9c8bef82380 9fbec5dab8167d2189582fbe75e5f9c8bef82380 Jan2022_release 97e76b882f9fb28327393d21708fb22f2f6c22f1 Jan2022_7 f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_9 +f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_SP1_release ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - More missing processed relations
Changeset: b0334723055d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b0334723055d Modified Files: sql/server/rel_optimizer.c sql/server/rel_propagate.c Branch: default Log Message: More missing processed relations diffs (128 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -1875,6 +1875,7 @@ rel_push_topn_and_sample_down(visitor *v ul->exps = list_distinct(list_merge(ul->exps, exps_copy(v->sql, rcopy), NULL), (fcmp) exp_equal, (fdup) NULL); ul->nrcols = list_length(ul->exps); ul->r = exps_copy(v->sql, r->r); + set_processed(ul); ul = func(v->sql->sa, ul, sum_limit_offset(v->sql, rel)); set_processed(ul); @@ -1884,6 +1885,7 @@ rel_push_topn_and_sample_down(visitor *v ur->exps = list_distinct(list_merge(ur->exps, exps_copy(v->sql, rcopy), NULL), (fcmp) exp_equal, (fdup) NULL); ur->nrcols = list_length(ur->exps); ur->r = exps_copy(v->sql, r->r); + set_processed(ur); ur = func(v->sql->sa, ur, sum_limit_offset(v->sql, rel)); set_processed(ur); @@ -3995,9 +3997,11 @@ rel_push_aggr_down(visitor *v, sql_rel * ul = rel_project(v->sql->sa, ul, NULL); ul->exps = exps_copy(v->sql, ou->exps); rel_rename_exps(v->sql, ou->exps, ul->exps); + set_processed(ul); ur = rel_project(v->sql->sa, ur, NULL); ur->exps = exps_copy(v->sql, ou->exps); rel_rename_exps(v->sql, ou->exps, ur->exps); + set_processed(ur); } if (g->r && list_length(g->r) > 0) { @@ -4948,8 +4952,10 @@ rel_push_join_down_union(visitor *v, sql if (l != ol) { ll = rel_project(v->sql->sa, ll, NULL); ll->exps = exps_copy(v->sql, ol->exps); + set_processed(ll); lr = rel_project(v->sql->sa, lr, NULL); lr->exps = exps_copy(v->sql, ol->exps); + set_processed(lr); } nl = rel_crossproduct(v->sql->sa, ll, rel_dup(or), rel->op); nr = rel_crossproduct(v->sql->sa, lr, rel_dup(or), rel->op); @@ -4979,8 +4985,10 @@ rel_push_join_down_union(visitor *v, sql if (l != ol) { ll = rel_project(v->sql->sa, ll, NULL); ll->exps = exps_copy(v->sql, ol->exps); + set_processed(ll); lr = rel_project(v->sql->sa, lr, NULL); lr->exps = exps_copy(v->sql, ol->exps); + set_processed(lr); } if (!is_project(rl->op)) rl = rel_project(v->sql->sa, rl, @@ -4993,8 +5001,10 @@ rel_push_join_down_union(visitor *v, sql if (r != or) { rl = rel_project(v->sql->sa, rl, NULL); rl->exps = exps_copy(v->sql, or->exps); + set_processed(rl); rr = rel_project(v->sql->sa, rr, NULL); rr->exps = exps_copy(v->sql, or->exps); + set_processed(rr); } nl = rel_crossproduct(v->sql->sa, ll, rl, rel->op); nr = rel_crossproduct(v->sql->sa, lr, rr, rel->op); @@ -5024,8 +5034,10 @@ rel_push_join_down_union(visitor *v, sql if (r != or) { rl = rel_project(v->sql->sa, rl, NULL); rl->exps = exps_copy(v->sql, or->exps); + set_processed(rl); rr = rel_project(v->sql->sa, rr, NULL); rr->exps = exps_copy(v->sql, or->exps); + set_processed(rr); } nl = rel_crossproduct(v->sql->sa, rel_dup(ol), rl, rel->op); nr = rel_crossproduct(v->sql->sa, rel_dup(ol), rr, rel->op); @@ -5075,6 +5087,7 @@ rel_push_join_down_union(visitor *v, sql if (r != or) { rl = rel_project(v->sql->sa, rl, NULL); rl->exps = exps_copy(v->sql, or->exps); + set_processed
MonetDB: default - The concurrency issue with the query queue is...
Changeset: e3939ab7cbc5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e3939ab7cbc5 Modified Files: sql/test/SQLancer/Tests/sqlancer19.SQL.py Branch: default Log Message: The concurrency issue with the query queue is still there diffs (24 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer19.SQL.py b/sql/test/SQLancer/Tests/sqlancer19.SQL.py --- a/sql/test/SQLancer/Tests/sqlancer19.SQL.py +++ b/sql/test/SQLancer/Tests/sqlancer19.SQL.py @@ -348,7 +348,6 @@ with SQLTestCase() as cli: UNION ALL (SELECT 1 FROM t3 RIGHT OUTER JOIN (SELECT 4) AS sub1n0(subc1n0) ON TRUE CROSS JOIN (SELECT FALSE FROM t3) AS sub1n1(subc1n0))) FROM t3; """).assertSucceeded().assertDataResultMatch([(True,),(True,),(True,),(True,),(True,),(True,)]) -# this query triggers a lot MAL user function calls at the moment. It allows to test concurrency issues with the query queue cli.execute(""" SELECT 5 <> ALL((SELECT 2 FROM rt3 FULL OUTER JOIN (SELECT 1) AS sub1n0(subc1n0) ON 2 < ANY(SELECT 1)) UNION ALL (SELECT 1 FROM rt3 RIGHT OUTER JOIN (SELECT 4) AS sub1n0(subc1n0) ON TRUE @@ -356,6 +355,12 @@ with SQLTestCase() as cli: """).assertSucceeded().assertDataResultMatch([(True,),(True,),(True,),(True,),(True,),(True,)]) cli.execute("ROLLBACK;") +cli.execute("SELECT CASE 1 WHEN 5 THEN ((SELECT t3.c0) INTERSECT (SELECT 9)) ELSE (VALUES (t3.c0), (1)) END FROM t3;") \ +.assertFailed() # GDK reported error: hashjoin: more than one match +# this query triggers a lot MAL user function calls at the moment. It allows to test concurrency issues with the query queue +cli.execute("SELECT CASE 1 WHEN 5 THEN ((SELECT rt3.c0) INTERSECT (SELECT 9)) ELSE (VALUES (rt3.c0), (1)) END FROM rt3;") \ +.assertFailed() # GDK reported error: hashjoin: more than one match + cli.execute(""" START TRANSACTION; DROP TABLE rt1; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - removed no longer needed rewrite of or expres...
Changeset: 3298ef6fea35 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/3298ef6fea35 Modified Files: sql/server/rel_unnest.c sql/test/prepare/Tests/sqlancer_prepare.stable.err sql/test/prepare/Tests/sqlancer_prepare.stable.err.int128 Branch: default Log Message: removed no longer needed rewrite of or expressions diffs (129 lines): diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -2260,84 +2260,13 @@ has_or(visitor *v, sql_rel *rel, sql_exp } static bool -exps_has_or_exp(mvc *sql, list *exps) +exps_have_or_exp(mvc *sql, list *exps) { visitor v = { .sql = sql, .data = NULL }; exps_exp_visitor_topdown(&v, NULL, exps, 0, &has_or, true); return v.data != NULL; } -/* remove or expressions with subqueries */ -static sql_rel * -rewrite_or_exp(visitor *v, sql_rel *rel) -{ - if (mvc_highwater(v->sql)) - return sql_error(v->sql, 10, SQLSTATE(42000) "Query too complex: running out of stack space"); - - if ((is_select(rel->op) || is_join(rel->op) || is_semi(rel->op)) && !list_empty(rel->exps)) { - for(node *n=rel->exps->h; n; n=n->next) { - sql_exp *e = n->data, *id; - - if (is_compare(e->type) && e->flag == cmp_or) { - /* check for exp_is_rel */ - if (exps_have_rel_exp(e->l) || exps_have_rel_exp(e->r)) { - /* rewrite into setop */ - list_remove_node(rel->exps, NULL, n); /* remove or expression */ - if (is_select(rel->op) && list_empty(rel->exps) && !(rel_is_ref(rel))) { /* remove empty select if that's the case */ - sql_rel *l = rel->l; - rel->l = NULL; - rel_destroy(rel); - rel = l; - } - if (!(rel = rel_add_identity(v->sql, rel, &id))) /* identity function needed */ - return NULL; - const char *idrname = exp_relname(id), *idname = exp_name(id); - list *tids = NULL, *exps = rel_projections(v->sql, rel, NULL, 1, 1); - - for( node *n = exps->h ; n ; ) { - node *next = n->next; - sql_exp *e = n->data; - - if (strcmp(exp_name(e), TID) == 0) { /* remove TID references and later restore them with identity function references */ - if (!tids) - tids = sa_list(v->sql->sa); - list_append(tids, exp_alias(v->sql->sa, exp_relname(e), TID, idrname, idname, sql_bind_localtype("oid"), CARD_MULTI, 0, 1, 1)); - list_remove_node(exps, NULL, n); - } - n = next; - } - - sql_rel *l = rel, *r = rel_dup(rel); - set_processed(rel); - l = rel_select(v->sql->sa, l, NULL); - l->exps = e->l; - set_processed(l); - if (!(l = rewrite_or_exp(v, l))) - return NULL; - r = rel_select(v->sql->sa, r, NULL); - r->exps = e->r; - set_processed(r); - if (!(r = rewrite_or_exp(v, r))) - return NULL; - if (!(rel = rel_setop_check_types(v->sql, l, r, exps_copy(v->sql, exps), exps_copy(v->sql, exps), op_union))) - return NULL; - rel_setop_set_exps(v->sql, rel, exps, false); - set_processed(rel); - rel = rel_distinct(rel); - if (tids) /* restore TIDs with identity function references */ - rel = rel_project(v->sql->sa, rel, list_merge(rel_projections(v->sql, rel, NULL, 1, 1), tids, NULL)); -
MonetDB: Jul2021 - Lock heap while writing the backup.
Changeset: 0480550045e9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0480550045e9 Modified Files: gdk/gdk_bbp.c Branch: Jul2021 Log Message: Lock heap while writing the backup. diffs (33 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -3472,6 +3472,7 @@ BBPbackup(BAT *b, bool subcommit) long_str nme; const char *s = BBP_physical(b->batCacheid); size_t slen; + bool locked = false; if (BBPprepare(subcommit) != GDK_SUCCEED) { return GDK_FAIL; @@ -3492,6 +3493,8 @@ BBPbackup(BAT *b, bool subcommit) memcpy(nme, s, slen + 1); srcdir[s - srcdir] = 0; + MT_lock_set(&b->theaplock); + locked = true; if (b->ttype != TYPE_void && do_backup(srcdir, nme, gettailname(b), b->theap, b->batDirtydesc || b->theap->dirty, @@ -3502,9 +3505,12 @@ BBPbackup(BAT *b, bool subcommit) b->batDirtydesc || b->tvheap->dirty, subcommit) != GDK_SUCCEED) goto fail; + MT_lock_unset(&b->theaplock); GDKfree(srcdir); return GDK_SUCCEED; fail: + if (locked) + MT_lock_unset(&b->theaplock); if(srcdir) GDKfree(srcdir); return GDK_FAIL; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Jan2022 - Merge with Jul2021 branch.
Changeset: 76f5311682a5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/76f5311682a5 Modified Files: gdk/gdk_bbp.c Branch: Jan2022 Log Message: Merge with Jul2021 branch. diffs (33 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -3750,6 +3750,7 @@ BBPbackup(BAT *b, bool subcommit) long_str nme; const char *s = BBP_physical(b->batCacheid); size_t slen; + bool locked = false; if (BBPprepare(subcommit) != GDK_SUCCEED) { return GDK_FAIL; @@ -3770,6 +3771,8 @@ BBPbackup(BAT *b, bool subcommit) memcpy(nme, s, slen + 1); srcdir[s - srcdir] = 0; + MT_lock_set(&b->theaplock); + locked = true; if (b->ttype != TYPE_void && do_backup(srcdir, nme, gettailname(b), b->theap, b->batDirtydesc || b->theap->dirty, @@ -3780,9 +3783,12 @@ BBPbackup(BAT *b, bool subcommit) b->batDirtydesc || b->tvheap->dirty, subcommit) != GDK_SUCCEED) goto fail; + MT_lock_unset(&b->theaplock); GDKfree(srcdir); return GDK_SUCCEED; fail: + if (locked) + MT_lock_unset(&b->theaplock); if(srcdir) GDKfree(srcdir); return GDK_FAIL; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merge with Jan2022 branch.
Changeset: cd94f3e492fc for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/cd94f3e492fc Branch: default Log Message: Merge with Jan2022 branch. diffs (41 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -752,3 +752,4 @@ 9fbec5dab8167d2189582fbe75e5f9c8bef82380 9fbec5dab8167d2189582fbe75e5f9c8bef82380 Jan2022_release 97e76b882f9fb28327393d21708fb22f2f6c22f1 Jan2022_7 f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_9 +f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_SP1_release diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -3750,6 +3750,7 @@ BBPbackup(BAT *b, bool subcommit) long_str nme; const char *s = BBP_physical(b->batCacheid); size_t slen; + bool locked = false; if (BBPprepare(subcommit) != GDK_SUCCEED) { return GDK_FAIL; @@ -3770,6 +3771,8 @@ BBPbackup(BAT *b, bool subcommit) memcpy(nme, s, slen + 1); srcdir[s - srcdir] = 0; + MT_lock_set(&b->theaplock); + locked = true; if (b->ttype != TYPE_void && do_backup(srcdir, nme, gettailname(b), b->theap, b->batDirtydesc || b->theap->dirty, @@ -3780,9 +3783,12 @@ BBPbackup(BAT *b, bool subcommit) b->batDirtydesc || b->tvheap->dirty, subcommit) != GDK_SUCCEED) goto fail; + MT_lock_unset(&b->theaplock); GDKfree(srcdir); return GDK_SUCCEED; fail: + if (locked) + MT_lock_unset(&b->theaplock); if(srcdir) GDKfree(srcdir); return GDK_FAIL; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Clear list hash if expressions are renamed
Changeset: fdba9fd0862b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/fdba9fd0862b Modified Files: sql/server/rel_unnest.c Branch: default Log Message: Clear list hash if expressions are renamed diffs (15 lines): diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c --- a/sql/server/rel_unnest.c +++ b/sql/server/rel_unnest.c @@ -1422,9 +1422,11 @@ push_up_set(mvc *sql, sql_rel *rel, list sl = rel_project(sql->sa, rel_dup(sl), rel_projections(sql, sl, NULL, 1, 1)); for (node *n = sl->exps->h, *m = s->exps->h; n && m; n = n->next, m = m->next) exp_prop_alias(sql->sa, n->data, m->data); + list_hash_clear(sl->exps); sr = rel_project(sql->sa, rel_dup(sr), rel_projections(sql, sr, NULL, 1, 1)); for (node *n = sr->exps->h, *m = s->exps->h; n && m; n = n->next, m = m->next) exp_prop_alias(sql->sa, n->data, m->data); + list_hash_clear(sr->exps); /* D djoin (sl setop sr) -> (D djoin sl) setop (D djoin sr) */ sl = rel_crossproduct(sql->sa, rel_dup(d), sl, rel->op); sl->exps = exps_copy(sql, rel->exps); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Next crashing query. Select expression pushed...
Changeset: dd458b52fc85 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/dd458b52fc85 Modified Files: sql/test/SQLancer/Tests/sqlancer22.test Branch: default Log Message: Next crashing query. Select expression pushed down to the wrong side? diffs (13 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer22.test b/sql/test/SQLancer/Tests/sqlancer22.test --- a/sql/test/SQLancer/Tests/sqlancer22.test +++ b/sql/test/SQLancer/Tests/sqlancer22.test @@ -595,5 +595,9 @@ SELECT 1 FROM t0 LEFT OUTER JOIN LATERAL ON tx.c0 > 2 OR t0.c0 > 3) AS x(x) ON (SELECT TRUE FROM t1) OR FALSE +query I nosort +SELECT 1 FROM (SELECT TRUE) AS vx(x), t3 WHERE vx.x AND greatest(t3.c0, EXISTS (SELECT 1 WHERE vx.x)) + + statement ok ROLLBACK ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: embedded_mapi - Merge with default.
Changeset: 2e26fb1ae104 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/2e26fb1ae104 Modified Files: clients/Tests/exports.stable.out Branch: embedded_mapi Log Message: Merge with default. diffs (truncated from 4106 to 300 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1447,6 +1447,7 @@ char *monetdbe_error(monetdbe_database d char *monetdbe_execute(monetdbe_statement *stmt, monetdbe_result **result, monetdbe_cnt *affected_rows); char *monetdbe_get_autocommit(monetdbe_database dbhdl, int *result); char *monetdbe_get_columns(monetdbe_database dbhdl, const char *schema_name, const char *table_name, size_t *column_count, monetdbe_column **columns); +const char *monetdbe_get_mapi_port(void); int monetdbe_in_transaction(monetdbe_database dbhdl); const void *monetdbe_null(monetdbe_database dbhdl, monetdbe_types t); int monetdbe_open(monetdbe_database *db, char *url, monetdbe_options *opts); diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -424,7 +424,7 @@ SQLhelp sqlhelp1[] = { "", "[ WITH cte_list ] MERGE INTO qname [ [AS] ident ] USING table_ref [ [AS] ident ] ON search_condition merge_list", "cte_list,table_ref,search_condition,merge_list", -"See also: https://www.monetdb.org/blog/sql2003_merge_statements_now_supported"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/merge-statements/"}, {"PLAN", "Give relational execution plan for the SQL statement", "PLAN statement", @@ -761,14 +761,14 @@ SQLhelp sqlhelp2[] = { NULL, "PARTITION BY { RANGE | VALUES } { ON '(' ident ')' | USING '(' query_expression ')' }", "query_expression", -"See also: https://www.monetdb.org/blog/updatable-merge-tables"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/update-mergetables/"}, {"partition_spec", NULL, "{ IN '(' partition_list ')' [ WITH NULL VALUES ]\n" "| FROM partition_range_from TO partition_range_to [ WITH NULL VALUES ]\n" "| FOR NULL VALUES }", "partition_list,partition_range_from,partition_range_to", -"See also: https://www.monetdb.org/blog/updatable-merge-tables"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/update-mergetables/"}, {"param", NULL, "ident data_type", diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake --- a/cmake/monetdb-options.cmake +++ b/cmake/monetdb-options.cmake @@ -69,6 +69,10 @@ option(SANITIZER "Enable support for the GCC address sanitizer (default=OFF)" OFF) +option(UNDEFINED + "Enable support for the GCC undefined sanitizer (default=OFF)" + OFF) + option(STRICT "Enable strict compiler flags (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake --- a/cmake/monetdb-toolchain.cmake +++ b/cmake/monetdb-toolchain.cmake @@ -30,6 +30,21 @@ function(monetdb_default_compiler_option endif() endif() + if(UNDEFINED) +if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + add_compile_options("-fsanitize=undefined") + add_compile_options("-fno-omit-frame-pointer") + add_compile_definitions(UNDEFINED) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0") +add_link_options("-fsanitize=undefined") + else() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" PARENT_SCOPE) + endif() +else() + message(FATAL_ERROR "Sanitizer only supported with GCC") +endif() + endif() + if(STRICT) if(${CMAKE_C_COMPILER_ID} MATCHES "^(GNU|Clang|AppleClang)$") add_compile_options("-Werror") diff --git a/common/stream/text_stream.c b/common/stream/text_stream.c --- a/common/stream/text_stream.c +++ b/common/stream/text_stream.c @@ -166,7 +166,8 @@ text_pump_out(inner_state_t *ist, pump_a size_t dst_count = ist->dst_win.count; size_t ncopy = src_count < dst_count ? src_count : dst_count; - memcpy(ist->dst_win.start, ist->src_win.start, ncopy); + if (ncopy > 0) + memcpy(ist->dst_win.start, ist->src_win.start, ncopy); ist->dst_win.start += ncopy; ist->dst_win.count -= ncopy; ist->src_win.start += ncopy; diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c --- a/gdk/gdk_analytic_func.c +++ b/gdk/gdk_analytic_func.c @@ -40,6 +40,8 @@ GDKrebuild_segment_tree(oid ncount, oid *nlevels = next_levels; /* set the logical size of levels before the physical one */ next_tree_size *= data_size; + /* round up to multiple of sizeof(oid) */ + next_tree_size = ((next_tree_size + SIZEOF_OI
MonetDB: properties - Merged with default
Changeset: 8aca4b46b584 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/8aca4b46b584 Modified Files: gdk/gdk_batop.c gdk/gdk_bbp.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_upgrades.c sql/server/rel_dump.c sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_rel.h sql/server/rel_rewriter.c sql/server/rel_schema.c sql/server/rel_select.c sql/server/rel_updates.c sql/server/sql_mvc.h sql/storage/store.c sql/test/SQLancer/Tests/sqlancer19.SQL.py Branch: properties Log Message: Merged with default diffs (truncated from 59927 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -751,3 +751,5 @@ 34d6df33e954fe8fbee1cb3d4e2bde0bbd903d74 9fbec5dab8167d2189582fbe75e5f9c8bef82380 Jan2022_5 9fbec5dab8167d2189582fbe75e5f9c8bef82380 Jan2022_release 97e76b882f9fb28327393d21708fb22f2f6c22f1 Jan2022_7 +f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_9 +f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_SP1_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -850,6 +850,14 @@ fi %endif %changelog +* Mon Feb 07 2022 Sjoerd Mullender - 11.43.9-20220207 +- Rebuilt. +- GH#7237: SELECT with concurrent writes rarely returns corrupt data +- GH#7238: query with system function: "index"(varchar, boolean) fails + with GDK error or assertion failure. +- GH#7241: Replacing a view by a query on the view itself crashes the + server. + * Thu Feb 03 2022 Sjoerd Mullender - 11.43.7-20220203 - Rebuilt. - GH#7228: COMMIT: transaction is aborted because of concurrency diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -424,7 +424,7 @@ SQLhelp sqlhelp1[] = { "", "[ WITH cte_list ] MERGE INTO qname [ [AS] ident ] USING table_ref [ [AS] ident ] ON search_condition merge_list", "cte_list,table_ref,search_condition,merge_list", -"See also: https://www.monetdb.org/blog/sql2003_merge_statements_now_supported"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/merge-statements/"}, {"PLAN", "Give relational execution plan for the SQL statement", "PLAN statement", @@ -761,14 +761,14 @@ SQLhelp sqlhelp2[] = { NULL, "PARTITION BY { RANGE | VALUES } { ON '(' ident ')' | USING '(' query_expression ')' }", "query_expression", -"See also: https://www.monetdb.org/blog/updatable-merge-tables"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/update-mergetables/"}, {"partition_spec", NULL, "{ IN '(' partition_list ')' [ WITH NULL VALUES ]\n" "| FROM partition_range_from TO partition_range_to [ WITH NULL VALUES ]\n" "| FOR NULL VALUES }", "partition_list,partition_range_from,partition_range_to", -"See also: https://www.monetdb.org/blog/updatable-merge-tables"}, +"See also: https://www.monetdb.org/documentation/user-guide/blog-archive/update-mergetables/"}, {"param", NULL, "ident data_type", diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake --- a/cmake/monetdb-options.cmake +++ b/cmake/monetdb-options.cmake @@ -69,6 +69,10 @@ option(SANITIZER "Enable support for the GCC address sanitizer (default=OFF)" OFF) +option(UNDEFINED + "Enable support for the GCC undefined sanitizer (default=OFF)" + OFF) + option(STRICT "Enable strict compiler flags (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake --- a/cmake/monetdb-toolchain.cmake +++ b/cmake/monetdb-toolchain.cmake @@ -30,6 +30,21 @@ function(monetdb_default_compiler_option endif() endif() + if(UNDEFINED) +if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + add_compile_options("-fsanitize=undefined") + add_compile_options("-fno-omit-frame-pointer") + add_compile_definitions(UNDEFINED) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0") +add_link_options("-fsanitize=undefined") + else() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" PARENT_SCOPE) + endif() +else() + message(FATAL_ERROR "Sanitizer only supported with GCC") +endif() + endif() + if(STRICT) if(${CMAKE_C_COMPILER_ID} MATCHES "^(GNU|Clang|AppleClang)$") add_compile_options("-Werror") diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake --- a/cmake/monetdb-versions.cmake +++ b/cmake/monetdb-versions.cmake @@ -40,7 +40,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M # common/options and common/utils) set(GDK_VERSION_MAJOR "25") set(GDK_VERSION_MINOR "0
MonetDB: default - Merge with embedded_mapi.
Changeset: bdc2cf595881 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/bdc2cf595881 Branch: default Log Message: Merge with embedded_mapi. diffs (118 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1447,6 +1447,7 @@ char *monetdbe_error(monetdbe_database d char *monetdbe_execute(monetdbe_statement *stmt, monetdbe_result **result, monetdbe_cnt *affected_rows); char *monetdbe_get_autocommit(monetdbe_database dbhdl, int *result); char *monetdbe_get_columns(monetdbe_database dbhdl, const char *schema_name, const char *table_name, size_t *column_count, monetdbe_column **columns); +const char *monetdbe_get_mapi_port(void); int monetdbe_in_transaction(monetdbe_database dbhdl); const void *monetdbe_null(monetdbe_database dbhdl, monetdbe_types t); int monetdbe_open(monetdbe_database *db, char *url, monetdbe_options *opts); diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c --- a/monetdb5/mal/mal_session.c +++ b/monetdb5/mal/mal_session.c @@ -273,21 +273,24 @@ MSscheduleClient(str command, str challe return; } else { str err; - oid uid; + oid uid = 0; sabdb *stats = NULL; - /* access control: verify the credentials supplied by the user, -* no need to check for database stuff, because that is done per -* database itself (one gets a redirect) */ - err = AUTHcheckCredentials(&uid, NULL, user, passwd, challenge, algo); - if (err != MAL_SUCCEED) { - mnstr_printf(fout, "!%s\n", err); - exit_streams(fin, fout); - freeException(err); - GDKfree(command); - return; + if (!GDKembedded()) { + /* access control: verify the credentials supplied by the user, + * no need to check for database stuff, because that is done per + * database itself (one gets a redirect) */ + err = AUTHcheckCredentials(&uid, NULL, user, passwd, challenge, algo); + if (err != MAL_SUCCEED) { + mnstr_printf(fout, "!%s\n", err); + exit_streams(fin, fout); + freeException(err); + GDKfree(command); + return; + } } + if (!GDKinmemory(0) && !GDKembedded()) { err = msab_getMyStatus(&stats); if (err != NULL) { diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c --- a/tools/monetdbe/monetdbe.c +++ b/tools/monetdbe/monetdbe.c @@ -617,7 +617,7 @@ monetdbe_startup(monetdbe_database_inter goto cleanup; } -with_mapi_server = false; + with_mapi_server = false; if (monetdbe_embedded_initialized) { set_error(mdbe, createException(MAL, "monetdbe.monetdbe_startup", "MonetDBe is already initialized")); @@ -646,8 +646,18 @@ monetdbe_startup(monetdbe_database_inter if (opts && opts->mapi_server) { /*This monetdbe instance wants to listen to external mapi client connections.*/ - with_mapi_server = true; + if (opts->mapi_server->host) { + with_mapi_server = true; + int psetlen = setlen; + setlen = mo_add_option(&set, setlen, opt_cmdline, "mapi_listenaddr", opts->mapi_server->host); + if (setlen == psetlen) { + mo_free_options(set, setlen); + set_error(mdbe, createException(MAL, "monetdbe.monetdbe_startup", MAL_MALLOC_FAIL)); + goto cleanup; + } + } if (opts->mapi_server->port) { + with_mapi_server = true; int psetlen = setlen; setlen = mo_add_option(&set, setlen, opt_cmdline, "mapi_port", opts->mapi_server->port); if (setlen == psetlen) { @@ -657,6 +667,7 @@ monetdbe_startup(monetdbe_database_inter } } if (opts->mapi_server->usock) { + with_mapi_server = true; int psetlen = setlen; setlen = mo_add_option(&set, setlen, opt_cmdline, "mapi_usock", opts->mapi_server->usock); if (setlen == psetlen) { @@ -2831,3 +2842,8 @@ timestamp_from_data(monetdbe_data_timest date_create(ptr->date.year, ptr->date.month, ptr->date.day), daytime_create(ptr->time.hours
MonetDB: Jul2021 - Add number of rows affected by output stateme...
Changeset: 5b05df3d384b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5b05df3d384b Modified Files: sql/backends/monet5/rel_bin.c sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test sql/test/copy/Tests/null_as_string_output.test Branch: Jul2021 Log Message: Add number of rows affected by output statements into the total rowcount diffs (170 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 @@ -5845,7 +5845,7 @@ rel2bin_output(backend *be, sql_rel *rel const char *tsep, *rsep, *ssep, *ns; const char *fn = NULL; int onclient = 0; - stmt *s = NULL, *fns = NULL; + stmt *s = NULL, *fns = NULL, *res = NULL; list *slist = sa_list(sql->sa); if (rel->l) /* first construct the sub relation */ @@ -5869,11 +5869,15 @@ rel2bin_output(backend *be, sql_rel *rel } list_append(slist, stmt_export(be, s, tsep, rsep, ssep, ns, onclient, fns)); if (s->type == st_list && ((stmt*)s->op4.lval->h->data)->nrcols != 0) { - stmt *cnt = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); - return cnt; + res = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); } else { - return stmt_atom_lng(be, 1); - } + res = stmt_atom_lng(be, 1); + } + if (!be->silent) { + /* if there are multiple output statements, update total count, otherwise use the the current count */ + be->rowcount = be->rowcount ? add_to_rowcount_accumulator(be, res->nr) : res->nr; + } + return res; } static list * diff --git a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test --- a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test +++ b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test @@ -4,13 +4,13 @@ start transaction statement ok create table t(i int) -statement ok +statement ok rowcount 1 insert into t values(1123) -statement ok +statement ok rowcount 1 copy select * from t into stdout using delimiters ',', E'\n' -statement ok +statement ok rowcount 1 copy select count(*) from t into stdout using delimiters ',', E'\n' statement ok diff --git a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test --- a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test +++ b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test @@ -1,19 +1,19 @@ statement ok create table bug2722 (time timestamp, val int, fk int) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 1, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 2, 2) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 3, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 4, 2) -statement ok +statement ok rowcount 2 copy select val from bug2722 where fk=2 order by time into stdout using delimiters ' ' , E'\n' statement ok diff --git a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test --- a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test +++ b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test @@ -4,13 +4,13 @@ start transaction statement ok create table table3393 (a clob, b clob) -statement ok +statement ok rowcount 1 insert into table3393 values ('one|two', 'three"four') -statement ok +statement ok rowcount 1 insert into table3393 values (E'five\tsix', E'seven\neight') -statement ok +statement ok rowcount 1 insert into table3393 values ('nine,ten', E'eleven\\twelve') query TT rowsort @@ -23,13 +23,13 @@ eleven\twelve one|two three"four -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters ',', E'\n', '|' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters '|', E'\n', ',' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout statement ok diff --git a/sql/test/copy/Tests/null_as_string_output.test b/sql/test/copy/Tests/null_as_string_output.test --- a/sql/test/copy/Tests/null_as_string_output.test +++ b/sql/test/copy/Tests/null_as_string_output.test @@ -4,7 +4,7 @@ start transaction statement ok create table null_as_string (i int, s string, d decimal(5,2)) -state
MonetDB: Jan2022 - Merged with Jul2021
Changeset: 56c49c745b4d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/56c49c745b4d Modified Files: sql/backends/monet5/rel_bin.c Branch: Jan2022 Log Message: Merged with Jul2021 diffs (170 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 @@ -5769,7 +5769,7 @@ rel2bin_output(backend *be, sql_rel *rel const char *tsep, *rsep, *ssep, *ns, *fn = NULL; atom *tatom, *ratom, *satom, *natom; int onclient = 0; - stmt *s = NULL, *fns = NULL; + stmt *s = NULL, *fns = NULL, *res = NULL; list *slist = sa_list(sql->sa); if (rel->l) /* first construct the sub relation */ @@ -5797,11 +5797,15 @@ rel2bin_output(backend *be, sql_rel *rel } list_append(slist, stmt_export(be, s, tsep, rsep, ssep, ns, onclient, fns)); if (s->type == st_list && ((stmt*)s->op4.lval->h->data)->nrcols != 0) { - stmt *cnt = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); - return cnt; + res = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); } else { - return stmt_atom_lng(be, 1); - } + res = stmt_atom_lng(be, 1); + } + if (!be->silent) { + /* if there are multiple output statements, update total count, otherwise use the the current count */ + be->rowcount = be->rowcount ? add_to_rowcount_accumulator(be, res->nr) : res->nr; + } + return res; } static list * diff --git a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test --- a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test +++ b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test @@ -4,13 +4,13 @@ start transaction statement ok create table t(i int) -statement ok +statement ok rowcount 1 insert into t values(1123) -statement ok +statement ok rowcount 1 copy select * from t into stdout using delimiters ',', E'\n' -statement ok +statement ok rowcount 1 copy select count(*) from t into stdout using delimiters ',', E'\n' statement ok diff --git a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test --- a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test +++ b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test @@ -1,19 +1,19 @@ statement ok create table bug2722 (time timestamp, val int, fk int) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 1, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 2, 2) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 3, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 4, 2) -statement ok +statement ok rowcount 2 copy select val from bug2722 where fk=2 order by time into stdout using delimiters ' ' , E'\n' statement ok diff --git a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test --- a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test +++ b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test @@ -4,13 +4,13 @@ start transaction statement ok create table table3393 (a clob, b clob) -statement ok +statement ok rowcount 1 insert into table3393 values ('one|two', 'three"four') -statement ok +statement ok rowcount 1 insert into table3393 values (E'five\tsix', E'seven\neight') -statement ok +statement ok rowcount 1 insert into table3393 values ('nine,ten', E'eleven\\twelve') query TT rowsort @@ -23,13 +23,13 @@ eleven\twelve one|two three"four -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters ',', E'\n', '|' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters '|', E'\n', ',' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout statement ok diff --git a/sql/test/copy/Tests/null_as_string_output.test b/sql/test/copy/Tests/null_as_string_output.test --- a/sql/test/copy/Tests/null_as_string_output.test +++ b/sql/test/copy/Tests/null_as_string_output.test @@ -4,7 +4,7 @@ start transaction statement ok create table null_as_string (i int, s string, d decimal(5,2)) -statement ok +statement ok rowcount 4 copy 4 records into null_as_string from stdin delimiters ',',E'\n' NULL as '' ,, @@ -12,13 +12,13 @@ copy 4 records into null_as_string from 1,,1 2,two, -statement ok +statement ok rowcount 4 copy select * from null_as_string into stdout delimiters
MonetDB: default - At the moment, disable query queue changes on...
Changeset: a6b0334ca07d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/a6b0334ca07d Modified Files: monetdb5/mal/mal_runtime.c Branch: default Log Message: At the moment, disable query queue changes on recursive calls. Later we have to improve this for these cases when multiple workers are around diffs (57 lines): diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c --- a/monetdb5/mal/mal_runtime.c +++ b/monetdb5/mal/mal_runtime.c @@ -196,6 +196,10 @@ runtimeProfileInit(Client cntxt, MalBlkP size_t i, paused = 0; str q; + /* Recursive calls don't change the query queue, but later we have to check + how to stop/pause/resume queries doing recursive calls from multiple workers */ + if (stk->up) + return; MT_lock_set(&mal_delayLock); if(USRstats == NULL){ @@ -218,20 +222,6 @@ runtimeProfileInit(Client cntxt, MalBlkP } } assert(qhead < qsize); - // check for recursive call, which does not change the number of workers - if (stk->up) { - i = qtail; - while (i != qhead) { - if (QRYqueue[i].mb && QRYqueue[i].stk == stk->up) { - QRYqueue[i].stk = stk; - mb->tag = stk->tag = qtag++; - MT_lock_unset(&mal_delayLock); - return; - } - if (++i >= qsize) - i = 0; - } - } i=qtail; while (i != qhead){ paused += QRYqueue[i].status && (QRYqueue[i].status[0] == 'p' || QRYqueue[i].status[0] == 'r'); /* running, prepared or paused */ @@ -287,17 +277,14 @@ runtimeProfileFinish(Client cntxt, MalBl size_t i; bool found = false; + /* Recursive calls don't change the query queue, but later we have to check + how to stop/pause/resume queries doing recursive calls from multiple workers */ + if (stk->up) + return; MT_lock_set(&mal_delayLock); i=qtail; while (i != qhead){ if (QRYqueue[i].stk == stk){ - if (stk->up){ - // recursive call - QRYqueue[i].stk = stk->up; - mb->tag = stk->tag; - MT_lock_unset(&mal_delayLock); - return; - } QRYqueue[i].status = "finished"; QRYqueue[i].finished = time(0); QRYqueue[i].workers = mb->workers; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merged with Jan2022
Changeset: 7b177e151afa for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/7b177e151afa Modified Files: sql/backends/monet5/rel_bin.c Branch: default Log Message: Merged with Jan2022 diffs (170 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 @@ -5788,7 +5788,7 @@ rel2bin_output(backend *be, sql_rel *rel const char *tsep, *rsep, *ssep, *ns, *fn = NULL; atom *tatom, *ratom, *satom, *natom; int onclient = 0; - stmt *s = NULL, *fns = NULL; + stmt *s = NULL, *fns = NULL, *res = NULL; list *slist = sa_list(sql->sa); if (rel->l) /* first construct the sub relation */ @@ -5816,11 +5816,15 @@ rel2bin_output(backend *be, sql_rel *rel } list_append(slist, stmt_export(be, s, tsep, rsep, ssep, ns, onclient, fns)); if (s->type == st_list && ((stmt*)s->op4.lval->h->data)->nrcols != 0) { - stmt *cnt = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); - return cnt; + res = stmt_aggr(be, s->op4.lval->h->data, NULL, NULL, sql_bind_func(sql, "sys", "count", sql_bind_localtype("void"), NULL, F_AGGR), 1, 0, 1); } else { - return stmt_atom_lng(be, 1); - } + res = stmt_atom_lng(be, 1); + } + if (!be->silent) { + /* if there are multiple output statements, update total count, otherwise use the the current count */ + be->rowcount = be->rowcount ? add_to_rowcount_accumulator(be, res->nr) : res->nr; + } + return res; } static list * diff --git a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test --- a/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test +++ b/sql/test/BugTracker-2008/Tests/copy-count.SF-2485215.test @@ -4,13 +4,13 @@ start transaction statement ok create table t(i int) -statement ok +statement ok rowcount 1 insert into t values(1123) -statement ok +statement ok rowcount 1 copy select * from t into stdout using delimiters ',', E'\n' -statement ok +statement ok rowcount 1 copy select count(*) from t into stdout using delimiters ',', E'\n' statement ok diff --git a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test --- a/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test +++ b/sql/test/BugTracker-2011/Tests/copy-into-file-error.Bug-2722.test @@ -1,19 +1,19 @@ statement ok create table bug2722 (time timestamp, val int, fk int) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 1, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 2, 2) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 3, 1) -statement ok +statement ok rowcount 1 insert into bug2722 values (current_timestamp(), 4, 2) -statement ok +statement ok rowcount 2 copy select val from bug2722 where fk=2 order by time into stdout using delimiters ' ' , E'\n' statement ok diff --git a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test --- a/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test +++ b/sql/test/BugTracker-2013/Tests/copy-out-quote.Bug-3393.test @@ -4,13 +4,13 @@ start transaction statement ok create table table3393 (a clob, b clob) -statement ok +statement ok rowcount 1 insert into table3393 values ('one|two', 'three"four') -statement ok +statement ok rowcount 1 insert into table3393 values (E'five\tsix', E'seven\neight') -statement ok +statement ok rowcount 1 insert into table3393 values ('nine,ten', E'eleven\\twelve') query TT rowsort @@ -23,13 +23,13 @@ eleven\twelve one|two three"four -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters ',', E'\n', '|' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout delimiters '|', E'\n', ',' -statement ok +statement ok rowcount 3 copy select * from table3393 into stdout statement ok diff --git a/sql/test/copy/Tests/null_as_string_output.test b/sql/test/copy/Tests/null_as_string_output.test --- a/sql/test/copy/Tests/null_as_string_output.test +++ b/sql/test/copy/Tests/null_as_string_output.test @@ -4,7 +4,7 @@ start transaction statement ok create table null_as_string (i int, s string, d decimal(5,2)) -statement ok +statement ok rowcount 4 copy 4 records into null_as_string from stdin delimiters ',',E'\n' NULL as '' ,, @@ -12,13 +12,13 @@ copy 4 records into null_as_string from 1,,1 2,two, -statement ok +statement ok rowcount 4 copy select * from null_as_string into stdout delimiters
MonetDB: default - Don't define Python 2 names to Python 3 names...
Changeset: dff7ec8faae6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/dff7ec8faae6 Modified Files: sql/backends/monet5/UDF/pyapi3/connection3.c sql/backends/monet5/UDF/pyapi3/conversion3.c sql/backends/monet5/UDF/pyapi3/convert_loops.h sql/backends/monet5/UDF/pyapi3/emit3.c 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/pytypes.h sql/backends/monet5/UDF/pyapi3/pytypes3.c sql/backends/monet5/UDF/pyapi3/type_conversion3.c Branch: default Log Message: Don't define Python 2 names to Python 3 names, just use the Python 3 names. diffs (294 lines): 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 @@ -16,7 +16,7 @@ static PyObject *_connection_execute(Py_ConnectionObject *self, PyObject *args) { char *query = NULL; - if (PyString_CheckExact(args)) { + if (PyUnicode_CheckExact(args)) { query = GDKstrdup(PyUnicode_AsUTF8(args)); } else { PyErr_Format(PyExc_TypeError, @@ -75,7 +75,7 @@ static PyObject *_connection_execute(Py_ return NULL; } PyDict_SetItem(result, - PyString_FromString(output->cols[i].name), + PyUnicode_FromString(output->cols[i].name), numpy_array); Py_DECREF(numpy_array); BBPunfix(input.bat->batCacheid); diff --git a/sql/backends/monet5/UDF/pyapi3/conversion3.c b/sql/backends/monet5/UDF/pyapi3/conversion3.c --- a/sql/backends/monet5/UDF/pyapi3/conversion3.c +++ b/sql/backends/monet5/UDF/pyapi3/conversion3.c @@ -42,19 +42,19 @@ PyObject *PyArrayObject_FromScalar(PyInp #endif break; case TYPE_oid: - vararray = PyInt_FromLong((long)(*(oid *)inp->dataptr)); + vararray = PyLong_FromLong((long)(*(oid *)inp->dataptr)); break; case TYPE_bit: - vararray = PyInt_FromLong((long)(*(bit *)inp->dataptr)); + vararray = PyLong_FromLong((long)(*(bit *)inp->dataptr)); break; case TYPE_bte: - vararray = PyInt_FromLong((long)(*(bte *)inp->dataptr)); + vararray = PyLong_FromLong((long)(*(bte *)inp->dataptr)); break; case TYPE_sht: - vararray = PyInt_FromLong((long)(*(sht *)inp->dataptr)); + vararray = PyLong_FromLong((long)(*(sht *)inp->dataptr)); break; case TYPE_int: - vararray = PyInt_FromLong((long)(*(int *)inp->dataptr)); + vararray = PyLong_FromLong((long)(*(int *)inp->dataptr)); break; case TYPE_lng: vararray = PyLong_FromLongLong((*(lng *)inp->dataptr)); @@ -111,7 +111,7 @@ PyObject *PyMaskedArray_FromBAT(PyInput if (b->tnil || !b->tnonil) { PyObject *mask; PyObject *mafunc = PyObject_GetAttrString( - PyImport_Import(PyString_FromString("numpy.ma")), "masked_array"); + PyImport_Import(PyUnicode_FromString("numpy.ma")), "masked_array"); PyObject *nullmask = PyNullMask_FromBAT(b, t_start, t_end); if (!nullmask) { @@ -350,7 +350,7 @@ PyObject *PyArrayObject_FromBAT(PyInput const char *t = (const char *)BUNtvar(li, p); ptrdiff_t offset = t - b->tvheap->base; if (!pyptrs[offset]) { - pyptrs[offset] = PyString_FromString(t); + pyptrs[offset] = PyUnicode_FromString(t); } else { Py_INCREF(pyptrs[offset]); } @@ -361,7 +361,7 @@ PyObject *PyArrayObject_FromBAT(PyInput BATloop(b, p, q) {
MonetDB: Jan2022 - Expect output.
Changeset: 927c77efc9ec for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/927c77efc9ec Modified Files: sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py Branch: Jan2022 Log Message: Expect output. diffs (12 lines): diff --git a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py --- a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py +++ b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py @@ -91,7 +91,7 @@ if __name__ == '__main__': if perr != "Error on line 12: [22000] Missing file name\nError on line 30: [22000] Requested file compression format .bz2 is not supported. Use .gz instead.\nError on line 32: [22000] Requested file compression format .lz4 is not supported. Use .gz instead.\nError on line 34: [22000] Requested file compression format .xz is not supported. Use .gz instead.\nError on line 36: [22000] Requested file compression format .zip is not supported. Use .gz instead.\n": print(perr) print("OnClientDownloadData err difference detected") -if pout != "": +if pout != "121 affected rows\n122 affected rows\n123 affected rows\n124 affected rows\n120 affected rows\n": print(pout) print("OnClientDownloadData out difference detected") ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merge with Jan2022 branch.
Changeset: 6a37f2bfc720 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6a37f2bfc720 Branch: default Log Message: Merge with Jan2022 branch. diffs (12 lines): diff --git a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py --- a/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py +++ b/sql/jdbc/tests/Tests/Test_JdbcClient.SQL.py @@ -91,7 +91,7 @@ if __name__ == '__main__': if perr != "Error on line 12: [22000] Missing file name\nError on line 30: [22000] Requested file compression format .bz2 is not supported. Use .gz instead.\nError on line 32: [22000] Requested file compression format .lz4 is not supported. Use .gz instead.\nError on line 34: [22000] Requested file compression format .xz is not supported. Use .gz instead.\nError on line 36: [22000] Requested file compression format .zip is not supported. Use .gz instead.\n": print(perr) print("OnClientDownloadData err difference detected") -if pout != "": +if pout != "121 affected rows\n122 affected rows\n123 affected rows\n124 affected rows\n120 affected rows\n": print(pout) print("OnClientDownloadData out difference detected") ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Tell the compiler certain code paths are unre...
Changeset: 0ac451062fdb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0ac451062fdb Modified Files: gdk/gdk.h gdk/gdk_atoms.h gdk/gdk_bat.c gdk/gdk_batop.c gdk/gdk_cand.h gdk/gdk_group.c gdk/gdk_hash.h gdk/gdk_storage.c gdk/gdk_system.h Branch: default Log Message: Tell the compiler certain code paths are unreachable. diffs (285 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1626,10 +1626,6 @@ gdk_export gdk_return GDKtracer_fill_com gdk_export _Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...) __attribute__((__format__(__printf__, 1, 2))); - /* -gdk_export void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...) - __attribute__((__format__(__printf__, 1, 2))); - */ gdk_export void GDKclrerr(void); @@ -1675,6 +1671,8 @@ tfastins_nocheckVAR(BAT *b, BUN p, const ((uint64_t *) b->theap->base)[p] = (uint64_t) d; break; #endif + default: + MT_UNREACHABLE(); } return GDK_SUCCEED; } diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h --- a/gdk/gdk_atoms.h +++ b/gdk/gdk_atoms.h @@ -437,12 +437,14 @@ VarHeapVal(const void *b, BUN p, int w) return (size_t) ((const uint8_t *) b)[p] + GDK_VAROFFSET; case 2: return (size_t) ((const uint16_t *) b)[p] + GDK_VAROFFSET; -#if SIZEOF_VAR_T == 8 case 4: return (size_t) ((const uint32_t *) b)[p]; +#if SIZEOF_VAR_T == 8 + case 8: + return (size_t) ((const uint64_t *) b)[p]; #endif default: - return (size_t) ((const var_t *) b)[p]; + MT_UNREACHABLE(); } } diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -1511,7 +1511,7 @@ BUNinplacemulti(BAT *b, const oid *posit ptr _ptr; _ptr = BUNtloc(bi, p); switch (b->twidth) { - default:/* only three or four cases possible */ + case 1: _d = (var_t) * (uint8_t *) _ptr + GDK_VAROFFSET; break; case 2: @@ -1525,6 +1525,8 @@ BUNinplacemulti(BAT *b, const oid *posit _d = (var_t) * (uint64_t *) _ptr; break; #endif + default: + MT_UNREACHABLE(); } if (ATOMreplaceVAR(b, &_d, t) != GDK_SUCCEED) { MT_rwlock_wrunlock(&b->thashlock); @@ -1549,7 +1551,7 @@ BUNinplacemulti(BAT *b, const oid *posit } _ptr = BUNtloc(bi, p); switch (b->twidth) { - default:/* only three or four cases possible */ + case 1: * (uint8_t *) _ptr = (uint8_t) (_d - GDK_VAROFFSET); break; case 2: @@ -1563,6 +1565,8 @@ BUNinplacemulti(BAT *b, const oid *posit * (uint64_t *) _ptr = (uint64_t) _d; break; #endif + default: + MT_UNREACHABLE(); } } else if (ATOMstorage(b->ttype) == TYPE_msk) { mskSetVal(b, p, * (msk *) t); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -211,7 +211,7 @@ insert_string_bat(BAT *b, BAT *n, struct break; #endif default: - assert(0); + MT_UNREACHABLE(); } MT_thread_setalgorithm("copy offset values"); r = b->batCount; @@ -1239,7 +1239,7 @@ BATappend_or_update(BAT *b, BAT *p, cons var_t d; switch (b->twidth) { - default: /* only three or four cases possible */ + case 1: d = (var_t) ((uint8_t *) b->theap->base)[updid] + GDK_VAROFFSET; break; case 2: @@ -1253,6 +1253,8 @@ BATappend_or_update(BAT *b, BAT *p, cons d = (var_t) ((uint64_t *) b->theap->base)[updid]; break; #endif + default: + MT_UNREACHABLE(); } if (ATOMreplaceVAR(b, &d, new) != GDK_SUCCEED) { goto bailout; @@ -1290,6 +1292,8 @@ BATappend_or_update(BAT *b, BAT *p, cons ((uint64_t *) b->theap->base)[updid] = (uint64_t
MonetDB: default - Bloody Intel compiler on Windows.
Changeset: b3a09f8d7c16 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b3a09f8d7c16 Modified Files: gdk/gdk.h gdk/gdk_system.h Branch: default Log Message: Bloody Intel compiler on Windows. diffs (35 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -343,6 +343,9 @@ typedef enum { GDK_FAIL, GDK_SUCCEED } gdk_return; +gdk_export _Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...) + __attribute__((__format__(__printf__, 1, 2))); + #include "gdk_system.h" #include "gdk_posix.h" #include "stream.h" @@ -1624,8 +1627,6 @@ gdk_export gdk_return GDKtracer_fill_com format, ##__VA_ARGS__) #define GDKsyserror(format, ...) GDKsyserr(errno, format, ##__VA_ARGS__) -gdk_export _Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...) - __attribute__((__format__(__printf__, 1, 2))); gdk_export void GDKclrerr(void); diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h --- a/gdk/gdk_system.h +++ b/gdk/gdk_system.h @@ -84,6 +84,9 @@ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) #define MT_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while (0) #elif defined(__clang__) || defined(__INTEL_COMPILER) +#ifdef WIN32 +#define __builtin_unreachable()GDKfatal("Unreachable C code path reached"); +#endif #define MT_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while (0) #elif defined(_MSC_VER) #define MT_UNREACHABLE() do { assert(0); __assume(0); } while (0) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org