Changeset: 5bd5a55921f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5bd5a55921f6
Modified Files:
        clients/mapiclient/dump.c
        clients/odbc/driver/ODBCUtil.c
        clients/odbc/driver/SQLGetInfo.c
        monetdb5/mal/mal.h
        sql/backends/monet5/UDF/capi/capi.c
        sql/test/testdb-reload/Tests/reload.stable.out
        sql/test/testdb/Tests/dump.stable.out
        sql/test/testdb/Tests/load.sql
        sql/test/testdb/Tests/load.stable.out
Branch: default
Log Message:

Merge with Apr2019 branch.


diffs (258 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -2677,7 +2677,7 @@ dump_database(Mapi mid, stream *toConsol
                                        mnstr_printf(toConsole, ")");
                                }
                                if (found_nil) {
-                                       mnstr_printf(toConsole, " WITH NULL");
+                                       mnstr_printf(toConsole, " WITH NULL 
VALUES");
                                }
                        } else { /* by range */
                                char *minv = NULL, *maxv = NULL, *wnulls = NULL;
@@ -2704,13 +2704,13 @@ dump_database(Mapi mid, stream *toConsol
                                        wnulls = mapi_fetch_field(shdl, 2);
                                }
                                if (minv && maxv) {
-                                       mnstr_printf(toConsole, " BETWEEN ");
+                                       mnstr_printf(toConsole, " FROM ");
                                        squoted_print(toConsole, minv, '\'');
-                                       mnstr_printf(toConsole, " AND ");
+                                       mnstr_printf(toConsole, " TO ");
                                        squoted_print(toConsole, maxv, '\'');
                                }
                                if (strcmp(wnulls, "true") == 0) {
-                                       mnstr_printf(toConsole, " WITH NULL");
+                                       mnstr_printf(toConsole, " WITH NULL 
VALUES");
                                }
                                mapi_close_handle(shdl);
                        }
diff --git a/clients/odbc/driver/ODBCUtil.c b/clients/odbc/driver/ODBCUtil.c
--- a/clients/odbc/driver/ODBCUtil.c
+++ b/clients/odbc/driver/ODBCUtil.c
@@ -359,7 +359,7 @@ static struct scalars {
        {"dayofmonth", 1, "sys.\"dayofmonth\"(\1)", },
        {"dayofweek", 1, "sys.\"dayofweek\"(\1)", },
        {"dayofyear", 1, "sys.\"dayofyear\"(\1)", },
-       {"degrees", 1, "sys.\"sys\".\"degrees\"(\1)", },
+       {"degrees", 1, "sys.\"degrees\"(\1)", },
        {"difference", 2, "sys.\"difference\"(\1,\2)", },
        {"exp", 1, "sys.\"exp\"(\1)", },
        {"extract", 1, "sys.\"extract\"(\1)", }, /* include "X FROM " in 
argument */
@@ -382,10 +382,10 @@ static struct scalars {
        {"now", 0, "sys.\"now\"()", },
        {"octet_length", 1, "sys.\"octet_length\"(\1)", },
        {"pi", 0, "sys.\"pi\"()", },
-       {"position", 1, "sys.\"position\"(\1)", }, /* includes "IN" in argument 
*/
+       {"position", 1, "POSITION(\1)", }, /* includes " IN str" in first 
argument. Note: POSITION is implemented in the parser. */
        {"power", 2, "sys.\"power\"(\1,\2)", },
        {"quarter", 1, "sys.\"quarter\"(\1)", },
-       {"radians", 1, "sys.\"sys\".\"radians\"(\1)", },
+       {"radians", 1, "sys.\"radians\"(\1)", },
        {"rand", 0, "sys.\"rand\"()", },
        {"rand", 1, "sys.\"rand\"(\1)", },
        {"repeat", 2, "sys.\"repeat\"(\1,\2)", },
diff --git a/clients/odbc/driver/SQLGetInfo.c b/clients/odbc/driver/SQLGetInfo.c
--- a/clients/odbc/driver/SQLGetInfo.c
+++ b/clients/odbc/driver/SQLGetInfo.c
@@ -610,6 +610,7 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_IS_SELECT_INTO;
                break;
        case SQL_INTEGRITY:
+               /* N because we currently do not supprt CHECK constraints (see 
bug 3568) nor deferrable FK constraints. */
                sValue = "N";   /* "Y" */
                break;
        case SQL_KEYSET_CURSOR_ATTRIBUTES1:
@@ -793,7 +794,7 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_FN_NUM_SIN |
                        SQL_FN_NUM_SQRT |
                        SQL_FN_NUM_TAN |
-                       SQL_FN_NUM_TRUNCATE;
+                       SQL_FN_NUM_TRUNCATE;    /* is mapped to ms_trunc() */
                break;
        case SQL_ODBC_INTERFACE_CONFORMANCE:
                nValue = SQL_OIC_CORE;
@@ -867,13 +868,13 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_SDF_CURRENT_TIME |
                        SQL_SDF_CURRENT_TIMESTAMP;
                break;
-       case SQL_SQL92_FOREIGN_KEY_DELETE_RULE: /* ? */
+       case SQL_SQL92_FOREIGN_KEY_DELETE_RULE:
                nValue = SQL_SFKD_CASCADE |
                        SQL_SFKD_NO_ACTION |
                        SQL_SFKD_SET_DEFAULT |
                        SQL_SFKD_SET_NULL;
                break;
-       case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE: /* ? */
+       case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE:
                nValue = SQL_SFKU_CASCADE |
                        SQL_SFKU_NO_ACTION |
                        SQL_SFKU_SET_DEFAULT |
@@ -931,18 +932,18 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_SRJO_UNION_JOIN;
                break;
        case SQL_SQL92_REVOKE:
-               nValue = SQL_SR_CASCADE |
-                       SQL_SR_DELETE_TABLE |
+               nValue = SQL_SR_DELETE_TABLE |
                        SQL_SR_GRANT_OPTION_FOR |
                        SQL_SR_INSERT_COLUMN |
                        SQL_SR_INSERT_TABLE |
                        SQL_SR_REFERENCES_COLUMN |
                        SQL_SR_REFERENCES_TABLE |
-                       SQL_SR_RESTRICT |
                        SQL_SR_SELECT_TABLE |
                        SQL_SR_UPDATE_COLUMN |
                        SQL_SR_UPDATE_TABLE;
-               /* SQL_SR_USAGE_ON_DOMAIN |
+               /* SQL_SR_CASCADE |
+                * SQL_SR_RESTRICT |
+                * SQL_SR_USAGE_ON_DOMAIN |
                 * SQL_SR_USAGE_ON_CHARACTER_SET |
                 * SQL_SR_USAGE_ON_COLLATION |
                 * SQL_SR_USAGE_ON_TRANSLATION */
@@ -953,16 +954,16 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_SRVC_DEFAULT |
                        SQL_SRVC_ROW_SUBQUERY;
                break;
-       case SQL_SQL92_STRING_FUNCTIONS: /* ? */
+       case SQL_SQL92_STRING_FUNCTIONS:
                nValue = SQL_SSF_CONVERT |
                        SQL_SSF_LOWER |
                        SQL_SSF_UPPER |
                        SQL_SSF_SUBSTRING |
-                       SQL_SSF_TRANSLATE |
                        SQL_SSF_TRIM_BOTH |
                        SQL_SSF_TRIM_LEADING |
                        SQL_SSF_TRIM_TRAILING;
                break;
+               /* SQL_SSF_TRANSLATE */
        case SQL_SQL92_VALUE_EXPRESSIONS:
                nValue = SQL_SVE_CASE |
                        SQL_SVE_CAST |
@@ -1014,7 +1015,6 @@ MNDBGetInfo(ODBCDbc *dbc,
                break;
        case SQL_STRING_FUNCTIONS:
                nValue = SQL_FN_STR_ASCII |
-                       SQL_FN_STR_BIT_LENGTH |
                        SQL_FN_STR_CHAR |
                        SQL_FN_STR_CHARACTER_LENGTH |
                        SQL_FN_STR_CHAR_LENGTH |
@@ -1037,6 +1037,7 @@ MNDBGetInfo(ODBCDbc *dbc,
                        SQL_FN_STR_SPACE |
                        SQL_FN_STR_SUBSTRING |
                        SQL_FN_STR_UCASE;
+               /* SQL_FN_STR_BIT_LENGTH */
                break;
        case SQL_SUBQUERIES:
                nValue = SQL_SQ_CORRELATED_SUBQUERIES |
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -243,7 +243,6 @@ typedef struct MALSTK {
         */
        DFhook admit;
        DFhook wrapup;
-       MT_Lock stklock;        /* used for parallel processing */
 
 /*
  * It is handy to administer the timing in the stack frame
diff --git a/sql/backends/monet5/UDF/capi/capi.c 
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -63,7 +63,7 @@ typedef struct _cached_functions {
 #define FUNCTION_CACHE_SIZE 128
 
 static cached_functions *function_cache[FUNCTION_CACHE_SIZE];
-static MT_Lock cache_lock;
+static MT_Lock cache_lock = MT_LOCK_INITIALIZER("cache_lock");
 static int cudf_initialized = 0;
 
 static str CUDFeval(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci,
@@ -83,7 +83,6 @@ str CUDFprelude(void *ret)
 {
        (void)ret;
        if (!cudf_initialized) {
-               MT_lock_init(&cache_lock, "cache_lock");
                cudf_initialized = true;
                option_enable_mprotect = GDKgetenv_istrue(mprotect_enableflag) 
|| GDKgetenv_isyes(mprotect_enableflag);
                option_enable_longjmp = GDKgetenv_istrue(longjmp_enableflag) || 
GDKgetenv_isyes(longjmp_enableflag);
diff --git a/sql/test/testdb-reload/Tests/reload.stable.out 
b/sql/test/testdb-reload/Tests/reload.stable.out
--- a/sql/test/testdb-reload/Tests/reload.stable.out
+++ b/sql/test/testdb-reload/Tests/reload.stable.out
@@ -101328,10 +101328,10 @@ 8   "attempt"
 CREATE TABLE "testschema"."""" (
        """" INTEGER
 );
-ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION BETWEEN '1' AND '10';
-ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION BETWEEN '11' AND '20';
+ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION FROM '1' TO '11';
+ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION FROM '11' TO '20';
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits1" AS PARTITION IN ('1', '2', '3');
-ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL;
+ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits3" AS PARTITION IN ('7', '8', '9');
 ALTER TABLE "testschema"."mt3" ADD TABLE "testschema"."mt1";
 ALTER TABLE "testschema"."mt3" ADD TABLE "testschema"."t4";
diff --git a/sql/test/testdb/Tests/dump.stable.out 
b/sql/test/testdb/Tests/dump.stable.out
--- a/sql/test/testdb/Tests/dump.stable.out
+++ b/sql/test/testdb/Tests/dump.stable.out
@@ -101364,10 +101364,10 @@ CREATE TABLE "testschema"."geomtest" (
 COPY 2 RECORDS INTO "testschema"."geomtest" FROM stdin USING DELIMITERS 
E'\t',E'\n','"';
 POINT (10.5 12.3)      LINESTRING (10 10, 20 20, 30 40)        LINESTRING (10 
10, 20 20, 30 40)        POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))   
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))   MULTIPOINT (20 80, 110 160, 20 
160)     MULTILINESTRING ((0 0, 0 80, 60 80, 60 0, 0 0)) MULTILINESTRING ((0 0, 
0 80, 60 80, 60 0, 0 0)) MULTIPOLYGON (((140 110, 260 110, 170 20, 50 20, 140 
110)), ((300 270, 420 270, 340 190, 220 190, 300 270)))    MULTIPOLYGON (((140 
110, 260 110, 170 20, 50 20, 140 110)), ((300 270, 420 270, 340 190, 220 190, 
300 270)))    POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))   
GEOMETRYCOLLECTION (POLYGON ((0 0, 0 100, 100 100, 100 0, 0 0)), LINESTRING (10 
10, 20 20, 30 40))      BOX (10.000000 10.000000, 20.000000 20.000000)
 NULL   NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    
NULL    NULL    NULL
-ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION BETWEEN '1' AND '10';
-ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION BETWEEN '11' AND '20';
+ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION FROM '1' TO '11';
+ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION FROM '11' TO '20';
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits1" AS PARTITION IN ('1', '2', '3');
-ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL;
+ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits3" AS PARTITION IN ('7', '8', '9');
 ALTER TABLE "testschema"."mt3" ADD TABLE "testschema"."mt1";
 ALTER TABLE "testschema"."mt3" ADD TABLE "testschema"."t4";
diff --git a/sql/test/testdb/Tests/load.sql b/sql/test/testdb/Tests/load.sql
--- a/sql/test/testdb/Tests/load.sql
+++ b/sql/test/testdb/Tests/load.sql
@@ -101252,15 +101252,15 @@ CREATE TABLE testschema.subtable1 (a int
 CREATE TABLE testschema.subtable2 (a int, b varchar(32));
 INSERT INTO testschema.subtable1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
 INSERT INTO testschema.subtable2 VALUES (11, 'eleven'), (12, 'twelve'), (13, 
'thirteen');
-ALTER TABLE testschema.testme ADD TABLE testschema.subtable1 AS PARTITION 
BETWEEN 1 AND 10;
-ALTER TABLE testschema.testme ADD TABLE testschema.subtable2 AS PARTITION 
BETWEEN 11 AND 20;
+ALTER TABLE testschema.testme ADD TABLE testschema.subtable1 AS PARTITION FROM 
1 TO 11;
+ALTER TABLE testschema.testme ADD TABLE testschema.subtable2 AS PARTITION FROM 
11 TO 20;
 CREATE MERGE TABLE testschema.testvaluespartitions (a int, b varchar(32)) 
PARTITION BY VALUES ON (a);
 CREATE TABLE testschema.sublimits1 (a int, b varchar(32));
 CREATE TABLE testschema.sublimits2 (a int, b varchar(32));
 CREATE TABLE testschema.sublimits3 (a int, b varchar(32));
 ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits1 AS 
PARTITION IN ('1', '2', '3');
 INSERT INTO testschema.testvaluespartitions VALUES (1, 'first');
-ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits2 AS 
PARTITION IN ('4', '5', '6') WITH NULL;
+ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits2 AS 
PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits3 AS 
PARTITION IN ('7', '8', '9');
 INSERT INTO testschema.testvaluespartitions VALUES (1, 'a'), (5, 'b'), (7, 
'c');
 INSERT INTO testschema.testvaluespartitions VALUES (7, 'another'), (9, 'to'), 
(9, 'pass');
diff --git a/sql/test/testdb/Tests/load.stable.out 
b/sql/test/testdb/Tests/load.stable.out
--- a/sql/test/testdb/Tests/load.stable.out
+++ b/sql/test/testdb/Tests/load.stable.out
@@ -300,8 +300,8 @@ Ready.
 [ 3    ]
 #INSERT INTO testschema.subtable2 VALUES (11, 'eleven'), (12, 'twelve'), (13, 
'thirteen');
 [ 3    ]
-#ALTER TABLE testschema.testme ADD TABLE testschema.subtable1 AS PARTITION 
BETWEEN 1 AND 10;
-#ALTER TABLE testschema.testme ADD TABLE testschema.subtable2 AS PARTITION 
BETWEEN 11 AND 20;
+#ALTER TABLE testschema.testme ADD TABLE testschema.subtable1 AS PARTITION 
FROM 1 TO 11;
+#ALTER TABLE testschema.testme ADD TABLE testschema.subtable2 AS PARTITION 
FROM 11 TO 20;
 #CREATE MERGE TABLE testschema.testvaluespartitions (a int, b varchar(32)) 
PARTITION BY VALUES ON (a);
 #CREATE TABLE testschema.sublimits1 (a int, b varchar(32));
 #CREATE TABLE testschema.sublimits2 (a int, b varchar(32));
@@ -309,7 +309,7 @@ Ready.
 #ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits1 
AS PARTITION IN ('1', '2', '3');
 #INSERT INTO testschema.testvaluespartitions VALUES (1, 'first');
 [ 1    ]
-#ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits2 
AS PARTITION IN ('4', '5', '6') WITH NULL;
+#ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits2 
AS PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 #ALTER TABLE testschema.testvaluespartitions ADD TABLE testschema.sublimits3 
AS PARTITION IN ('7', '8', '9');
 #INSERT INTO testschema.testvaluespartitions VALUES (1, 'a'), (5, 'b'), (7, 
'c');
 [ 3    ]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to