Changeset: b84861d048b3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b84861d048b3
Removed Files:
        sql/backends/monet5/prog.c
Modified Files:
        clients/Tests/exports.stable.out
        common/options/monet_options.c
        gdk/gdk.h
        gdk/gdk_utils.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_parser.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/tablet.c
        monetdb5/optimizer/opt_garbageCollector.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/sql_statement.h
        sql/backends/monet5/sql_user.c
        sql/server/rel_schema.c
        sql/server/sql_mvc.c
        tools/mserver/mserver5.1.in
Branch: mdbl-mal
Log Message:

Merge with default


diffs (truncated from 698 to 300 lines):

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
@@ -211,7 +211,6 @@ BAT *COLcopy(BAT *b, int tt, bool writab
 BAT *COLnew(oid hseq, int tltype, BUN capacity, role_t role) 
__attribute__((__warn_unused_result__));
 size_t GDK_mem_maxsize;
 size_t GDK_vm_maxsize;
-int GDK_vm_trim;
 gdk_return GDKanalyticalavg(BAT *r, BAT *b, BAT *s, BAT *e, int tpe);
 gdk_return GDKanalyticalcount(BAT *r, BAT *b, BAT *s, BAT *e, const bit 
*restrict ignore_nils, int tpe);
 gdk_return GDKanalyticaldiff(BAT *r, BAT *b, BAT *p, int tpe);
@@ -2185,6 +2184,7 @@ str expandRef;
 str exportOperationRef;
 str export_tableRef;
 str fcnDefinition(MalBlkPtr mb, InstrPtr p, str s, int flg, str base, size_t 
len);
+str fetchRef;
 int findGDKtype(int type);
 Module findModule(Module scope, str name);
 str findRef;
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      10      /*MUST MATCH # OPTIONS BELOW */
+#define N_OPTIONS      9       /*MUST MATCH # OPTIONS BELOW */
        set = malloc(sizeof(opt) * N_OPTIONS);
        if (set == NULL)
                return 0;
@@ -234,20 +234,6 @@ mo_builtin_settings(opt **Set)
        set[i].value = strdup("0");
        i++;
        set[i].kind = opt_builtin;
-       set[i].name = strdup("gdk_vmtrim");
-       /* default for gdk_vmtrim is
-        * "yes" on 32 bit architectures and
-        * "no"  on 64 bit architectures;
-        * see also GDKinit() in gdk/gdk_utils.c */
-#if SIZEOF_VOID_P == 4
-       /* 32 bit architecture */
-       set[i].value = strdup("yes");
-#else
-       /* 64 bit architecture */
-       set[i].value = strdup("no");
-#endif
-       i++;
-       set[i].kind = opt_builtin;
        set[i].name = strdup("monet_prompt");
        set[i].value = strdup(">");
        i++;
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1882,7 +1882,6 @@ gdk_export void *GDKmmap(const char *pat
 
 gdk_export size_t GDK_mem_maxsize;     /* max allowed size of committed memory 
*/
 gdk_export size_t GDK_vm_maxsize;      /* max allowed size of reserved vm */
-gdk_export int GDK_vm_trim;            /* allow trimming */
 
 gdk_export size_t GDKmem_cursize(void);        /* RAM/swapmem that MonetDB has 
claimed from OS */
 gdk_export size_t GDKvm_cursize(void); /* current MonetDB VM address space 
usage */
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -261,8 +261,6 @@ size_t GDK_mmap_pagesize = MMAP_PAGESIZE
 size_t GDK_mem_maxsize = GDK_VM_MAXSIZE;
 size_t GDK_vm_maxsize = GDK_VM_MAXSIZE;
 
-int GDK_vm_trim = 1;
-
 #define SEG_SIZE(x,y)  ((x)+(((x)&((1<<(y))-1))?(1<<(y))-((x)&((1<<(y))-1)):0))
 
 /* This block is to provide atomic addition and subtraction to select
@@ -793,8 +791,6 @@ GDKreset(int status)
                GDK_vm_maxsize = GDK_VM_MAXSIZE;
                GDKatomcnt = TYPE_str + 1;
 
-               GDK_vm_trim = 1;
-
                if (GDK_mem_maxsize / 16 < GDK_mmap_minsize_transient) {
                        GDK_mmap_minsize_transient = GDK_mem_maxsize / 16;
                        if (GDK_mmap_minsize_persistent > 
GDK_mmap_minsize_transient)
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -27,7 +27,7 @@ addMalException(MalBlkPtr mb, str msg)
                        return ; // just stick to one error message, ignore rest
                strcpy(new, mb->errors);
                strcat(new, msg);
-               GDKfree(mb->errors);
+               freeException(mb->errors);
                mb->errors = new;
        } else {
                new = GDKstrdup(msg);
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -1448,8 +1448,8 @@ parseEnd(Client cntxt)
                                strcat(new,"!");
                                strcat(new,cntxt->curprg->def->errors);
 
-                               GDKfree(errors);
-                               GDKfree(cntxt->curprg->def->errors);
+                               freeException(errors);
+                               freeException(cntxt->curprg->def->errors);
 
                                cntxt->curprg->def->errors=0;
                                errors = new;
diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c
--- a/monetdb5/modules/mal/mat.c
+++ b/monetdb5/modules/mal/mat.c
@@ -152,7 +152,10 @@ MATpackIncrement(Client cntxt, MalBlkPtr
                }
                b->unused--;
                if(b->unused == 0)
-                       BATsetaccess(b, BAT_READ);
+                       if (BATsetaccess(b, BAT_READ) != GDK_SUCCEED) {
+                               BBPunfix(b->batCacheid);
+                               throw(MAL, "mat.pack", GDK_EXCEPTION);
+                       }
                assert(!b->tnil || !b->tnonil);
                BBPkeepref(*ret = b->batCacheid);
        }
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -60,7 +60,10 @@ void_bat_create(int adt, BUN nr)
        /* check for correct structures */
        if (b == NULL)
                return NULL;
-       BATsetaccess(b, BAT_APPEND);
+       if (BATsetaccess(b, BAT_APPEND) != GDK_SUCCEED) {
+               BBPunfix(b->batCacheid);
+               return NULL;
+       }
        if (nr > BATTINY && adt && BATextend(b, nr) != GDK_SUCCEED) {
                BBPunfix(b->batCacheid);
                return NULL;
@@ -170,7 +173,8 @@ TABLETcollect(BAT **bats, Tablet *as)
                        continue;
                bats[j] = fmt[i].c;
                BBPfix(bats[j]->batCacheid);
-               BATsetaccess(fmt[i].c, BAT_READ);
+               if (BATsetaccess(fmt[i].c, BAT_READ) != GDK_SUCCEED)
+                       throw(SQL, "copy", "Failed to set access at tablet part 
" BUNFMT "\n", cnt);
                fmt[i].c->tsorted = fmt[i].c->trevsorted = false;
                fmt[i].c->tkey = false;
                BATsettrivprop(fmt[i].c);
@@ -200,7 +204,8 @@ TABLETcollect_parts(BAT **bats, Tablet *
                b->tsorted = b->trevsorted = false;
                b->tkey = false;
                BATsettrivprop(b);
-               BATsetaccess(b, BAT_READ);
+               if (BATsetaccess(b, BAT_READ) != GDK_SUCCEED)
+                       throw(SQL, "copy", "Failed to set access at tablet part 
" BUNFMT "\n", cnt);
                bv = BATslice(b, (offset > 0) ? offset - 1 : 0, BATcount(b));
                bats[j] = bv;
 
@@ -1587,7 +1592,6 @@ SQLload_file(Client cntxt, Tablet *as, b
        READERtask ptask[MAXWORKERS];
        int threads = (!maxrow || maxrow > (1 << 16)) ? (GDKnr_threads < 
MAXWORKERS && GDKnr_threads > 1 ? GDKnr_threads - 1 : MAXWORKERS - 1) : 1;
        lng lio = 0, tio, t1 = 0, total = 0, iototal = 0;
-       int vmtrim = GDK_vm_trim;
 
 #ifdef _DEBUG_TABLET_
        mnstr_printf(GDKout, "#Prepare copy work for %d threads col '%s' rec 
'%s' quot '%c'\n",
@@ -1606,11 +1610,6 @@ SQLload_file(Client cntxt, Tablet *as, b
                goto bailout;
        }
 
-       /* trimming process should not be active during this process. */
-       /* on sf10 experiments it showed a slowdown of a factor 2 on */
-       /* large tables. Instead rely on madvise */
-       GDK_vm_trim = 0;
-
        assert(rsep);
        assert(csep);
        assert(maxrow < 0 || maxrow <= (lng) BUN_MAX);
@@ -2006,8 +2005,6 @@ SQLload_file(Client cntxt, Tablet *as, b
        munlockall();
 #endif
 
-       /* restore system setting */
-       GDK_vm_trim = vmtrim;
        return res < 0 ? BUN_NONE : cnt;
 
   bailout:
@@ -2027,8 +2024,6 @@ SQLload_file(Client cntxt, Tablet *as, b
 #ifdef MLOCK_TST
        munlockall();
 #endif
-       /* restore system setting */
-       GDK_vm_trim = vmtrim;
        return BUN_NONE;
 }
 
diff --git a/monetdb5/optimizer/opt_garbageCollector.c 
b/monetdb5/optimizer/opt_garbageCollector.c
--- a/monetdb5/optimizer/opt_garbageCollector.c
+++ b/monetdb5/optimizer/opt_garbageCollector.c
@@ -144,7 +144,7 @@ OPTgarbageCollectorImplementation(Client
                chkFlow(mb);
                if ( mb->errors != MAL_SUCCEED ){
                        fprintf(stderr,"%s\n",mb->errors);
-                       GDKfree(mb->errors);
+                       freeException(mb->errors);
                        mb->errors = MAL_SUCCEED;
                }
                fprintFunction(stderr,mb, 0, LIST_MAL_ALL);
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -127,6 +127,7 @@ str execRef;
 str expandRef;
 str exportOperationRef;
 str export_tableRef;
+str fetchRef;
 str findRef;
 str finishRef;
 str firstnRef;
@@ -429,6 +430,7 @@ void optimizerInit(void)
        expandRef = putName("expand");
        exportOperationRef = putName("exportOperation");
        export_tableRef = putName("export_table");
+       fetchRef = putName("fetch");
        findRef = putName("find");
        finishRef = putName("finish");
        firstnRef = putName("firstn");
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -126,6 +126,7 @@ mal_export  str execRef;
 mal_export  str expandRef;
 mal_export  str exportOperationRef;
 mal_export  str export_tableRef;
+mal_export  str fetchRef;
 mal_export  str findRef;
 mal_export  str finishRef;
 mal_export  str firstnRef;
diff --git a/sql/backends/monet5/prog.c b/sql/backends/monet5/prog.c
deleted file mode 100644
--- a/sql/backends/monet5/prog.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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/.
- *
- * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
- */
-
-#include "monetdb_config.h"
-#include "sql.h"
-#include "monet_options.h"
-#include "embeddedclient.h"
-
-#include <string.h>
-
-#include <time.h>
-
-#ifdef HAVE_FTIME
-#include <sys/timeb.h>         /* ftime */
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>          /* gettimeofday */
-#endif
-
-#ifndef HAVE_GETOPT_LONG
-#  include "monet_getopt.h"
-#else
-# ifdef HAVE_GETOPT_H
-#  include "getopt.h"
-# endif
-#endif
-
-static int64_t
-gettime(void)
-{
-#ifdef HAVE_GETTIMEOFDAY
-       struct timeval tp;
-
-       gettimeofday(&tp, NULL);
-       return (int64_t) tp.tv_sec * 1000000 + (int64_t) tp.tv_usec;
-#else
-#ifdef HAVE_FTIME
-       struct timeb tb;
-
-       ftime(&tb);
-       return (int64_t) tb.time * 1000000 + (int64_t) tb.millitm * 1000;
-#endif
-#endif
-}
-
-static void
-usage(char *prog)
-{
-       fprintf(stderr, "Usage: %s [ options ] [ script+ ]                   
\n", prog);
-       fprintf(stderr, "Options are:                                        
\n");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to