Changeset: 90d8b759fbd8 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=90d8b759fbd8 Added Files: common/utils/mprompt.h common/utils/prompt.c Removed Files: clients/mapiclient/mprompt.h clients/mapiclient/prompt.c Modified Files: clients/mapiclient/Makefile.ag clients/mapiclient/eventparser.c clients/mapiclient/tachograph.c clients/python2/monetdb/mapi.py clients/python3/monetdb/mapi.py common/utils/Makefile.ag monetdb5/mal/mal_profiler.c sql/test/BugTracker-2013/Tests/All tools/mserver/mserver5.c Branch: mosaic Log Message:
Merge with default diffs (272 lines): diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag --- a/clients/mapiclient/Makefile.ag +++ b/clients/mapiclient/Makefile.ag @@ -9,21 +9,23 @@ INCLUDES = ../mapilib ../../common/optio lib_mcutil = { NOINST - SOURCES = dump.c prompt.c dotmonetdb.c eventparser.c eventparser.h + SOURCES = dump.c dotmonetdb.c dotmonetdb.h eventparser.c eventparser.h } bin_mclient = { SOURCES = mclient.c ReadlineTools.c ReadlineTools.h LIBS = libmcutil ../mapilib/libmapi \ ../../common/stream/libstream \ + ../../common/utils/libmutils \ $(READLINE_LIBS) \ $(curl_LIBS) $(LTLIBICONV) $(PTHREAD_LIBS) $(MATH_LIBS) $(SOCKET_LIBS) } bin_msqldump = { - SOURCES = msqldump.c + SOURCES = msqldump.c msqldump.h LIBS = libmcutil ../mapilib/libmapi \ ../../common/stream/libstream \ + ../../common/utils/libmutils \ $(curl_LIBS) } @@ -31,6 +33,7 @@ bin_stethoscope = { SOURCES = stethoscope.c LIBS = libmcutil ../mapilib/libmapi \ ../../common/stream/libstream \ + ../../common/utils/libmutils \ $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS) } @@ -38,6 +41,7 @@ bin_tachograph = { SOURCES = tachograph.c LIBS = libmcutil ../mapilib/libmapi \ ../../common/stream/libstream \ + ../../common/utils/libmutils \ $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS) } @@ -45,6 +49,7 @@ bin_tomograph = { SOURCES = tomograph.c LIBS = libmcutil ../mapilib/libmapi \ ../../common/stream/libstream \ + ../../common/utils/libmutils \ $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS) $(SOCKET_LIBS) } @@ -59,6 +64,6 @@ bin_tomograph = { man_MANS = mclient.1 msqldump.1 -EXTRA_DIST = msqldump.h mprompt.h dotmonetdb.h $(man_MANS) +EXTRA_DIST = $(man_MANS) EXTRA_DIST_DIR = Tests diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c --- a/clients/mapiclient/eventparser.c +++ b/clients/mapiclient/eventparser.c @@ -429,7 +429,7 @@ eventparser(char *row, EventRecord *ev) if( v) parseArguments(v+3,1); } - if (ev->stmt && (v=strstr(ev->stmt, ";\",\t"))) + if (ev->stmt && (v=strstr(ev->stmt, "\t]"))) *v = 0; return 0; } diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c --- a/clients/mapiclient/tachograph.c +++ b/clients/mapiclient/tachograph.c @@ -539,11 +539,23 @@ initFiles(void) static void progressBarInit(char *qry) { + char *s; fprintf(tachojson,"{ \"tachograph\":0.1,\n"); fprintf(tachojson," \"system\":%s,\n",monetdb_characteristics); fprintf(tachojson," \"qid\":\"%s\",\n",currentfunction?currentfunction:""); - fprintf(tachojson," \"tag\":\"%d\",\n",currenttag); - fprintf(tachojson," \"query\":\"%s\",\n",qry); + fprintf(tachojson," \"tag\":%d,\n",currenttag); + + fprintf(tachojson," \"query\":\""); + for(s = qry; *s; s++) + switch(*s){ + case '\n': fputs("\\n", tachojson); break; + case '\r': fputs("\\r", tachojson); break; + case '\t': fputs("\\t", tachojson); break; + case '\b': fputs("\\b", tachojson); break; + default: fputc((int) *s, tachojson); + } + fprintf(tachojson,"\",\n"); + fprintf(tachojson," \"started\": "LLFMT",\n",starttime); fprintf(tachojson," \"duration\":"LLFMT",\n",duration); fprintf(tachojson," \"instructions\":%d\n",malsize); @@ -556,7 +568,7 @@ update(EventRecord *ev) { int progress=0; int i,j; - char *v; + char *v, *s; int uid = 0,qid = 0; char line[BUFSIZ]; char prereq[BUFSIZ]={0}; @@ -685,7 +697,25 @@ update(EventRecord *ev) fprintf(tachojson,"\"status\": \"start\",\n"); fprintf(tachojson,"\"estimate\": "LLFMT",\n",ev->ticks); fprintf(tachojson,"\"stmt\": \"%s\",\n",ev->stmt); - fprintf(tachojson,"\"beautystmt\": \"%s\",\n",line); + + fprintf(tachojson," \"stmt\":\""); + for(s = ev->stmt; *s; s++) + switch(*s){ + case '\\': + if( *(s+1) == '\\' ) s++; + default: fputc((int) *s, tachojson); + } + fprintf(tachojson,"\",\n"); + + fprintf(tachojson," \"beautystmt\":\""); + for(s = line; *s; s++) + switch(*s){ + case '\\': + if( *(s+1) == '\\' ) s++; + default: fputc((int) *s, tachojson); + } + fprintf(tachojson,"\",\n"); + // collect all input producing PCs fprintf(tachojson,"\"prereq\":["); for( i=0; i < malvartop; i++){ diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py --- a/clients/python2/monetdb/mapi.py +++ b/clients/python2/monetdb/mapi.py @@ -73,7 +73,7 @@ class Connection(object): hostname = None if not unix_socket and os.path.exists("/tmp/.s.monetdb.%i" % port): unix_socket = "/tmp/.s.monetdb.%i" % port - elif not hostname: + elif not unix_socket and not hostname: hostname = 'localhost' self.hostname = hostname diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py --- a/clients/python3/monetdb/mapi.py +++ b/clients/python3/monetdb/mapi.py @@ -74,7 +74,7 @@ class Connection(object): hostname = None if not unix_socket and os.path.exists("/tmp/.s.monetdb.%i" % port): unix_socket = "/tmp/.s.monetdb.%i" % port - elif not hostname: + elif not unix_socket and not hostname: hostname = 'localhost' self.hostname = hostname diff --git a/common/utils/Makefile.ag b/common/utils/Makefile.ag --- a/common/utils/Makefile.ag +++ b/common/utils/Makefile.ag @@ -12,7 +12,7 @@ INCLUDES = $(openssl_CFLAGS) lib_mutils = { NOINST - SOURCES = mutils.h mutils.c + SOURCES = mutils.h mutils.c prompt.c mprompt.h } lib_mcrypt = { diff --git a/clients/mapiclient/mprompt.h b/common/utils/mprompt.h rename from clients/mapiclient/mprompt.h rename to common/utils/mprompt.h diff --git a/clients/mapiclient/prompt.c b/common/utils/prompt.c rename from clients/mapiclient/prompt.c rename to common/utils/prompt.c --- a/clients/mapiclient/prompt.c +++ b/common/utils/prompt.c @@ -7,8 +7,6 @@ */ #include "monetdb_config.h" -#include <monet_options.h> -#include "mapi.h" #include <unistd.h> #include <stdlib.h> #include <errno.h> @@ -39,12 +37,12 @@ prompt_getlogin(void) * The correct procedure for determining the login name is to call * cuserid(3C), or to call getlogin() and if it fails to call * getpwuid(3C). */ - return(cuserid(NULL)); + return cuserid(NULL); # else - return(getlogin()); + return getlogin(); # endif #else - return(defaultlogin); + return defaultlogin; #endif } diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c --- a/monetdb5/mal/mal_profiler.c +++ b/monetdb5/mal/mal_profiler.c @@ -232,7 +232,7 @@ offlineProfilerEvent(MalBlkPtr mb, MalSt #endif if ( msg){ - logadd("\"%s\",\t",msg); + logadd("\"%s\"",msg); } else { // TODO Obfusate instructions unless administrator calls for it. @@ -244,13 +244,13 @@ offlineProfilerEvent(MalBlkPtr mb, MalSt c++; stmtq = mal_quote(c, strlen(c)); if (stmtq != NULL) { - logadd(" \"%s\",\t", stmtq); + logadd(" \"%s\"", stmtq); GDKfree(stmtq); - } else logadd(" ,\t"); + } GDKfree(stmt); } - logadd("]\n"); + logadd("\t]\n"); // end marker logsend(logbuffer); } /* diff --git a/sql/test/BugTracker-2013/Tests/All b/sql/test/BugTracker-2013/Tests/All --- a/sql/test/BugTracker-2013/Tests/All +++ b/sql/test/BugTracker-2013/Tests/All @@ -5,7 +5,7 @@ HAVE_PHP?php-size-limit-bug select-around-zero.Bug-3220 segfault_in_aggregation.Bug-3225 subtract-one-year.Bug-3215 -perl-undef-0.Bug-3235 +HAVE_PERL?perl-undef-0.Bug-3235 crash-from-optimizer.Bug-3241 select-view-view.Bug-3245 stddev-group.Bug-3257 diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c --- a/tools/mserver/mserver5.c +++ b/tools/mserver/mserver5.c @@ -155,13 +155,13 @@ monet_hello(void) printf("# Visit http://www.monetdb.org/ for further information\n"); // The properties shipped through the performance profiler - len = snprintf(monet_characteristics, sizeof(monet_characteristics)-1, "{ MonetDBversion:\"%s\", ", VERSION); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "release:\"%s\", ", MONETDB_RELEASE); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "host:\"%s\", ", HOST); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "threads:\"%d\", ", GDKnr_threads); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "memory:\"%.3f %cB\", ", sz_mem_h, qc[qi]); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "oid:\""SZFMT"\", ", sizeof(oid) *8); - len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "packages:["); + len = snprintf(monet_characteristics, sizeof(monet_characteristics)-1, "{ \"MonetDBversion\":\"%s\", ", VERSION); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"release\":\"%s\", ", MONETDB_RELEASE); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"host\":\"%s\", ", HOST); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"threads\":\"%d\", ", GDKnr_threads); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"memory\":\"%.3f %cB\", ", sz_mem_h, qc[qi]); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"oid\":\""SZFMT"\", ", sizeof(oid) *8); + len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"packages\":["); // add the compiled in package names #ifdef HAVE_HGE len += snprintf(monet_characteristics + len, sizeof(monet_characteristics)-1-len, "\"%s\"","huge"); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list