Changeset: 491d4b6c90da for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=491d4b6c90da Modified Files: clients/Tests/exports.stable.out gdk/gdk.h gdk/gdk_batop.c geom/monetdb5/geom.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/mal/pcre.c monetdb5/modules/mal/remote.c monetdb5/optimizer/opt_pushselect.c sql/backends/monet5/sql.c sql/server/rel_optimizer.c sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 Branch: unlock Log Message:
Merge with default branch. diffs (truncated from 126896 to 300 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -119,7 +119,7 @@ gdk_return BATclear(BAT *b, bool force); void BATcommit(BAT *b, BUN size); BAT *BATconstant(oid hseq, int tt, const void *val, BUN cnt, role_t role); BAT *BATconvert(BAT *b, BAT *s, int tp, bool abort_on_error, uint8_t scale1, uint8_t scale2, uint8_t precision); -BUN BATcount_no_nil(BAT *b); +BUN BATcount_no_nil(BAT *b, BAT *s); gdk_return BATdel(BAT *b, BAT *d) __attribute__((__warn_unused_result__)); BAT *BATdense(oid hseq, oid tseq, BUN cnt) __attribute__((__warn_unused_result__)); BAT *BATdiff(BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool not_in, BUN estimate); diff --git a/common/stream/Tests/All b/common/stream/Tests/All --- a/common/stream/Tests/All +++ b/common/stream/Tests/All @@ -10,7 +10,7 @@ HAVE_LIBZ?write_gz HAVE_LIBLZ4&HAVE_PYTHON_LZ4?write_lz4 HAVE_LIBLZMA?write_xz -urlstream +HAVE_CURL?urlstream read_iconv write_iconv diff --git a/common/stream/Tests/read_bz2.py b/common/stream/Tests/read_bz2.py --- a/common/stream/Tests/read_bz2.py +++ b/common/stream/Tests/read_bz2.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import read_tests -import sys def filter(f): diff --git a/common/stream/Tests/read_gz.py b/common/stream/Tests/read_gz.py --- a/common/stream/Tests/read_gz.py +++ b/common/stream/Tests/read_gz.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import read_tests -import sys def filter(f): diff --git a/common/stream/Tests/read_iconv.py b/common/stream/Tests/read_iconv.py --- a/common/stream/Tests/read_iconv.py +++ b/common/stream/Tests/read_iconv.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) from testdata import Doc, TestFile -import os import subprocess -import sys def run_streamcat(text, enc, expected_error = None): @@ -20,7 +20,10 @@ def run_streamcat(text, enc, expected_er cmd = ['streamcat', 'read', filename, 'rstream', f'iconv:{enc}'] print(f"Input is {repr(content)}") proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if proc.stdout: + proc.stdout = proc.stdout.replace(b'\r', b'') if proc.stderr: + proc.stderr = proc.stderr.replace(b'\r', b'') sys.stderr.buffer.write(proc.stderr) sys.stderr.flush() if expected_error == None: @@ -49,4 +52,3 @@ run_streamcat(text, 'latin1') # invalid utf-8, expect an error run_streamcat(b"M\xc3\xc3NETDB", 'utf-8', b'multibyte sequence') - diff --git a/common/stream/Tests/read_lz4.py b/common/stream/Tests/read_lz4.py --- a/common/stream/Tests/read_lz4.py +++ b/common/stream/Tests/read_lz4.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import read_tests -import sys def filter(f): diff --git a/common/stream/Tests/read_uncompressed.py b/common/stream/Tests/read_uncompressed.py --- a/common/stream/Tests/read_uncompressed.py +++ b/common/stream/Tests/read_uncompressed.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import read_tests -import sys def filter(f): diff --git a/common/stream/Tests/read_xz.py b/common/stream/Tests/read_xz.py --- a/common/stream/Tests/read_xz.py +++ b/common/stream/Tests/read_xz.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import read_tests -import sys def filter(f): diff --git a/common/stream/Tests/write_bz2.py b/common/stream/Tests/write_bz2.py --- a/common/stream/Tests/write_bz2.py +++ b/common/stream/Tests/write_bz2.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import write_tests -import sys def filter(f): diff --git a/common/stream/Tests/write_gz.py b/common/stream/Tests/write_gz.py --- a/common/stream/Tests/write_gz.py +++ b/common/stream/Tests/write_gz.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import write_tests -import sys def filter(f): diff --git a/common/stream/Tests/write_iconv.py b/common/stream/Tests/write_iconv.py --- a/common/stream/Tests/write_iconv.py +++ b/common/stream/Tests/write_iconv.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) from testdata import Doc, TestFile -import os import subprocess -import sys import tempfile diff --git a/common/stream/Tests/write_lz4.py b/common/stream/Tests/write_lz4.py --- a/common/stream/Tests/write_lz4.py +++ b/common/stream/Tests/write_lz4.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import write_tests -import sys def filter(f): diff --git a/common/stream/Tests/write_uncompressed.py b/common/stream/Tests/write_uncompressed.py --- a/common/stream/Tests/write_uncompressed.py +++ b/common/stream/Tests/write_uncompressed.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import write_tests -import sys def filter(f): diff --git a/common/stream/Tests/write_xz.py b/common/stream/Tests/write_xz.py --- a/common/stream/Tests/write_xz.py +++ b/common/stream/Tests/write_xz.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import sys, os +sys.path.append(os.environ.get('TSTSRCDIR','.')) import write_tests -import sys def filter(f): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1086,7 +1086,7 @@ BUNtoid(BAT *b, BUN p) * to insert BUNs at the end of the BAT, but not to modify anything * that already was in there. */ -gdk_export BUN BATcount_no_nil(BAT *b); +gdk_export BUN BATcount_no_nil(BAT *b, BAT *s); gdk_export void BATsetcapacity(BAT *b, BUN cnt); gdk_export void BATsetcount(BAT *b, BUN cnt); gdk_export BUN BATgrows(BAT *b); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -2580,7 +2580,7 @@ BATrmprop(BAT *b, enum prop_t idx) * non-nil tail value. */ BUN -BATcount_no_nil(BAT *b) +BATcount_no_nil(BAT *b, BAT *s) { BUN cnt = 0; BUN i, n; @@ -2588,9 +2588,11 @@ BATcount_no_nil(BAT *b) const char *restrict base; int t; int (*cmp)(const void *, const void *); + struct canditer ci; + oid hseq = b->hseqbase; BATcheck(b, 0); - n = BATcount(b); + n = canditer_init(&ci, b, s); if (b->tnonil) return n; p = Tloc(b, 0); @@ -2604,54 +2606,54 @@ BATcount_no_nil(BAT *b) break; case TYPE_bte: for (i = 0; i < n; i++) - cnt += !is_bte_nil(((const bte *) p)[i]); + cnt += !is_bte_nil(((const bte *) p)[canditer_next(&ci) - hseq]); break; case TYPE_sht: for (i = 0; i < n; i++) - cnt += !is_sht_nil(((const sht *) p)[i]); + cnt += !is_sht_nil(((const sht *) p)[canditer_next(&ci) - hseq]); break; case TYPE_int: for (i = 0; i < n; i++) - cnt += !is_int_nil(((const int *) p)[i]); + cnt += !is_int_nil(((const int *) p)[canditer_next(&ci) - hseq]); break; case TYPE_lng: for (i = 0; i < n; i++) - cnt += !is_lng_nil(((const lng *) p)[i]); + cnt += !is_lng_nil(((const lng *) p)[canditer_next(&ci) - hseq]); break; #ifdef HAVE_HGE case TYPE_hge: for (i = 0; i < n; i++) - cnt += !is_hge_nil(((const hge *) p)[i]); + cnt += !is_hge_nil(((const hge *) p)[canditer_next(&ci) - hseq]); break; #endif case TYPE_flt: for (i = 0; i < n; i++) - cnt += !is_flt_nil(((const flt *) p)[i]); + cnt += !is_flt_nil(((const flt *) p)[canditer_next(&ci) - hseq]); break; case TYPE_dbl: for (i = 0; i < n; i++) - cnt += !is_dbl_nil(((const dbl *) p)[i]); + cnt += !is_dbl_nil(((const dbl *) p)[canditer_next(&ci) - hseq]); break; case TYPE_str: base = b->tvheap->base; switch (b->twidth) { case 1: for (i = 0; i < n; i++) - cnt += base[(var_t) ((const unsigned char *) p)[i] + GDK_VAROFFSET] != '\200'; + cnt += base[(var_t) ((const unsigned char *) p)[canditer_next(&ci) - hseq] + GDK_VAROFFSET] != '\200'; break; case 2: for (i = 0; i < n; i++) - cnt += base[(var_t) ((const unsigned short *) p)[i] + GDK_VAROFFSET] != '\200'; + cnt += base[(var_t) ((const unsigned short *) p)[canditer_next(&ci) - hseq] + GDK_VAROFFSET] != '\200'; break; #if SIZEOF_VAR_T != SIZEOF_INT case 4: for (i = 0; i < n; i++) - cnt += base[(var_t) ((const unsigned int *) p)[i]] != '\200'; + cnt += base[(var_t) ((const unsigned int *) p)[canditer_next(&ci) - hseq]] != '\200'; break; #endif default: for (i = 0; i < n; i++) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list