Changeset: 477fd309b52a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=477fd309b52a
Modified Files:
        clients/NT/mclient.bat
        clients/NT/msqldump.bat
        clients/NT/stethoscope.bat
        clients/Tests/exports.stable.out
        clients/odbc/driver/README
        gdk/gdk_bbp.c
        gdk/gdk_heap.c
        gdk/gdk_utils.c
        monetdb5/NT/M5server.bat
        
monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_resource.h
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/manifold.c
        monetdb5/optimizer/opt_mitosis.c
        monetdb5/optimizer/opt_mitosis.h
        monetdb5/optimizer/opt_support.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
        sql/backends/monet5/sql_scenario.c
        sql/server/rel_optimizer.c
        sql/test/BugTracker-2017/Tests/side-effect.Bug-6397.stable.out
        tools/mserver/mserver5.c
Branch: sq2default
Log Message:

Merge with default


diffs (truncated from 778 to 300 lines):

diff --git a/clients/NT/mclient.bat b/clients/NT/mclient.bat
--- a/clients/NT/mclient.bat
+++ b/clients/NT/mclient.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 if not "%1"=="/STARTED-FROM-MENU" goto skip
 shift
diff --git a/clients/NT/msqldump.bat b/clients/NT/msqldump.bat
--- a/clients/NT/msqldump.bat
+++ b/clients/NT/msqldump.bat
@@ -11,8 +11,7 @@
 @set MONETDB=%MONETDB:~0,-1%
 
 @rem extend the search path with our EXE and DLL folders
-@rem we depend on pthreadVCE.dll having been copied to the lib folder
-@set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+@set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 @rem start the real client
 @"%MONETDB%\bin\msqldump.exe" %*
