Changeset: 9c3fe94d3395 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c3fe94d3395
Modified Files:
        clients/mapiclient/eventparser.c
        clients/mapiclient/tachograph.c
        monetdb5/mal/mal_profiler.c
Branch: default
Log Message:

More JSON fixing


diffs (80 lines):

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
@@ -568,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};
@@ -697,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/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);
 }
 /*
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to