Changeset: bb9147180e61 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb9147180e61
Removed Files:
        monetdb5/mal/mal_readline.c
        monetdb5/mal/mal_readline.h
Modified Files:
        NT/monetdb_config.h.in
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        clients/mapiclient/mclient.c
        clients/mapilib/mapi.c
        common/options/monet_options.c
        common/utils/msabaoth.c
        common/utils/msabaoth.h
        configure.ag
        monetdb5/mal/Makefile.ag
        monetdb5/mal/Tests/tst251.stable.out
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/uuid.c
        monetdb5/modules/mal/clients.c
        monetdb5/tools/Tests/mserver5--help.stable.err
        monetdb5/tools/Tests/mserver5--help.stable.err.Windows
        sql/backends/monet5/Tests/simpleSQL.malC
        sql/backends/monet5/Tests/simpleSQL.stable.out
        sql/backends/monet5/mal_backend.c
        sql/backends/monet5/mal_backend.h
        sql/backends/monet5/sql.mal
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_scenario.h
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.err
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.out
        
sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
        sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out
        
sql/test/BugTracker-2016/Tests/convert-function-test.Bug-3460.stable.out.int128
        testing/Mtest.py.in
        tools/merovingian/daemon/forkmserver.c
        tools/mserver/mserver5.c
Branch: context
Log Message:

merged with default