diff --git a/clients/NT/stethoscope.bat b/clients/NT/stethoscope.bat
--- a/clients/NT/stethoscope.bat
+++ b/clients/NT/stethoscope.bat
@@ -12,8 +12,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-rem we depend on pthreadVCE.dll having been copied to the lib folder
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\bin;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 rem start the real client
 "%MONETDB%\bin\stethoscope.exe" %1 %2 %3 %4 %5 %6 %7 %8
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
@@ -1355,7 +1355,8 @@ str LIKEjoin(bat *r1, bat *r2, const bat
 str LIKEjoin1(bat *r1, bat *r2, const bat *lid, const bat *rid, const bat 
*slid, const bat *srid, const bit *nil_matches, const lng *estimate);
 str MACROprocessor(Client cntxt, MalBlkPtr mb, Symbol t);
 int MAL_MAXCLIENTS;
-int MALadmission(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, lng 
argclaim);
+int MALadmission_claim(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci, lng argclaim);
+void MALadmission_release(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci, lng argclaim);
 str MALassertBit(void *ret, bit *val, str *msg);
 str MALassertHge(void *ret, hge *val, str *msg);
 str MALassertInt(void *ret, int *val, str *msg);
@@ -2389,7 +2390,6 @@ int mnstr_write_string(Stream *S, str da
 str mnstr_write_stringwrap(void *ret, Stream *S, str *data);
 char monet_characteristics[4096];
 char monet_cwd[FILENAME_MAX];
-size_t monet_memory;
 void moveInstruction(MalBlkPtr mb, int pc, int target);
 void msab_dbfarminit(const char *dbfarm);
 void msab_dbpathinit(const char *dbpath);
diff --git a/clients/odbc/driver/README b/clients/odbc/driver/README
--- a/clients/odbc/driver/README
+++ b/clients/odbc/driver/README
@@ -25,7 +25,7 @@ ODBC is chosen to be implemented first b
   ourselves to get this functionality now.
 Update 2016: the JDBC-ODBC bridge driver is no longer needed nor supported in 
JRE.
 We provide a 100% pure (type 4) JDBC driver implementation for MonetDB.
-See: https://www.monetdb.org/downloads/Java/Latest/
+See: https://www.monetdb.org/downloads/Java/
 
 Tip:
 =======================================================================
@@ -33,7 +33,6 @@ To do ODBC driver development/maintenanc
  specification to learn what the ODBC API functions and behavior has to be.
 This specification is available as MS Windows help file (ODBC.HLP and 
ODBC.CNT).
 It is part of the MS ODBC SDK which has become part of the MS MDAC SDK.
-For convenience it is also available in /ufs/dinther/ODBC/
 
 For compilation you need the ODBC API include header files:
        sqltypes.h      /* ODBC type defines */
@@ -51,7 +50,7 @@ All ODBC driver implementation files are
 Every ODBC API function which needs to be implemented by the driver
  has its own file with the same name as the function and suffix ".c".
 The ODBC API functions all start with SQL, so its easy to locate them.
-There are 73 SQL*.c files and thus 73 ODBC API functions implemented.
+There are 76 SQL*.c files and thus 76 ODBC API functions implemented.
 
 The ODBC API function prototypes and defines are defined in sqltypes.h,
  sql.h, sqlext.h and sqlucode.h so there are NO SQL*.h files.
@@ -61,7 +60,7 @@ the sql*.h files and other standard exte
 Every SQL*.c must include this ODBCGlobal.h file as first include.
 
 Besides the SQL*.c files there are the ODBC*.[ch] files.
-The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCHostVar.[ch]
+The files ODBCEnv.[ch] ODBCDbc.[ch], ODBCStmt.[ch], ODBCDesc.[ch]
  and ODBCError.[ch] implement the structures needed to represent the
  handles (pointers to an object) and the internal state of the ODBC objects.
 In the implementation section below it is explained why these are necessary.
@@ -100,7 +99,7 @@ In ODBC multiple environments (each appl
  multiple input parameters per statement, multiple output columns per result
  set.
 The management and validity of these handles is all implemented in
-the ODBCEnv.[ch], ODBCDbc.{ch], ODBCStmt.[ch] and ODBCHostVar.[ch] files.
+the ODBCEnv.[ch], ODBCDbc.[ch], ODBCStmt.[ch] and ODBCDesc.[ch] files.
 
 Error handling in ODBC is done in a special way which is explained here.
 Every ODBC API function returns a code (integer) which can be:
@@ -126,7 +125,7 @@ specific handle (e.g. addDbcError()), to
 
 Implementation of the ODBC API functions:
 ------------------------------------------------------------------------
-Although 73 SQL*() functions are implemented, some do not implement the
+Although 76 SQL*() functions are implemented, some do not implement the
  requested behavior or parameter option. They just set an error message code
 and return SQL_ERROR.
 
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1744,7 +1744,7 @@ BBPdir_subcommit(int cnt, bat *subcommit
                assert(subcommit[n - 1] < subcommit[n]);
 #endif
 
-       if ((nbbpf = GDKfilelocate(0, "BBP", "wx", "dir")) == NULL)
+       if ((nbbpf = GDKfilelocate(0, "BBP", "w", "dir")) == NULL)
                return GDK_FAIL;
 
        n = (bat) ATOMIC_GET(&BBPsize);
@@ -1856,7 +1856,7 @@ BBPdir(int cnt, bat *subcommit)
                return BBPdir_subcommit(cnt, subcommit);
 
        IODEBUG fprintf(stderr, "#BBPdir: writing BBP.dir (%d bats).\n", (int) 
(bat) ATOMIC_GET(&BBPsize));
-       if ((fp = GDKfilelocate(0, "BBP", "wx", "dir")) == NULL) {
+       if ((fp = GDKfilelocate(0, "BBP", "w", "dir")) == NULL) {
                goto bailout;
        }
 
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -110,7 +110,6 @@ HEAPalloc(Heap *h, size_t nitems, size_t
                return GDK_FAIL;
        }
        if (GDKinmemory() ||
-           h->size < 4 * GDK_mmap_pagesize ||
            (GDKmem_cursize() + h->size < GDK_mem_maxsize &&
             h->size < (h->farmid == 0 ? GDK_mmap_minsize_persistent : 
GDK_mmap_minsize_transient))) {
                h->storage = STORE_MEM;
@@ -200,7 +199,7 @@ HEAPextend(Heap *h, size_t size, bool ma
                /* extend a malloced heap, possibly switching over to
                 * file-mapped storage */
                Heap bak = *h;
-               bool exceeds_swap = size >= 4 * GDK_mmap_pagesize && size + 
GDKmem_cursize() >= GDK_mem_maxsize;
+               bool exceeds_swap = size + GDKmem_cursize() >= GDK_mem_maxsize;
                bool must_mmap = !GDKinmemory() && (exceeds_swap || 
h->newstorage != STORE_MEM || size >= (h->farmid == 0 ? 
GDK_mmap_minsize_persistent : GDK_mmap_minsize_transient));
 
                h->size = size;
@@ -597,9 +596,6 @@ HEAPfree(Heap *h, bool rmheap)
  * @- HEAPload
  *
  * If we find file X.new, we move it over X (if present) and open it.
- *
- * This routine initializes the h->filename without deallocating its
- * previous contents.
  */
 static gdk_return
 HEAPload_intern(Heap *h, const char *nme, const char *ext, const char *suffix, 
bool trunc)
@@ -609,7 +605,7 @@ HEAPload_intern(Heap *h, const char *nme
        char *srcpath, *dstpath, *tmp;
        int t0;
 
-       h->storage = h->newstorage = h->size < 4 * GDK_mmap_pagesize ? 
STORE_MEM : STORE_MMAP;
+       h->storage = h->newstorage = h->size < GDK_mmap_minsize_persistent ? 
STORE_MEM : STORE_MMAP;
 
        minsize = (h->size + GDK_mmap_pagesize - 1) & ~(GDK_mmap_pagesize - 1);
        if (h->storage != STORE_MEM && minsize != h->size)
diff --git a/monetdb5/NT/M5server.bat b/monetdb5/NT/M5server.bat
--- a/monetdb5/NT/M5server.bat
+++ b/monetdb5/NT/M5server.bat
@@ -15,7 +15,7 @@ rem remove the final backslash from the 
 set MONETDB=%MONETDB:~0,-1%
 
 rem extend the search path with our EXE and DLL folders
-set PATH=%MONETDB%\bin;%MONETDB%\lib;%MONETDB%\lib\MonetDB5;%PATH%
+set PATH=%MONETDB%\bin;%MONETDB%\lib\monetdb5;%PATH%
 
 rem prepare the arguments to mserver5 to tell it where to put the dbfarm
 
diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
--- 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
+++ 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
@@ -65,7 +65,7 @@ stdout of test 'opt_sql_append` in direc
 % def # name
 % clob # type
 % 580 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.aliases();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.postfix();optimizer.deadcode();optimizer.wlc();optimizer.garbageCollector();"
       ]
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.aliases();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.deadcode();optimizer.postfix();optimizer.wlc();optimizer.garbageCollector();"
       ]
 #explain copy into ttt from E'a:\\tmp/xyz';
 % .explain # table_name
 % mal # name
@@ -120,7 +120,7 @@ end user.s10_0;
 % def # name
 % clob # type
 % 603 # length
-[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.aliases();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.postfix();optimizer.deadcode();optimizer.wlc();optimizer.sql_append();optimizer.garbageCollector();"
        ]
+[ 
"optimizer.inline();optimizer.remap();optimizer.costModel();optimizer.coercions();optimizer.aliases();optimizer.evaluate();optimizer.emptybind();optimizer.pushselect();optimizer.aliases();optimizer.mergetable();optimizer.deadcode();optimizer.aliases();optimizer.constants();optimizer.commonTerms();optimizer.projectionpath();optimizer.deadcode();optimizer.reorder();optimizer.matpack();optimizer.querylog();optimizer.multiplex();optimizer.generator();optimizer.profiler();optimizer.candidates();optimizer.deadcode();optimizer.postfix();optimizer.wlc();optimizer.sql_append();optimizer.garbageCollector();"
        ]
 #explain copy into ttt from 'Z:/tmp/xyz';
 % .explain # table_name
 % mal # name
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -11,7 +11,6 @@
 #include "mal.h"
 
 char   monet_cwd[FILENAME_MAX] = { 0 };
-size_t         monet_memory = 0;
 char   monet_characteristics[4096];
 stream *maleventstream = 0;
 
@@ -66,7 +65,6 @@ int mal_init(void){
                return -1;
        }
 #endif
-       monet_memory = MT_npages() * MT_pagesize();
        initNamespace();
        initParser();
 #ifndef HAVE_EMBEDDED
@@ -130,7 +128,6 @@ void mserver_reset(void)
 #endif
 
        memset((char*)monet_cwd, 0, sizeof(monet_cwd));
-       monet_memory = 0;
        memset((char*)monet_characteristics,0, sizeof(monet_characteristics));
        mal_namespace_reset();
        /* No need to clean up the namespace, it will simply be extended
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -84,10 +84,9 @@ mal_export lng MALdebug;
  * leaving a small portion for other programs.
  */
 #define GB (((lng)1024)*1024*1024)
-#define MEMORY_THRESHOLD  (0.2 * monet_memory > 8 * GB?  monet_memory - 8 * 
GB: 0.8 * monet_memory)
+#define MEMORY_THRESHOLD  (0.2 * GDK_mem_maxsize > 8 * GB?  GDK_mem_maxsize - 
8 * GB: 0.8 * GDK_mem_maxsize)
 
 mal_export char     monet_cwd[FILENAME_MAX];
-mal_export size_t      monet_memory;
 mal_export char        monet_characteristics[4096];
 mal_export stream      *maleventstream;
 
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -514,14 +514,13 @@ MCstopClients(Client cntxt)
 int
 MCactiveClients(void)
 {
-       int finishing=0, running = 0;
+       int idles = 0;
        Client cntxt = mal_clients;
 
        for(cntxt = mal_clients;  cntxt<mal_clients+MAL_MAXCLIENTS; cntxt++){
-               finishing += (cntxt->mode == FINISHCLIENT);
-               running += (cntxt->mode == RUNCLIENT);
+               idles += (cntxt->idle != 0 && cntxt->mode == RUNCLIENT);
        }
-       return finishing + running;
+       return idles;
 }
 
 void
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -327,6 +327,7 @@ DFLOWworker(void *T)
        int tid = THRgettid();
        str error = 0;
        int i,last;
+       lng claim;
        Client cntxt;
        InstrPtr p;
 
@@ -381,7 +382,8 @@ DFLOWworker(void *T)
                }
 
                p= getInstrPtr(flow->mb,fe->pc);
-               if (MALadmission(flow->cntxt, flow->mb, flow->stk, p, 
fe->argclaim)) {
+               claim = fe->argclaim;
+               if (MALadmission_claim(flow->cntxt, flow->mb, flow->stk, p, 
claim)) {
                        // never block on deblockdataflow()
                        if( p->fcn != (MALfcn) deblockdataflow){
                                fe->hotclaim = 0;   /* don't assume priority 
anymore */
@@ -394,9 +396,9 @@ DFLOWworker(void *T)
                }
                error = runMALsequence(flow->cntxt, flow->mb, fe->pc, fe->pc + 
1, flow->stk, 0, 0);
                PARDEBUG fprintf(stderr, "#executed pc= %d wrk= %d claim= " 
LLFMT "," LLFMT "," LLFMT " %s\n",
-                                                fe->pc, id, fe->argclaim, 
fe->hotclaim, fe->maxclaim, error ? error : "");
+                                                fe->pc, id, claim, 
fe->hotclaim, fe->maxclaim, error ? error : "");
                /* release the memory claim */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to