Changeset: a08187b00dfc for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a08187b00dfc Modified Files: clients/NT/mclient.bat clients/NT/msqldump.bat clients/NT/stethoscope.bat clients/odbc/driver/README gdk/gdk_bbp.c gdk/gdk_heap.c gdk/gdk_utils.c monetdb5/NT/M5server.bat monetdb5/mal/mal.c monetdb5/mal/mal.h monetdb5/optimizer/opt_mitosis.c tools/mserver/mserver5.c Branch: default Log Message:
Merge with Nov2019 branch. diffs (254 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/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/mal/mal.c b/monetdb5/mal/mal.c --- a/monetdb5/mal/mal.c +++ b/monetdb5/mal/mal.c @@ -66,7 +66,6 @@ int mal_init(void){ return -1; } #endif - monet_memory = MT_npages() * MT_pagesize(); initNamespace(); initParser(); #ifndef HAVE_EMBEDDED @@ -130,7 +129,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,7 +84,7 @@ 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; diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c --- a/monetdb5/optimizer/opt_mitosis.c +++ b/monetdb5/optimizer/opt_mitosis.c @@ -123,10 +123,10 @@ OPTmitosisImplementation(Client cntxt, M * Take into account the number of client connections, * because all user together are responsible for resource contentions */ - m = monet_memory / argsize; + m = GDK_mem_maxsize / argsize; /* if data exceeds memory size, - * i.e., (rowcnt*argsize > monet_memory), - * i.e., (rowcnt > monet_memory/argsize = m) */ + * i.e., (rowcnt*argsize > GDK_mem_maxsize), + * i.e., (rowcnt > GDK_mem_maxsize/argsize = m) */ assert(threads > 0); assert(activeClients > 0); if (rowcnt > m && m / threads / activeClients > 0) { diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c --- a/tools/mserver/mserver5.c +++ b/tools/mserver/mserver5.c @@ -125,13 +125,6 @@ monet_hello(void) char *qc = " kMGTPE"; int qi = 0; - monet_memory = MT_npages() * MT_pagesize(); - sz_mem_h = (dbl) monet_memory; - while (sz_mem_h >= 1000.0 && qi < 6) { - sz_mem_h /= 1024.0; - qi++; - } - printf("# MonetDB 5 server v%s", GDKversion()); { #ifdef MONETDB_RELEASE @@ -156,7 +149,20 @@ monet_hello(void) "" #endif ); - printf("# Found %.3f %ciB available main-memory.\n", + sz_mem_h = (dbl) (MT_npages() * MT_pagesize()); + while (sz_mem_h >= 1000.0 && qi < 6) { + sz_mem_h /= 1024.0; + qi++; + } + printf("# Found %.3f %ciB available main-memory", + sz_mem_h, qc[qi]); + sz_mem_h = (dbl) GDK_mem_maxsize; + qi = 0; + while (sz_mem_h >= 1000.0 && qi < 6) { + sz_mem_h /= 1024.0; + qi++; + } + printf(" of which we use %.3f %ciB\n", sz_mem_h, qc[qi]); #ifdef MONET_GLOBAL_DEBUG printf("# Database path:%s\n", GDKgetenv("gdk_dbpath")); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list