Changeset: faeea75126f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=faeea75126f7
Added Files:
        sql/test/malloc_fail/Tests/initialize.sql
        sql/test/malloc_fail/Tests/initialize.stable.err
        sql/test/malloc_fail/Tests/initialize.stable.out
        sql/test/malloc_fail/Tests/setmemorylimit-fail.reqtests
        sql/test/malloc_fail/Tests/setmemorylimit-fail2.reqtests
        sql/test/malloc_fail/Tests/setmemorylimit.reqtests
Removed Files:
        sql/backends/monet5/sql_readline.c
        sql/backends/monet5/sql_readline.h
Modified Files:
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        clients/Tests/exports.stable.out
        clients/mapiclient/stethoscope.c
        clients/mapiclient/tachograph.c
        clients/mapiclient/tomograph.c
        monetdb5/mal/Makefile.ag
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_import.c
        monetdb5/mal/mal_private.h
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_readline.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/clients.h
        monetdb5/modules/mal/clients.mal
        monetdb5/modules/mal/mal_mapi.c
        monetdb5/optimizer/opt_mergetable.c
        monetdb5/tools/Makefile.ag
        sql/backends/monet5/Makefile.ag
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/vaults/Makefile.ag
        sql/backends/monet5/vaults/fits/Makefile.ag
        sql/backends/monet5/vaults/lidar/Makefile.ag
        sql/backends/monet5/vaults/netcdf/Makefile.ag
        sql/backends/monet5/vaults/shp/Makefile.ag
        sql/scripts/25_debug.sql
        sql/server/rel_optimizer.c
        sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade/Tests/check.stable.out
        sql/test/emptydb-upgrade/Tests/check.stable.out.int128
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/emptydb/updatetests
        sql/test/malloc_fail/Tests/All
Branch: jit
Log Message:

Merge with default


