MonetDB: Jun2020 - Address bug report 6850. The idle time should...
Changeset: 94b3c1c31e0b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=94b3c1c31e0b Modified Files: monetdb5/mal/mal_client.c monetdb5/mal/mal_runtime.c monetdb5/optimizer/opt_mitosis.c Branch: Jun2020 Log Message: Address bug report 6850. The idle time should be set correctly. diffs (51 lines): diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c --- a/monetdb5/mal/mal_client.c +++ b/monetdb5/mal/mal_client.c @@ -499,13 +499,13 @@ MCstopClients(Client cntxt) int MCactiveClients(void) { - int idles = 0; + int active = 0; Client cntxt = mal_clients; for(cntxt = mal_clients; cntxtidle != 0 && cntxt->mode == RUNCLIENT); + active += (cntxt->idle == 0 && cntxt->mode == RUNCLIENT); } - return idles; + return active; } void diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c --- a/monetdb5/mal/mal_runtime.c +++ b/monetdb5/mal/mal_runtime.c @@ -88,6 +88,7 @@ runtimeProfileInit(Client cntxt, MalBlkP // add new invocation if (i == qtop) { + cntxt->idle = 0; QRYqueue[i].mb = mb; QRYqueue[i].tag = qtag++; QRYqueue[i].stk = stk; // for status pause 'p'/running '0'/ quiting 'q' @@ -136,6 +137,8 @@ runtimeProfileFinish(Client cntxt, MalBl QRYqueue[i].progress =0; QRYqueue[i].stk =0; QRYqueue[i].mb =0; + // assume that the user is now idle + cntxt->idle = time(0); } qtop = j; diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c --- a/monetdb5/optimizer/opt_mitosis.c +++ b/monetdb5/optimizer/opt_mitosis.c @@ -122,6 +122,7 @@ OPTmitosisImplementation(Client cntxt, M * Take into account the number of client connections, * because all user together are responsible for resource contentions */ + cntxt->idle = 0; // this one is definitely not idle activeClients = mb->activeClients = MCactiveClients(); /* This code was used to experiment with block sizes, mis-using the memorylimit variable ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: makelibstreamgreatagain - Add test for \r\n removal acr...
Changeset: 74ba8ae4295a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=74ba8ae4295a Modified Files: common/stream/Tests/read_bz2.stable.out common/stream/Tests/read_gz.stable.out common/stream/Tests/read_lz4.stable.out common/stream/Tests/read_tests.py common/stream/Tests/read_uncompressed.stable.out common/stream/Tests/read_xz.stable.out common/stream/Tests/testdata.py Branch: makelibstreamgreatagain Log Message: Add test for \r\n removal across block boundaries diffs (97 lines): diff --git a/common/stream/Tests/read_bz2.stable.out b/common/stream/Tests/read_bz2.stable.out --- a/common/stream/Tests/read_bz2.stable.out +++ b/common/stream/Tests/read_bz2.stable.out @@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.bz2 Test read rastream block16385_bom.txt.bz2 OK +Test read rstream crlf1024.txt.bz2 OK + +Test read rastream crlf1024.txt.bz2 OK + # 14:14:05 > # 14:14:05 > "Done." # 14:14:05 > diff --git a/common/stream/Tests/read_gz.stable.out b/common/stream/Tests/read_gz.stable.out --- a/common/stream/Tests/read_gz.stable.out +++ b/common/stream/Tests/read_gz.stable.out @@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.gz Test read rastream block16385_bom.txt.gz OK +Test read rstream crlf1024.txt.gz OK + +Test read rastream crlf1024.txt.gz OK + # 14:14:05 > # 14:14:05 > "Done." # 14:14:05 > diff --git a/common/stream/Tests/read_lz4.stable.out b/common/stream/Tests/read_lz4.stable.out --- a/common/stream/Tests/read_lz4.stable.out +++ b/common/stream/Tests/read_lz4.stable.out @@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.lz4 Test read rastream block16385_bom.txt.lz4 OK +Test read rstream crlf1024.txt.lz4 OK + +Test read rastream crlf1024.txt.lz4 OK + # 14:14:05 > # 14:14:05 > "Done." # 14:14:05 > diff --git a/common/stream/Tests/read_tests.py b/common/stream/Tests/read_tests.py --- a/common/stream/Tests/read_tests.py +++ b/common/stream/Tests/read_tests.py @@ -44,6 +44,12 @@ def gen_docs(): size = base_size + delta yield from gen_bom_compr_variants(f'block{size}', input, size) +# \r at end of first block, \n at start of next +head = (1023 * b'a') + b'\r\n' + (20 * b'b') + b'\r\n' + (20 * b'c') +# word of wisdom: you have to test your tests +assert head[:1024].endswith(b'\r') +assert head[1024:].startswith(b'\n') +yield from gen_compr_variants('crlf1024.txt', head, None) def test_read(opener, text_mode, doc): filename = doc.write_tmp() diff --git a/common/stream/Tests/read_uncompressed.stable.out b/common/stream/Tests/read_uncompressed.stable.out --- a/common/stream/Tests/read_uncompressed.stable.out +++ b/common/stream/Tests/read_uncompressed.stable.out @@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt OK Test read rastream block16385_bom.txt OK +Test read rstream crlf1024.txt OK + +Test read rastream crlf1024.txt OK + # 14:11:30 > # 14:11:30 > "Done." # 14:11:30 > diff --git a/common/stream/Tests/read_xz.stable.out b/common/stream/Tests/read_xz.stable.out --- a/common/stream/Tests/read_xz.stable.out +++ b/common/stream/Tests/read_xz.stable.out @@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.xz Test read rastream block16385_bom.txt.xz OK +Test read rstream crlf1024.txt.xz OK + +Test read rastream crlf1024.txt.xz OK + # 14:14:06 > # 14:14:06 > "Done." # 14:14:06 > diff --git a/common/stream/Tests/testdata.py b/common/stream/Tests/testdata.py --- a/common/stream/Tests/testdata.py +++ b/common/stream/Tests/testdata.py @@ -71,7 +71,6 @@ class Doc: else: raise Exception("Unknown compression scheme: " + self.compression) f.write(self.content) -f.close() return filename # Read contents of the given file, decompressing appropriately ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: makelibstreamgreatagain - Generate testdata to stdout i...
Changeset: 0e68be865954 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0e68be865954 Modified Files: common/stream/Tests/read_tests.py common/stream/Tests/testdata.py Branch: makelibstreamgreatagain Log Message: Generate testdata to stdout if required for manual testing diffs (57 lines): diff --git a/common/stream/Tests/read_tests.py b/common/stream/Tests/read_tests.py --- a/common/stream/Tests/read_tests.py +++ b/common/stream/Tests/read_tests.py @@ -94,6 +94,15 @@ def all_tests(filename_filter): if __name__ == "__main__": -docname = "small.txt.gz" -doc = [d for d in gen_docs()][0] -test_read('rastream', True, doc) +# generate test data for manual testing +if len(sys.argv) == 1: +for d in gen_docs(): +print(d.name) +elif len(sys.argv) == 2: +for d in gen_docs(): +if d.name == sys.argv[1]: +d.write(sys.stdout.buffer) +else: +print("Usage: python3 read_tests.py [TESTDATANAME]", file=sys.stderr) +sys.exit(1) + diff --git a/common/stream/Tests/testdata.py b/common/stream/Tests/testdata.py --- a/common/stream/Tests/testdata.py +++ b/common/stream/Tests/testdata.py @@ -51,18 +51,23 @@ class Doc: if length_limit != None: self.content = self.content[:length_limit] -# not sure if this is the right API -def write(self, filename): +def write(self, filename_or_fileobj): +if hasattr(filename_or_fileobj, "write"): +filename = None +fileobj = filename_or_fileobj +else: +filename = filename_or_fileobj +fileobj = open(filename, 'wb') if not self.compression: -f = open(filename, 'wb') +f = fileobj elif self.compression == 'gz': -f = gzip.GzipFile(filename, 'wb', mtime=131875200, compresslevel=1) +f = gzip.GzipFile(filename, 'wb', fileobj=fileobj, mtime=131875200, compresslevel=1) elif self.compression == 'bz2': -f = bz2.BZ2File(filename, 'wb', compresslevel=1) +f = bz2.BZ2File(fileobj, 'wb', compresslevel=1) elif self.compression == 'xz': -f = lzma.LZMAFile(filename, 'wb', preset=1) -elif self.compression == 'lz4': -f = lz4.frame.LZ4FrameFile(filename, 'wb', compression_level=1) +f = lzma.LZMAFile(fileobj, 'wb', preset=1) +elif self.compression == 'lz4': # ok +f = lz4.frame.LZ4FrameFile(fileobj, 'wb', compression_level=1) else: raise Exception("Unknown compression scheme: " + self.compression) f.write(self.content) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: makelibstreamgreatagain - Annotate stream.h: where and ...
Changeset: 605e033587fe for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=605e033587fe Modified Files: common/stream/stream.c common/stream/stream.h Branch: makelibstreamgreatagain Log Message: Annotate stream.h: where and how often are things used? diffs (252 lines): diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -571,7 +571,8 @@ isa_block_stream(const stream *s) /* Put here because I need to think very carefully about this - * mnstr_read(,, 0, 0). */ + * mnstr_read(,, 0, 0). What would that mean? + */ ssize_t mnstr_read_block(stream *restrict s, void *restrict buf, size_t elmsize, size_t cnt) { diff --git a/common/stream/stream.h b/common/stream/stream.h --- a/common/stream/stream.h +++ b/common/stream/stream.h @@ -89,87 +89,87 @@ stream_export int mnstr_init(void); * 0 on error * !0 on success */ -stream_export int mnstr_readBte(stream *restrict s, int8_t *restrict val); -stream_export int mnstr_readChr(stream *restrict s, char *restrict val); -stream_export int mnstr_writeChr(stream *s, char val); +stream_export int mnstr_readBte(stream *restrict s, int8_t *restrict val); // unused +stream_export int mnstr_readChr(stream *restrict s, char *restrict val); // used once in gdk_logger.c +stream_export int mnstr_writeChr(stream *s, char val); // used once in gdk_logger and mclient.c +stream_export int mnstr_writeBte(stream *s, int8_t val); // used in sql_result.c/mapi10 -stream_export int mnstr_writeBte(stream *s, int8_t val); -stream_export int mnstr_readSht(stream *restrict s, int16_t *restrict val); -stream_export int mnstr_writeSht(stream *s, int16_t val); -stream_export int mnstr_readInt(stream *restrict s, int *restrict val); -stream_export int mnstr_writeInt(stream *s, int val); -stream_export int mnstr_readLng(stream *restrict s, int64_t *restrict val); -stream_export int mnstr_writeLng(stream *s, int64_t val); +stream_export int mnstr_readSht(stream *restrict s, int16_t *restrict val); // unused +stream_export int mnstr_writeSht(stream *s, int16_t val); // used in sql_result.c/mapi10 +stream_export int mnstr_readInt(stream *restrict s, int *restrict val); // used in gdk +stream_export int mnstr_writeInt(stream *s, int val); // used in gdk +stream_export int mnstr_readLng(stream *restrict s, int64_t *restrict val); // used in gdk_logger.c +stream_export int mnstr_writeLng(stream *s, int64_t val); // used in gdk_logger.c, sql_result.c/mapi10 -stream_export int mnstr_writeFlt(stream *s, float val); -stream_export int mnstr_writeDbl(stream *s, double val); +stream_export int mnstr_writeFlt(stream *s, float val); // sql_result.c/mapi10 +stream_export int mnstr_writeDbl(stream *s, double val); // sql_result.c/mapi10 #ifdef HAVE_HGE -stream_export int mnstr_readHge(stream *restrict s, hge *restrict val); -stream_export int mnstr_writeHge(stream *s, hge val); +stream_export int mnstr_readHge(stream *restrict s, hge *restrict val); // unused +stream_export int mnstr_writeHge(stream *s, hge val); // sql_result.c/mapi10 #endif -stream_export int mnstr_readBteArray(stream *restrict s, int8_t *restrict val, size_t cnt); +stream_export int mnstr_readBteArray(stream *restrict s, int8_t *restrict val, size_t cnt); // unused stream_export int mnstr_writeBteArray(stream *restrict s, const int8_t *restrict val, size_t cnt); -stream_export int mnstr_writeStr(stream *restrict s, const char *restrict val); -stream_export int mnstr_readStr(stream *restrict s, char *restrict val); +stream_export int mnstr_writeStr(stream *restrict s, const char *restrict val); // sql_result.c/mapi10 +stream_export int mnstr_readStr(stream *restrict s, char *restrict val); // unused -stream_export int mnstr_readShtArray(stream *restrict s, int16_t *restrict val, size_t cnt); -stream_export int mnstr_writeShtArray(stream *restrict s, const int16_t *restrict val, size_t cnt); -stream_export int mnstr_readIntArray(stream *restrict s, int *restrict val, size_t cnt); -stream_export int mnstr_writeIntArray(stream *restrict s, const int *restrict val, size_t cnt); -stream_export int mnstr_readLngArray(stream *restrict s, int64_t *restrict val, size_t cnt); -stream_export int mnstr_writeLngArray(stream *restrict s, const int64_t *restrict val, size_t cnt); +stream_export int mnstr_readShtArray(stream *restrict s, int16_t *restrict val, size_t cnt); // unused +stream_export int mnstr_writeShtArray(stream *restrict s, const int16_t *restrict val, size_t cnt); //unused +stream_export int mnstr_readIntArray(stream *restrict s, int *restrict val, size_t cnt); // used once in geom.c +stream_export int mnstr_writeIntArray(stream *restrict s, const int *restrict val, size_t cnt); // used once in geom.c +stream_export int mnstr_readLngArray(stream *restrict s, int64_t *restrict val, size_t cnt); // unused +stream_export int mnstr_writeLngArray(stream *restrict s, const int64_t *restric
MonetDB: makelibstreamgreatagain - Finish splitting stream.c int...
Changeset: 96e82731c99d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=96e82731c99d Added Files: common/stream/blackhole.c common/stream/bs.c common/stream/bs2.c common/stream/bstream.c common/stream/callback.c common/stream/fwf.c common/stream/memio.c common/stream/rw.c common/stream/tmpl Removed Files: common/stream/oldcode.c Modified Files: common/stream/Makefile.ag common/stream/stream.c common/stream/stream_internal.h Branch: makelibstreamgreatagain Log Message: Finish splitting stream.c into separate files diffs (truncated from 4489 to 300 lines): diff --git a/common/stream/Makefile.ag b/common/stream/Makefile.ag --- a/common/stream/Makefile.ag +++ b/common/stream/Makefile.ag @@ -17,10 +17,12 @@ INCLUDES = ../utils \ $(curl_CFLAGS) lib_stream = { - SOURCES = oldcode.c stream.c \ + SOURCES = stream.c rw.c bstream.c \ + bs.c bs2.c \ stdio_stream.c \ gz_stream.c bz2_stream.c xz_stream.c lz4_stream.c \ url_stream.c socket_stream.c \ + memio.c callback.c blackhole.c fwf.c \ iconv_stream.c \ misc.c \ stream.h stream_internal.h stream_socket.h diff --git a/common/stream/blackhole.c b/common/stream/blackhole.c new file mode 100644 --- /dev/null +++ b/common/stream/blackhole.c @@ -0,0 +1,45 @@ +/* + * 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 - 2020 MonetDB B.V. + */ + +#include "monetdb_config.h" +#include "stream.h" +#include "stream_internal.h" + + + +static ssize_t +stream_blackhole_write(stream *restrict s, const void *restrict buf, size_t elmsize, size_t cnt) +{ + (void) s; + (void) buf; + (void) elmsize; + return (ssize_t) cnt; +} + +static void +stream_blackhole_close(stream *s) +{ + (void) s; + /* no resources to close */ +} + +stream * +stream_blackhole_create(void) +{ + stream *s; + if ((s = create_stream("blackhole")) == NULL) { + return NULL; + } + + s->read = NULL; + s->write = stream_blackhole_write; + s->close = stream_blackhole_close; + s->flush = NULL; + s->readonly = false; + return s; +} diff --git a/common/stream/bs.c b/common/stream/bs.c new file mode 100644 --- /dev/null +++ b/common/stream/bs.c @@ -0,0 +1,398 @@ +/* + * 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 - 2020 MonetDB B.V. + */ + +#include "monetdb_config.h" +#include "stream.h" +#include "stream_internal.h" + + +/* -- */ + +/* A buffered stream consists of a sequence of blocks. Each block + * consists of a count followed by the data in the block. A flush is + * indicated by an empty block (i.e. just a count of 0). + */ + +static bs * +bs_create(stream *s) +{ + /* should be a binary stream */ + bs *ns; + + if ((ns = malloc(sizeof(*ns))) == NULL) + return NULL; + *ns = (bs) { + .s = s, + }; + return ns; +} + +/* Collect data until the internal buffer is filled, then write the + * filled buffer to the underlying stream. + * Struct field usage: + * s - the underlying stream; + * buf - the buffer in which data is collected; + * nr - how much of buf is already filled (if nr == sizeof(buf) the + * data is written to the underlying stream, so upon entry nr < + * sizeof(buf)); + * itotal - unused. + */ +ssize_t +bs_write(stream *restrict ss, const void *restrict buf, size_t elmsize, size_t cnt) +{ + bs *s; + size_t todo = cnt * elmsize; + uint16_t blksize; + + s = (bs *) ss->stream_data.p; + if (s == NULL) + return -1; + assert(!ss->readonly); + assert(s->nr < sizeof(s->buf)); + while (todo > 0) { + size_t n = sizeof(s->buf) - s->nr; + + if (todo < n) + n = todo; + memcpy(s->buf + s->nr, buf, n); + s->nr += (unsigned) n; + todo -= n; + buf = ((const char *) buf + n); + if (s->nr == sizeof(s->buf)) { + /* block is full, write it to the stream */ +#ifdef BSTREAM_DEBUG + { + unsigned i; + + fprintf(stderr, "W %s %u \"", ss->name, s->nr); + for (i = 0; i < s->nr; i++) +
MonetDB: scoping - Updated TODO and error message
Changeset: 7cbeb0766846 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7cbeb0766846 Modified Files: sql/test/scoping/Tests/scoping01.sql sql/test/scoping/Tests/scoping01.stable.err Branch: scoping Log Message: Updated TODO and error message diffs (41 lines): diff --git a/sql/test/scoping/Tests/scoping01.sql b/sql/test/scoping/Tests/scoping01.sql --- a/sql/test/scoping/Tests/scoping01.sql +++ b/sql/test/scoping/Tests/scoping01.sql @@ -1,8 +1,9 @@ ---TODO transaction management +-- temp tables precedence +-- hash lookup for variables +-- TODO transaction management -- Test variables with different schemas and scoping levels --- Update rel_read and RAstatemet --- Check what must be persisted -- upgrade drop dt_schema +-- drop tables and variables? declare i integer; set i = 1234; @@ -50,6 +51,8 @@ SELECT tests_scopes2(vals) FROM (VALUES -- 2 -- 3 +with a(i) as (select 4) select i from tmp1, a; --error, ambiguous identifier 'i' + DROP TABLE tmp1; DROP TABLE tmp2; DROP FUNCTION tests_scopes1(INT); diff --git a/sql/test/scoping/Tests/scoping01.stable.err b/sql/test/scoping/Tests/scoping01.stable.err --- a/sql/test/scoping/Tests/scoping01.stable.err +++ b/sql/test/scoping/Tests/scoping01.stable.err @@ -60,7 +60,11 @@ MAPI = (monetdb) /var/tmp/mtest-183822/ QUERY = SELECT tests_scopes1(vals) FROM (VALUES (1),(2),(3)) AS vals(vals); --will trigger error ERROR = !SELECT: no such unary operator 'tests_scopes1(tinyint)' CODE = 42000 -MAPI = (monetdb) /var/tmp/mtest-183822/.s.monetdb.31204 +MAPI = (monetdb) /var/tmp/mtest-362309/.s.monetdb.34330 +QUERY = with a(i) as (select 4) select i from tmp1, a; --error, ambiguous identifier 'i' +ERROR = !SELECT: identifier 'i' ambiguous +CODE = 42000 +MAPI = (monetdb) /var/tmp/mtest-362309/.s.monetdb.34330 QUERY = DROP FUNCTION tests_scopes1(INT); ERROR = !DROP FUNCTION: no such function 'tests_scopes1' (int(32)) CODE = 42000 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mbedded - use new GDKinit/mal_init
Changeset: a6daf1590b73 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a6daf1590b73 Modified Files: tools/mserver/shutdowntest.c Branch: mbedded Log Message: use new GDKinit/mal_init diffs (24 lines): diff --git a/tools/mserver/shutdowntest.c b/tools/mserver/shutdowntest.c --- a/tools/mserver/shutdowntest.c +++ b/tools/mserver/shutdowntest.c @@ -131,7 +131,7 @@ static str monetdb_initialize(void) { retval = GDKstrdup("BBPaddfarm failed"); goto cleanup; } - if (GDKinit(set, setlen) != GDK_SUCCEED) { + if (GDKinit(set, setlen, 1) != GDK_SUCCEED) { retval = GDKstrdup("GDKinit() failed"); goto cleanup; } @@ -269,7 +269,10 @@ static str monetdb_initialize(void) { exit(1); } - if (mal_init() != 0) { // mal_init() does not return meaningful codes on failure + char *modules[2]; + modules[0] = "sql"; + modules[1] = 0; + if (mal_init(modules, 1) != 0) { // mal_init() does not return meaningful codes on failure retval = GDKstrdup("mal_init() failed"); goto cleanup; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mbedded - merged with default
Changeset: b2efdca7d3db for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2efdca7d3db Modified Files: MonetDB.spec NT/Makefile NT/rules.msc NT/winconfig.py buildtools/autogen/autogen/am.py buildtools/autogen/autogen/msc.py debian/changelog gdk/gdk.h gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_hash.c gdk/gdk_imprints.c gdk/gdk_orderidx.c gdk/gdk_storage.c gdk/gdk_system.c gdk/gdk_system.h gdk/gdk_utils.c monetdb5/mal/mal_client.c monetdb5/mal/mal_dataflow.c monetdb5/modules/mal/mal_mapi.c monetdb5/modules/mal/tablet.c monetdb5/optimizer/opt_support.c sql/ChangeLog.Jun2020 sql/backends/monet5/mal_backend.c sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_upgrades.c sql/common/sql_types.c sql/scripts/51_sys_schema_extension.sql sql/server/rel_exp.c sql/server/rel_select.c sql/server/rel_unnest.c sql/server/rel_updates.c sql/server/sql_atom.c sql/server/sql_parser.y sql/server/sql_partition.c sql/server/sql_query.c sql/server/sql_scan.c sql/server/sql_semantic.c sql/server/sql_tokens.h sql/storage/bat/bat_storage.c sql/storage/sql_storage.h sql/storage/store.c sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql sql/test/Tests/hot-snapshot.py 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.err sql/test/subquery/Tests/subquery5.sql sql/test/subquery/Tests/subquery5.stable.err sql/test/subquery/Tests/subquery5.stable.out testing/Mtest.py.in Branch: mbedded Log Message: merged with default diffs (truncated from 1500 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -5062,20 +5062,20 @@ fi * Fri May 13 2011 Sjoerd Mullender - 11.3.3-20110517 - gdk: Fixed a bug where large files (> 2GB) didn't always get deleted on -Windows. + Windows. * Wed May 11 2011 Fabian Groffen - 11.3.3-20110517 - java: Insertion via PreparedStatement and retrieval via ResultSet of timestamp -and time fields with and without timezones was improved to better -respect timezones, as partly indicated in bug #2781. + and time fields with and without timezones was improved to better + respect timezones, as partly indicated in bug #2781. * Wed May 11 2011 Sjoerd Mullender - 11.3.3-20110517 - monetdb5: Fixed a bug in conversion from string to the URL type. The bug was -an incorrect call to free(). + an incorrect call to free(). * Wed Apr 27 2011 Sjoerd Mullender - 11.3.3-20110517 - geom: Fixed various problems so that now all our tests work correctly on -all our testing platforms. + all our testing platforms. * Thu Apr 21 2011 Sjoerd Mullender - 11.3.1-20110421 - Rebuilt. diff --git a/NT/Makefile b/NT/Makefile --- a/NT/Makefile +++ b/NT/Makefile @@ -64,7 +64,6 @@ targetdirs: if not exist "$(libexecdir)"$(MKDIR) "$(libexecdir)" if not exist "$(datadir)" $(MKDIR) "$(datadir)" if not exist "$(sysconfdir)"$(MKDIR) "$(sysconfdir)" - if not exist "$(sharedstatedir)"$(MKDIR) "$(sharedstatedir)" if not exist "$(localstatedir)" $(MKDIR) "$(localstatedir)" if not exist "$(libdir)"$(MKDIR) "$(libdir)" if not exist "$(infodir)" $(MKDIR) "$(infodir)" diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -218,7 +218,6 @@ sbindir = $(exec_prefix)\sbin libexecdir = $(exec_prefix)\libexec datadir = $(prefix)\share sysconfdir = $(prefix)\etc -sharedstatedir = $(prefix)\com localstatedir = $(prefix)\var libdir = $(exec_prefix)\lib infodir = $(prefix)\info diff --git a/NT/winconfig.py b/NT/winconfig.py --- a/NT/winconfig.py +++ b/NT/winconfig.py @@ -18,7 +18,6 @@ subs = [("@exec_prefix@", r'%prefix%'), ("@datadir@", r'%prefix%\share'), ("@datarootdir@", r'%prefix%\share'), ("@sysconfdir@", r'%prefix%\etc'), -("@sharedstatedir@", r'%prefix%\com'), ("@localstatedir@", r'%prefix%\var'), ("@libdir@", r'%exec_prefix%\lib'), ("@infodir@", r'%prefix%\info'), diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -853,7 +853,7 @@ def am_translate_dir(path, am): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgin
MonetDB: Jun2020 - SQL MAL statements that should be labeled unsafe
Changeset: eb3e9834cb5e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb3e9834cb5e Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 sql/backends/monet5/sql.mal sql/backends/monet5/sql_session.mal sql/backends/monet5/sql_transaction.mal Branch: Jun2020 Log Message: SQL MAL statements that should be labeled unsafe diffs (truncated from 662 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -11357,9 +11357,9 @@ stdout of test 'MAL-signatures` in direc [ "batsql","lead", "pattern batsql.lead(b:bat[:any_1], p:any_3, o:any_4):bat[:any_1] ","SQLlead;", "return the value in the next row in the partition or NULL if non existent" ] [ "batsql","max", "pattern batsql.max(b:bat[:any_1], s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLmax;", "return the maximum of groups" ] [ "batsql","min", "pattern batsql.min(b:bat[:any_1], s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLmin;", "return the minimum of groups" ] -[ "batsql","next_value", "pattern batsql.next_value(sname:bat[:str], sequence:bat[:str]):bat[:lng] ","mvc_bat_next_value;", "return the next value of sequences"] -[ "batsql","next_value", "pattern batsql.next_value(sname:bat[:str], sequence:str):bat[:lng] ", "mvc_bat_next_value;", "return the next value of the sequence" ] -[ "batsql","next_value", "pattern batsql.next_value(sname:str, sequence:bat[:str]):bat[:lng] ", "mvc_bat_next_value;", "return the next value of sequences"] +[ "batsql","next_value", "unsafe pattern batsql.next_value(sname:bat[:str], sequence:bat[:str]):bat[:lng] ", "mvc_bat_next_value;", "return the next value of sequences"] +[ "batsql","next_value", "unsafe pattern batsql.next_value(sname:bat[:str], sequence:str):bat[:lng] ", "mvc_bat_next_value;", "return the next value of the sequence" ] +[ "batsql","next_value", "unsafe pattern batsql.next_value(sname:str, sequence:bat[:str]):bat[:lng] ", "mvc_bat_next_value;", "return the next value of sequences"] [ "batsql","nth_value","pattern batsql.nth_value(b:any_1, n:bat[:any_2], s:lng, e:lng):bat[:any_1] ", "SQLnth_value;","return the nth value of each group"] [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], n:any_2, s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLnth_value;", "return the nth value of each group"] [ "batsql","nth_value","pattern batsql.nth_value(b:bat[:any_1], n:bat[:any_2], s:bat[:lng], e:bat[:lng]):bat[:any_1] ","SQLnth_value;", "return the nth value of each group"] @@ -14009,16 +14009,16 @@ stdout of test 'MAL-signatures` in direc [ "shp", "attach", "pattern shp.attach(filename:str):void ", "SHPattach;", "Register an ESRI Shapefile in the vault catalog" ] [ "shp", "import", "pattern shp.import(fileid:int):void ", "SHPimport;", "Import an ESRI Shapefile with given id into the vault" ] [ "shp", "import", "pattern shp.import(fileid:int, po:wkb):void ", "SHPpartialimport;","Partially import an ESRI Shapefile with given id into the vault" ] -[ "sql", "abort","pattern sql.abort():void ","SQLabort;", "Trigger the abort operation for a MAL block" ] +[ "sql", "abort","unsafe pattern sql.abort():void ", "SQLabort;","Trigger the abort operation for a MAL block" ] [ "sql", "affectedRows", "unsafe pattern sql.affectedRows(mvc:int, nr:lng):int ","mvc_affected_rows_wrap;", "export the number of affected rows by the current query" ] [ "sql", "all", "inline function sql.all(b:bat[:any_1], gp:bat[:oid], gpe:bat[:oid], no_nil:bit):bat[:any_1];", "", "" ] [ "sql", "all", "command sql.all(col:bat[:any_1]):any_1 ", "SQLall;", "if all values in col are equal return this, else nil" ] [ "sql", "all", "command sql.all(cmp:bit, nl:bit, nr:bit):bit ", "SQLall_cmp;", "if !cmp then false, (nl or nr) then nil, else true"] [ "sql", "alpha","command sql.alpha(dec:dbl, theta:dbl):dbl ", "SQLcst_alpha_cst;","Implementation of astronomy alpha function: expands the radius theta depending on the declination" ] -[ "sql", "analyze", "pattern sql.analyze(minmax:int, sample:lng):void ","sql_analyze;", "" ] -[ "sql", "analyze", "pattern sql.analyze(minmax:int, sample:lng, sch:str):void ", "sql_analyze;", "" ] -[ "sql", "analyze", "pattern sql.analyze(minmax:int, sample:lng, sch:str, tbl:str):void ", "sql_analyze;", "" ] -[ "sql", "analyze", "pattern sql.analyze(minmax:int, sample
MonetDB: Jun2020 - Same % mistake on Jun2020 branch.
Changeset: 05d23e8dc443 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=05d23e8dc443 Modified Files: sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_gencode.c Branch: Jun2020 Log Message: Same % mistake on Jun2020 branch. Visual Studio Code inducts in error for this character on strings. diffs (24 lines): diff --git a/sql/backends/monet5/sql_execute.c b/sql/backends/monet5/sql_execute.c --- a/sql/backends/monet5/sql_execute.c +++ b/sql/backends/monet5/sql_execute.c @@ -966,7 +966,7 @@ RAstatement2(Client cntxt, MalBlkPtr mb, list *types_list = sa_list(m->sa); str token, rest; - for (token = strtok_r(types, "%%", &rest); token; token = strtok_r(NULL, "%%", &rest)) + for (token = strtok_r(types, "%", &rest); token; token = strtok_r(NULL, "%", &rest)) list_append(types_list, token); if (list_length(types_list) != list_length(rel->exps)) diff --git a/sql/backends/monet5/sql_gencode.c b/sql/backends/monet5/sql_gencode.c --- a/sql/backends/monet5/sql_gencode.c +++ b/sql/backends/monet5/sql_gencode.c @@ -500,7 +500,7 @@ static int buf = tmp; } - nr += snprintf(buf+nr, len-nr, "%s%s", next, n->next?"%%":""); + nr += snprintf(buf+nr, len-nr, "%s%s", next, n->next?"%":""); GDKfree(next); } if (buf) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: scoping - My mistake, % is an escape character only on ...
Changeset: c0d7bd30c8e6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c0d7bd30c8e6 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_statement.c sql/server/rel_semantic.c sql/server/rel_sequence.c Branch: scoping Log Message: My mistake, % is an escape character only on printf-like functions diffs (86 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 @@ -1654,14 +1654,14 @@ exp2bin_args(backend *be, sql_exp *e, li nme = SA_NEW_ARRAY(be->mvc->sa, char, strlen(vname->sname) + strlen(vname->name) + 5); if (!nme) return NULL; - stpcpy(stpcpy(stpcpy(stpcpy(nme, "A0%%"), vname->sname), "%%"), vname->name); /* mangle variable name */ + stpcpy(stpcpy(stpcpy(stpcpy(nme, "A0%"), vname->sname), "%"), vname->name); /* mangle variable name */ } else { /* Parameter or local variable */ char levelstr[16]; snprintf(levelstr, sizeof(levelstr), "%u", e->flag); nme = SA_NEW_ARRAY(be->mvc->sa, char, strlen(levelstr) + strlen(vname->name) + 3); if (!nme) return NULL; - stpcpy(stpcpy(stpcpy(stpcpy(nme, "A"), levelstr), "%%"), vname->name); /* mangle variable name */ + stpcpy(stpcpy(stpcpy(stpcpy(nme, "A"), levelstr), "%"), vname->name); /* mangle variable name */ } if (!list_find(args, nme, (fcmp)&alias_cmp)) { stmt *s = stmt_var(be, vname->sname, vname->name, &e->tpe, 0, 0); diff --git a/sql/backends/monet5/sql_gencode.c b/sql/backends/monet5/sql_gencode.c --- a/sql/backends/monet5/sql_gencode.c +++ b/sql/backends/monet5/sql_gencode.c @@ -1346,7 +1346,7 @@ backend_create_sql_func(backend *be, sql if (a->name) { buf = SA_NEW_ARRAY(m->sa, char, strlen(a->name) + 4); if (buf) - stpcpy(stpcpy(buf, "A1%%"), a->name); /* mangle variable name */ + stpcpy(stpcpy(buf, "A1%"), a->name); /* mangle variable name */ } else { buf = SA_NEW_ARRAY(m->sa, char, IDLENGTH); if (buf) 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 @@ -337,7 +337,7 @@ stmt_var(backend *be, const char *sname, buf = SA_NEW_ARRAY(be->mvc->sa, char, strlen(levelstr) + strlen(varname) + 3); if (!buf) return NULL; - stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%%"), varname); /* mangle variable name */ + stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%"), varname); /* mangle variable name */ q = newAssignment(mb); q = pushArgumentId(mb, q, buf); } else { @@ -349,7 +349,7 @@ stmt_var(backend *be, const char *sname, buf = SA_NEW_ARRAY(be->mvc->sa, char, strlen(levelstr) + strlen(varname) + 3); if (!buf) return NULL; - stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%%"), varname); /* mangle variable name */ + stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%"), varname); /* mangle variable name */ q = newInstruction(mb, NULL, NULL); if (q == NULL) { @@ -3792,7 +3792,7 @@ stmt_assign(backend *be, const char *sna buf = SA_NEW_ARRAY(be->mvc->sa, char, strlen(levelstr) + strlen(varname) + 3); if (!buf) return NULL; - stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%%"), varname); /* mangle variable name */ + stpcpy(stpcpy(stpcpy(stpcpy(buf, "A"), levelstr), "%"), varname); /* mangle variable name */ q = newInstruction(mb, NULL, NULL); if (q == NULL) { return NULL; diff --git a/sql/server/rel_semantic.c b/sql/server/rel_semantic.c --- a/sql/server/rel_semantic.c +++ b/sql/server/rel_semantic.c @@ -200,7 +200,7 @@ rel_semantic(sql_query *query, symbol *s dnode *d; sql_rel *r = NULL; - if (!stack_push_frame(sql, "%%MUL")) + if (!stack_push_frame(sql, "%MUL")) return sql_error(sql, 02, SQLSTATE(HY013)
MonetDB: scoping - Merged with default
Changeset: 5551b6da3006 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5551b6da3006 Modified Files: MonetDB.spec NT/Makefile NT/rules.msc NT/winconfig.py buildtools/autogen/autogen/am.py buildtools/autogen/autogen/msc.py debian/changelog sql/ChangeLog.Jun2020 sql/backends/monet5/sql_upgrades.c sql/scripts/51_sys_schema_extension.sql sql/server/rel_select.c sql/server/rel_updates.c sql/server/sql_parser.y sql/server/sql_scan.c sql/server/sql_tokens.h sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql 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/subquery/Tests/subquery5.sql sql/test/subquery/Tests/subquery5.stable.err testing/Mtest.py.in Branch: scoping Log Message: Merged with default diffs (truncated from 638 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -5062,20 +5062,20 @@ fi * Fri May 13 2011 Sjoerd Mullender - 11.3.3-20110517 - gdk: Fixed a bug where large files (> 2GB) didn't always get deleted on -Windows. + Windows. * Wed May 11 2011 Fabian Groffen - 11.3.3-20110517 - java: Insertion via PreparedStatement and retrieval via ResultSet of timestamp -and time fields with and without timezones was improved to better -respect timezones, as partly indicated in bug #2781. + and time fields with and without timezones was improved to better + respect timezones, as partly indicated in bug #2781. * Wed May 11 2011 Sjoerd Mullender - 11.3.3-20110517 - monetdb5: Fixed a bug in conversion from string to the URL type. The bug was -an incorrect call to free(). + an incorrect call to free(). * Wed Apr 27 2011 Sjoerd Mullender - 11.3.3-20110517 - geom: Fixed various problems so that now all our tests work correctly on -all our testing platforms. + all our testing platforms. * Thu Apr 21 2011 Sjoerd Mullender - 11.3.1-20110421 - Rebuilt. diff --git a/NT/Makefile b/NT/Makefile --- a/NT/Makefile +++ b/NT/Makefile @@ -64,7 +64,6 @@ targetdirs: if not exist "$(libexecdir)"$(MKDIR) "$(libexecdir)" if not exist "$(datadir)" $(MKDIR) "$(datadir)" if not exist "$(sysconfdir)"$(MKDIR) "$(sysconfdir)" - if not exist "$(sharedstatedir)"$(MKDIR) "$(sharedstatedir)" if not exist "$(localstatedir)" $(MKDIR) "$(localstatedir)" if not exist "$(libdir)"$(MKDIR) "$(libdir)" if not exist "$(infodir)" $(MKDIR) "$(infodir)" diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -218,7 +218,6 @@ sbindir = $(exec_prefix)\sbin libexecdir = $(exec_prefix)\libexec datadir = $(prefix)\share sysconfdir = $(prefix)\etc -sharedstatedir = $(prefix)\com localstatedir = $(prefix)\var libdir = $(exec_prefix)\lib infodir = $(prefix)\info diff --git a/NT/winconfig.py b/NT/winconfig.py --- a/NT/winconfig.py +++ b/NT/winconfig.py @@ -18,7 +18,6 @@ subs = [("@exec_prefix@", r'%prefix%'), ("@datadir@", r'%prefix%\share'), ("@datarootdir@", r'%prefix%\share'), ("@sysconfdir@", r'%prefix%\etc'), -("@sharedstatedir@", r'%prefix%\com'), ("@localstatedir@", r'%prefix%\var'), ("@libdir@", r'%exec_prefix%\lib'), ("@infodir@", r'%prefix%\info'), diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -853,7 +853,7 @@ def am_translate_dir(path, am): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" dir = dir + rest diff --git a/buildtools/autogen/autogen/msc.py b/buildtools/autogen/autogen/msc.py --- a/buildtools/autogen/autogen/msc.py +++ b/buildtools/autogen/autogen/msc.py @@ -147,7 +147,7 @@ def msc_translate_dir(path, msc): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" if rest: diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -5846,29 +5846,29 @
MonetDB: default - Merged with Jun2020
Changeset: f3fa4abc4ee8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f3fa4abc4ee8 Modified Files: MonetDB.spec NT/Makefile NT/rules.msc NT/winconfig.py buildtools/autogen/autogen/am.py buildtools/autogen/autogen/msc.py debian/changelog monetdb5/optimizer/opt_support.c sql/ChangeLog.Jun2020 sql/backends/monet5/sql_upgrades.c sql/scripts/51_sys_schema_extension.sql sql/server/rel_select.c sql/server/rel_updates.c sql/server/sql_parser.y sql/server/sql_scan.c sql/server/sql_tokens.h sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql 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/subquery/Tests/subquery5.sql sql/test/subquery/Tests/subquery5.stable.err testing/Mtest.py.in Branch: default Log Message: Merged with Jun2020 diffs (truncated from 654 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -5062,20 +5062,20 @@ fi * Fri May 13 2011 Sjoerd Mullender - 11.3.3-20110517 - gdk: Fixed a bug where large files (> 2GB) didn't always get deleted on -Windows. + Windows. * Wed May 11 2011 Fabian Groffen - 11.3.3-20110517 - java: Insertion via PreparedStatement and retrieval via ResultSet of timestamp -and time fields with and without timezones was improved to better -respect timezones, as partly indicated in bug #2781. + and time fields with and without timezones was improved to better + respect timezones, as partly indicated in bug #2781. * Wed May 11 2011 Sjoerd Mullender - 11.3.3-20110517 - monetdb5: Fixed a bug in conversion from string to the URL type. The bug was -an incorrect call to free(). + an incorrect call to free(). * Wed Apr 27 2011 Sjoerd Mullender - 11.3.3-20110517 - geom: Fixed various problems so that now all our tests work correctly on -all our testing platforms. + all our testing platforms. * Thu Apr 21 2011 Sjoerd Mullender - 11.3.1-20110421 - Rebuilt. diff --git a/NT/Makefile b/NT/Makefile --- a/NT/Makefile +++ b/NT/Makefile @@ -64,7 +64,6 @@ targetdirs: if not exist "$(libexecdir)"$(MKDIR) "$(libexecdir)" if not exist "$(datadir)" $(MKDIR) "$(datadir)" if not exist "$(sysconfdir)"$(MKDIR) "$(sysconfdir)" - if not exist "$(sharedstatedir)"$(MKDIR) "$(sharedstatedir)" if not exist "$(localstatedir)" $(MKDIR) "$(localstatedir)" if not exist "$(libdir)"$(MKDIR) "$(libdir)" if not exist "$(infodir)" $(MKDIR) "$(infodir)" diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -218,7 +218,6 @@ sbindir = $(exec_prefix)\sbin libexecdir = $(exec_prefix)\libexec datadir = $(prefix)\share sysconfdir = $(prefix)\etc -sharedstatedir = $(prefix)\com localstatedir = $(prefix)\var libdir = $(exec_prefix)\lib infodir = $(prefix)\info diff --git a/NT/winconfig.py b/NT/winconfig.py --- a/NT/winconfig.py +++ b/NT/winconfig.py @@ -18,7 +18,6 @@ subs = [("@exec_prefix@", r'%prefix%'), ("@datadir@", r'%prefix%\share'), ("@datarootdir@", r'%prefix%\share'), ("@sysconfdir@", r'%prefix%\etc'), -("@sharedstatedir@", r'%prefix%\com'), ("@localstatedir@", r'%prefix%\var'), ("@libdir@", r'%exec_prefix%\lib'), ("@infodir@", r'%prefix%\info'), diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -853,7 +853,7 @@ def am_translate_dir(path, am): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" dir = dir + rest diff --git a/buildtools/autogen/autogen/msc.py b/buildtools/autogen/autogen/msc.py --- a/buildtools/autogen/autogen/msc.py +++ b/buildtools/autogen/autogen/msc.py @@ -147,7 +147,7 @@ def msc_translate_dir(path, msc): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" if rest: diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++
MonetDB: Jun2020 - Cleanup. Find redudant relation names in the ...
Changeset: b1fc17098c61 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b1fc17098c61 Modified Files: sql/server/rel_updates.c Branch: Jun2020 Log Message: Cleanup. Find redudant relation names in the from clause of updates. Also cleaned table aliasing in updates diffs (151 lines): diff --git a/sql/server/rel_updates.c b/sql/server/rel_updates.c --- a/sql/server/rel_updates.c +++ b/sql/server/rel_updates.c @@ -12,6 +12,7 @@ #include "rel_select.h" #include "rel_rel.h" #include "rel_exp.h" +#include "rel_schema.h" #include "sql_privileges.h" #include "rel_unnest.h" #include "rel_optimizer.h" @@ -1104,26 +1105,22 @@ update_table(sql_query *query, dlist *qn t = mvc_bind_table(sql, NULL, tname); } if (update_allowed(sql, t, tname, "UPDATE", "update", 0) != NULL) { - sql_rel *r = NULL, *bt = rel_basetable(sql, t, t->base.name), *res = bt; + sql_rel *r = NULL, *bt = rel_basetable(sql, t, alias ? alias : t->base.name), *res = bt; - if (alias) { - for (node *nn = res->exps->h ; nn ; nn = nn->next) - exp_setname(sql->sa, (sql_exp*) nn->data, alias, NULL); //the last parameter is optional, hence NULL - } if (opt_from) { dlist *fl = opt_from->data.lval; - dnode *n = NULL; - sql_rel *fnd = NULL; + list *names = list_append(new_exp_list(sql->sa), (char*) rel_name(bt)); - for (n = fl->h; n && res; n = n->next) { - fnd = table_ref(query, NULL, n->data.sym, 0); + for (dnode *n = fl->h; n && res; n = n->next) { + char *nrame = NULL; + sql_rel *fnd = table_ref(query, NULL, n->data.sym, 0); + if (fnd) { - if (alias) { - for (node *nn = fnd->exps->h ; nn ; nn = nn->next) { - sql_exp* ee = (sql_exp*) nn->data; - if (exp_relname(ee) && !strcmp(exp_relname(ee), alias)) - return sql_error(sql, 02, SQLSTATE(42000) "UPDATE: multiple references into table '%s'", alias); - } + if ((nrame = (char*) rel_name(fnd))) { + if (list_find(names, nrame, (fcmp) &strcmp)) + return sql_error(sql, 02, SQLSTATE(42000) "UPDATE: multiple references into table '%s'", nrame); + else + list_append(names, nrame); } res = rel_crossproduct(sql->sa, res, fnd, op_join); } else @@ -1221,16 +1218,12 @@ delete_table(sql_query *query, dlist *qn r = rel_logical_exp(query, NULL, opt_where, sql_where); if (r) { /* simple predicate which is not using the to be updated table. We add a select all */ - sql_rel *l = rel_basetable(sql, t, t->base.name ); + sql_rel *l = rel_basetable(sql, t, alias ? alias : t->base.name); r = rel_crossproduct(sql->sa, l, r, op_join); } else { sql->errstr[0] = 0; sql->session->status = status; - r = rel_basetable(sql, t, t->base.name ); - if (alias) { - for (node *nn = r->exps->h ; nn ; nn = nn->next) - exp_setname(sql->sa, (sql_exp*) nn->data, alias, NULL); //the last parameter is optional, hence NULL - } + r = rel_basetable(sql, t, alias ? alias : t->base.name); r = rel_logical_exp(query, r, opt_where, sql_where); } if (!r) @@ -1271,8 +1264,6 @@ truncate_table(mvc *sql, dlist *qname, i #define MERGE_UPDATE_DELETE 1 #define MERGE_INSERT2 -extern sql_rel *rel_list(sql_allocator *sa, sql_rel *l, sql_rel *r); - static sql_rel * validate_merge_update_delete(mvc *sql, sql_table *t, str alias, sql_rel *joined_table, tokens upd_token, sql_rel *upd_del, sql_rel *bt, sql_rel *extra_selection) @@ -1323,12 +1314,13 @
MonetDB: Jun2020 - Cleanup: we do not use sharedstatedir.
Changeset: 46dad74e2aea for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46dad74e2aea Modified Files: NT/Makefile NT/rules.msc NT/winconfig.py buildtools/autogen/autogen/am.py buildtools/autogen/autogen/msc.py testing/Mtest.py.in Branch: Jun2020 Log Message: Cleanup: we do not use sharedstatedir. diffs (76 lines): diff --git a/NT/Makefile b/NT/Makefile --- a/NT/Makefile +++ b/NT/Makefile @@ -64,7 +64,6 @@ targetdirs: if not exist "$(libexecdir)"$(MKDIR) "$(libexecdir)" if not exist "$(datadir)" $(MKDIR) "$(datadir)" if not exist "$(sysconfdir)"$(MKDIR) "$(sysconfdir)" - if not exist "$(sharedstatedir)"$(MKDIR) "$(sharedstatedir)" if not exist "$(localstatedir)" $(MKDIR) "$(localstatedir)" if not exist "$(libdir)"$(MKDIR) "$(libdir)" if not exist "$(infodir)" $(MKDIR) "$(infodir)" diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -218,7 +218,6 @@ sbindir = $(exec_prefix)\sbin libexecdir = $(exec_prefix)\libexec datadir = $(prefix)\share sysconfdir = $(prefix)\etc -sharedstatedir = $(prefix)\com localstatedir = $(prefix)\var libdir = $(exec_prefix)\lib infodir = $(prefix)\info diff --git a/NT/winconfig.py b/NT/winconfig.py --- a/NT/winconfig.py +++ b/NT/winconfig.py @@ -18,7 +18,6 @@ subs = [("@exec_prefix@", r'%prefix%'), ("@datadir@", r'%prefix%\share'), ("@datarootdir@", r'%prefix%\share'), ("@sysconfdir@", r'%prefix%\etc'), -("@sharedstatedir@", r'%prefix%\com'), ("@localstatedir@", r'%prefix%\var'), ("@libdir@", r'%exec_prefix%\lib'), ("@infodir@", r'%prefix%\info'), diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -853,7 +853,7 @@ def am_translate_dir(path, am): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" dir = dir + rest diff --git a/buildtools/autogen/autogen/msc.py b/buildtools/autogen/autogen/msc.py --- a/buildtools/autogen/autogen/msc.py +++ b/buildtools/autogen/autogen/msc.py @@ -147,7 +147,7 @@ def msc_translate_dir(path, msc): 'libdir', 'libexecdir', 'localstatedir', 'mandir', 'oldincludedir', 'pkgbindir', 'pkgdatadir', 'pkgincludedir', 'pkglibdir', 'pkglocalstatedir', 'pkgsysconfdir', 'sbindir', - 'sharedstatedir', 'srcdir', 'sysconfdir', 'top_builddir', + 'srcdir', 'sysconfdir', 'top_builddir', 'top_srcdir', 'prefix'): dir = "$("+dir+")" if rest: diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -156,7 +156,6 @@ def _configure(str): ('${datarootdir}', '@QXdatarootdir@'), ('${datadir}', '@QXdatadir@'), ('${sysconfdir}', '@QXsysconfdir@'), -##('${sharedstatedir}', '@QXsharedstatedir@'), ('${localstatedir}', '@QXlocalstatedir@'), ('${libdir}', '@QXlibdir@'), ('${includedir}', '@QXincludedir@'), @@ -169,7 +168,6 @@ def _configure(str): ('${Qdatarootdir}', '@QXdatarootdir@'), ('${Qdatadir}', '@QXdatadir@'), ('${Qsysconfdir}', '@QXsysconfdir@'), -##('${Qsharedstatedir}', '@QXsharedstatedir@'), ('${Qlocalstatedir}', '@QXlocalstatedir@'), ('${Qlibdir}', '@QXlibdir@'), ('${Qincludedir}', '@QXincludedir@'), ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Small bugfix, disallow relations with the sam...
Changeset: 6b4e76ced517 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b4e76ced517 Modified Files: sql/server/rel_select.c sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql sql/test/subquery/Tests/subquery5.sql sql/test/subquery/Tests/subquery5.stable.err Branch: Jun2020 Log Message: Small bugfix, disallow relations with the same name on the FROM clause. It leads into ambiguous cases diffs (93 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -5628,10 +5628,11 @@ rel_query(sql_query *query, sql_rel *rel if (sn->from) { /* keep variable list with tables and names */ dlist *fl = sn->from->data.lval; - dnode *n = NULL; sql_rel *fnd = NULL; - - for (n = fl->h; n ; n = n->next) { + list *names = new_exp_list(sql->sa); + + for (dnode *n = fl->h; n ; n = n->next) { + char *nrame = NULL; int lateral = check_is_lateral(n->data.sym); /* just used current expression */ @@ -5647,6 +5648,14 @@ rel_query(sql_query *query, sql_rel *rel } if (!fnd) break; + if ((nrame = (char*) rel_name(fnd))) { + if (list_find(names, nrame, (fcmp) &strcmp)) { + if (res) + rel_destroy(res); + return sql_error(sql, 01, SQLSTATE(42000) "SELECT: relation name \"%s\" specified more than once", nrame); + } else + list_append(names, nrame); + } if (res) { res = rel_crossproduct(sql->sa, res, fnd, op_join); if (lateral) @@ -5918,6 +5927,9 @@ rel_crossquery(sql_query *query, sql_rel if (!t1 || !t2) return NULL; + if (rel_name(t1) && rel_name(t2) && strcmp(rel_name(t1), rel_name(t2)) == 0) + return sql_error(sql, 02, SQLSTATE(42000) "SELECT: '%s' on both sides of the CROSS JOIN expression", rel_name(t1)); + return rel_crossproduct(sql->sa, t1, t2, op_join); } diff --git a/sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql b/sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql --- a/sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql +++ b/sql/test/BugTracker-2015/Tests/project_rewrite.Bug-3693.sql @@ -57,7 +57,7 @@ CREATE VIEW output_1427727864562__386719 CREATE VIEW output_1427727864562_7461402036329501989 AS SELECT a2 AS a1, a4 AS a2, prob AS prob FROM output_1427727864562__3867191803197065991; -CREATE VIEW output_1427727864562_664384226664078002 AS SELECT output_1427727864562_7461402036329501989.a1 AS a1, output_1427727864562_7461402036329501989.a2 AS a2, output_1427727864562_7461402036329501989.a1 AS a3, output_1427727864562_7461402036329501989.a2 AS a4, output_1427727864562_7461402036329501989.prob * output_1427727864562_7461402036329501989.prob AS prob FROM output_1427727864562_7461402036329501989,output_1427727864562_7461402036329501989 WHERE output_1427727864562_7461402036329501989.a2 = output_1427727864562_7461402036329501989.a2; +CREATE VIEW output_1427727864562_664384226664078002 AS SELECT output_1427727864562_7461402036329501989.a1 AS a1, output_1427727864562_7461402036329501989.a2 AS a2, output_1427727864562_7461402036329501989.a1 AS a3, output_1427727864562_7461402036329501989.a2 AS a4, output_1427727864562_7461402036329501989.prob * output_1427727864562_7461402036329501989.prob AS prob FROM output_1427727864562_7461402036329501989,output_1427727864562_7461402036329501989 myalias WHERE output_1427727864562_7461402036329501989.a2 = output_1427727864562_7461402036329501989.a2; CREATE VIEW output_1427727864562_8055303038742365054 AS SELECT a1 AS a1, a3 AS a2, sum(prob) AS prob FROM output_1427727864562_664384226664078002 GROUP BY a1, a3; diff --git a/sql/test/subquery/Tests/subquery5.sql b/sql/test/subquery/Tests/subquery5.sql --- a/sql/test/subquery/Tests/subquery5.sql +++ b/sql/test/subquery/Tests/subquery5.sql @@ -139,6 +139,12 @@ SELECT (VALUES(col1, col2)) FROM another SELECT (VALUES(col1), (col2)) FROM another_t; --error, more than one row returned by a subquery used as an expression +SELECT integers.i FROM (VALUES(4),(5),(6),(8)) AS integers(i), integers; --error table integers specified more than once + +SELECT integers.i FROM integers, (VALUES(4)) AS myt(i), (SELECT 1) AS integers(i); --error table integers specified more than once + +SELECT 1 FROM integers CROSS JOIN integers; --error table integers specified more than once + SELECT * FROM integers i
MonetDB: Jun2020 - Removed unionjoin statements. They were dropp...
Changeset: e0f4cec30293 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0f4cec30293 Modified Files: sql/ChangeLog.Jun2020 sql/backends/monet5/sql_upgrades.c sql/scripts/51_sys_schema_extension.sql sql/server/rel_select.c sql/server/sql_parser.y sql/server/sql_scan.c sql/server/sql_tokens.h sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 Branch: Jun2020 Log Message: Removed unionjoin statements. They were dropped by the SQL:2003 standard, plus MonetDB implementation was not compliant diffs (232 lines): diff --git a/sql/ChangeLog.Jun2020 b/sql/ChangeLog.Jun2020 --- a/sql/ChangeLog.Jun2020 +++ b/sql/ChangeLog.Jun2020 @@ -1,6 +1,10 @@ # ChangeLog file for sql # This file is updated with Maddlog +* Wed Apr 15 2020 Pedro Ferreira +- Removed UNION JOIN statements. They were dropped by the SQL:2003 + standard, plus MonetDB implementation was not fully compliant. + * Wed Apr 1 2020 Sjoerd Mullender - The OFFSET value in the COPY INTO query now counts uninterpreted newlines. Before it counted "unquoted record separators" which meant diff --git a/sql/backends/monet5/sql_upgrades.c b/sql/backends/monet5/sql_upgrades.c --- a/sql/backends/monet5/sql_upgrades.c +++ b/sql/backends/monet5/sql_upgrades.c @@ -2906,6 +2906,11 @@ sql_update_jun2020(Client c, mvc *sql, c "update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'logging')" " and name = 'compinfo';\n"); + /* 51_sys_schema_extensions */ + pos += snprintf(buf + pos, bufsize - pos, + "ALTER TABLE sys.keywords SET READ WRITE;\n" + "DELETE FROM sys.keywords where \"keyword\" = 'UNIONJOIN';\n"); + pos += snprintf(buf + pos, bufsize - pos, "commit;\n"); pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", prev_schema); assert(pos < bufsize); diff --git a/sql/scripts/51_sys_schema_extension.sql b/sql/scripts/51_sys_schema_extension.sql --- a/sql/scripts/51_sys_schema_extension.sql +++ b/sql/scripts/51_sys_schema_extension.sql @@ -268,7 +268,6 @@ INSERT INTO sys.keywords (keyword) VALUE ('UNCOMMITTED'), ('UNENCRYPTED'), ('UNION'), - ('UNIONJOIN'), ('UNIQUE'), ('UPDATE'), ('USER'), diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -160,7 +160,6 @@ rel_orderby(mvc *sql, sql_rel *l) static sql_rel * rel_setquery(sql_query *query, symbol *sq); static sql_rel * rel_joinquery(sql_query *query, sql_rel *rel, symbol *sq); static sql_rel * rel_crossquery(sql_query *query, sql_rel *rel, symbol *q); -static sql_rel * rel_unionjoinquery(sql_query *query, sql_rel *rel, symbol *sq); static sql_rel * rel_table_optname(mvc *sql, sql_rel *sq, symbol *optname) @@ -340,14 +339,6 @@ query_exp_optname(sql_query *query, sql_ return NULL; return rel_table_optname(sql, tq, q->data.lval->t->data.sym); } - case SQL_UNIONJOIN: - { - sql_rel *tq = rel_unionjoinquery(query, r, q); - - if (!tq) - return NULL; - return rel_table_optname(sql, tq, q->data.lval->t->data.sym); - } default: (void) sql_error(sql, 02, SQLSTATE(42000) "case %d %s", (int) q->token, token2string(q->token)); } @@ -5915,6 +5906,7 @@ rel_joinquery(sql_query *query, sql_rel static sql_rel * rel_crossquery(sql_query *query, sql_rel *rel, symbol *q) { + mvc *sql = query->sql; dnode *n = q->data.lval->h; symbol *tab1 = n->data.sym; symbol *tab2 = n->next->data.sym; @@ -5926,59 +5918,7 @@ rel_crossquery(sql_query *query, sql_rel if (!t1 || !t2) return NULL; - rel = rel_crossproduct(query->sql->sa, t1, t2, op_join); - return rel; -} - -static sql_rel * -rel_unionjoinquery(sql_query *query, sql_rel *rel, symbol *q) -{ - mvc *sql = query->sql; - dnode *n = q->data.lval->h; - sql_rel *lv = table_ref(query, rel, n->data.sym, 0); - sql_rel *rv = NULL; - int all = n->next->data.i_val; - list *lexps, *rexps; - node *m; - int found = 0; - - if (lv) - rv = table_ref(query, rel, n->next->next->data.sym, 0); - assert(n->next->type == type_int); - if (!lv || !rv) - return NULL; - - lexps = rel_projections(sql, lv, NULL, 1, 1); - /* find the matching columns (all should match?) -* union these -* if !all do a distinct operation at the end -*/ - /* join all result columns ie join(lh,rh) on column_name */ - rexps = new_exp_list(sql->sa); - for (m = lexps->h; m; m = m->next) { -
MonetDB: unlock - small fix in makefile
Changeset: 79ed8156dd37 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=79ed8156dd37 Modified Files: gdk/Makefile.ag Branch: unlock Log Message: small fix in makefile diffs (12 lines): diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag --- a/gdk/Makefile.ag +++ b/gdk/Makefile.ag @@ -23,7 +23,7 @@ lib_gdk = { gdk_group.c \ gdk_join.c \ gdk_firstn.c \ - gdk_logger.c gdk_logger.h gdk_logger_internals.h gdk_logger_old.c \ + gdk_logger.c gdk_logger.h gdk_logger_internals.h gdk_logger_old.c gdk_geomlogger.h \ gdk_batop.c \ gdk_bat.c \ gdk_hash.c gdk_hash.h \ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list