diffs (truncated from 1878 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -136,9 +136,6 @@
 /* Define if you have the CommonCrypto library */
 /* #undef HAVE_COMMONCRYPTO */
 
-/* If the console should be used */
-#define HAVE_CONSOLE 1
-
 /* Define to 1 if you have the `ctime_r' function. */
 #define HAVE_CTIME_R 1
 
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
@@ -11724,7 +11724,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sql",       "grow", "pattern sql.grow(tid:bat[:oid], X_0:any_1):int ",      
"mvc_grow_wrap;",       "Resize the tid column of a declared table."    ]
 [ "sql",       "importTable",  "unsafe pattern sql.importTable(sname:str, 
tname:str, onclient:int, fname:str...):bat[:any]... ",       
"mvc_bin_import_table_wrap;",   "Import a table from the files (fname)" ]
 [ "sql",       "include",      "pattern sql.include(fname:str):void ", 
"SQLinclude;",  "Compile and execute a sql statements on the file"      ]
-[ "sql",       "init", "pattern sql.init():void ",     "SQLinitEnvironment;",  
"Initialize the environment for MAL"    ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, d:any_1, p:any_3, 
o:any_4):any_1 ",  "SQLlag;",      "return the value in the previous 'l' row in 
the partition or 'd' if non existent"      ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, d:bat[:any_1], 
p:any_3, o:any_4):any_1 ",    "SQLlag;",      "return the value in the previous 
'l' row in the partition or 'd' if non existent"      ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, p:any_3, 
o:any_4):any_1 ",   "SQLlag;",      "return the value in the previous 'l' row 
in the partition or NULL if non existent"     ]
@@ -11801,8 +11800,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sql",       "single",       "pattern sql.single(x:any_2):bat[:any_2] ",     
"CMDBATsingle;",        ""      ]
 [ "sql",       "sql_environment",      "inline function sql.sql_environment() 
(name:bat[:str], value:bat[:str]);",     "",     ""      ]
 [ "sql",       "sql_variables",        "pattern sql.sql_variables():bat[:str] 
",       "sql_variables;",       "return the table with session variables"      
 ]
-[ "sql",       "start",        "pattern sql.start():void ",    "SQLsession;",  
"Switch to processing SQL statements"   ]
-[ "sql",       "start2",       "pattern sql.start2():void ",   "SQLsession2;", 
"Switch to processing precompiled sql statements"       ]
 [ "sql",       "storage",      "pattern sql.storage() (schema:bat[:str], 
table:bat[:str], column:bat[:str], type:bat[:str], mode:bat[:str], 
location:bat[:str], count:bat[:lng], atomwidth:bat[:int], columnsize:bat[:lng], 
heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], imprints:bat[:lng], 
sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], orderidx:bat[:lng]) ",    
    "sql_storage;", "return a table with storage information "      ]
 [ "sql",       "storage",      "pattern sql.storage(sname:str) 
(schema:bat[:str], table:bat[:str], column:bat[:str], type:bat[:str], 
mode:bat[:str], location:bat[:str], count:bat[:lng], atomwidth:bat[:int], 
columnsize:bat[:lng], heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], 
imprints:bat[:lng], sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], 
orderidx:bat[:lng]) ",       "sql_storage;", "return a table with storage 
information for a particular schema "      ]
 [ "sql",       "storage",      "pattern sql.storage(sname:str, tname:str) 
(schema:bat[:str], table:bat[:str], column:bat[:str], type:bat[:str], 
mode:bat[:str], location:bat[:str], count:bat[:lng], atomwidth:bat[:int], 
columnsize:bat[:lng], heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], 
imprints:bat[:lng], sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], 
orderidx:bat[:lng]) ",    "sql_storage;", "return a table with storage 
information for a particular table"        ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -16138,7 +16138,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sql",       "grow", "pattern sql.grow(tid:bat[:oid], X_0:any_1):int ",      
"mvc_grow_wrap;",       "Resize the tid column of a declared table."    ]
 [ "sql",       "importTable",  "unsafe pattern sql.importTable(sname:str, 
tname:str, onclient:int, fname:str...):bat[:any]... ",       
"mvc_bin_import_table_wrap;",   "Import a table from the files (fname)" ]
 [ "sql",       "include",      "pattern sql.include(fname:str):void ", 
"SQLinclude;",  "Compile and execute a sql statements on the file"      ]
-[ "sql",       "init", "pattern sql.init():void ",     "SQLinitEnvironment;",  
"Initialize the environment for MAL"    ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, d:any_1, p:any_3, 
o:any_4):any_1 ",  "SQLlag;",      "return the value in the previous 'l' row in 
the partition or 'd' if non existent"      ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, d:bat[:any_1], 
p:any_3, o:any_4):any_1 ",    "SQLlag;",      "return the value in the previous 
'l' row in the partition or 'd' if non existent"      ]
 [ "sql",       "lag",  "pattern sql.lag(b:any_1, l:any_2, p:any_3, 
o:any_4):any_1 ",   "SQLlag;",      "return the value in the previous 'l' row 
in the partition or NULL if non existent"     ]
@@ -16221,8 +16220,6 @@ stdout of test 'MAL-signatures` in direc
 [ "sql",       "single",       "pattern sql.single(x:any_2):bat[:any_2] ",     
"CMDBATsingle;",        ""      ]
 [ "sql",       "sql_environment",      "inline function sql.sql_environment() 
(name:bat[:str], value:bat[:str]);",     "",     ""      ]
 [ "sql",       "sql_variables",        "pattern sql.sql_variables():bat[:str] 
",       "sql_variables;",       "return the table with session variables"      
 ]
-[ "sql",       "start",        "pattern sql.start():void ",    "SQLsession;",  
"Switch to processing SQL statements"   ]
-[ "sql",       "start2",       "pattern sql.start2():void ",   "SQLsession2;", 
"Switch to processing precompiled sql statements"       ]
 [ "sql",       "storage",      "pattern sql.storage() (schema:bat[:str], 
table:bat[:str], column:bat[:str], type:bat[:str], mode:bat[:str], 
location:bat[:str], count:bat[:lng], atomwidth:bat[:int], columnsize:bat[:lng], 
heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], imprints:bat[:lng], 
sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], orderidx:bat[:lng]) ",    
    "sql_storage;", "return a table with storage information "      ]
 [ "sql",       "storage",      "pattern sql.storage(sname:str) 
(schema:bat[:str], table:bat[:str], column:bat[:str], type:bat[:str], 
mode:bat[:str], location:bat[:str], count:bat[:lng], atomwidth:bat[:int], 
columnsize:bat[:lng], heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], 
imprints:bat[:lng], sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], 
orderidx:bat[:lng]) ",       "sql_storage;", "return a table with storage 
information for a particular schema "      ]
 [ "sql",       "storage",      "pattern sql.storage(sname:str, tname:str) 
(schema:bat[:str], table:bat[:str], column:bat[:str], type:bat[:str], 
mode:bat[:str], location:bat[:str], count:bat[:lng], atomwidth:bat[:int], 
columnsize:bat[:lng], heap:bat[:lng], hashes:bat[:lng], phash:bat[:bit], 
imprints:bat[:lng], sorted:bat[:bit], revsorted:bat[:bit], key:bat[:bit], 
orderidx:bat[:lng]) ",    "sql_storage;", "return a table with storage 
information for a particular table"        ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2217,7 +2217,6 @@ int getBitConstant(MalBlkPtr mb, bit val
 int getBlockBegin(MalBlkPtr mb, int pc);
 int getBlockExit(MalBlkPtr mb, int pc);
 int getBteConstant(MalBlkPtr mb, bte val);
-char *getConsoleInput(Client c, const char *prompt, int linemode, int 
exit_on_error);
 int getDblConstant(MalBlkPtr mb, dbl val);
 lng getDiskReads(void);
 lng getDiskSpace(void);
@@ -2375,8 +2374,6 @@ str mal_quote(const char *msg, size_t si
 MT_Lock mal_remoteLock;
 void mal_resource_reset(void) __attribute__((__visibility__("hidden")));
 void mal_runtime_reset(void) __attribute__((__visibility__("hidden")));
-str mal_session_uuid;
-int mal_trace;
 void mal_unquote(char *msg);
 str manifoldRef;
 str mapiRef;
@@ -2432,6 +2429,7 @@ char *msab_getDBfarm(char **ret);
 char *msab_getDBname(char **ret);
 char *msab_getMyStatus(sabdb **ret);
 char *msab_getStatus(sabdb **ret, char *dbname);
+char *msab_getUUID(char **ret);
 char *msab_getUplogInfo(sabuplog *ret, const sabdb *db);
 char *msab_marchConnection(const char *host, const int port);
 char *msab_marchScenario(const char *lang);
@@ -2553,7 +2551,6 @@ str raiseRef;
 str rangejoinRef;
 str rankRef;
 str rapiRef;
-int readConsole(Client cntxt);
 MalStkPtr reallocGlobalStack(MalStkPtr s, int cnt);
 str reconnectRef;
 str reenterMAL(Client cntxt, MalBlkPtr mb, int startpc, int stoppc, MalStkPtr 
stk);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -27,6 +27,7 @@
 #ifdef HAVE_STRINGS_H
 #include <strings.h>           /* strcasecmp */
 #endif
+#include <sys/stat.h>
 
 #ifdef HAVE_LIBREADLINE
 #include <readline/readline.h>
@@ -3241,6 +3242,18 @@ usage(const char *prog, int xit)
 /* hardwired defaults, only used if monet environment cannot be found */
 #define defaultPort 50000
 
+static inline bool
+isfile(FILE *fp)
+{
+       struct stat stb;
+       if (fstat(fileno(fp), &stb) < 0 ||
+           (stb.st_mode & S_IFMT) != S_IFREG) {
+               fclose(fp);
+               return false;
+       }
+       return true;
+}
+
 int
 main(int argc, char **argv)
 {
@@ -3559,7 +3572,8 @@ main(int argc, char **argv)
        has_fileargs = optind != argc;
 
        if (dbname == NULL && has_fileargs &&
-           (fp = fopen(argv[optind], "r")) == NULL) {
+           ((fp = fopen(argv[optind], "r")) == NULL || !isfile(fp))) {
+               fp = NULL;
                dbname = strdup(argv[optind]);
                optind++;
                has_fileargs = optind != argc;
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3649,7 +3649,7 @@ slice_row(const char *reply, char *null,
        i = 0;
        anchors = length == 0 ? NULL : malloc(length * sizeof(*anchors));
        lens = length == 0 ? NULL : malloc(length * sizeof(*lens));
-       do {
+       for (;;) {
                if (i >= length) {
                        length = i + 1;
                        REALLOC(anchors, length);
@@ -3663,9 +3663,17 @@ slice_row(const char *reply, char *null,
                }
                lens[i] = len;
                anchors[i++] = start;
-               while (reply && *reply && isspace((unsigned char) *reply))
+               if (reply == NULL)
+                       break;
+               while (*reply && isspace((unsigned char) *reply))
+                       reply++;
+               if (*reply == ',') {
                        reply++;
-       } while (reply && *reply && *reply != endchar);
+                       while (*reply && isspace((unsigned char) *reply))
+                               reply++;
+               } else if (*reply == 0 || *reply == endchar)
+                       break;
+       }
        *anchorsp = anchors;
        *lensp = lens;
        return i;
@@ -4774,8 +4782,6 @@ unquote(const char *msg, char **str, con
                /* skip over trailing junk (presumably white space) */
                while (*p && *p != ',' && *p != endchar)
                        p++;
-               if (*p == ',')
-                       p++;
                if (next)
                        *next = p;
                *str = start;
@@ -4797,8 +4803,7 @@ unquote(const char *msg, char **str, con
                        ;
                if (s < msg || !isspace((unsigned char) *s))    /* gone one too 
far */
                        s++;
-               if (*p == ',' || *p == '\t') {
-                       /* there is more to come; skip over separator */
+               if (*p == '\t') {
                        p++;
                }
                len = s - msg;
diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -219,7 +219,7 @@ mo_builtin_settings(opt **Set)
        if (Set == NULL)
                return 0;
 
-#define N_OPTIONS      9       /*MUST MATCH # OPTIONS BELOW */
+#define N_OPTIONS      8       /*MUST MATCH # OPTIONS BELOW */
        set = malloc(sizeof(opt) * N_OPTIONS);
        if (set == NULL)
                return 0;
@@ -234,10 +234,6 @@ mo_builtin_settings(opt **Set)
        set[i].value = strdup(">");
        i++;
        set[i].kind = opt_builtin;
-       set[i].name = strdup("monet_daemon");
-       set[i].value = strdup("no");
-       i++;
-       set[i].kind = opt_builtin;
        set[i].name = strdup("mapi_port");
        set[i].value = strdup("50000");
        i++;
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -45,7 +45,7 @@ char *_sabaoth_internal_dbfarm = NULL;
 /** the database which is "active" */
 char *_sabaoth_internal_dbname = NULL;
 /** identifier of the current process */
-char *_sabaoth_internal_uuid = NULL;
+static char *_sabaoth_internal_uuid = NULL;
 
 /**
  * Retrieves the dbfarm path plus an optional extra component added
@@ -242,6 +242,15 @@ msab_getDBname(char **ret)
        return(NULL);
 }
 
+char *
+msab_getUUID(char **ret)
+{
+       if (_sabaoth_internal_uuid == NULL)
+               return(strdup("sabaoth not initialized"));
+       *ret = strdup(_sabaoth_internal_uuid);
+       return NULL;
+}
+
 #define SCENARIOFILE ".scen"
 
 /**
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -65,6 +65,7 @@ msab_export void msab_dbpathinit(const c
 msab_export void msab_dbfarminit(const char *dbfarm);
 msab_export char *msab_getDBfarm(char **ret);
 msab_export char *msab_getDBname(char **ret);
+msab_export char *msab_getUUID(char **ret);
 msab_export char *msab_marchScenario(const char *lang);
 msab_export char *msab_retreatScenario(const char *lang);
 msab_export char *msab_marchConnection(const char *host, const int port);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -300,21 +300,6 @@ AC_ARG_ENABLE(py3integration,
        enable_py3integration=$enableval,
        enable_py3integration=$dft_py3integration)
 
-# The console is a direct client hooked onto the kernel with full
-# administrative privileges, bypassing any security checks.  It is
-# handy only during development.
-# We simply can't disable it for now because Testing gets hopelessly
-# upset about it, but we can offer to the user to disable it for
-# increased security.
-dft_console=yes
-AC_ARG_ENABLE([console],
-       [AS_HELP_STRING([--enable-console],
-               [enables direct console on the server (involves security risks) 
(default=yes)])],
-       [enable_console="$enableval"],
-       [enable_console=$dft_console])
-AS_VAR_IF([enable_console], [no], [],
-       [AC_DEFINE([HAVE_CONSOLE], 1, [If the console should be used])])
-
 dft_int128=auto
 AC_ARG_ENABLE([int128],
        [AS_HELP_STRING([--enable-int128],
@@ -2954,7 +2939,6 @@ for comp in \
        'monetdb5      ' \
        'sql           ' \
        'geom          ' \
-       'console       ' \
        'py2integration' \
        'py3integration' \
        'rintegration  ' \
diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -38,7 +38,6 @@ lib_mal = {
                mal_namespace.c mal_namespace.h \
                mal_parser.c mal_parser.h \
                mal_profiler.c mal_profiler.h \
-               mal_readline.c mal_readline.h \
                mal_resolve.c mal_resolve.h \
                mal_sabaoth.c mal_sabaoth.h \
                mal_scenario.c mal_scenario.h \
diff --git a/monetdb5/mal/Tests/tst251.stable.out 
b/monetdb5/mal/Tests/tst251.stable.out
--- a/monetdb5/mal/Tests/tst251.stable.out
+++ b/monetdb5/mal/Tests/tst251.stable.out
@@ -43,7 +43,7 @@ stdout of test 'tst251` in directory 'mo
 [ 0,   "hello" ]
 [ 1,   "brave" ]
 [ 2,   "world" ]
-[ 3    ]
+[ 3,   ""      ]
 [ 4,   nil     ]
 [ 5,   "!"     ]
 
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to