Changeset: 9fb768aa8f3e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9fb768aa8f3e Added Files: monetdb5/modules/mal/Tests/bigsum.mal monetdb5/modules/mal/Tests/bigsum.stable.err monetdb5/modules/mal/Tests/bigsum.stable.out sql/test/BugTracker-2012/Tests/string-insert-default-null-crash.Bug-3168.sql sql/test/BugTracker-2012/Tests/string-insert-default-null-crash.Bug-3168.stable.err sql/test/BugTracker-2012/Tests/string-insert-default-null-crash.Bug-3168.stable.out sql/test/BugTracker-2012/Tests/timestamp-diff.Bug-3190.sql sql/test/BugTracker-2012/Tests/timestamp-diff.Bug-3190.stable.err sql/test/BugTracker-2012/Tests/timestamp-diff.Bug-3190.stable.out Modified Files: clients/Tests/exports.stable.out clients/mapiclient/mclient.c common/utils/msabaoth.c common/utils/msabaoth.h gdk/gdk_aggr.c gdk/gdk_calc.h monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out monetdb5/modules/atoms/mtime.c monetdb5/modules/kernel/algebra.mx monetdb5/modules/mal/Tests/All monetdb5/modules/mal/calc.c monetdb5/modules/mal/calc.mal monetdb5/modules/mal/calc.mal.sh monetdb5/optimizer/Tests/inline07.stable.out sql/ChangeLog.Oct2012 sql/backends/monet5/sql_scenario.c sql/common/sql_string.c sql/test/BugTracker-2012/Tests/All sql/test/BugTracker/Tests/explain.SF-1739353.stable.out sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out sql/test/Tests/setoptimizer.stable.err sql/test/Tests/setoptimizer.stable.out tools/merovingian/ChangeLog tools/merovingian/client/monetdb.1 tools/merovingian/client/monetdb.c tools/merovingian/daemon/controlrunner.c tools/merovingian/daemon/merovingian.h Branch: rdf Log Message:
Merge with default branch diffs (truncated from 3527 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 @@ -160,6 +160,7 @@ BAT *BATouterjoin(BAT *l, BAT *r, BUN es BAT *BATprev(BAT *b); int BATprint(BAT *b); int BATprintf(stream *f, BAT *b); +gdk_return BATprod(void *res, int tp, BAT *b, BAT *s, int skip_nils, int abort_on_error, int nil_if_empty); BAT *BATrangejoin(BAT *l, BAT *rl, BAT *rh, bit li, bit hi); BAT *BATreplace(BAT *b, BAT *n, bit force); BAT *BATrestrict(BAT *b, const void *hl, const void *hh, const void *tl, const void *th); @@ -185,6 +186,7 @@ BAT *BATssort(BAT *b); BAT *BATssort_rev(BAT *b); BAT *BATsubselect(BAT *b, BAT *s, const void *tl, const void *th, int li, int hi, int anti); gdk_return BATsubsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, BAT *g, int reverse, int stable); +gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, int skip_nils, int abort_on_error, int nil_if_empty); BAT *BATsunion(BAT *b, BAT *c); BAT *BATsunique(BAT *b); BAT *BATthetajoin(BAT *l, BAT *r, int mode, BUN estimate); @@ -761,29 +763,6 @@ str ALGouterjoinestimate(int *result, in str ALGposition(wrd *retval, int *bid, ptr val); str ALGpositionBUN(wrd *retval, int *bid, ptr val, ptr tval); str ALGprejoin(int *rl, int *rr, int *l, int *r); -str ALGprod_bte_bte(bte *res, int *bid, bit *empty_is_nil); -str ALGprod_bte_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_bte_int(int *res, int *bid, bit *empty_is_nil); -str ALGprod_bte_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGprod_bte_sht(sht *res, int *bid, bit *empty_is_nil); -str ALGprod_bte_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGprod_dbl_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_flt_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_flt_flt(flt *res, int *bid, bit *empty_is_nil); -str ALGprod_int_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_int_int(int *res, int *bid, bit *empty_is_nil); -str ALGprod_int_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGprod_int_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGprod_lng_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_lng_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGprod_sht_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_sht_int(int *res, int *bid, bit *empty_is_nil); -str ALGprod_sht_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGprod_sht_sht(sht *res, int *bid, bit *empty_is_nil); -str ALGprod_sht_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGprod_wrd_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGprod_wrd_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGprod_wrd_wrd(wrd *res, int *bid, bit *empty_is_nil); str ALGprojectNIL(int *ret, int *bid); str ALGprojecthead(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str ALGprojecttail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); @@ -827,29 +806,6 @@ str ALGsubsort23(bat *result, bat *norde str ALGsubsort31(bat *result, bat *bid, bat *order, bat *group, bit *reverse, bit *stable); str ALGsubsort32(bat *result, bat *norder, bat *bid, bat *order, bat *group, bit *reverse, bit *stable); str ALGsubsort33(bat *result, bat *norder, bat *ngroup, bat *bid, bat *order, bat *group, bit *reverse, bit *stable); -str ALGsum_bte_bte(bte *res, int *bid, bit *empty_is_nil); -str ALGsum_bte_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_bte_int(int *res, int *bid, bit *empty_is_nil); -str ALGsum_bte_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGsum_bte_sht(sht *res, int *bid, bit *empty_is_nil); -str ALGsum_bte_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGsum_dbl_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_flt_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_flt_flt(flt *res, int *bid, bit *empty_is_nil); -str ALGsum_int_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_int_int(int *res, int *bid, bit *empty_is_nil); -str ALGsum_int_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGsum_int_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGsum_lng_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_lng_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGsum_sht_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_sht_int(int *res, int *bid, bit *empty_is_nil); -str ALGsum_sht_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGsum_sht_sht(sht *res, int *bid, bit *empty_is_nil); -str ALGsum_sht_wrd(wrd *res, int *bid, bit *empty_is_nil); -str ALGsum_wrd_dbl(dbl *res, int *bid, bit *empty_is_nil); -str ALGsum_wrd_lng(lng *res, int *bid, bit *empty_is_nil); -str ALGsum_wrd_wrd(wrd *res, int *bid, bit *empty_is_nil); str ALGsunion(int *result, int *lid, int *rid); str ALGsunique(int *result, int *bid); str ALGtdiff(int *result, int *lid, int *rid); @@ -1167,6 +1123,8 @@ str CMDBATderivedByName(int *ret, str *n str CMDBATnew(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p); str CMDBATnewDerived(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p); str CMDBATnewint(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p); +str CMDBATprod(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); +str CMDBATsum(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CMDactivateProfiler(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CMDbatABS(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CMDbatADD(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); @@ -2763,6 +2721,7 @@ str kunionRef; str kuniqueRef; str languageRef; str lastline(Client cntxt); +str leftfetchjoinPathRef; str leftfetchjoinRef; str leftjoinPathRef; str leftjoinRef; @@ -3073,6 +3032,7 @@ str schedulerRef; str selectNotNilRef; str selectRef; str semaRef; +str semijoinPathRef; str semijoinRef; str setAccessRef; void setArgType(MalBlkPtr mb, InstrPtr p, int i, int tpe); diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -94,7 +94,7 @@ static stream *toConsole_raw; /* toConso static stream *stdout_stream; static stream *stderr_stream; static FILE *fromConsole = NULL; -static char *language = "sql"; +static char *language = NULL; static char *logfile = NULL; static char promptbuf[16]; static int echoquery = 0; @@ -2714,6 +2714,9 @@ main(int argc, char **argv) } else if (strcmp(language, "jaql") == 0) { mode = JAQL; } + } else { + language = strdup("sql"); + mode = SQL; } while ((c = getopt_long(argc, argv, "aDNd:e" @@ -2758,21 +2761,25 @@ main(int argc, char **argv) strcmp(optarg, "sq") == 0 || strcmp(optarg, "s") == 0) { - language = optarg; + free(language); + language = strdup(optarg); mode = SQL; } else if (strcmp(optarg, "mal") == 0 || strcmp(optarg, "ma") == 0) { - language = "mal"; + free(language); + language = strdup("mal"); mode = MAL; } else if (strcmp(optarg, "jaql") == 0 || strcmp(optarg, "jaq") == 0 || strcmp(optarg, "ja") == 0 || strcmp(optarg, "j") == 0) { - language = "jaql"; + free(language); + language = strdup("jaql"); mode = JAQL; } else if (strcmp(optarg, "msql") == 0) { - language = "msql"; + free(language); + language = strdup("msql"); mode = MAL; } else { fprintf(stderr, "language option needs to be sql or mal\n"); diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -565,6 +565,7 @@ msab_getStatus(sabdb** ret, char *dbname sdb = sdb->next = malloc(sizeof(sabdb)); } sdb->uplog = NULL; + sdb->uri = NULL; sdb->next = NULL; /* store the database name */ @@ -716,6 +717,8 @@ msab_freeStatus(sabdb** ret) while (p != NULL) { if (p->path != NULL) free(p->path); + if (p->uri != NULL) + free(p->uri); if (p->uplog != NULL) free(p->uplog); r = p->scens; @@ -853,7 +856,7 @@ msab_getUplogInfo(sabuplog *ret, const s } /* used in the serialisation to be able to change it in the future */ -#define SABDBVER "1" +#define SABDBVER "2" /** * Produces a string representation suitable for storage/sending. @@ -863,7 +866,6 @@ msab_serialise(char **ret, const sabdb * { char buf[8096]; char scens[64]; - char conns[1024]; sablist *l; sabuplog dbu; char *p; @@ -885,32 +887,18 @@ msab_serialise(char **ret, const sabdb * if (p != scens) p[-1] = '\0'; - conns[0] = '\0'; - p = conns; - avail = sizeof(conns) - 1; - for (l = db->conns; l != NULL; l = l->next) { - len = strlen(l->val); - if (len >= avail) - break; - memcpy(p, l->val, len); - p += len + 1; - avail -= len + 1; - memcpy(p - 1, "'", 2); - } - if (p != conns) - p[-1] = '\0'; - if ((p = msab_getUplogInfo(&dbu, db)) != NULL) return(p); /* sabdb + sabuplog structs in one */ snprintf(buf, sizeof(buf), "sabdb:" SABDBVER ":" - "%s,%d,%d,%s,%s" "," + "%s,%s,%d,%d,%s," "%d,%d,%d," "" LLFMT "," LLFMT "," LLFMT "," "" LLFMT "," LLFMT "," "%d,%f,%f", - db->path, db->locked, (int)(db->state), scens, conns, + db->dbname, db->uri ? db->uri : "", db->locked, + (int)(db->state), scens, dbu.startcntr, dbu.stopcntr, dbu.crashcntr, (lng)dbu.avguptime, (lng)dbu.maxuptime, (lng)dbu.minuptime, (lng)dbu.lastcrash, (lng)dbu.laststart, @@ -926,17 +914,18 @@ msab_serialise(char **ret, const sabdb * char * msab_deserialise(sabdb **ret, char *sdb) { - char *path; + char *dbname; + char *uri; int locked; int state; char *scens = ""; - char *conns = ""; sabdb *s; sabuplog *u; sablist *l; char *p; char *lasts; char buf[PATHLENGTH]; + char protover = 0; lasts = sdb; if ((p = strchr(lasts, ':')) == NULL) { @@ -957,19 +946,45 @@ msab_deserialise(sabdb **ret, char *sdb) return(strdup(buf)); } *p++ = '\0'; - if (strcmp(lasts, SABDBVER) != 0) { + if (strcmp(lasts, "1") == 0) { + /* Protocol 1 was used uptil Oct2012. Since Jul2012 a new state + * SABdbStarting was introduced, but not exposed to the client + * in serialise. After Oct2012, the path component was removed + * and replaced by an URI field. This meant dbname could no + * longer be deduced from path, and hence sent separately. + * Since the conns property became useless in the light of the + * added uri, it was dropped. + * These four changes were effectuated in protocol 2. When + * reading protocol 1, we use the path field to set dbname, but + * ignore the path information (and set uri to "<unknown>". The + * SABdbStarting state never occurs. */ + } else if (strcmp(lasts, SABDBVER) != 0) { snprintf(buf, sizeof(buf), "string has unsupported version: %s", lasts); return(strdup(buf)); } + protover = lasts[0]; lasts = p; if ((p = strchr(p, ',')) == NULL) { snprintf(buf, sizeof(buf), - "string does not contain path: %s", lasts); + "string does not contain %s: %s", + protover == '1' ? "path" : "dbname", lasts); return(strdup(buf)); } *p++ = '\0'; - path = lasts; + dbname = lasts; + if (protover == '1') { + uri = "<unknown>"; + } else { + lasts = p; + if ((p = strchr(p, ',')) == NULL) { + snprintf(buf, sizeof(buf), + "string does not contain uri: %s", lasts); + return(strdup(buf)); + } + *p++ = '\0'; + uri = lasts; + } lasts = p; if ((p = strchr(p, ',')) == NULL) { snprintf(buf, sizeof(buf), @@ -995,14 +1010,15 @@ msab_deserialise(sabdb **ret, char *sdb) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list