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 <sjo...@acm.org> - 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 <sjo...@acm.org> - 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") -set(GDK_VERSION_PATCH "1") +set(GDK_VERSION_PATCH "2") set(GDK_VERSION "${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}") # version of the MAPI library (subdirectory clients/mapilib) @@ -70,5 +70,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ # version of the SQL library (subdirectory sql) set(SQL_VERSION_MAJOR "12") set(SQL_VERSION_MINOR "0") -set(SQL_VERSION_PATCH "1") +set(SQL_VERSION_PATCH "2") set(SQL_VERSION "${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}") 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/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +monetdb (11.43.9) unstable; urgency=low + + * 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. + + -- Sjoerd Mullender <sjo...@acm.org> Mon, 07 Feb 2022 14:42:18 +0100 + monetdb (11.43.7) unstable; urgency=low * Rebuilt. 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_OID - 1) / SIZEOF_OID) * SIZEOF_OID; total_size = next_tree_size + next_levels * sizeof(oid); if (total_size > BATcount(st)) { diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -554,7 +554,7 @@ append_msk_bat(BAT *b, BAT *n, struct ca *bp++ |= (*np & mask) << boff; cnt -= 32; } - if (cnt > boff) { + if (cnt > noff) { /* the last bits come from two words * in n */ *bp = (*np++ & ~mask) >> noff; 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; diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c --- a/gdk/gdk_select.c +++ b/gdk/gdk_select.c @@ -1160,6 +1160,30 @@ scanselect(BAT *b, BATiter *bi, struct c /* in the case where equi==true, the check is x == *tl */ \ } while (false) +#if SIZEOF_BUN == SIZEOF_INT +#define CALC_ESTIMATE(TPE) \ + do { \ + if (*(TPE*)tl < 1) { \ + if ((int) BUN_MAX + *(TPE*)tl >= *(TPE*)th) \ + estimate = (BUN) ((int) *(TPE*)th - *(TPE*)tl); \ + } else { \ + if (-(int) BUN_MAX + *(TPE*)tl <= *(TPE*)th) \ + estimate = (BUN) ((int) *(TPE*)th - *(TPE*)tl); \ + } \ + } while (0) +#else +#define CALC_ESTIMATE(TPE) \ + do { \ + if (*(TPE*)tl < 1) { \ + if ((lng) BUN_MAX + *(TPE*)tl >= *(TPE*)th) \ + estimate = (BUN) ((lng) *(TPE*)th - *(TPE*)tl); \ + } else { \ + if (-(lng) BUN_MAX + *(TPE*)tl <= *(TPE*)th) \ + estimate = (BUN) ((lng) *(TPE*)th - *(TPE*)tl); \ + } \ + } while (0) +#endif + /* generic range select * * Return a BAT with the OID values of b for qualifying tuples. The @@ -1874,19 +1898,18 @@ BATselect(BAT *b, BAT *s, const void *tl estimate = (BUN) (*(sht *) th - *(sht *) tl); break; case TYPE_int: - estimate = (BUN) (*(int *) th - *(int *) tl); + CALC_ESTIMATE(int); break; case TYPE_lng: - estimate = (BUN) (*(lng *) th - *(lng *) tl); + CALC_ESTIMATE(lng); break; #ifdef HAVE_HGE case TYPE_hge: - if (*(hge *) th - *(hge *) tl < (hge) BUN_MAX) - estimate = (BUN) (*(hge *) th - *(hge *) tl); + CALC_ESTIMATE(hge); break; #endif } - if (estimate != BUN_NONE) + if (estimate == BUN_NONE) estimate += li + hi - 1; } } diff --git a/gdk/gdk_subquery.c b/gdk/gdk_subquery.c --- a/gdk/gdk_subquery.c +++ b/gdk/gdk_subquery.c @@ -38,7 +38,7 @@ } \ for (i = 0; i < ngrp; i++) { /* convert the found oids in values */ \ BUN noid = oids[i]; \ - if (noid >= (BUN_NONE - 1)) { \ + if (noid > (BUN_NONE - 2)) { \ rp[i] = TYPE##_nil; \ hasnil = 1; \ } else { \ @@ -145,9 +145,9 @@ BATall_grp(BAT *l, BAT *g, BAT *e, BAT * if (ATOMvarsized(l->ttype)) { for (i = 0; i < ngrp; i++) { /* convert the found oids in values */ BUN noid = oids[i]; - void *next; - if (noid == BUN_NONE) { - next = (void*) nilp; + const void *next; + if (noid > (BUN_NONE - 2)) { + next = nilp; hasnil = 1; } else { next = BUNtvar(li, noid); @@ -163,7 +163,7 @@ BATall_grp(BAT *l, BAT *g, BAT *e, BAT * for (i = 0; i < ngrp; i++) { /* convert the found oids in values */ BUN noid = oids[i]; const void *next; - if (noid == BUN_NONE) { + if (noid > (BUN_NONE - 2)) { next = nilp; hasnil = 1; } else { diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h --- a/gdk/gdk_system.h +++ b/gdk/gdk_system.h @@ -230,51 +230,36 @@ gdk_export void MT_thread_set_qry_ctx(Qr TRC_DEBUG(TEM, "Locking %s complete\n", (l)->name); \ } while (0) _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org