Changeset: 0dff902ec0a0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0dff902ec0a0 Modified Files: sql/server/rel_unnest.c Branch: typing Log Message:
Merged with Oct2020 diffs (truncated from 729 to 300 lines): diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -57,9 +57,9 @@ SQLhelp sqlhelp1[] = { "See also https://www.monetdb.org/Documentation/SQLreference/Alter"}, {"ALTER SEQUENCE", "", - "ALTER SEQUENCE qname [ AS int_datatype] [ RESTART [WITH intval]] [INCREMENT BY intval]\n" + "ALTER SEQUENCE qname [ AS seq_int_datatype] [ RESTART [WITH intval]] [INCREMENT BY intval]\n" "[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] [CACHE intval] [[NO] CYCLE]", - "int_datatype,intval", + "seq_int_datatype,intval", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"}, {"ALTER TABLE", "", @@ -126,36 +126,36 @@ SQLhelp sqlhelp1[] = { "qname,scalar_expression", NULL}, {"CREATE AGGREGATE", - "Create an user-defined aggregate function. The body of the aggregate function\n" + "Create a user-defined aggregate function. The body of the aggregate function\n" "can also be defined in other programming languages such as Python, R, C or CPP.", "CREATE [ OR REPLACE ] AGGREGATE [ FUNCTION ] qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS data_type\n" + " RETURNS function_return_data_type\n" " EXTERNAL NAME ident ',' ident\n" "CREATE [ OR REPLACE ] AGGREGATE [ FUNCTION ] qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS data_type\n" + " RETURNS function_return_data_type\n" " LANGUAGE language_keyword external_code", - "qname,param,data_type,ident,language_keyword,external_code", + "qname,param,function_return_data_type,ident,language_keyword,external_code", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"}, {"CREATE FILTER FUNCTION", - "", + "Create a user-defined filter function. Currently only MAL definitions\n" "CREATE [ OR REPLACE ] FILTER [ FUNCTION ] qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS { data_type | TABLE '(' function_return [',' ...] ')' }\n" + " RETURNS function_return_data_type\n" " EXTERNAL NAME ident ',' ident", - "qname,param,data_type,function_return,ident", + "qname,param,function_return_data_type,ident", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"}, {"CREATE FUNCTION", - "Create an user-defined function. Besides standard SQL the body of the function\n" - "can also be defined in other programming languages such as Python, R, C or CPP.", + "Create a user-defined function (UDF). The body of the function can be defined in\n" + " PL/SQL or programming languages such as Python, R, C or CPP when embedded on the server.", "CREATE [ OR REPLACE ] FUNCTION qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS { data_type | TABLE '(' function_return [',' ...] ')' }\n" + " RETURNS function_return_data_type\n" " BEGIN [ ATOMIC ] statement [ ';' ...] END\n" "CREATE [ OR REPLACE ] FUNCTION qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS { data_type | TABLE '(' function_return [',' ...] ')' }\n" + " RETURNS function_return_data_type\n" " EXTERNAL NAME ident ',' ident\n" "CREATE [ OR REPLACE ] FUNCTION qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS { data_type | TABLE '(' function_return [',' ...] ')' }\n" + " RETURNS function_return_data_type\n" " LANGUAGE language_keyword external_code", - "qname,param,data_type,function_return,statement,ident,language_keyword,external_code", + "qname,param,function_return_data_type,statement,ident,language_keyword,external_code", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"}, {"CREATE INDEX", "Create a hint for a secondary index on a column or set of columns of a table", @@ -174,7 +174,7 @@ SQLhelp sqlhelp1[] = { "table_source,partition_by", "See also https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning"}, {"CREATE PROCEDURE", - "Create an user-defined procedure", + "Create a user-defined procedure", "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] } ')'\n" " BEGIN [ ATOMIC ] procedure_statement [ ';' ...] END\n" "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] } ')'\n" @@ -204,9 +204,9 @@ SQLhelp sqlhelp1[] = { "See also https://www.monetdb.org/Documentation/SQLreference/Schema"}, {"CREATE SEQUENCE", "Define a new integer number sequence generator", - "CREATE SEQUENCE qname [ AS int_datatype] [ START [WITH intval]] [INCREMENT BY intval]\n" + "CREATE SEQUENCE qname [ AS seq_int_datatype] [ START [WITH intval]] [INCREMENT BY intval]\n" "[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] [CACHE intval] [[NO] CYCLE]", - "int_datatype,intval", + "seq_int_datatype,intval", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"}, {"CREATE STREAM TABLE", "Temporary table, locked during updates/ continues query processing", @@ -244,12 +244,12 @@ SQLhelp sqlhelp1[] = { "qname,column_list,query_expression", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Views"}, {"CREATE WINDOW", - "Create an user-defined window function. Currently only MAL definitions\n" + "Create a user-defined window function. Currently only MAL definitions\n" "are supported.", - "CREATE [ OR REPLACE ] WINDOW qname '(' { '*' | [ param [',' ...]] } ')'\n" - " RETURNS data_type\n" + "CREATE [ OR REPLACE ] WINDOW [ FUNCTION ] qname '(' { '*' | [ param [',' ...]] } ')'\n" + " RETURNS function_return_data_type\n" " EXTERNAL NAME ident ',' ident", - "qname,param,data_type,function_return,ident", + "qname,param,function_return_data_type,ident", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"}, {"CURRENT_DATE", "Pseudo column or function to get the current date", @@ -381,7 +381,7 @@ SQLhelp sqlhelp1[] = { "DROP VIEW [ IF EXISTS ] qname [ RESTRICT | CASCADE ]", NULL, NULL}, - {"DROP WINDOW [ FUNCTION ]", + {"DROP WINDOW", "", "DROP ALL WINDOW [ FUNCTION ] qname [ RESTRICT | CASCADE ]\n" "DROP WINDOW [ FUNCTION ] [ IF EXISTS ] qname [ '(' [ param [',' ...]] ')' ] [ RESTRICT | CASCADE ]", @@ -484,9 +484,9 @@ SQLhelp sqlhelp1[] = { "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Variables"}, {"SET LOCAL TRANSACTION", "", - "START LOCAL TRANSACTION transactionmode", - "transactionmode,isolevel", - "DIAGNOSTICS is not yet supported"}, + "SET LOCAL TRANSACTION [ transactionmode ]", + "transactionmode", + "See also https://www.monetdb.org/Documentation/SQLreference/SQLSyntaxOverview#SET_LOCAL_TRANSACTION"}, {"SET ROLE", "Change current role", "SET ROLE ident", @@ -514,9 +514,9 @@ SQLhelp sqlhelp1[] = { NULL}, {"SET TRANSACTION", "", - "SET TRANSACTION transactionmode", - "transactionmode,isolevel", - "DIAGNOSTICS is not yet supported"}, + "SET TRANSACTION [ transactionmode ]", + "transactionmode", + "See also https://www.monetdb.org/Documentation/SQLreference/SQLSyntaxOverview#SET_TRANSACTION"}, {"SET USER", "Change current user", "SET USER '=' ident", @@ -525,7 +525,7 @@ SQLhelp sqlhelp1[] = { {"START TRANSACTION", "Change transaction mode from auto-commit to user controlled commit/rollback", "{ START | BEGIN } TRANSACTION transactionmode", - "transactionmode,isolevel", + "transactionmode", "See also https://www.monetdb.org/Documentation/Manuals/SQLreference/Transactions"}, {"TABLE JOINS", "", @@ -650,14 +650,14 @@ SQLhelp sqlhelp2[] = { "SECOND timestamp_precision\n,timestamp_precision", NULL, NULL}, - {"function_return", + {"function_return_data_type", NULL, - "ident data_type", + "data_type | TABLE '(' ident data_type [',' ...] ')'", NULL, NULL}, {"function_type", NULL, - "{ FUNCTION | PROCEDURE | { AGGREGATE | FILTER | LOADER | WINDOW [ FUNCTION ] } }", + "{ FUNCTION | PROCEDURE | { { AGGREGATE | FILTER | LOADER | WINDOW } [ FUNCTION ] } }", NULL, NULL}, {"generated_column", @@ -705,7 +705,7 @@ SQLhelp sqlhelp2[] = { "[ ELSE procedure_statement ... ] END IF", "search_condition,procedure_statement", "See also https://www.monetdb.org/Documentation/SQLreference/Flowofcontrol"}, - {"int_datatype", + {"seq_int_datatype", NULL, "BIGINT | INTEGER | INT | SMALLINT | TINYINT", NULL, @@ -780,7 +780,7 @@ SQLhelp sqlhelp2[] = { NULL}, {"partition_list", NULL, - "query_expression [ ',' ... ]", + "query_expression [',' ...]", "query_expression", NULL}, {"partition_range_from", @@ -931,7 +931,7 @@ SQLhelp sqlhelp2[] = { NULL, "{ READ ONLY | READ WRITE | ISOLATION LEVEL isolevel | DIAGNOSTICS intval } [ , ... ]", "isolevel", - NULL}, + "Note: DIAGNOSTICS is not yet implemented"}, {"trigger_reference", NULL, "{ OLD | NEW } { [ROW] | TABLE } [AS] ident", @@ -997,8 +997,8 @@ SQLhelp sqlhelp2[] = { {"window_specification", NULL, "[ ident ]\n" - "[ PARTITION BY expression [ ',' ... ] ]\n" - "[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [ ',' ... ] ]\n" + "[ PARTITION BY expression [',' ...] ]\n" + "[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [',' ...] ]\n" "[ { ROWS | RANGE | GROUPS } { window_frame_start | BETWEEN window_bound AND window_bound }\n" " [ EXCLUDING { CURRENT ROW | GROUP | TIES | NO OTHERS } ] ]", "window_bound,window_frame_start", diff --git a/documentation/source/manual_pages/mserver5.rst.in b/documentation/source/manual_pages/mserver5.rst.in --- a/documentation/source/manual_pages/mserver5.rst.in +++ b/documentation/source/manual_pages/mserver5.rst.in @@ -34,11 +34,10 @@ OPERATION ========= When the build-time configuration did not disable this, a *mserver5* -process presents the user with a console prompt. On this prompt, MAL -commands can be executed. The architecture is setup to handle multiple -streams of requests. The first thread started represents the server, -which is the console prompt, reading from standard input and writing to -standard output. +process presents the user with server startup information and internal +exceptions due to errors in commands sent by clients. The architecture +is setup to handle multiple streams of requests. The first thread +started represents the server, which only writes to standard output. The server thread started remains in existence until all other threads die. The server is stopped by sending it a termination signal (SIGINT, diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1070,6 +1070,9 @@ gdk_export restrict_t BATgetaccess(BAT * (b)->batDirtydesc || \ (b)->theap.dirty || \ ((b)->tvheap != NULL && (b)->tvheap->dirty)) +#define BATdirtydata(b) (!(b)->batCopiedtodisk || \ + (b)->theap.dirty || \ + ((b)->tvheap != NULL && (b)->tvheap->dirty)) #define BATcapacity(b) (b)->batCapacity /* @@ -1191,8 +1194,9 @@ static inline void BATsettrivprop(BAT *b) { assert(!is_oid_nil(b->hseqbase)); - b->batDirtydesc = true; /* likely already set */ assert(is_oid_nil(b->tseqbase) || ATOMtype(b->ttype) == TYPE_oid); + if (!b->batDirtydesc) + return; if (b->ttype == TYPE_void) { if (is_oid_nil(b->tseqbase)) { b->tnonil = b->batCount == 0; diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -435,6 +435,7 @@ VIEWdestroy(BAT *b) HASHdestroy(b); IMPSdestroy(b); OIDXdestroy(b); + PROPdestroy(b); VIEWunlink(b); if (b->ttype && !b->theap.parentid) { diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -550,7 +550,6 @@ BATfree(BAT *b) if (b->tident && !default_ident(b->tident)) GDKfree(b->tident); b->tident = BATstring_t; - PROPdestroy(b); HASHfree(b); IMPSfree(b); OIDXfree(b); diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1412,6 +1412,7 @@ BBPexit(void) } VIEWdestroy(b); } else { + PROPdestroy(b); BATfree(b); } } @@ -1714,15 +1715,14 @@ BBPdump(void) if (b == NULL) continue; fprintf(stderr, - "# %d[%s]: nme='%s' refs=%d lrefs=%d " - "status=%u count=" BUNFMT, + "# %d: " ALGOBATFMT " " + "refs=%d lrefs=%d " + "status=%u", i, - ATOMname(b->ttype), - BBP_logical(i) ? BBP_logical(i) : "<NULL>", + ALGOBATPAR(b), BBP_refs(i), BBP_lrefs(i), - BBP_status(i), - b->batCount); + BBP_status(i)); if (b->batSharecnt > 0) fprintf(stderr, " shares=%d", b->batSharecnt); if (b->batDirtydesc) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list