Changeset: 680787a1aa30 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=680787a1aa30
Modified Files:
        clients/R/Tests/copy_into_fwf.stable.err
        configure.ag
        gdk/gdk_utils.c
        monetdb5/mal/Tests/tst903.stable.out
        monetdb5/mal/Tests/tst904.stable.out
        monetdb5/mal/Tests/tst907.stable.out
        monetdb5/modules/mal/pcre.c
        monetdb5/optimizer/Tests/Mexample.stable.out
        monetdb5/optimizer/Tests/inlineFunction2.stable.out
        monetdb5/optimizer/Tests/manifold2.stable.out
        monetdb5/optimizer/opt_multiplex.c
        sql/backends/monet5/wlr.c
        sql/server/rel_exp.h
        sql/server/rel_optimizer.c
        sql/server/rel_rel.c
        sql/server/rel_rel.h
        sql/server/rel_select.c
        sql/server/sql_mvc.c
        sql/server/sql_mvc.h
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/miscellaneous/Tests/simple_selects.sql
        sql/test/miscellaneous/Tests/simple_selects.stable.out
        sql/test/subquery/Tests/subquery3.sql
Branch: mlogger
Log Message:

Merge with default


diffs (truncated from 1271 to 300 lines):

diff --git a/clients/R/Tests/copy_into_fwf.stable.err 
b/clients/R/Tests/copy_into_fwf.stable.err
--- a/clients/R/Tests/copy_into_fwf.stable.err
+++ b/clients/R/Tests/copy_into_fwf.stable.err
@@ -28,8 +28,6 @@ stderr of test 'copy_into_fwf` in direct
 # 16:40:23 >  "R" "--vanilla" "--slave" "--args" "30658"
 # 16:40:23 >  
 
-Warning message:
-S3 methods ‘[.fun_list’, ‘[.grouped_df’, ‘all.equal.tbl_df’, 
‘anti_join.data.frame’, ‘anti_join.tbl_df’, ‘arrange.data.frame’, 
‘arrange.default’, ‘arrange.grouped_df’, ‘arrange.tbl_df’, 
‘arrange_.data.frame’, ‘arrange_.tbl_df’, 
‘as.data.frame.grouped_df’, ‘as.data.frame.rowwise_df’, 
‘as.data.frame.tbl_cube’, ‘as.table.tbl_cube’, ‘as.tbl.data.frame’, 
‘as.tbl.tbl’, ‘as.tbl_cube.array’, ‘as.tbl_cube.data.frame’, 
‘as.tbl_cube.matrix’, ‘as.tbl_cube.table’, ‘as_tibble.grouped_df’, 
‘as_tibble.tbl_cube’, ‘auto_copy.tbl_cube’, ‘auto_copy.tbl_df’, 
‘cbind.grouped_df’, ‘collapse.data.frame’, ‘collect.data.frame’, 
‘common_by.NULL’, ‘common_by.character’, ‘common_by.default’, 
‘common_by.list’, ‘compute.data.frame’, ‘copy_to.DBIConnection’, 
‘copy_to.src_local’, ‘default_missing.data.frame’, 
‘default_missing.default’, ‘dim.tbl_cube’, ‘distinct.data.f [... 
truncated] 
 
 # 16:40:23 >  
 # 16:40:23 >  "Done."
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1666,12 +1666,22 @@ AS_VAR_IF([enable_rintegration], [no], [
                         enable_rintegration=no
                         why_not_rintegration="(libR library not found)"])],
                [AS_IF([RHOME=`$RCMD RHOME` && libr_CFLAGS=`$RCMD CMD config 
--cppflags` && libr_LIBS=`$RCMD CMD config --ldflags | sed -e 's|-fopenmp 
|-fopenmp=libgomp |'`],
-                       [have_libr=yes
-                        AC_DEFINE([HAVE_LIBR], 1, [Define if you have libR 
installed])
-                        AC_SUBST([libr_CFLAGS], [$libr_CFLAGS])
-                        AC_SUBST([libr_LIBS], [$libr_LIBS])
-                        AC_SUBST([RHOME], [$RHOME])
-                        AC_DEFINE_UNQUOTED([RHOME], ["$RHOME"], [The home of 
R])])])])
+                       [save_CPPFLAGS="$CPPFLAGS"
+                        CPPFLAGS="$CPPFLAGS $libr_CFLAGS"
+                        AC_CHECK_HEADER([Rembedded.h],
+                               [have_libr=yes
+                                AC_DEFINE([HAVE_LIBR], 1, [Define if you have 
libR installed])
+                                AC_SUBST([libr_CFLAGS], [$libr_CFLAGS])
+                                AC_SUBST([libr_LIBS], [$libr_LIBS])
+                                AC_SUBST([RHOME], [$RHOME])
+                                AC_DEFINE_UNQUOTED([RHOME], ["$RHOME"], [The 
home of R])],
+                               [AS_VAR_IF([enable_rintegration], [yes],
+                                       [AC_MSG_ERROR([libR library required 
for R integration support])],
+                                       [have_libr=no
+                                        why_not_libr="(Rembedded.h not found)"
+                                        enable_rintegration=no
+                                        why_not_rintegration="(Rembedded.h not 
found)"])])
+                        CPPFLAGS="$save_CPPFLAGS"])])])
 AM_CONDITIONAL([HAVE_LIBR], [test x"$have_libr" != xno])
 
 # Python API (Python UDFs)
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -403,39 +403,76 @@ MT_init(void)
 # error "don't know how to get the amount of physical memory for your OS"
 #endif
 
