Changeset: 71b5d245d6e9 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=71b5d245d6e9 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/mapiclient/tomograph.c configure.ag gdk/gdk_value.c monetdb5/extras/rapi/rapi.c monetdb5/mal/mal_interpreter.c monetdb5/modules/atoms/json.c monetdb5/modules/mal/Tests/inspect00.stable.out monetdb5/modules/mal/batcalc.c monetdb5/modules/mal/mdb.mal testing/Mtest.py.in Branch: pyapi Log Message:
Merge with default branch. diffs (truncated from 595 to 300 lines): 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 @@ -39090,7 +39090,7 @@ pattern mdb.getDefinition():bat[:oid,:st address MDBgetDefinition; comment Returns a string representation of the current function with typing information attached -pattern mdb.getStackTrace() (X_1:bat[:oid,:str],X_2:bat[:oid,:str]) +pattern mdb.getStackTrace() (X_1:bat[:oid,:int],X_2:bat[:oid,:str]) address MDBStkTrace; pattern mdb.getStackFrame() (X_1:bat[:oid,:str],X_2:bat[:oid,:str]) address MDBgetStackFrame; 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 @@ -50021,7 +50021,7 @@ pattern mdb.getDefinition():bat[:oid,:st address MDBgetDefinition; comment Returns a string representation of the current function with typing information attached -pattern mdb.getStackTrace() (X_1:bat[:oid,:str],X_2:bat[:oid,:str]) +pattern mdb.getStackTrace() (X_1:bat[:oid,:int],X_2:bat[:oid,:str]) address MDBStkTrace; pattern mdb.getStackFrame() (X_1:bat[:oid,:str],X_2:bat[:oid,:str]) address MDBgetStackFrame; diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c --- a/clients/mapiclient/tomograph.c +++ b/clients/mapiclient/tomograph.c @@ -362,6 +362,7 @@ base_colors[NUM_COLORS] = { /* 2 */ { 0, 0, "calc", "bit", 0 }, /* 2 */ { 0, 0, "calc", "*", 0 }, /* 2 */ { 0, 0, "algebra", "thetajoin", 0 }, +/* 2 */ { 0, 0, "algebra", "subthetajoin", 0 }, /* 1 */ { 0, 0, "sql", "dec_round", 0 }, /* 1 */ { 0, 0, "pqueue", "topn_min", 0 }, /* 1 */ { 0, 0, "mtime", "date_sub_msec_interval", 0 }, @@ -377,6 +378,20 @@ base_colors[NUM_COLORS] = { /* 1 */ { 0, 0, "aggr", "max", 0 }, /* ? */ { 0, 0, "aggr", "avg", 0 }, /* ? */ { 0, 0, "aggr", "subavg", 0 }, +/* ? */ { 0, 0, "aggr", "submedian", 0 }, +/* ? */ { 0, 0, "aggr", "subquantile", 0 }, +/* ? */ { 0, 0, "aggr", "substdev", 0 }, +/* ? */ { 0, 0, "batcalc", "floor", 0 }, +/* ? */ { 0, 0, "batcalc", "identity", 0 }, +/* ? */ { 0, 0, "batmkey", "hash", 0 }, +/* ? */ { 0, 0, "calc", "hge", 0 }, +/* ? */ { 0, 0, "batcalc", "hge", 0 }, +/* ? */ { 0, 0, "algebra", "firstn", 0 }, +/* ? */ { 0, 0, "sql", "single", 0 }, +/* ? */ { 0, 0, "algebra", "crossproduct", 0 }, +/* ? */ { 0, 0, "profiler", "wait", 0 }, +/* ? */ { 0, 0, "querylog", "define", 0 }, +/* ? */ { 0, 0, "*", "*", 0 }, /* 0 */ { 0, 0, 0, 0, 0 } }; @@ -963,6 +978,14 @@ showcolormap(char *filename, int all) lng totfreq = 0, tottime = 0; Color *clrs = colors, *_clrs_ = NULL; char *c; + time_t tm; + char *date; + + tm = time(0); + date = ctime(&tm); + if (strchr(date, '\n')) + *strchr(date, '\n') = 0; + // count size of query text for (nl=0, c= currentquery; c && *c; c++) @@ -1055,23 +1078,25 @@ showcolormap(char *filename, int all) fprintf(f, "\" at 0,%d\n", h - 70); // show complete query text if( currentquery ){ - h = h1-30; + h = h1-40; //fprintf(gnudata, "set object %d rectangle from %d.0, 250.0 to %d.0,%d.0\n", object++, 3 * w, 5 *w , h -5); fprintf(f, "set label %d \"", object++); k=0; for (c= currentquery; *c; c++){ - if (*c == '"') fprintf(gnudata,"\\"); else - if (*c == '\t') fprintf(gnudata," "); else - if (*c == '\n') { fprintf(gnudata,"\\n"); k=0; continue;} else + if (*c == '"') fprintf(f,"\\"); else + if (*c == '\t') fprintf(f," "); else + if (*c == '\n') { fprintf(f,"\\n"); k=0; continue;} else if( ++k >60 && (*c == ' ' || *c =='\t')){ - fprintf(gnudata,"\\n"); + fprintf(f,"\\n"); k = 1; } - fputc(*c,gnudata); + fputc(*c,f); } fprintf(f, "\" at %d,%d\n", (int) ( 3 * w ), h - 17); h-= 17; } + fprintf(f, "set label %d \"%d\" at 1750.0, 100.00\n", object++, atlaspage + 1); + fprintf(f, "set label %d \"%s\" at 0.0, 100.00\n", object++, date); fprintf(f, "plot 0 notitle with lines linecolor rgb \"white\"\n"); if (all) { fclose(f); @@ -1079,21 +1104,25 @@ showcolormap(char *filename, int all) } static void -updmap(int idx) +updatecolormap(int idx) { char *mod, *fcn, buf[BUFSIZ], *call = buf; int i, fnd = 0; if( box[idx].fcn == 0) return; + snprintf(buf, sizeof(buf), "%s", box[idx].fcn); mod = call; fcn = strchr(call, '.'); if (fcn) { *fcn = 0; fcn++; - } else + } else{ fcn = "*"; + } + if( strncmp(call,"end",3) == 0) + mod ="*"; /* find "mod.fcn" */ for (i = 1; i < NUM_COLORS && colors[i].mod; i++) if (strcmp(mod, colors[i].mod) == 0 && @@ -1106,8 +1135,8 @@ updmap(int idx) fnd = i; colors[fnd].mod = mod?strdup(mod): 0; colors[fnd].fcn = strdup(fcn); - if( debug) - printf("added function #%d: %s.%s\n", fnd, (mod?mod:""), fcn); + if( debug) + fprintf(stderr,"-- Added function #%d: %s.%s\n", fnd, (mod?mod:""), fcn); } colors[fnd].freq++; @@ -1121,28 +1150,25 @@ static int height = 160; static void gnuplotheader(char *filename) { - time_t tm; - char *date, *c,ch; + char *c,ch; int i=0; fprintf(gnudata, "set terminal pdfcairo noenhanced font 'verdana,10' color solid size 8.3,11.7\n"); fprintf(gnudata, "set output \"%s.pdf\"\n", filename); fprintf(gnudata, "set size 1,1\n"); fprintf(gnudata, "set tics front\n"); - tm = time(0); - date = ctime(&tm); - if (strchr(date, '\n')) - *strchr(date, '\n') = 0; + if( title){ for (c = title; c && *c && i <100; c++, i++) if (*c == '_')// for gnuplot *c = '-'; ch= *c; *c =0; - fprintf(gnudata, "set title \"%s\t%s%s\"\n", date, title, *c? "...":""); + fprintf(gnudata, "set title \"%s%s\"\n", title, (*c? "...":"")); *c =ch; } else - fprintf(gnudata, "set title \"%s\tMonetDB %s tomogram\"\n", date, dbname); + fprintf(gnudata, "set title \"MonetDB tomogram for database %s\"\n", dbname); fprintf(gnudata, "set multiplot\n"); + } static void @@ -1170,6 +1196,7 @@ createTomogram(void) if( strchr(buf,'.')) *strchr(buf, '.') = 0; gnuplotheader(buf); + object=1; dumpboxes(); showio(); //DISABLED due to access permissions showmemory(); @@ -1196,12 +1223,12 @@ createTomogram(void) rows[top++] = box[i].thread; } if( box[i].state != MDB_WAIT) - updmap(i); + updatecolormap(i); } } - height = top * 20; + height = (top < cpus? cpus : top) * 20; fprintf(gnudata, "set yrange [0:%d]\n", height); fprintf(gnudata, "set ylabel \"threads\"\n"); fprintf(gnudata, "set key right \n"); diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -1207,6 +1207,10 @@ fi AC_SUBST(PERL) AM_CONDITIONAL(HAVE_PERL, test x"$have_perl" != xno) AC_SUBST(PERL_LIBDIR) +QPERL_LIBDIR="$PERL_LIBDIR" +XPERL_LIBDIR="`$translatepath "$QPERL_LIBDIR"`" +QXPERL_LIBDIR="`echo "$XPERL_LIBDIR" | sed 's/\\\\/\\\\\\\\/g'`" +AC_SUBST(QXPERL_LIBDIR) # check major version of python # check if python2 and python3 exist @@ -1330,8 +1334,16 @@ else fi AC_SUBST(PYTHON2) +QPYTHON2="$PYTHON2" +XPYTHON2="`$translatepath "$QPYTHON2"`" +QXPYTHON2="`echo "$XPYTHON2" | sed 's/\\\\/\\\\\\\\/g'`" +AC_SUBST(QXPYTHON2) AM_CONDITIONAL(HAVE_PYTHON2, test x"$have_python2" != xno) AC_SUBST(PYTHON2_LIBDIR) +QPYTHON2_LIBDIR="$PYTHON2_LIBDIR" +XPYTHON2_LIBDIR="`$translatepath "$QPYTHON2_LIBDIR"`" +QXPYTHON2_LIBDIR="`echo "$XPYTHON2_LIBDIR" | sed 's/\\\\/\\\\\\\\/g'`" +AC_SUBST(QXPYTHON2_LIBDIR) if test "x$have_python3" != xno; then if test x$cross_compiling != xyes; then @@ -1385,8 +1397,16 @@ else fi AC_SUBST(PYTHON3) +QPYTHON3="$PYTHON3" +XPYTHON3="`$translatepath "$QPYTHON3"`" +QXPYTHON3="`echo "$XPYTHON3" | sed 's/\\\\/\\\\\\\\/g'`" +AC_SUBST(QXPYTHON3) AM_CONDITIONAL(HAVE_PYTHON3, test x"$have_python3" != xno) AC_SUBST(PYTHON3_LIBDIR) +QPYTHON3_LIBDIR="$PYTHON3_LIBDIR" +XPYTHON3_LIBDIR="`$translatepath "$QPYTHON3_LIBDIR"`" +QXPYTHON3_LIBDIR="`echo "$XPYTHON3_LIBDIR" | sed 's/\\\\/\\\\\\\\/g'`" +AC_SUBST(QXPYTHON3_LIBDIR) AM_CONDITIONAL(HAVE_PYTHON, test x"$have_python2" != xno -o x"$have_python3" != xno) diff --git a/gdk/gdk_value.c b/gdk/gdk_value.c --- a/gdk/gdk_value.c +++ b/gdk/gdk_value.c @@ -175,7 +175,7 @@ VALinit(ValPtr d, int tpe, const void *s GDKerror("VALinit:unsupported init\n"); d->vtype = TYPE_int; } else if (tpe >= TYPE_str && ATOMstorage(tpe) == TYPE_str) { - d->vtype = TYPE_str; + d->vtype = tpe; d->val.sval = GDKstrdup(s); d->len = strLen(s); } else { diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c --- a/monetdb5/extras/rapi/rapi.c +++ b/monetdb5/extras/rapi/rapi.c @@ -645,7 +645,7 @@ str RAPIeval(Client cntxt, MalBlkPtr mb, i, rtypename(TYPEOF(ret_col))); goto wrapup; } - SXP_TO_BAT(bte, LOGICAL_POINTER, *p==NA_LOGICAL); + SXP_TO_BAT(bit, LOGICAL_POINTER, *p==NA_LOGICAL); break; } case TYPE_dbl: { diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c --- a/monetdb5/mal/mal_interpreter.c +++ b/monetdb5/mal/mal_interpreter.c @@ -627,11 +627,52 @@ str runMALsequence(Client cntxt, MalBlkP if (pci->fcn == NULL) { ret = createScriptException(mb, stkpc, MAL, NULL, "address of pattern %s.%s missing", pci->modname, pci->fcnname); - } else + } else { ret = (str)(*pci->fcn)(cntxt, mb, stk, pci); +#ifndef NDEBUG + /* check that the types of actual results match + * expected results */ + for (i = 0; i < pci->retc; i++) { + int a = getArg(pci, i); + int t = getArgType(mb, pci, i); + + if (isaBatType(t)) { + bat bid = stk->stk[a].val.bval; + t = getColumnType(t); + assert(stk->stk[a].vtype == TYPE_bat); + assert(bid == 0 || + bid == bat_nil || + t == TYPE_any || + ATOMtype(BBP_cache(bid)->ttype) == ATOMtype(t)); + } else { + assert(t == stk->stk[a].vtype); + } + } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list