Changeset: 693e7048ae59 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/693e7048ae59 Modified Files: sql/storage/store.c Branch: default Log Message:
Merge with Sep2022 branch. diffs (truncated from 425003 to 300 lines): diff --git a/clients/examples/perl/malsample.pl b/clients/examples/perl/malsample.pl --- a/clients/examples/perl/malsample.pl +++ b/clients/examples/perl/malsample.pl @@ -8,14 +8,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. - use strict; use warnings; use DBI(); diff --git a/clients/examples/perl/sqlsample.pl b/clients/examples/perl/sqlsample.pl --- a/clients/examples/perl/sqlsample.pl +++ b/clients/examples/perl/sqlsample.pl @@ -8,14 +8,6 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. - use strict; use warnings; use DBI(); diff --git a/common/stream/memio.c b/common/stream/memio.c --- a/common/stream/memio.c +++ b/common/stream/memio.c @@ -63,7 +63,6 @@ buffer_get_buf(buffer *b) b->buf = r; return NULL; } - b->len = b->buf ? b->len : 0; b->pos = 0; return r; } diff --git a/monetdb5/mal/Tests/msk000.malC b/monetdb5/mal/Tests/msk000.malC deleted file mode 100644 --- a/monetdb5/mal/Tests/msk000.malC +++ /dev/null @@ -1,75 +0,0 @@ -# scalar tests for msk-type -# the msk type only know true/false, nil is mapped to false - -function foo(); -t := true:msk; -io.print(t); -f := false:msk; -io.print(f); -n := nil:msk; -io.print(n); - -# Coercions should be chosen carefully -# One way is to align it with 0/1 -ti:msk := 1:msk; -io.print(ti); -fi:msk := 0:msk; -io.print(fi); - -tl:= 1:lng; -fl:= 0:lng; -t:msk := tl:msk; -io.print(t); -f:msk := fl:msk; -io.print(f); - -tsv:= 1:sht; -fsv:= 0:bit; -t:msk := tsv:msk; -io.print(t); -f:msk := fsv:msk; -io.print(f); - -tbv:= 1:bit; -fbv:= 0:bit; -t:msk := tbv:msk; -io.print(t); -f:msk := fbv:msk; -io.print(f); - -tfv:= 1:flt; -ffv:= 0:flt; -t:msk := calc.msk(tfv); -io.print(t); -f:msk := calc.msk(ffv); -io.print(f); - -# perhaps case incensitive -t:msk := "t":msk; -io.print(t); -f:msk := "f":msk; -io.print(f); - -t:msk := "T":msk; -io.print(t); -f:msk := "F":msk; -io.print(f); - -t:msk := "true":msk; -io.print(t); -f:msk := "false":msk; -io.print(f); -end foo; - -# the following examples all should cause errors -function error1(); -n:msk := nil:msk; -end error1; - -function error2(); -n:msk := calc.msk(nil); -end error2; - -foo(); -error1(); -error2(); diff --git a/monetdb5/mal/Tests/msk001.malC b/monetdb5/mal/Tests/msk001.malC deleted file mode 100644 --- a/monetdb5/mal/Tests/msk001.malC +++ /dev/null @@ -1,20 +0,0 @@ -# create a simple MSK BAT by appending values -# The MSK should behave like any other BAT although it only holds values from {0,1} - -bv1:= bat.new(:msk); -bat.append(bv1,1:msk); -bat.append(bv1,1:msk); -bat.append(bv1,0:msk); -bat.append(bv1,1:msk); - -io.print(bv1); # this should produce (1,1,0,1) - -# select all elements that are not set -cnd:bat[:oid]:= algebra.select(bv1, nil:bat[:oid], 0, 0, true, true, false); - -io.print(f); # returns 2@0:oid - -# select operations can also return a MASK -m:bat[:msk]:= algebra.select(bv1, nil:bat[:oid], 0, 0, true, true, false); - -io.print(m); # produce 0,0,1 diff --git a/monetdb5/mal/Tests/msk002.malC b/monetdb5/mal/Tests/msk002.malC deleted file mode 100644 --- a/monetdb5/mal/Tests/msk002.malC +++ /dev/null @@ -1,40 +0,0 @@ -# MSK bats are dynamically sized bitvectors. -# The length depends on the bits being set and starts with index 0. -# All bits beyond the last one set are considered 0 -# This allows for bitvectors produced in select() to be cut off and still to be used where appropriate in set operations - -bv2:= bat.new(:msk); -bat.setbit(bv2,1:msk); -bat.setbit(bv2,3:msk); -bat.setbit(bv2,5:msk); -bat.setbit(bv2,7:msk); -bat.setbit(bv2,6:msk); - -io.print(bv2); # should produce 0,1,0,1,0,1,1,1 - -cnt = bat.length(bv1); -io.print(cnt); # MSK bat has 8 elements, the position of the last bit set - -scnt = aggr.count(bv1, 1); -io.print(scnt); # MSK bat has 5 elements set to 1 - -bat.clrbit(bv2,3) -io.print(bv2); # should produce 0,1,0,0,0,1,1,1 - -# MSK bats come with set operations, their underlying size should be the same -bv3:= bat.new(:msk); -bat.setbit(bv2,1); -bat.setbit(bv2,2); -bat.setbit(bv2,5); - -x:= batcalc.and(bv2, bv3); # bv3 is implictly extended with 0 to reach 8 elements -io.print(x) # should produce 0,1,0,0,1 - -y:= batcalc.or(bv2, bv3); -io.print(y) # should produce 0,1,1,1,0,1,1,1 - -z:= batcalc.not(bv2); -io.print(z) # should produce 1,0,0,0,1 -# The negation stops as the last false reported. - -u:bat[:msk] := bat.newmask(8:int, 1:int); #create mask of length 8 and set it to 1. diff --git a/monetdb5/mal/Tests/msk002.stable.err b/monetdb5/mal/Tests/msk002.stable.err deleted file mode 100644 --- a/monetdb5/mal/Tests/msk002.stable.err +++ /dev/null @@ -1,65 +0,0 @@ -stderr of test 'msk002` in directory 'monetdb5/mal` itself: - - -# 12:40:01 > -# 12:40:01 > "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" "--host=/var/tmp/mtest-4031653" "--port=31360" -# 12:40:01 > - -MAPI = (monetdb) /var/tmp/mtest-4031653/.s.monetdb.31360 -QUERY = # MSK bats are dynamically sized bitvectors. - # The length depends on the bits being set and starts with index 0. - # All bits beyond the last one set are considered 0 - # This allows for bitvectors produced in select() to be cut off and still to be used where appropriate in set operations - - bv2:= bat.new(:msk); - bat.setbit(bv2,1:msk); - bat.setbit(bv2,3:msk); - bat.setbit(bv2,5:msk); - bat.setbit(bv2,7:msk); - bat.setbit(bv2,6:msk); - - io.print(bv2); # should produce 0,1,0,1,0,1,1,1 - - cnt = bat.length(bv1); - io.print(cnt); # MSK bat has 8 elements, the position of the last bit set - - scnt = aggr.count(bv1, 1); - io.print(scnt); # MSK bat has 5 elements set to 1 - - bat.clrbit(bv2,3) - io.print(bv2); # should produce 0,1,0,0,0,1,1,1 - - # MSK bats come with set operations, their underlying size should be the same - bv3:= bat.new(:msk); - bat.setbit(bv2,1); - bat.setbit(bv2,2); - bat.setbit(bv2,5); - - x:= batcalc.and(bv2, bv3); # bv3 is implictly extended with 0 to reach 8 elements - io.print(x) # should produce 0,1,0,0,1 - - y:= batcalc.or(bv2, bv3); - io.print(y) # should produce 0,1,1,1,0,1,1,1 - - z:= batcalc.not(bv2); - io.print(z) # should produce 1,0,0,0,1 - # The negation stops as the last false reported. - - u:bat[:msk] := bat.newmask(8:int, 1:int); #create mask of length 8 and set it to 1. - - !SyntaxException:parseError: ^';' expected - !SyntaxException:parseError:scnt = aggr.count(bv1, 1); - !SyntaxException:parseError: ^';' expected - !SyntaxException:parseError:io.print(bv2); # should produce 0,1,0,0,0,1,1,1 - !SyntaxException:parseError:^';' expected - !SyntaxException:parseError:io.print(x) # should produce 0,1,0,0,1 - !SyntaxException:parseError: ^';' expected - !SyntaxException:parseError:io.print(y) # should produce 0,1,1,1,0,1,1,1 - !SyntaxException:parseError: ^';' expected - !SyntaxException:parseError:io.print(z) # should produce 1,0,0,0,1 - !SyntaxException:parseError: ^';' expected - -# 12:40:01 > -# 12:40:01 > "Done." -# 12:40:01 > - diff --git a/monetdb5/mal/Tests/msk002.stable.out b/monetdb5/mal/Tests/msk002.stable.out deleted file mode 100644 --- a/monetdb5/mal/Tests/msk002.stable.out +++ /dev/null @@ -1,12 +0,0 @@ -stdout of test 'msk002` in directory 'monetdb5/mal` itself: - - -# 12:40:01 > -# 12:40:01 > "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8" "--host=/var/tmp/mtest-4031653" "--port=31360" -# 12:40:01 > -Need to be provided - -# 12:40:01 > -# 12:40:01 > "Done." -# 12:40:01 > - diff --git a/monetdb5/mal/Tests/msk003.malC b/monetdb5/mal/Tests/msk003.malC deleted file mode 100644 --- a/monetdb5/mal/Tests/msk003.malC +++ /dev/null @@ -1,22 +0,0 @@ -# Let's explore what happens when we want to support :bat[:msk] vectors - -b := bat.new(:oid); -bat.append(b,1@0); -bat.append(b,3@0); -bat.append(b,5@0); -bat.append(b,6@0); -bat.append(b,8@0); - -bv2:bat[:msk]:= mask.mask(b); -io.print(bv2); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org