Changeset: c5c2db4f0ee9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c5c2db4f0ee9
Modified Files:
        clients/R/Tests/dplyr-flights.stable.err
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        common/utils/msabaoth.c
        monetdb5/extras/pyapi/pyapi.c
        monetdb5/extras/rapi/Tests/rapi02.malC
        monetdb5/extras/rapi/Tests/rapi02.stable.out
        monetdb5/extras/rapi/rapi.c
        sql/backends/monet5/Tests/rapi14.sql
        sql/scripts/27_rejects.sql
        sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
        sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
        sql/test/Tests/systemfunctions.stable.out
        sql/test/Tests/systemfunctions.stable.out.int128
Branch: pyapi
Log Message:

Merge with default.


diffs (truncated from 438 to 300 lines):

diff --git a/clients/R/Tests/dplyr-flights.stable.err 
b/clients/R/Tests/dplyr-flights.stable.err
--- a/clients/R/Tests/dplyr-flights.stable.err
+++ b/clients/R/Tests/dplyr-flights.stable.err
@@ -30,7 +30,7 @@ stderr of test 'dplyr-flights` in direct
 # 11:44:05 >  "R" "--vanilla" "--slave" "--args" "30588"
 # 11:44:05 >  
 
-Identifier(s) year, month, day, hour, minute are reserved SQL keywords and 
need to be quoted.
+Identifier(s) year, month, day, hour, minute are reserved SQL keywords and 
need(s) to be quoted in queries.
 
 # 11:44:15 >  
 # 11:44:15 >  "Done."
diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -7047,7 +7047,7 @@ 5813      "stop"  "create procedure sys.stop(t
 5816   "pause" "create procedure sys.pause(tag bigint)\nexternal name 
sql.sysmon_pause;"       "sql"   1       2       true    false   false   2000
 5819   "resume"        "create procedure sys.resume(tag bigint)\nexternal name 
sql.sysmon_resume;"     "sql"   1       2       true    false   false   2000
 5822   "stop"  "create procedure sys.stop(tag bigint)\nexternal name 
sql.sysmon_stop;" "sql"   1       2       true    false   false   2000
-5825   "rejects"       "-- The contents of this file are subject to the 
MonetDB Public License\n-- Version 1.1 (the ""License""); you may not use this 
file except in\n-- compliance with the License. You may obtain a copy of the 
License at\n-- http://www.monetdb.org/Legal/MonetDBLicense\n--\n-- Software 
distributed under the License is distributed on an ""AS IS""\n-- basis, WITHOUT 
WARRANTY OF ANY KIND, either express or implied. See the\n-- License for the 
specific language governing rights and limitations\n-- under the 
License.\n--\n-- The Original Code is the MonetDB Database System.\n--\n-- The 
Initial Developer of the Original Code is CWI.\n-- Portions created by CWI are 
Copyright (C) 1997-July 2008 CWI.\n-- Copyright August 2008-2014 MonetDB 
B.V.\n-- All Rights Reserved.\n\n-- COPY into reject management\n\ncreate 
function sys.rejects()\nreturns table(\n\trowid bigint,\n\tfldid 
int,\n\t""message"" string,\n\t""input"" string\n)\nexternal name 
sql.copy_rejects;"   "sql"   1       5       false   false   fa
 lse    2000
+5825   "rejects"       "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\n-- 
COPY into reject management\n\ncreate function sys.rejects()\nreturns 
table(\n\trowid bigint,\n\tfldid int,\n\t""message"" string,\n\t""input"" 
string\n)\nexternal name sql.copy_rejects;"        "sql"   1       5       
false   false   false   2000
 5837   "clearrejects"  "create procedure sys.clearrejects()\nexternal name 
sql.copy_rejects_clear;"    "sql"   1       2       true    false   false   2000
 5839   "stddev_samp"   "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\ncreate 
aggregate stddev_samp(val tinyint) returns double\n\texternal name 
""aggr"".""stdev"";"        "aggr"  1       3       false   false   false   2000
 5843   "stddev_samp"   "create aggregate stddev_samp(val smallint) returns 
double\n\texternal name ""aggr"".""stdev"";"        "aggr"  1       3       
false   false   false   2000
diff --git a/clients/Tests/SQL-dump.stable.out.int128 
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -7727,7 +7727,7 @@ 6266      "stop"  "create procedure sys.stop(t
 6269   "pause" "create procedure sys.pause(tag bigint)\nexternal name 