-#ifndef WIN32
+#ifdef __linux__
        /* limit values to whatever cgroups gives us */
-       FILE *f;
-       /* limit of memory usage */
-       f = fopen("/sys/fs/cgroup/memory/memory.limit_in_bytes", "r");
-       if (f != NULL) {
-               uint64_t mem;
-               if (fscanf(f, "%" SCNu64, &mem) == 1
-                   && mem < (uint64_t) _MT_pagesize * _MT_npages) {
-                       _MT_npages = (size_t) (mem / _MT_pagesize);
+       FILE *fc;
+       fc = fopen("/proc/self/cgroup", "r");
+       if (fc != NULL) {
+               char buf[1024];
+               while (fgets(buf, (int) sizeof(buf), fc) != NULL) {
+                       char *p, *q;
+                       p = strchr(buf, ':');
+                       if (p == NULL)
+                               break;
+                       q = p + 1;
+                       p = strchr(q, ':');
+                       if (p == NULL)
+                               break;
+                       *p++ = 0;
+                       if (strstr(q, "memory") != NULL) {
+                               char pth[1024];
+                               FILE *f;
+                               q = strchr(p, '\n');
+                               if (q == NULL)
+                                       break;
+                               *q = 0;
+                               q = stpconcat(pth, "/sys/fs/cgroup/memory",
+                                             p, NULL);
+                               /* sometimes the path in
+                                * /proc/self/cgroup ends in "/" (or
+                                * actually, is "/"); in all other
+                                * cases add one */
+                               if (q[-1] != '/')
+                                       *q++ = '/';
+                               /* limit of memory usage */
+                               strcpy(q, "memory.limit_in_bytes");
+                               f = fopen(pth, "r");
+                               if (f != NULL) {
+                                       uint64_t mem;
+                                       if (fscanf(f, "%" SCNu64, &mem) == 1
+                                           && mem < (uint64_t) _MT_pagesize * 
_MT_npages) {
+                                               _MT_npages = (size_t) (mem / 
_MT_pagesize);
+                                       }
+                                       fclose(f);
+                               }
+                               /* soft limit of memory usage */
+                               strcpy(q, "memory.soft_limit_in_bytes");
+                               f = fopen(pth, "r");
+                               if (f != NULL) {
+                                       uint64_t mem;
+                                       if (fscanf(f, "%" SCNu64, &mem) == 1
+                                           && mem < (uint64_t) _MT_pagesize * 
_MT_npages) {
+                                               _MT_npages = (size_t) (mem / 
_MT_pagesize);
+                                       }
+                                       fclose(f);
+                               }
+                               /* limit of memory+swap usage
+                                * we use this as maximum virtual memory size */
+                               strcpy(q, "memory.memsw.limit_in_bytes");
+                               f = fopen(pth, "r");
+                               if (f != NULL) {
+                                       uint64_t mem;
+                                       if (fscanf(f, "%" SCNu64, &mem) == 1
+                                           && mem < (uint64_t) GDK_vm_maxsize) 
{
+                                               GDK_vm_maxsize = (size_t) mem;
+                                       }
+                                       fclose(f);
+                               }
+                               break;
+
+                       }
                }
-               fclose(f);
-       }
-       /* soft limit of memory usage */
-       f = fopen("/sys/fs/cgroup/memory/memory.soft_limit_in_bytes", "r");
-       if (f != NULL) {
-               uint64_t mem;
-               if (fscanf(f, "%" SCNu64, &mem) == 1
-                   && mem < (uint64_t) _MT_pagesize * _MT_npages) {
-                       _MT_npages = (size_t) (mem / _MT_pagesize);
-               }
-               fclose(f);
-       }
-       /* limit of memory+swap usage
-        * we use this as maximum virtual memory size */
-       f = fopen("/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes", "r");
-       if (f != NULL) {
-               uint64_t mem;
-               if (fscanf(f, "%" SCNu64, &mem) == 1
-                   && mem < (uint64_t) GDK_vm_maxsize) {
-                       GDK_vm_maxsize = (size_t) mem;
-               }
-               fclose(f);
+               fclose(fc);
        }
 #endif
 
diff --git a/monetdb5/mal/Tests/tst903.stable.out 
b/monetdb5/mal/Tests/tst903.stable.out
--- a/monetdb5/mal/Tests/tst903.stable.out
+++ b/monetdb5/mal/Tests/tst903.stable.out
@@ -142,7 +142,7 @@ exit i;
 barrier (X_83, X_84) := iterator.new(b);
     X_86 := algebra.fetch(c, X_83);
     X_88 := calc.+(X_84, X_86);
-    bat.append(X_80, X_88);
+    X_80 := bat.append(X_80, X_88);
     redo (X_83, X_84) := iterator.next(b);
 exit (X_83, X_84);
     x:bat[:lng] := X_80;
diff --git a/monetdb5/mal/Tests/tst904.stable.out 
b/monetdb5/mal/Tests/tst904.stable.out
--- a/monetdb5/mal/Tests/tst904.stable.out
+++ b/monetdb5/mal/Tests/tst904.stable.out
@@ -41,7 +41,7 @@ exit i:lng;                             
     X_13:bat[:lng] := bat.new(nil:lng);        #[10] (0) CMDBATnew 18 <- 19 
 barrier (X_16:oid, X_17:lng) := iterator.new(b:bat[:lng]);     #[11] (0) 
ITRbunIterator 21 22 <- 3 
     X_19:lng := calc.+(X_17:lng, c:int);       #[12] (0) CMDvarADDsignal 24 <- 
22 12 
-    bat.append(X_13:bat[:lng], X_19:lng);      #[13] (0) BKCappend_val_wrap 25 
<- 18 24 
+    X_13:bat[:lng] := bat.append(X_13:bat[:lng], X_19:lng);    #[13] (0) 
BKCappend_val_wrap 18 <- 18 24 
     redo (X_16:oid, X_17:lng) := iterator.next(b:bat[:lng]);   #[14] (0) 
ITRbunNext 21 22 <- 3 
 exit (X_16:oid, X_17:lng);                     #[15] (0)  21 22 
     xz:bat[:lng] := X_13:bat[:lng];            #[16] (0)  14 <- 18 
diff --git a/monetdb5/mal/Tests/tst907.stable.out 
b/monetdb5/mal/Tests/tst907.stable.out
--- a/monetdb5/mal/Tests/tst907.stable.out
+++ b/monetdb5/mal/Tests/tst907.stable.out
@@ -38,7 +38,7 @@ function user.foo():void;               
     X_16:bat[:int] := bat.new(nil:int);        #[7] (0) CMDBATnew 22 <- 23 
 barrier (X_19:oid, X_20:int) := iterator.new(b:bat[:int]);     #[8] (0) 
ITRbunIterator 25 26 <- 7 
     X_22:int := user.three(X_20:int, 2:int, 3:int);    #[9] (0)  28 <- 26 4 5 
-    bat.append(X_16:bat[:int], X_22:int);      #[10] (0) BKCappend_val_wrap 29 
<- 22 28 
+    X_16:bat[:int] := bat.append(X_16:bat[:int], X_22:int);    #[10] (0) 
BKCappend_val_wrap 22 <- 22 28 
     redo (X_19:oid, X_20:int) := iterator.next(b:bat[:int]);   #[11] (0) 
ITRbunNext 25 26 <- 7 
 exit (X_19:oid, X_20:int);                     #[12] (0)  25 26 
     z:bat[:int] := X_16:bat[:int];             #[13] (0)  12 <- 22 
@@ -46,7 +46,7 @@ exit (X_19:oid, X_20:int);              
     X_27:bat[:int] := bat.new(nil:int);        #[15] (0) CMDBATnew 33 <- 23 
 barrier (X_29:oid, X_30:int) := iterator.new(b:bat[:int]);     #[16] (0) 
ITRbunIterator 35 36 <- 7 
     X_32:int := user.one(X_30:int);            #[17] (0)  38 <- 36 
-    bat.append(X_27:bat[:int], X_32:int);      #[18] (0) BKCappend_val_wrap 39 
<- 33 38 
+    X_27:bat[:int] := bat.append(X_27:bat[:int], X_32:int);    #[18] (0) 
BKCappend_val_wrap 33 <- 33 38 
     redo (X_29:oid, X_30:int) := iterator.next(b:bat[:int]);   #[19] (0) 
ITRbunNext 35 36 <- 7 
 exit (X_29:oid, X_30:int);                     #[20] (0)  35 36 
     z:bat[:int] := X_27:bat[:int];             #[21] (0)  12 <- 33 
@@ -54,7 +54,7 @@ exit (X_29:oid, X_30:int);              
     X_37:bat[:int] := bat.new(nil:int);        #[23] (0) CMDBATnew 43 <- 23 
 barrier (X_39:oid, X_40:int) := iterator.new(b:bat[:int]);     #[24] (0) 
ITRbunIterator 45 46 <- 7 
     X_42:int := user.pow(X_40:int, 2:int);     #[25] (0)  48 <- 46 4 
-    bat.append(X_37:bat[:int], X_42:int);      #[26] (0) BKCappend_val_wrap 49 
<- 43 48 
+    X_37:bat[:int] := bat.append(X_37:bat[:int], X_42:int);    #[26] (0) 
BKCappend_val_wrap 43 <- 43 48 
     redo (X_39:oid, X_40:int) := iterator.next(b:bat[:int]);   #[27] (0) 
ITRbunNext 45 46 <- 7 
 exit (X_39:oid, X_40:int);                     #[28] (0)  45 46 
     z:bat[:int] := X_37:bat[:int];             #[29] (0)  12 <- 43 
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -32,7 +32,9 @@
 #ifndef PCRE_STUDY_JIT_COMPILE
 /* old library version on e.g. EPEL 6 */
 #define pcre_free_study(x)             pcre_free(x)
+#define PCRE_STUDY_JIT_COMPILE 0
 #endif
+#define JIT_COMPILE_MIN        1024    /* when to try JIT compilation of 
patterns */
 
 #else
 
@@ -221,17 +223,6 @@ utf8stoucs(const char *src)
        return dest;
 }
 
-static uint32_t *
-myucschr(const uint32_t *ucs, uint32_t uc)
-{
-       while (*ucs) {
-               if (*ucs == uc)
-                       return (uint32_t *) ucs;
-               ucs++;
-       }
-       return NULL;
-}
-
 static size_t
 myucslen(const uint32_t *ucs)
 {
@@ -364,32 +355,43 @@ mywstrcasestr(const char *restrict hayst
        return NULL;
 }
 
-static int
-re_simple(const char *pat)
+/* returns true if the pattern does not contain unescaped `_' (single
+ * character match) and ends with unescaped `%' (any sequence
+ * match) */
+static bool
+re_simple(const char *pat, unsigned char esc)
 {
-       int nr = 0;
+       bool escaped = false;
+       bool percatend = false;
 
        if (pat == 0)
                return 0;
-       if (*pat == '%')
+       if (*pat == '%') {
+               percatend = true;
                pat++;
+       }
        while (*pat) {
-               if (*pat == '_')
+               percatend = false;
+               if (escaped) {
+                       escaped = false;
+               } else if ((unsigned char) *pat == esc) {
+                       escaped = true;
+               } else if (*pat == '_') {
                        return 0;
-               if (*pat++ == '%')
-                       nr++;
+               } else if (*pat == '%') {
+                       percatend = true;
+               }
+               pat++;
        }
-       if (*(pat-1) != '%')
-               return 0;
-       return nr;
+       return percatend;
 }
 
 static bool
-is_strcmpable(const char *pat, const str esc)
+is_strcmpable(const char *pat, const char *esc)
 {
        if (pat[strcspn(pat, "%_")])
                return false;
-       return strlen(esc) == 0 || strstr(pat, esc) == NULL;
+       return strlen(esc) == 0 || strcmp(esc, str_nil) == 0 || strstr(pat, 
esc) == NULL;
 }
 
 static bool
@@ -398,6 +400,8 @@ re_match_ignore(const char *s, RE *patte
        RE *r;
 
        for (r = pattern; r; r = r->n) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to