Changeset: 8ac56c9beaff for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ac56c9beaff Added Files: clients/R/Tests/deps-install.timeout Modified Files: clients/R/Tests/dbapply.R clients/R/Tests/deps-install.R clients/R/Tests/deps-test.R clients/R/Tests/deps-test.timeout clients/R/Tests/dplyr-flights.R clients/R/Tests/dplyr-flights.stable.err clients/R/Tests/install.R monetdb5/mal/mal_linker.c monetdb5/optimizer/opt_candidates.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_profiler.c monetdb5/optimizer/opt_querylog.c sql/backends/monet5/UDF/pyapi/type_conversion.c sql/backends/monet5/UDF/pyapi/type_conversion.h sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/vaults/shp/shp.c sql/common/sql_types.c sql/server/rel_updates.c sql/storage/store.c sql/test/Tests/seq-default.stable.out sql/test/seq-default.sql sql/test/testdb-upgrade/Tests/upgrade.stable.out.powerpc64.int128 testing/exportutils.py Branch: subjoin Log Message:
merge with default diffs (truncated from 542 to 300 lines): diff --git a/clients/R/Tests/dbapply.R b/clients/R/Tests/dbapply.R --- a/clients/R/Tests/dbapply.R +++ b/clients/R/Tests/dbapply.R @@ -1,3 +1,5 @@ +cat("#~BeginProfilingOutput~#\n", file=stderr()) + if (Sys.getenv("TSTTRGDIR") != "") { .libPaths(c(.libPaths(), paste0(Sys.getenv("TSTTRGDIR"),"/rlibdir"))) } @@ -81,4 +83,6 @@ print(res) dbRemoveTable(con,tname) stopifnot(identical(FALSE, dbExistsTable(con,tname))) +cat("#~EndProfilingOutput~#\n", file=stderr()) + print("SUCCESS") diff --git a/clients/R/Tests/deps-install.R b/clients/R/Tests/deps-install.R --- a/clients/R/Tests/deps-install.R +++ b/clients/R/Tests/deps-install.R @@ -1,6 +1,6 @@ # autoinstall DBI and digest, we need those to install MonetDB.R options(warn = -1) -packages_required <- c("digest", "DBI") +packages_required <- c("digest", "DBI", "devtools") cat("#~BeginProfilingOutput~#\n", file=stderr()) cat("#~BeginProfilingOutput~#\n", file=stdout()) diff --git a/clients/R/Tests/deps-install.timeout b/clients/R/Tests/deps-install.timeout new file mode 100644 --- /dev/null +++ b/clients/R/Tests/deps-install.timeout @@ -0,0 +1,1 @@ +2 diff --git a/clients/R/Tests/deps-test.R b/clients/R/Tests/deps-test.R --- a/clients/R/Tests/deps-test.R +++ b/clients/R/Tests/deps-test.R @@ -1,4 +1,4 @@ -packages_required <- c("assertthat","testthat","survey","nycflights13","RSQLite","dbplyr","dplyr","gdata","callr","devtools","DBItest") +packages_required <- c("assertthat","testthat","survey","nycflights13","RSQLite","dbplyr","dplyr","gdata","callr","DBItest") install_or_upgrade_packages <- function(lp) { np <- lp[!(lp %in% installed.packages()[,"Package"])] diff --git a/clients/R/Tests/deps-test.timeout b/clients/R/Tests/deps-test.timeout --- a/clients/R/Tests/deps-test.timeout +++ b/clients/R/Tests/deps-test.timeout @@ -1,1 +1,1 @@ -5 +20 diff --git a/clients/R/Tests/dplyr-flights.R b/clients/R/Tests/dplyr-flights.R --- a/clients/R/Tests/dplyr-flights.R +++ b/clients/R/Tests/dplyr-flights.R @@ -1,3 +1,5 @@ +cat("#~BeginProfilingOutput~#\n", file=stderr()) + ff <- textConnection("asdf", open="w") # hide output from connect and attach since it would blow up the test output # dangerous since it might hide useful warnings @@ -118,5 +120,6 @@ so(flights %>% ) %>% filter(arr > 30 | dep > 30)) +cat("#~EndProfilingOutput~#\n", file=stderr()) print("SUCCESS") diff --git a/clients/R/Tests/dplyr-flights.stable.err b/clients/R/Tests/dplyr-flights.stable.err --- a/clients/R/Tests/dplyr-flights.stable.err +++ b/clients/R/Tests/dplyr-flights.stable.err @@ -30,7 +30,6 @@ stderr of test 'dplyr-flights` in direct # 11:44:05 > "R" "--vanilla" "--slave" "--args" "30588" # 11:44:05 > -Identifier(s) "year", "month", "day", "hour", "minute" are reserved SQL keywords and need(s) to be quoted in queries. # 11:44:15 > # 11:44:15 > "Done." diff --git a/clients/R/Tests/install.R b/clients/R/Tests/install.R --- a/clients/R/Tests/install.R +++ b/clients/R/Tests/install.R @@ -2,13 +2,7 @@ options(warn = -1) cat("#~BeginProfilingOutput~#\n", file=stderr()) cat("#~BeginProfilingOutput~#\n", file=stdout()) -install_submodule_git <- function(x, ...) { - install_dir <- tempfile() - system(paste("git clone --recursive --depth 1", shQuote(x), -shQuote(install_dir))) - devtools::install(install_dir, ...) -} -install_submodule_git("https://github.com/hannesmuehleisen/MonetDBLite-R") +devtools::install_github("hannesmuehleisen/MonetDBLite-R") cat("#~EndProfilingOutput~#\n", file=stderr()) cat("#~EndProfilingOutput~#\n", file=stdout()) diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c --- a/monetdb5/mal/mal_linker.c +++ b/monetdb5/mal/mal_linker.c @@ -233,6 +233,7 @@ loadLibrary(str filename, int flag) MT_lock_set(&mal_contextLock); if (lastfile == maxfiles) { + MT_lock_unset(&mal_contextLock); if (handle) dlclose(handle); throw(MAL,"mal.linker", "loadModule internal error, too many modules loaded"); diff --git a/monetdb5/optimizer/opt_candidates.c b/monetdb5/optimizer/opt_candidates.c --- a/monetdb5/optimizer/opt_candidates.c +++ b/monetdb5/optimizer/opt_candidates.c @@ -82,11 +82,11 @@ OPTcandidatesImplementation(Client cntxt //chkTypes(cntxt->usermodule, mb, FALSE); //chkFlow(mb); //chkDeclarations(mb); - /* keep all actions taken as a post block comment */ + + /* keep all actions taken as a post block comment */ usec = GDKusec()- usec; - snprintf(buf,256,"%-20s actions=1 time=" LLFMT " usec","candidates",usec); - newComment(mb,buf); + snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","candidates",usec); + newComment(mb,buf); addtoMalBlkHistory(mb); - return MAL_SUCCEED; } diff --git a/monetdb5/optimizer/opt_macro.c b/monetdb5/optimizer/opt_macro.c --- a/monetdb5/optimizer/opt_macro.c +++ b/monetdb5/optimizer/opt_macro.c @@ -510,7 +510,7 @@ str OPTmacro(Client cntxt, MalBlkPtr mb, chkDeclarations(mb); usec += GDKusec() - clk; /* keep all actions taken as a post block comment */ - snprintf(buf,256,"%-20s actions=1 time=" LLFMT " usec","macro",usec); + snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","macro",usec); newComment(mb,buf); addtoMalBlkHistory(mb); if (mb->errors) @@ -553,7 +553,7 @@ str OPTorcam(Client cntxt, MalBlkPtr mb, usec += GDKusec() - clk; /* keep all actions taken as a post block comment */ usec = GDKusec()- usec; - snprintf(buf,256,"%-20s actions=1 time=" LLFMT " usec","orcam",usec); + snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","orcam",usec); newComment(mb,buf); addtoMalBlkHistory(mb); if (mb->errors) diff --git a/monetdb5/optimizer/opt_profiler.c b/monetdb5/optimizer/opt_profiler.c --- a/monetdb5/optimizer/opt_profiler.c +++ b/monetdb5/optimizer/opt_profiler.c @@ -110,11 +110,11 @@ OPTprofilerImplementation(Client cntxt, //chkTypes(cntxt->usermodule, mb, FALSE); //chkFlow(mb); //chkDeclarations(mb); - // - /* keep all actions taken as a post block comment */ + + /* keep all actions taken as a post block comment */ usec = GDKusec()- usec; - snprintf(buf,256,"%-20s actions=1 time=" LLFMT " usec","profiler", usec); - newComment(mb,buf); + snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","profiler", usec); + newComment(mb,buf); addtoMalBlkHistory(mb); return MAL_SUCCEED; } diff --git a/monetdb5/optimizer/opt_querylog.c b/monetdb5/optimizer/opt_querylog.c --- a/monetdb5/optimizer/opt_querylog.c +++ b/monetdb5/optimizer/opt_querylog.c @@ -195,10 +195,10 @@ OPTquerylogImplementation(Client cntxt, chkFlow(mb); chkDeclarations(mb); } - /* keep all actions taken as a post block comment */ + /* keep all actions taken as a post block comment */ usec = GDKusec()- usec; - snprintf(buf,256,"%-20s actions=1 time=" LLFMT " usec","querylog", usec); - newComment(mb,buf); + snprintf(buf,256,"%-20s actions= 1 time=" LLFMT " usec","querylog", usec); + newComment(mb,buf); addtoMalBlkHistory(mb); return msg; } diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.c b/sql/backends/monet5/UDF/pyapi/type_conversion.c --- a/sql/backends/monet5/UDF/pyapi/type_conversion.c +++ b/sql/backends/monet5/UDF/pyapi/type_conversion.c @@ -18,7 +18,7 @@ #define PyString_CheckExact PyUnicode_CheckExact #endif -bool string_copy(char *source, char *dest, size_t max_size, bool allow_unicode) +bool string_copy(const char *source, char *dest, size_t max_size, bool allow_unicode) { size_t i; for (i = 0; i < max_size; i++) { @@ -175,7 +175,7 @@ str pyobject_to_str(PyObject **ptr, size ucs2_to_utf8(0, ((PyUnicodeObject *)obj)->length, utf8_string, str); #endif #else - char *str = PyUnicode_AsUTF8(obj); + const char *str = PyUnicode_AsUTF8(obj); if (!string_copy(str, utf8_string, len-1, true)) { msg = createException(MAL, "pyapi.eval", SQLSTATE(PY000) "Invalid string encoding used. Please return " @@ -206,7 +206,7 @@ wrapup: } #define STRING_TO_NUMBER_FACTORY(tpe) \ - str str_to_##tpe(char *ptr, size_t maxsize, tpe *value) \ + str str_to_##tpe(const char *ptr, size_t maxsize, tpe *value) \ { \ size_t len = sizeof(tpe); \ char buf[256]; \ diff --git a/sql/backends/monet5/UDF/pyapi/type_conversion.h b/sql/backends/monet5/UDF/pyapi/type_conversion.h --- a/sql/backends/monet5/UDF/pyapi/type_conversion.h +++ b/sql/backends/monet5/UDF/pyapi/type_conversion.h @@ -24,12 +24,12 @@ //! Copies the string of size up to max_size from the source to the destination, //! returns FALSE if "source" is not a legal ASCII string (i.e. a character is //! >= 128) -bool string_copy(char *source, char *dest, size_t max_size, bool allow_unicode); +bool string_copy(const char *source, char *dest, size_t max_size, bool allow_unicode); #ifdef HAVE_HGE //! Converts a hge to a string and writes it into the string "str" int hge_to_string(char *str, hge); //! Converts a base-10 string to a hge value -str str_to_hge(char *ptr, size_t maxsize, hge *value); +str str_to_hge(const char *ptr, size_t maxsize, hge *value); //! Converts a base-10 utf32-encoded string to a hge value str unicode_to_hge(Py_UNICODE *utf32, size_t maxsize, hge *value); //! Converts a PyObject to a hge value @@ -48,7 +48,7 @@ str pyobject_to_blob(PyObject **ptr, siz //using macros, create a number of str_to_<type>, unicode_to_<type> and pyobject_to_<type> functions (we are Java now) #define CONVERSION_FUNCTION_HEADER_FACTORY(tpe) \ - str str_to_##tpe(char *ptr, size_t maxsize, tpe *value); \ + str str_to_##tpe(const char *ptr, size_t maxsize, tpe *value); \ str unicode_to_##tpe(Py_UNICODE *ptr, size_t maxsize, tpe *value); \ str pyobject_to_##tpe(PyObject **ptr, size_t maxsize, tpe *value); 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 @@ -405,7 +405,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l } else if (e->flag & PSM_IF) { stmt *cond = exp_bin(be, e->l, left, right, grp, ext, cnt, sel, rsel); stmt *ifstmt = stmt_cond(be, cond, NULL, 0, 0), *res; - (void)exp_list(be, e->r, left, right, grp, cnt, ext, sel, rsel); + (void)exp_list(be, e->r, left, right, grp, ext, cnt, sel, rsel); res = stmt_control_end(be, ifstmt); if (e->f) { stmt *elsestmt = stmt_cond(be, cond, NULL, 0, 1); diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -403,8 +403,10 @@ SQLinit(Client c) monet5_user_init(&be_funcs); msg = MTIMEtimezone(&tz, &gmt); - if (msg) + if (msg) { + MT_lock_unset(&sql_contextLock); return msg; + } (void) tz; if (debug_str) SQLdebug = strtol(debug_str, NULL, 10); @@ -477,14 +479,18 @@ SQLinit(Client c) buffer* createdb_buf; stream* createdb_stream; bstream* createdb_bstream; - if ((createdb_buf = GDKmalloc(sizeof(buffer))) == NULL) + if ((createdb_buf = GDKmalloc(sizeof(buffer))) == NULL) { + MT_lock_unset(&sql_contextLock); throw(MAL, "createdb", SQLSTATE(HY001) MAL_MALLOC_FAIL); + } buffer_init(createdb_buf, createdb_inline, createdb_len); if ((createdb_stream = buffer_rastream(createdb_buf, "createdb.sql")) == NULL) { + MT_lock_unset(&sql_contextLock); GDKfree(createdb_buf); throw(MAL, "createdb", SQLSTATE(HY001) MAL_MALLOC_FAIL); } if ((createdb_bstream = bstream_create(createdb_stream, createdb_len)) == NULL) { + MT_lock_unset(&sql_contextLock); close_stream(createdb_stream); GDKfree(createdb_buf); throw(MAL, "createdb", SQLSTATE(HY001) MAL_MALLOC_FAIL); @@ -580,10 +586,12 @@ SQLinit(Client c) *m->errstr = 0; sqlcleanup(m, mvc_status(m)); } - if ((msg = SQLresetClient(c)) != MAL_SUCCEED) + + msg = SQLresetClient(c); + MT_lock_unset(&sql_contextLock); + if (msg != MAL_SUCCEED) return msg; - MT_lock_unset(&sql_contextLock); if (MT_create_thread(&sqllogthread, (void (*)(void *)) mvc_logmanager, NULL, MT_THR_JOINABLE) != 0) { throw(SQL, "SQLinit", SQLSTATE(42000) "Starting log manager failed"); } diff --git a/sql/backends/monet5/vaults/shp/shp.c b/sql/backends/monet5/vaults/shp/shp.c _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list