sql.sysmon_pause;"       "sql"   1       2       true    false   false   2000
 6272   "resume"        "create procedure sys.resume(tag bigint)\nexternal name 
sql.sysmon_resume;"     "sql"   1       2       true    false   false   2000
 6275   "stop"  "create procedure sys.stop(tag bigint)\nexternal name 
sql.sysmon_stop;" "sql"   1       2       true    false   false   2000
-6278   "rejects"       "-- The contents of this file are subject to the 
MonetDB Public License\n-- Version 1.1 (the ""License""); you may not use this 
file except in\n-- compliance with the License. You may obtain a copy of the 
License at\n-- http://www.monetdb.org/Legal/MonetDBLicense\n--\n-- Software 
distributed under the License is distributed on an ""AS IS""\n-- basis, WITHOUT 
WARRANTY OF ANY KIND, either express or implied. See the\n-- License for the 
specific language governing rights and limitations\n-- under the 
License.\n--\n-- The Original Code is the MonetDB Database System.\n--\n-- The 
Initial Developer of the Original Code is CWI.\n-- Portions created by CWI are 
Copyright (C) 1997-July 2008 CWI.\n-- Copyright August 2008-2014 MonetDB 
B.V.\n-- All Rights Reserved.\n\n-- COPY into reject management\n\ncreate 
function sys.rejects()\nreturns table(\n\trowid bigint,\n\tfldid 
int,\n\t""message"" string,\n\t""input"" string\n)\nexternal name 
sql.copy_rejects;"   "sql"   1       5       false   false   fa
 lse    2000
+6278   "rejects"       "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\n-- 
COPY into reject management\n\ncreate function sys.rejects()\nreturns 
table(\n\trowid bigint,\n\tfldid int,\n\t""message"" string,\n\t""input"" 
string\n)\nexternal name sql.copy_rejects;"        "sql"   1       5       
false   false   false   2000
 6290   "clearrejects"  "create procedure sys.clearrejects()\nexternal name 
sql.copy_rejects_clear;"    "sql"   1       2       true    false   false   2000
 6292   "stddev_samp"   "-- This Source Code Form is subject to the terms of 
the Mozilla Public\n-- License, v. 2.0.  If a copy of the MPL was not 
distributed with this\n-- file, You can obtain one at 
http://mozilla.org/MPL/2.0/.\n--\n-- Copyright 2008-2015 MonetDB B.V.\n\ncreate 
aggregate stddev_samp(val tinyint) returns double\n\texternal name 
""aggr"".""stdev"";"        "aggr"  1       3       false   false   false   2000
 6296   "stddev_samp"   "create aggregate stddev_samp(val smallint) returns 
double\n\texternal name ""aggr"".""stdev"";"        "aggr"  1       3       
false   false   false   2000
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -678,8 +678,8 @@ msab_getStatus(sabdb** ret, char *dbname
         * sufficient to see if reparsing is necessary.  The gdk_lock always has
         * to be checked to detect crashes. */
 
-       sabdb *sdb, *top;
-       sdb = top = *ret = NULL;
+       sabdb *sdb;
+       sdb = *ret = NULL;
 
        /* scan the parent for directories */
        if ((p = getFarmPath(pathbuf, sizeof(pathbuf), NULL)) != NULL)
@@ -700,12 +700,10 @@ msab_getStatus(sabdb** ret, char *dbname
                        continue;
 
                sdb = msab_getSingleStatus(pathbuf, e->d_name, sdb);
-               if (top == NULL)
-                       top = sdb;
        }
        (void)closedir(d);
 
-       *ret = top;
+       *ret = sdb;
        return(NULL);
 }
 
