Changeset: d8870e2eae85 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d8870e2eae85
Branch: literal_features
Log Message:
Merge with default


diffs (162 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2421,10 +2421,15 @@ log_cleanup_range(logger *lg, ulng id)
 static void
 do_rotate(logger *lg)
 {
-       logged_range *next = lg->current->next;
+       logged_range *cur = lg->current;
+       logged_range *next = cur->next;
        if (next) {
                assert(ATOMIC_GET(&next->refcount) == 1);
-               lg->current = lg->current->next;
+               lg->current = next;
+               if (!LOG_DISABLED(lg) && ATOMIC_GET(&cur->refcount) == 1) {
+                       close_stream(cur->output_log);
+                       cur->output_log = NULL;
+               }
        }
 }
 
@@ -3099,7 +3104,14 @@ log_tflush(logger *lg, ulng file_id, uln
        }
        /* else somebody else has flushed our log file */
 
-       ATOMIC_DEC(&frange->refcount);
+       if (ATOMIC_DEC(&frange->refcount) == 1 && !LOG_DISABLED(lg)) {
+               rotation_lock(lg);
+               if (frange != lg->current) {
+                       close_stream(frange->output_log);
+                       frange->output_log = NULL;
+               }
+               rotation_unlock(lg);
+       }
 
        if (ATOMIC_DEC(&lg->nr_flushers) == 0) {
                /* I am the last flusher
diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -65,6 +65,7 @@
 #include <string.h>
 #ifdef HAVE_ICONV
 #include <iconv.h>
+#include <locale.h>
 #endif
 #include "mal_interpreter.h"
 
@@ -5046,37 +5047,40 @@ static str
 STRasciify(str *r, const str *s)
 {
 #ifdef HAVE_ICONV
-       /* Handle NULL and return early */
+
        if (strNil(*s)) {
                if ((*r = GDKstrdup(str_nil)) == NULL)
                        throw(MAL, "str.asciify", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                else
                        return MAL_SUCCEED;
        }
+
        iconv_t cd;
        const str f = "UTF-8", t = "ASCII//TRANSLIT";
        str in = *s, out;
-       size_t in_len = strlen(in), out_len = in_len * 4;       /* oversized as 
a single utf8 char could change into multiple
-                                                                               
                                   ascii char */
-       /* man iconv; /TRANSLIT */
+       size_t in_len = strlen(in), out_len = in_len * 4; /* oversized as a 
single utf8 char could change into multiple ascii char */
+
        if ((cd = iconv_open(t, f)) == (iconv_t) (-1))
-               throw(MAL, "str.asciify", "ICONV: cannot convert from (%s) to 
(%s).", f,
-                         t);
+               throw(MAL, "str.asciify", "ICONV: cannot convert from (%s) to 
(%s).", f, t);
+
        if ((*r = out = GDKmalloc(out_len)) == NULL) {
                iconv_close(cd);
                throw(MAL, "str.asciify", SQLSTATE(HY013) MAL_MALLOC_FAIL);
        }
+
        str o = out;
+
        if (iconv(cd, &in, &in_len, &o, &out_len) == (size_t) -1) {
                GDKfree(out);
                *r = NULL;
                iconv_close(cd);
-               throw(MAL, "str.asciify",
-                         "ICONV: string conversion failed from (%s) to (%s)", 
f, t);
+               throw(MAL, "str.asciify", "Conversion failed, possibly due to 
system locale %s.", setlocale(0, NULL));
        }
+
        *o = '\0';
        iconv_close(cd);
        return MAL_SUCCEED;
+
 #else
        throw(MAL, "str.asciify", "ICONV library not available.");
 #endif
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
@@ -2837,7 +2837,6 @@ rel2bin_groupjoin(backend *be, sql_rel *
 
        en = jexps?jexps->h:NULL;
        if (list_empty(jexps) || !(is_equi_exp_((sql_exp*)en->data) && 
can_join_exp(rel, en->data, false))) {
-               printf("# outer cross\n");
                stmt *l = bin_find_smallest_column(be, left);
                stmt *r = bin_find_smallest_column(be, right);
                if (list_empty(jexps)) {
@@ -2878,7 +2877,6 @@ rel2bin_groupjoin(backend *be, sql_rel *
                        /* split out (left)join vs (left)mark-join */
                        /* call 3 result version */
                        if (mark && is_any(e)) {
-                               printf("# mark join 3\n");
                                join = stmt_markjoin(be, l, r, 0);
                        } else
                                join = stmt_join_cand(be, column(be, l), 
column(be, r), left->cand, NULL/*right->cand*/, is_anti(e), (comp_type) 
cmp_equal/*e->flag*/, 0, is_any(e)|is_semantics(e), false, rel->op == 
op_left?false:true);
@@ -2887,7 +2885,6 @@ rel2bin_groupjoin(backend *be, sql_rel *
                        if (mark && is_any(e))
                                m = stmt_result(be, join, 2);
                } else {
-                       printf("# mark join 2\n");
                        join = stmt_markjoin(be, l, r, 1);
                        jl = stmt_result(be, join, 0);
                        m = stmt_result(be, join, 1);
@@ -2954,10 +2951,8 @@ rel2bin_groupjoin(backend *be, sql_rel *
                                li = stmt_project(be, sel, li);
                        osel = sel;
                        if (en->next) {
-                               printf("# outer select\n");
                                join = stmt_outerselect(be, li, m, p, 
is_any(e));
                        } else {
-                               printf("# mark select\n");
                                join = stmt_markselect(be, li, m, p, is_any(e));
                        }
                        sel = stmt_result(be, join, 0);
diff --git a/sql/test/sys-schema/Tests/All b/sql/test/sys-schema/Tests/All
--- a/sql/test/sys-schema/Tests/All
+++ b/sql/test/sys-schema/Tests/All
@@ -12,7 +12,7 @@ HAVE_NETCDF?netcdf_tables_checks
 fkeys
 
 webExamplesLogicalFunctionsOperators
-webExamplesComparisonFunctionsOperators
+HAVE_LIBPCRE?webExamplesComparisonFunctionsOperators
 webExamplesCastFunctionsOperators
 webExamplesMathematicalFunctionsOperators
 webExamplesDateTimeFunctionsOperators
diff --git a/sql/test/sys-schema/Tests/webExamplesStringFunctions.test 
b/sql/test/sys-schema/Tests/webExamplesStringFunctions.test
--- a/sql/test/sys-schema/Tests/webExamplesStringFunctions.test
+++ b/sql/test/sys-schema/Tests/webExamplesStringFunctions.test
@@ -16,11 +16,6 @@ select ascii(R'€')
 ----
 8364
 
-query T
-select asciify(R'a € sign')
-----
-a EUR sign
-
 query I
 select char_length(R'2€')
 ----
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to