MonetDB: default - merged with jun

2020-07-06 Thread Niels Nes
Changeset: 16f425c76298 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=16f425c76298
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
Branch: default
Log Message:

merged with jun


diffs (57 lines):

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
@@ -1098,23 +1098,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
s = stmt_unop(be, s, a);
s->cand = cand;
}
-#if 0
-   } else if (((e->flag&3) != 3) /* both sides 
closed use between implementation */ && l->nrcols > 0 && r->nrcols > 0 && 
r2->nrcols > 0) {
-   s = stmt_uselect(be, l, r, 
range2lcompare(e->flag),
-   stmt_uselect(be, l, r2, 
range2rcompare(e->flag), sel, is_anti(e), 0), is_anti(e), 0);
-#endif
} else {
-   /* done in stmt_uselect2
-   if (sel && ((l->cand && l->nrcols) || 
(r->cand && r->nrcols) || (r2->cand && r->nrcols))) {
-   if (!l->cand && l->nrcols)
-   l = stmt_project(be, 
sel, l);
-   if (!r->cand && r->nrcols)
-   r = stmt_project(be, 
sel, r);
-   if (!r2->cand && r2->nrcols)
-   r2 = stmt_project(be, 
sel, r2);
-   sel = NULL;
-   }
-   */
if (l->nrcols == 0)
l = stmt_const(be, 
bin_first_column(be, left), l);
s = stmt_uselect2(be, l, r, r2, 
(comp_type)e->flag, sel, is_anti(e));
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -1638,14 +1638,18 @@ select2_join2(backend *be, stmt *op1, st
p = pushNil(mb, p, TYPE_bat);
else if (op1->nrcols)
p = pushArgument(mb, p, sub->nr);
-   if (op2->cand)
-   p = pushNil(mb, p, TYPE_bat);
-   else if (op2->nrcols)
-   p = pushArgument(mb, p, sub->nr);
-   if (op3->cand)
-   p = pushNil(mb, p, TYPE_bat);
-   else if (op3->nrcols)
-   p = pushArgument(mb, p, sub->nr);
+   if (op2->nrcols) {
+   if (op2->cand)
+   p = pushNil(mb, p, TYPE_bat);
+   else if (op2->nrcols)
+   p = pushArgument(mb, p, sub->nr);
+   }
+   if (op2->nrcols) {
+   if (op3->cand)
+   p = pushNil(mb, p, TYPE_bat);
+   else if (op3->nrcols)
+   p = pushArgument(mb, p, sub->nr);
+   }
sub = NULL;
}
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: default - merged with jun

2020-06-08 Thread Niels Nes
Changeset: 28c70933daa5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=28c70933daa5
Added Files:
sql/test/Tests/hot_snapshot_lz4_lite.py
sql/test/Tests/hot_snapshot_lz4_lite.stable.err
sql/test/Tests/hot_snapshot_lz4_lite.stable.out
Modified Files:
monetdb5/mal/Tests/tst201.malC
monetdb5/modules/mal/pcre.c
sql/test/Tests/All
sql/test/Tests/hot_snapshot.py
Branch: default
Log Message:

merged with jun


diffs (truncated from 741 to 300 lines):

diff --git a/monetdb5/mal/Tests/tst201.malC b/monetdb5/mal/Tests/tst201.malC
--- a/monetdb5/mal/Tests/tst201.malC
+++ b/monetdb5/mal/Tests/tst201.malC
@@ -61,14 +61,14 @@ exit  MALException;
v45:= algebra.slice(b,v43,v44);
v46:= io.print(v45);
 
-   v75:= algebra.likeselect(b, nil:bat[:oid], "ox", nil:str, false, false);
+   v75:= algebra.likeselect(b, nil:bat[:oid], "ox", "", false, false);
v76:= io.print(v75);
 
-   v78:= algebra.likeselect(b, nil:bat[:oid], "fo", nil:str, false, false);
+   v78:= algebra.likeselect(b, nil:bat[:oid], "fo", "", false, false);
v79:= io.print(v78);
 
-   v81:= algebra.likeselect(b, nil:bat[:oid], "fox", nil:str, false, 
false);
+   v81:= algebra.likeselect(b, nil:bat[:oid], "fox", "", false, false);
v82:= io.print(v81);
 
-   v84:= algebra.likeselect(b, nil:bat[:oid], " fox", nil:str, false, 
false);
+   v84:= algebra.likeselect(b, nil:bat[:oid], " fox", "", false, false);
v85:= io.print(v84);
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
@@ -87,13 +87,14 @@ mal_export str ILIKEjoin(bat *r1, bat *r
 mal_export str ILIKEjoin1(bat *r1, bat *r2, const bat *lid, const bat *rid, 
const bat *slid, const bat *srid, const bit *nil_matches, const lng *estimate);
 
 /* current implementation assumes simple %keyword% [keyw%]* */
-typedef struct RE {
+struct RE {
char *k;
uint32_t *w;
-   bool search;
+   bool search:1,
+   atend:1;
size_t len;
struct RE *n;
-} RE;
+};
 
 /* We cannot use strcasecmp and strncasecmp since they work byte for
  * byte and don't deal with multibyte encodings (such as UTF-8).
@@ -235,32 +236,32 @@ myucslen(const uint32_t *ucs)
return i;
 }
 
-static inline int
-mywstrncasecmp(const char *restrict s1, const uint32_t *restrict s2, size_t n2)
+static inline bool
+mywstrncaseeq(const char *restrict s1, const uint32_t *restrict s2, size_t n2, 
bool atend)
 {
uint32_t c1;
 
while (n2 > 0) {
size_t nn1 = utfc8touc(, s1);
if (nn1 == 0 || nn1 == (size_t) -1)
-   return -(*s2 != 0);
+   return (*s2 == 0);
if (*s2 == 0)
-   return 1;
+   return false;
if (nn1 == (size_t) -1 || nn1 == (size_t) -2)
-   return 0;/* actually an error that shouldn't 
happen */
+   return true; /* actually an error that shouldn't 
happen */
 #if SIZEOF_WCHAR_T == 2
if (c1 > 0x || *s2 > 0x) {
if (c1 != *s2)
-   return c1 - *s2;
+   return false;
} else
 #endif
if (towlower((wint_t) c1) != towlower((wint_t) *s2))
-   return towlower((wint_t) c1) - towlower((wint_t) *s2);
+   return false;
s1 += nn1;
n2--;
s2++;
}
-   return 0;
+   return !atend || *s1 == 0;
 }
 
 static inline int
@@ -318,12 +319,12 @@ mywstrcasecmp(const char *restrict s1, c
 }
 
 static inline const char *
-mywstrcasestr(const char *restrict haystack, const uint32_t *restrict wneedle)
+mywstrcasestr(const char *restrict haystack, const uint32_t *restrict wneedle, 
bool atend)
 {
size_t nlen = myucslen(wneedle);
 
if (nlen == 0)
-   return haystack;
+   return atend ? haystack + strlen(haystack) : haystack;
 
size_t hlen = strlen(haystack);
 
@@ -349,7 +350,7 @@ mywstrcasestr(const char *restrict hayst
break;
h += j;
}
-   if (i == nlen)
+   if (i == nlen && (!atend || haystack[h] == 0))
return haystack;
haystack += step;
hlen -= step;
@@ -364,31 +365,44 @@ static bool
 re_simple(const char *pat, unsigned char esc)
 {
bool escaped = false;
-   bool percatend = false;
 
if (pat == 0)
-   return 0;
+   return false;
if (*pat == '%') {
-   percatend = true;
pat++;
}
while (*pat) {
-   percatend = false;
if (escaped) {