diff --git a/monetdb5/extras/pyapi/pyapi.c b/monetdb5/extras/pyapi/pyapi.c
--- a/monetdb5/extras/pyapi/pyapi.c
+++ b/monetdb5/extras/pyapi/pyapi.c
@@ -1674,7 +1674,7 @@ finally:
 PyObject *PyArrayObject_FromScalar(PyInput* inp, char **return_message)
 {
     PyObject *vararray = NULL; 
-    char *msg;
+    char *msg = NULL;
     assert(inp->scalar); //input has to be a scalar
     VERBOSE_MESSAGE("- Loading a scalar of type %s (%i)\n", 
BatType_Format(inp->bat_type), inp->bat_type);
         
diff --git a/monetdb5/extras/rapi/Tests/rapi02.malC 
b/monetdb5/extras/rapi/Tests/rapi02.malC
--- a/monetdb5/extras/rapi/Tests/rapi02.malC
+++ b/monetdb5/extras/rapi/Tests/rapi02.malC
@@ -89,7 +89,7 @@ bat.append(bstr,"asdf":str);
 bat.append(bstr,"sd asd asd asd asd a":str);
 bat.append(bstr,"":str);
 bat.append(bstr,nil:str);
-rstr:bat[:oid,:int] := rapi.eval(nil:ptr,"unlist(lapply(arg1,nchar))",bstr);
+rstr:bat[:oid,:int] := rapi.eval(nil:ptr,"nchar(arg1)",bstr);
 io.print(rstr);
 
 
diff --git a/monetdb5/extras/rapi/Tests/rapi02.stable.out 
b/monetdb5/extras/rapi/Tests/rapi02.stable.out
--- a/monetdb5/extras/rapi/Tests/rapi02.stable.out
+++ b/monetdb5/extras/rapi/Tests/rapi02.stable.out
@@ -112,7 +112,7 @@ Ready.
 [ 0@0, 4       ]
 [ 1@0, 20      ]
 [ 2@0, 0       ]
-[ 3@0, 1       ]
+[ 3@0, 2       ]
 #io.print(rintbi);
 #--------------------------#
 # h    t  # name
diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -153,7 +153,7 @@ void clearRErrConsole(void) {
        // Do nothing?
 }
 
-int RAPIinstalladdons(void);
+static char *RAPIinstalladdons(void);
 
 /* UNIX-like initialization */
 #ifndef WIN32
@@ -162,8 +162,10 @@ int RAPIinstalladdons(void);
 #define CSTACK_DEFNS 1
 #include <Rinterface.h>
 
-static int RAPIinitialize(void) {
+static char *RAPIinitialize(void) {
 // TODO: check for header/library version mismatch?
+       char *e;
+
        // set R_HOME for packages etc. We know this from our configure script
        setenv("R_HOME", RHOME, TRUE);
 
@@ -186,7 +188,7 @@ static int RAPIinitialize(void) {
                Rp->NoRenviron = TRUE;
                stat = Rf_initialize_R(2, rargv);
                if (stat < 0) {
-                       return 2;
+                       return "Rf_initialize failed";
                }
                R_SetParams(Rp);
        }
@@ -207,8 +209,8 @@ static int RAPIinitialize(void) {
        // big boy here
        setup_Rmainloop();
 
-       if (RAPIinstalladdons() != 0) {
-               return 3;
+       if ((e = RAPIinstalladdons()) != 0) {
+               return e;
        }
        // patch R internals to disallow quit and system. Setting them to NULL 
produces an error.
        SET_INTERNAL(install("quit"), R_NilValue);
@@ -216,7 +218,7 @@ static int RAPIinitialize(void) {
        //SET_INTERNAL(install("system"), R_NilValue);
 
        rapiInitialized++;
-       return 0;
+       return NULL;
 }
 #else
 /* Completely different Windows initialization */
@@ -280,23 +282,20 @@ static void my_onintr(int sig)
 
 //extern Rboolean R_LoadRconsole;
 
-int RAPIinitialize(void) {
+static char *RAPIinitialize(void) {
        structRstart rp;
        Rstart Rp = &rp;
        char Rversion[25], *RHome;
 
        snprintf(Rversion, 25, "%s.%s", R_MAJOR, R_MINOR);
        if(strncmp(getDLLVersion(), Rversion, 25) != 0) {
-               fprintf(stderr, "Error: R.DLL version does not match\n");
-               exit(1);
+               return "Error: R.DLL version does not match";
        }
 
        R_setStartTime();
        R_DefParams(Rp);
        if((RHome = get_R_HOME()) == NULL) {
-               fprintf(stderr,
-                               "R_HOME must be set in the environment or 
Registry\n");
-               exit(2);
+               return "R_HOME must be set in the environment or Registry";
        }
        Rp->rhome = RHome;
        Rp->home = getRUser();
@@ -333,7 +332,7 @@ void initRinside() {
 #endif
 
 
-int RAPIinstalladdons(void) {
+static char *RAPIinstalladdons(void) {
        int evalErr;
        ParseStatus status;
        char rlibs[BUFSIZ];
@@ -345,7 +344,7 @@ int RAPIinstalladdons(void) {
                         "rapi_packages");
 
        if (mkdir(rlibs, S_IRWXU) != 0 && errno != EEXIST) {
-               return 4;
+               return "cannot create rapi_packages directory";
        }
 #ifdef _RAPI_DEBUG_
        printf("# R libraries installed in %s\n",rlibs);
@@ -359,6 +358,14 @@ int RAPIinstalladdons(void) {
        // run rapi.R environment setup script
        snprintf(rapiinclude, sizeof(rapiinclude), "source(\"%s\")",
                         locate_file("rapi", ".R", 0));
+#if DIR_SEP != '/'
+       {
+               char *p;
+               for (p = rapiinclude; *p; p++)
+                       if (*p == DIR_SEP)
+                               *p = '/';
+       }
+#endif
        R_tryEvalSilent(
                VECTOR_ELT(
                        R_ParseVector(mkString(rapiinclude), 1, &status,
@@ -366,9 +373,9 @@ int RAPIinstalladdons(void) {
 
        // of course the script may contain errors as well
        if (evalErr != FALSE) {
-               return 5;
+               return "failure running R setup script";
        }
-       return 0;
+       return NULL;
 }
 
 rapi_export str RAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
@@ -749,15 +756,15 @@ str RAPIprelude(void *ret) {
                MT_lock_set(&rapiLock, "rapi.evaluate");
                /* startup internal R environment  */
                if (!rapiInitialized) {
-                       int initstatus;
+                       char *initstatus;
                        initstatus = RAPIinitialize();
                        if (initstatus != 0) {
                                throw(MAL, "rapi.eval",
-                                         "failed to initialise R environment 
(%i)", initstatus);
+                                         "failed to initialise R environment 
(%s)", initstatus);
                        }
                }
                MT_lock_unset(&rapiLock, "rapi.evaluate");
-               fprintf(stdout, "# MonetDB/R   module loaded\n");
+               printf("# MonetDB/R   module loaded\n");
        }
        return MAL_SUCCEED;
 }
diff --git a/sql/backends/monet5/Tests/rapi14.sql 
b/sql/backends/monet5/Tests/rapi14.sql
--- a/sql/backends/monet5/Tests/rapi14.sql
+++ b/sql/backends/monet5/Tests/rapi14.sql
@@ -4,9 +4,9 @@ CREATE TABLE dval(i integer);
 INSERT INTO dval VALUES (1),(2),(3),(4);
 
 CREATE FUNCTION rapi14() returns boolean
-language R
+language P
 {
-    rep(TRUE, 4)
+    return [True, True, True, True]
 };
 
 SELECT rapi14() FROM dval;
diff --git a/sql/scripts/27_rejects.sql b/sql/scripts/27_rejects.sql
--- a/sql/scripts/27_rejects.sql
+++ b/sql/scripts/27_rejects.sql
@@ -1,19 +1,8 @@
--- The contents of this file are subject to the MonetDB Public License
--- Version 1.1 (the "License"); you may not use this file except in
--- compliance with the License. You may obtain a copy of the License at
--- http://www.monetdb.org/Legal/MonetDBLicense
+-- 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/.
 --
--- Software distributed under the License is distributed on an "AS IS"
--- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
--- License for the specific language governing rights and limitations
--- under the License.
---
--- The Original Code is the MonetDB Database System.
---
--- The Initial Developer of the Original Code is CWI.
--- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
--- Copyright August 2008-2014 MonetDB B.V.
--- All Rights Reserved.
+-- Copyright 2008-2015 MonetDB B.V.
 
 -- COPY into reject management
 
diff --git a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql 
b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
--- a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
+++ b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
@@ -1,5 +1,67 @@
+CREATE TABLE "sys"."tbls" (
+       "id"            INTEGER,
+       "name"          VARCHAR(1024),
+       "schema_id"     INTEGER,
+       "query"         VARCHAR(2048),
+       "type"          SMALLINT,
+       "system"        BOOLEAN,
+       "commit_action" SMALLINT,
+       "access"        SMALLINT
+);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to