Changeset: caef8be3f386 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=caef8be3f386 Modified Files: sql/backends/monet5/sql_cast.c Branch: alloc-less-str Log Message:
Merged with default diffs (truncated from 381 to 300 lines): diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,14 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: documentation/conf.py + +# Optionally build your docs in additional formats such as PDF +formats: + - pdf diff --git a/cmake/Toolchains/linux-gnu.cmake b/cmake/Toolchains/linux-gnu.cmake --- a/cmake/Toolchains/linux-gnu.cmake +++ b/cmake/Toolchains/linux-gnu.cmake @@ -16,7 +16,6 @@ # MT_checkCompilerFlag("-Wdisabled-optimization") # MT_checkCompilerFlag("-Wfloat-equal") # MT_checkCompilerFlag("-Winline") - # MT_checkCompilerFlag("-Wmissing-noreturn") # MT_checkCompilerFlag("-Wpadded") # MT_checkCompilerFlag("-Wredundant-decls") # MT_checkCompilerFlag("-Wshadow") diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake --- a/cmake/monetdb-toolchain.cmake +++ b/cmake/monetdb-toolchain.cmake @@ -55,6 +55,8 @@ function(monetdb_default_toolchain) MT_checkCompilerFlag("-Wduplicated-branches") MT_checkCompilerFlag("-Wrestrict") MT_checkCompilerFlag("-Wnested-externs") + MT_checkCompilerFlag("-Wmissing-noreturn") + MT_checkCompilerFlag("-Wuninitialized") # since we use values of type "int8_t" as subscript, # and int8_t may be defined as plain "char", we cannot diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -25,7 +25,7 @@ if(SPHINX_FOUND) set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" + "${CMAKE_CURRENT_SOURCE_DIR}/conf.py" "${BINARY_BUILD_DIR}/conf.py" @ONLY) diff --git a/documentation/conf.py.in b/documentation/conf.py rename from documentation/conf.py.in rename to documentation/conf.py --- a/documentation/conf.py.in +++ b/documentation/conf.py @@ -16,7 +16,7 @@ # -- Project information ----------------------------------------------------- -project = 'monetdbe' +project = 'MonetDB' copyright = '2020, MonetDB Solutions' author = '' @@ -48,9 +48,9 @@ master_doc = 'index' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -#html_theme = 'alabaster' -html_theme = '@SPHINX_THEME@' -html_theme_path = ['@SPHINX_THEME_DIR@'] +html_theme = 'alabaster' +# html_theme = '@SPHINX_THEME@' +# html_theme_path = ['@SPHINX_THEME_DIR@'] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -58,3 +58,4 @@ html_theme_path = ['@SPHINX_THEME_DIR@'] #html_static_path = ['_static'] htmlhelp_basename = 'MonetDB' +smartquotes = False diff --git a/documentation/source/conf.py b/documentation/source/conf.py deleted file mode 100644 --- a/documentation/source/conf.py +++ /dev/null @@ -1,54 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- Project information ----------------------------------------------------- - -project = 'MonetDB' -copyright = '2020, MonetDB B.V.' -author = 'Panagiotis Koutsourakis' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -smartquotes=False diff --git a/sql/include/exception_buffer.h b/sql/include/exception_buffer.h --- a/sql/include/exception_buffer.h +++ b/sql/include/exception_buffer.h @@ -1,6 +1,15 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V. + */ + #ifndef EXCEPTION_BUFFER_H #define EXCEPTION_BUFFER_H +#include "monetdb_config.h" #include <setjmp.h> typedef struct exception_buffer { @@ -14,6 +23,6 @@ extern exception_buffer *eb_init( except /* != 0 on when we return to the savepoint */ #define eb_savepoint(eb) ((eb)->enabled=1,setjmp((eb)->state)) -extern void eb_error( exception_buffer *eb, char *msg, int val ); +extern _Noreturn void eb_error( exception_buffer *eb, char *msg, int val ); #endif /* EXCEPTION_BUFFER_H */ diff --git a/tools/merovingian/daemon/argvcmds.c b/tools/merovingian/daemon/argvcmds.c --- a/tools/merovingian/daemon/argvcmds.c +++ b/tools/merovingian/daemon/argvcmds.c @@ -42,11 +42,11 @@ command_help(int argc, char *argv[]) printf(" created, or a directory that is writable that already exists.\n"); } else if (strcmp(argv[1], "start") == 0) { printf("usage: monetdbd start [-n] <dbfarm>\n"); - printf(" Starts the monetdbd deamon for the given dbfarm.\n"); + printf(" Starts the monetdbd daemon for the given dbfarm.\n"); printf(" When -n is given, monetdbd will not fork into the background.\n"); } else if (strcmp(argv[1], "stop") == 0) { printf("usage: monetdbd stop <dbfarm>\n"); - printf(" Stops a running monetdbd deamon for the given dbfarm.\n"); + printf(" Stops a running monetdbd daemon for the given dbfarm.\n"); } else if (strcmp(argv[1], "set") == 0) { printf("usage: monetdbd set property=value <dbfarm>\n"); printf(" Sets property to value for the given dbfarm.\n"); diff --git a/tools/merovingian/daemon/controlrunner.c b/tools/merovingian/daemon/controlrunner.c --- a/tools/merovingian/daemon/controlrunner.c +++ b/tools/merovingian/daemon/controlrunner.c @@ -400,6 +400,7 @@ static void ctl_handle_client( // Kill it appropriately if (strcmp(p, "stop") == 0) { + bool terminated = false; /* make an attempt to shut down the profiler first. */ if ((e = shutdown_profiler(q, &stats)) != NULL) { free(e); @@ -408,9 +409,13 @@ static void ctl_handle_client( /* then kill it */ if (dp) pthread_mutex_lock(&dp->fork_lock); - terminateProcess(q, pid, mtype); - if (dp) + if (pid != -1) + terminated = terminateProcess(q, pid, mtype); + if (dp) { + if (terminated) + dp->pid = -1; pthread_mutex_unlock(&dp->fork_lock); + } Mfprintf(_mero_ctlout, "%s: stopped " "database '%s'\n", origin, q); } else { diff --git a/tools/merovingian/daemon/forkmserver.c b/tools/merovingian/daemon/forkmserver.c --- a/tools/merovingian/daemon/forkmserver.c +++ b/tools/merovingian/daemon/forkmserver.c @@ -34,13 +34,15 @@ * The terminateProcess function tries to let the given mserver process * shut down gracefully within a given time-out. If that fails, it * sends the deadly SIGKILL signal to the mserver process and returns. + * + * Returns a boolean indicating if the process was shutdown succesfuly. */ -void +bool terminateProcess(char *dbname, pid_t pid, mtype type) { sabdb *stats; char *er; - int i; + int i, killed, e; confkeyval *kv; er = msab_getStatus(&stats, dbname); @@ -48,23 +50,24 @@ terminateProcess(char *dbname, pid_t pid Mfprintf(stderr, "cannot terminate process %lld: %s\n", (long long int)pid, er); free(er); - return; + return false; } if (stats == NULL) { Mfprintf(stderr, "strange, process %lld serves database '%s' " "which does not exist\n", (long long int)pid, dbname); - return; + return false; } if (stats->pid != pid) { Mfprintf(stderr, "strange, trying to kill process %lld to stop database '%s' " "which seems to be served by process %lld instead\n", - (long long int)pid, + (long long int)stats->pid, dbname, (long long int)pid ); + return false; } assert(stats->pid == pid); @@ -77,13 +80,13 @@ terminateProcess(char *dbname, pid_t pid "(pid %lld) has crashed\n", dbname, (long long int)pid); msab_freeStatus(&stats); - return; + return false; case SABdbInactive: Mfprintf(stdout, "database '%s' appears to have shut down already\n", dbname); fflush(stdout); msab_freeStatus(&stats); - return; + return false; case SABdbStarting: Mfprintf(stderr, "database '%s' appears to be starting up\n", dbname); @@ -92,19 +95,19 @@ terminateProcess(char *dbname, pid_t pid default: Mfprintf(stderr, "unknown state: %d\n", (int)stats->state); msab_freeStatus(&stats); - return; + return false; } if (type == MEROFUN) { multiplexDestroy(dbname); msab_freeStatus(&stats); - return; + return true; } else if (type != MERODB) { /* barf */ Mfprintf(stderr, "cannot stop merovingian process role: %s\n", dbname); msab_freeStatus(&stats); - return; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list