Changeset: 9554058b8714 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9554058b8714 Modified Files: clients/mapiclient/dump.c sql/server/rel_optimize_sel.c Branch: nested Log Message:
merged with default diffs (truncated from 600 to 300 lines): diff --git a/clients/ChangeLog.Mar2025 b/clients/ChangeLog.Mar2025 --- a/clients/ChangeLog.Mar2025 +++ b/clients/ChangeLog.Mar2025 @@ -1,3 +1,7 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Tue Feb 18 2025 Sjoerd Mullender <[email protected]> +- Support for dumping databases from servers from before Jul2021 (11.41.X) + has been removed. + diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -298,8 +298,10 @@ bailout: return 0; } +/* columns sys.db_user_info.max_memory and sys.db_user_info.max_workers + * introduced Sep2022 */ static bool -has_schema_path(Mapi mid) +has_schema_max_memory(Mapi mid) { MapiHdl hdl; bool ret; @@ -308,7 +310,7 @@ has_schema_path(Mapi mid) if (answer >= 0) return answer; - if ((hdl = mapi_query(mid, "select id from sys._columns where table_id = (select id from sys._tables where name = 'db_user_info' and schema_id = (select id from sys.schemas where name = 'sys')) and name = 'schema_path'")) == NULL || + if ((hdl = mapi_query(mid, "select id from sys._columns where table_id = (select id from sys._tables where name = 'db_user_info' and schema_id = 2000) and name = 'max_memory'")) == NULL || mapi_error(mid)) goto bailout; ret = mapi_get_row_count(hdl) == 1; @@ -334,83 +336,7 @@ bailout: return false; } -static bool -has_schema_max_memory(Mapi mid) -{ - MapiHdl hdl; - bool ret; - static int answer = -1; - - if (answer >= 0) - return answer; - - if ((hdl = mapi_query(mid, "select id from sys._columns where table_id = (select id from sys._tables where name = 'db_user_info' and schema_id = (select id from sys.schemas where name = 'sys')) and name = 'max_memory'")) == NULL || - mapi_error(mid)) - goto bailout; - ret = mapi_get_row_count(hdl) == 1; - while ((mapi_fetch_row(hdl)) != 0) { - if (mapi_error(mid)) - goto bailout; - } - if (mapi_error(mid)) - goto bailout; - mapi_close_handle(hdl); - answer = ret; - return ret; - -bailout: - if (hdl) { - if (mapi_result_error(hdl)) - mapi_explain_result(hdl, stderr); - else - mapi_explain_query(hdl, stderr); - mapi_close_handle(hdl); - } else - mapi_explain(mid, stderr); - return false; -} - -static bool -has_table_partitions(Mapi mid) -{ - MapiHdl hdl; - bool ret; - static int answer = -1; - - if (answer >= 0) - return answer; - - if ((hdl = mapi_query(mid, - "select id from sys._tables" - " where name = 'table_partitions'" - " and schema_id = (" - "select id from sys.schemas" - " where name = 'sys')")) == NULL || - mapi_error(mid)) - goto bailout; - ret = mapi_get_row_count(hdl) == 1; - while ((mapi_fetch_row(hdl)) != 0) { - if (mapi_error(mid)) - goto bailout; - } - if (mapi_error(mid)) - goto bailout; - mapi_close_handle(hdl); - answer = ret; - return ret; - -bailout: - if (hdl) { - if (mapi_result_error(hdl)) - mapi_explain_result(hdl, stderr); - else - mapi_explain_query(hdl, stderr); - mapi_close_handle(hdl); - } else - mapi_explain(mid, stderr); - return false; -} - +/* table sys.remote_user_info introduced Jun2023 */ static bool has_remote_user_info_table(Mapi mid) { @@ -424,9 +350,7 @@ has_remote_user_info_table(Mapi mid) if ((hdl = mapi_query(mid, "select id from sys._tables" " where name = 'remote_user_info'" - " and schema_id = (" - "select id from sys.schemas" - " where name = 'sys')")) == NULL || + " and schema_id = 2000")) == NULL || mapi_error(mid)) goto bailout; ret = mapi_get_row_count(hdl) == 1; @@ -1496,7 +1420,7 @@ describe_table(Mapi mid, const char *sch squoted_print(sqlf, rt_hash, '\'', false); mapi_close_handle(hdl); hdl = NULL; - } else if (type == 3 && has_table_partitions(mid)) { /* A merge table might be partitioned */ + } else if (type == 3) { /* A merge table might be partitioned */ int properties = 0; snprintf(query, maxquerylen, "SELECT tp.type FROM sys.table_partitions tp WHERE tp.table_id = '%d'", table_id); @@ -2820,7 +2744,6 @@ dump_database(Mapi mid, stream *sqlf, co "AND t.sqlname NOT IN ('geometrya','mbr','url','inet','json','uuid')))" "ORDER BY s.name, t.sqlname"; const char *users = - has_schema_path(mid) ? has_schema_max_memory(mid) ? "SELECT ui.name, " "ui.fullname, " @@ -2848,18 +2771,6 @@ dump_database(Mapi mid, stream *sqlf, co "WHERE ui.default_schema = s.id " "AND ui.name <> 'monetdb' " "AND ui.name <> '.snapshot' " - "ORDER BY ui.name" : - "SELECT ui.name, " - "ui.fullname, " - "sys.password_hash(ui.name), " - "s.name, " - "cast(null as clob), " - "0, 0, 'default_pipe', cast(null as clob) " - "FROM sys.db_user_info ui, " - "sys.schemas s " - "WHERE ui.default_schema = s.id " - "AND ui.name <> 'monetdb' " - "AND ui.name <> '.snapshot' " "ORDER BY ui.name"; const char roles[] = "SELECT name " @@ -3036,8 +2947,7 @@ dump_database(Mapi mid, stream *sqlf, co "AND t.system = FALSE " "AND s.id = t.schema_id " "ORDER BY id"; - const char *mergetables = - has_table_partitions(mid) ? + const char mergetables[] = "SELECT subq.s1name, " "subq.t1name, " "subq.s2name, " @@ -3063,26 +2973,7 @@ dump_database(Mapi mid, stream *sqlf, co "AND t2.schema_id = s2.id " "ORDER BY t1.id, t2.id) subq " "LEFT OUTER JOIN sys.table_partitions " - "ON subq.id = table_partitions.table_id" - : - "SELECT s1.name, " - "t1.name, " - "s2.name, " - "t2.name, " - "0 " - "FROM sys.schemas s1, " - "sys._tables t1, " - "sys.dependencies d, " - "sys.schemas s2, " - "sys._tables t2 " - "WHERE t1.type = 3 " - "AND t1.schema_id = s1.id " - "AND s1.name <> 'tmp' " - "AND t1.system = FALSE " - "AND t1.id = d.depend_id " - "AND d.id = t2.id " - "AND t2.schema_id = s2.id " - "ORDER BY t1.id, t2.id"; + "ON subq.id = table_partitions.table_id"; /* we must dump views, functions/procedures and triggers in order * of creation since they can refer to each other */ const char views_functions_triggers[] = diff --git a/documentation/source/manual_pages/mserver5.rst.in b/documentation/source/manual_pages/mserver5.rst.in --- a/documentation/source/manual_pages/mserver5.rst.in +++ b/documentation/source/manual_pages/mserver5.rst.in @@ -82,7 +82,8 @@ MSERVER5 OPTIONS **--loadmodule=**\ *module* Load extra module in the form of a dynamic link library (.dll or .so file) which should be located in the lib/monetdb5 directory. This - option can be repeated for different modules. + option can be repeated for different modules. Also see the + **loadmodules** entry in *monetdb*\ (1). **--without-geom** Start the server without *geom* support, even if it is available. @@ -216,6 +217,9 @@ MSERVER5 OPTIONS *monetdbd*\ (1) when creating a new database with an administrator password and should not be used otherwise. +**--process-wal-and-exit** + Stop the server immediately after processing the write-ahead log. + MSERVER5 PARAMETERS =================== diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -380,8 +380,6 @@ gdk_export _Noreturn void GDKfatal(_In_z #define THRDMASK (1U) #define CHECKMASK (1U<<1) #define CHECKDEBUG if (ATOMIC_GET(&GDKdebug) & CHECKMASK) -#define PROPMASK (1U<<3) /* unused */ -#define PROPDEBUG if (ATOMIC_GET(&GDKdebug) & PROPMASK) /* unused */ #define IOMASK (1U<<4) #define BATMASK (1U<<5) #define PARMASK (1U<<7) @@ -403,11 +401,6 @@ gdk_export _Noreturn void GDKfatal(_In_z #define ALLOCMASK (1U<<26) -/* M5, only; cf., - * monetdb5/mal/mal.h - */ -#define OPTMASK (1U<<27) - #define HEAPMASK (1U<<28) #define FORCEMITOMASK (1U<<29) diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -3791,6 +3791,8 @@ BBPsync(int cnt, bat *restrict subcommit int n = subcommit ? 0 : -1; FILE *obbpf, *nbbpf; + TRC_INFO(TM, "Committing %d bats\n", cnt - 1); + if (GDKfilepath(bakdir, sizeof(bakdir), 0, NULL, subcommit ? SUBDIR : BAKDIR, NULL) != GDK_SUCCEED || GDKfilepath(deldir, sizeof(deldir), 0, NULL, DELDIR, NULL) != GDK_SUCCEED) return GDK_FAIL; @@ -3812,6 +3814,7 @@ BBPsync(int cnt, bat *restrict subcommit BATiter bi, *bip; const bat bid = i; + TRC_DEBUG(TM, "Commit bat %d\n", bid); if (lock) MT_lock_set(&GDKswapLock(bid)); /* set flag that we're syncing, i.e. that we'll diff --git a/gdk/gdk_delta.c b/gdk/gdk_delta.c --- a/gdk/gdk_delta.c +++ b/gdk/gdk_delta.c @@ -41,9 +41,8 @@ BATcommit(BAT *b, BUN size) if (b == NULL) return; assert(size <= BATcount(b) || size == BUN_NONE); - TRC_DEBUG(DELTA, "BATcommit1 %s free %zu ins " BUNFMT " base %p\n", - BATgetId(b), b->theap->free, b->batInserted, b->theap->base); + BUN old = b->batInserted; b->batInserted = size < BATcount(b) ? size : BATcount(b); - TRC_DEBUG(DELTA, "BATcommit2 %s free %zu ins " BUNFMT " base %p\n", - BATgetId(b), b->theap->free, b->batInserted, b->theap->base); + TRC_DEBUG(DELTA, "%s free %zu ins from " BUNFMT " to " BUNFMT " base %p\n", + BATgetId(b), b->theap->free, old, b->batInserted, b->theap->base); } diff --git a/gdk/gdk_tracer.h b/gdk/gdk_tracer.h --- a/gdk/gdk_tracer.h +++ b/gdk/gdk_tracer.h @@ -108,6 +108,7 @@ typedef enum { COMP( PERF ) \ COMP( TEM ) \ COMP( THRD ) \ + COMP( TM ) \ \ COMP( GEOM ) \ COMP( FITS ) \ @@ -122,6 +123,7 @@ typedef enum { _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