diffs (truncated from 1651 to 300 lines):

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
@@ -951,7 +951,7 @@ create filter function "like"(val string
 
 create procedure listdir(dirname string) external name fits.listdir;
 create procedure listdirpat(dirname string,pat string) external name 
fits.listdirpattern;
-create function sys.malfunctions() returns table("signature" string, "address" 
string, "comment" string) external name "manual"."functions";
+create function sys.malfunctions() returns table("module" string, "function" 
string, "signature" string, "address" string, "comment" string) external name 
"manual"."functions";
 create function "masklen" (p inet) returns int external name inet."masklen";
 create function mbr(geom geometry) returns mbr external name geom."mbr";
 create function sys.md5(v string) returns string external name clients.md5sum;
@@ -2099,7 +2099,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
-[ "sys",       "malfunctions", "create function sys.malfunctions() returns 
table(\"signature\" string, \"address\" string, \"comment\" string) external 
name \"manual\".\"functions\";",       "manual",       1,      5,      false,  
false,  false   ]
+[ "sys",       "malfunctions", "create function sys.malfunctions() returns 
table(\"module\" string, \"function\" string, \"signature\" string, \"address\" 
string, \"comment\" string) external name \"manual\".\"functions\";",       
"manual",       1,      5,      false,  false,  false   ]
 [ "sys",       "masklen",      "create function \"masklen\" (p inet) returns 
int external name inet.\"masklen\";",     "inet", 1,      1,      false,  
false,  false   ]
 [ "sys",       "max",  "max",  "aggr", 0,      3,      false,  false,  false   
]
 [ "sys",       "mbr",  "create function mbr(geom geometry) returns mbr 
external name geom.\"mbr\";",   "geom", 1,      1,      false,  false,  false   
]
@@ -3653,7 +3653,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "ltrim",        "arg_1",        "clob", 0,      0,      1,      
"arg_2",        "clob", 0,      0,      1,      NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
 [ "sys",       "ltrim",        "arg_1",        "varchar",      0,      0,      
1,      NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
 [ "sys",       "ltrim",        "arg_1",        "varchar",      0,      0,      
1,      "arg_2",        "varchar",      0,      0,      1,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL    ]
-[ "sys",       "malfunctions", "address",      "clob", 0,      0,      0,      
"comment",      "clob", 0,      0,      0,      NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
+[ "sys",       "malfunctions", "function",     "clob", 0,      0,      0,      
"signature",    "clob", 0,      0,      0,      "address",      "clob", 0,      
0,      0,      "comment",      "clob", 0,      0,      0,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL    ]
 [ "sys",       "masklen",      "p",    "inet", 0,      0,      1,      NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys",       "max",  "arg",  "any",  0,      0,      1,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys",       "mbr",  "geom", "geometry",     0,      0,      1,      NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
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
@@ -951,7 +951,7 @@ create filter function "like"(val string
 
 create procedure listdir(dirname string) external name fits.listdir;
 create procedure listdirpat(dirname string,pat string) external name 
fits.listdirpattern;
-create function sys.malfunctions() returns table("signature" string, "address" 
string, "comment" string) external name "manual"."functions";
+create function sys.malfunctions() returns table("module" string, "function" 
string, "signature" string, "address" string, "comment" string) external name 
"manual"."functions";
 create function "masklen" (p inet) returns int external name inet."masklen";
 create function mbr(geom geometry) returns mbr external name geom."mbr";
 create function sys.md5(v string) returns string external name clients.md5sum;
@@ -2122,7 +2122,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
 [ "sys",       "ltrim",        "ltrim",        "str",  0,      1,      false,  
false,  false   ]
-[ "sys",       "malfunctions", "create function sys.malfunctions() returns 
table(\"signature\" string, \"address\" string, \"comment\" string) external 
name \"manual\".\"functions\";",       "manual",       1,      5,      false,  
false,  false   ]
+[ "sys",       "malfunctions", "create function sys.malfunctions() returns 
table(\"module\" string, \"function\" string, \"signature\" string, \"address\" 
string, \"comment\" string) external name \"manual\".\"functions\";",       
"manual",       1,      5,      false,  false,  false   ]
 [ "sys",       "masklen",      "create function \"masklen\" (p inet) returns 
int external name inet.\"masklen\";",     "inet", 1,      1,      false,  
false,  false   ]
 [ "sys",       "max",  "max",  "aggr", 0,      3,      false,  false,  false   
]
 [ "sys",       "mbr",  "create function mbr(geom geometry) returns mbr 
external name geom.\"mbr\";",   "geom", 1,      1,      false,  false,  false   
]
@@ -3856,7 +3856,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "ltrim",        "arg_1",        "clob", 0,      0,      1,      
"arg_2",        "clob", 0,      0,      1,      NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
 [ "sys",       "ltrim",        "arg_1",        "varchar",      0,      0,      
1,      NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
 [ "sys",       "ltrim",        "arg_1",        "varchar",      0,      0,      
1,      "arg_2",        "varchar",      0,      0,      1,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL    ]
-[ "sys",       "malfunctions", "address",      "clob", 0,      0,      0,      
"comment",      "clob", 0,      0,      0,      NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL    ]
+[ "sys",       "malfunctions", "function",     "clob", 0,      0,      0,      
"signature",    "clob", 0,      0,      0,      "address",      "clob", 0,      
0,      0,      "comment",      "clob", 0,      0,      0,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL    ]
 [ "sys",       "masklen",      "p",    "inet", 0,      0,      1,      NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys",       "max",  "arg",  "any",  0,      0,      1,      NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys",       "mbr",  "geom", "geometry",     0,      0,      1,      NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL    ]
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
@@ -904,7 +904,6 @@ str CLTquit(Client cntxt, MalBlkPtr mb, 
 str CLTremoveUser(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CLTripemd160sum(str *ret, str *pw);
 str CLTsessions(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str CLTsetHistory(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CLTsetListing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CLTsetPassword(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str CLTsetScenario(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -339,6 +339,9 @@ main(int argc, char **argv)
        }
        conn = mapi_get_from(dbh);
        while ((n = mnstr_read(conn, buffer + len, 1, buflen - len-1)) >= 0) {
+               if (n == 0 &&
+                   (n = mnstr_read(conn, buffer + len, 1, buflen - len-1)) <= 
0)
+                       break;
                buffer[len + n] = 0;
                response = buffer;
                if( debug)
diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c
--- a/clients/mapiclient/tachograph.c
+++ b/clients/mapiclient/tachograph.c
@@ -521,6 +521,9 @@ main(int argc, char **argv)
        }
        conn = mapi_get_from(dbh);
        while ((n = mnstr_read(conn, buffer + len, 1, buflen - len-1)) >= 0) {
+               if (n == 0 &&
+                   (n = mnstr_read(conn, buffer + len, 1, buflen - len-1)) <= 
0)
+                       break;
                buffer[len + n] = 0;
                response = buffer;
                while ((e = strchr(response, '\n')) != NULL) {
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1877,7 +1877,8 @@ main(int argc, char **argv)
                resetTomograph();
                conn = mapi_get_from(dbh);
                while ((m = mnstr_read(conn, buffer + len, 1, buflen - len-1)) 
>= 0) {
-                       if (m == 0 && (m = mnstr_read(conn, buffer + len, 1, 
buflen - len-1)) <= 0)
+                       if (m == 0 &&
+                           (m = mnstr_read(conn, buffer + len, 1, buflen - 
len-1)) <= 0)
                                break;
                        buffer[len + m] = 0;
                        response = buffer;
diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -9,8 +9,7 @@ INCLUDES = ../../common/options \
                   ../../common/utils \
                   ../../clients/mapilib \
                   ../../gdk \
-                  ../optimizer \
-                  $(READLINE_INCS) 
+                  ../optimizer
 MTSAFE
 
 lib_mal = {
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -18,10 +18,12 @@
 #define CONSOLE     0
 #define isAdministrator(X) (X==mal_clients)
 
-#define FREECLIENT     0
-#define FINISHCLIENT   1   
-#define RUNCLIENT              2
-#define BLOCKCLIENT     3
+enum clientmode {
+       FREECLIENT,
+       FINISHCLIENT,
+       RUNCLIENT,
+       BLOCKCLIENT
+};
 
 #define PROCESSTIMEOUT  2   /* seconds */
 
@@ -125,7 +127,7 @@ typedef struct CLIENT {
        int debug;
        void  *mdb;            /* context upon suspend */
        str    history;        /* where to keep console history */
-       short  mode;           /* FREECLIENT..BLOCKED */
+       enum clientmode mode;  /* FREECLIENT..BLOCKED */
        /*
         * Client records are organized into a two-level dependency tree,
         * where children may be created to deal with parallel processing
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -112,7 +112,7 @@ malLoadScript(Client c, str name, bstrea
        bstream *oldfdin = c->fdin; \
        int oldyycur = c->yycur; \
        int oldlisting = c->listing; \
-       int oldmode = c->mode; \
+       enum clientmode oldmode = c->mode; \
        int oldblkmode = c->blkmode; \
        str oldsrcFile = c->srcFile; \
        ClientInput *oldbak = c->bak; \
@@ -121,7 +121,7 @@ malLoadScript(Client c, str name, bstrea
        Symbol oldprg = c->curprg; \
        MalStkPtr oldglb = c->glb       /* ; added by caller */
 #define restoreState3 \
-       int oldmode = c->mode; \
+       enum clientmode oldmode = c->mode; \
        int oldblkmode = c->blkmode; \
        str oldsrcFile = c->srcFile; \
        Module oldnspace = c->nspace; \
@@ -174,7 +174,7 @@ malInclude(Client c, str name, int listi
        bstream *oldfdin = c->fdin;
        int oldyycur = c->yycur;
        int oldlisting = c->listing;
-       int oldmode = c->mode;
+       enum clientmode oldmode = c->mode;
        int oldblkmode = c->blkmode;
        ClientInput *oldbak = c->bak;
        str oldprompt = c->prompt;
diff --git a/monetdb5/mal/mal_private.h b/monetdb5/mal/mal_private.h
--- a/monetdb5/mal/mal_private.h
+++ b/monetdb5/mal/mal_private.h
@@ -12,8 +12,8 @@
 #error this file should not be included outside its source directory
 #endif
 
-#ifdef FREECLIENT
-/* FREECLIENT is defined in the same file as Client */
+#ifdef _MAL_CLIENT_H_
+/* _MAL_CLIENT_H_ is defined in the same file as Client */
 __hidden void MCexitClient(Client c)
        __attribute__((__visibility__("hidden")));
 __hidden int MCreadClient(Client c)
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -786,19 +786,19 @@ clearTrace(void)
                return;     /* not initialized */
        }
        /* drop all trace tables */
-       BBPunfix(TRACE_id_event->batCacheid);
-       BBPunfix(TRACE_id_time->batCacheid);
-       BBPunfix(TRACE_id_pc->batCacheid);
-       BBPunfix(TRACE_id_thread->batCacheid);
-       BBPunfix(TRACE_id_ticks->batCacheid);
-       BBPunfix(TRACE_id_rssMB->batCacheid);
-       BBPunfix(TRACE_id_tmpspace->batCacheid);
-       BBPunfix(TRACE_id_inblock->batCacheid);
-       BBPunfix(TRACE_id_oublock->batCacheid);
-       BBPunfix(TRACE_id_minflt->batCacheid);
-       BBPunfix(TRACE_id_majflt->batCacheid);
-       BBPunfix(TRACE_id_nvcsw->batCacheid);
-       BBPunfix(TRACE_id_stmt->batCacheid);
+       BBPclear(TRACE_id_event->batCacheid);
+       BBPclear(TRACE_id_time->batCacheid);
+       BBPclear(TRACE_id_pc->batCacheid);
+       BBPclear(TRACE_id_thread->batCacheid);
+       BBPclear(TRACE_id_ticks->batCacheid);
+       BBPclear(TRACE_id_rssMB->batCacheid);
+       BBPclear(TRACE_id_tmpspace->batCacheid);
+       BBPclear(TRACE_id_inblock->batCacheid);
+       BBPclear(TRACE_id_oublock->batCacheid);
+       BBPclear(TRACE_id_minflt->batCacheid);
+       BBPclear(TRACE_id_majflt->batCacheid);
+       BBPclear(TRACE_id_nvcsw->batCacheid);
+       BBPclear(TRACE_id_stmt->batCacheid);
        TRACE_init = 0;
        MT_lock_unset(&mal_contextLock);
        initTrace();
diff --git a/monetdb5/mal/mal_readline.c b/monetdb5/mal/mal_readline.c
--- a/monetdb5/mal/mal_readline.c
+++ b/monetdb5/mal/mal_readline.c
@@ -17,8 +17,6 @@
 #include <strings.h>           /* for strncasecmp */
 #endif
 
-/* #define _MAL_READLINE_DEBUG  */
-
 #ifndef S_ISCHR
 #define S_ISCHR(m)  (((m) & S_IFMT) == S_IFCHR)
 #endif
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -137,10 +137,9 @@ exit_streams( bstream *fin, stream *fout
 {
        if (fout && fout != GDKstdout) {
                mnstr_flush(fout);
-               mnstr_close(fout);
-               mnstr_destroy(fout);
+               close_stream(fout);
        }
-       if (fin) 
+       if (fin)
                (void) bstream_destroy(fin);
 }
 
@@ -422,7 +421,7 @@ MSserveClient(void *dummy)
                c->glb = newGlobalStack(MAXGLOBALS + mb->vsize);
        if (c->glb == NULL) {
                showException(c->fdout, MAL, "serveClient", MAL_MALLOC_FAIL);
-               c->mode = FINISHCLIENT + 1; /* == RUNCLIENT */
+               c->mode = RUNCLIENT;
        } else {
                c->glb->stktop = mb->vtop;
                c->glb->blk = mb;
@@ -432,7 +431,7 @@ MSserveClient(void *dummy)
                msg = defaultScenario(c);
        if (msg) {
                showException(c->fdout, MAL, "serveClient", "could not 
initialize default scenario");
-               c->mode = FINISHCLIENT + 1; /* == RUNCLIENT */
+               c->mode = RUNCLIENT;
                GDKfree(msg);
        } else {
                do {
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -27,11 +27,6 @@
 #include "mal_private.h"
 #include "mtime.h"
 
-#ifdef HAVE_LIBREADLINE
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
-
 static void
 pseudo(bat *ret, BAT *b, str X1,str X2) {
        char buf[BUFSIZ];
@@ -277,29 +272,6 @@ CLTusers(bat *ret)
 }
 
 str
-CLTsetHistory(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
-       str* fname = getArgReference_str(stk,pci,1);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to