Changeset: 4ba9e2641e8e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ba9e2641e8e
Modified Files:
        monetdb5/mal/mal_debugger.mx
        monetdb5/mal/mal_instruction.mx
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_listing.h
        monetdb5/optimizer/opt_pipes.c
Branch: default
Log Message:

Sent optimizer output to mclient


diffs (92 lines):

diff --git a/monetdb5/mal/mal_debugger.mx b/monetdb5/mal/mal_debugger.mx
--- a/monetdb5/mal/mal_debugger.mx
+++ b/monetdb5/mal/mal_debugger.mx
@@ -1552,9 +1552,9 @@ mdbCommand(Client cntxt, MalBlkPtr mb, M
                        if (*b) {
                                mdot=mdbLocateMalBlk(cntxt,mb,b,out);
                                if(mdot != NULL)
-                                       showMalBlkHistory(mdot);
+                                       showMalBlkHistory(out,mdot);
                        } else
-                               showMalBlkHistory(mb);
+                               showMalBlkHistory(out,mb);
                        break;
                }
                case 'r':       /* reset program counter */
diff --git a/monetdb5/mal/mal_instruction.mx b/monetdb5/mal/mal_instruction.mx
--- a/monetdb5/mal/mal_instruction.mx
+++ b/monetdb5/mal/mal_instruction.mx
@@ -226,7 +226,6 @@ mal_export void prepareMalBlk(MalBlkPtr 
 mal_export void freeMalBlk(MalBlkPtr mb);
 mal_export MalBlkPtr copyMalBlk(MalBlkPtr mb);
 mal_export void addtoMalBlkHistory(MalBlkPtr mb, str marker);
-mal_export void showMalBlkHistory(MalBlkPtr mb);
 mal_export MalBlkPtr getMalBlkHistory(MalBlkPtr mb, int idx);
 mal_export MalBlkPtr gotoMalBlkMarker(MalBlkPtr mb, str marker);
 mal_export MalBlkPtr getMalBlkMarker(MalBlkPtr mb, str marker);
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -689,7 +689,7 @@ printSignature(stream *fd, Symbol s, int
  * For clarity we show the last optimizer applied
  * also as the last of the list, although it is linked with mb.
 */
-void showMalBlkHistory(MalBlkPtr mb)
+void showMalBlkHistory(stream *out, MalBlkPtr mb)
 {
        MalBlkPtr m=mb;
        InstrPtr p,sig;
@@ -703,7 +703,7 @@ void showMalBlkHistory(MalBlkPtr mb)
                if( p->token == REMsymbol){
                        msg= instruction2str(m, 0, p, FALSE);
                        if (msg ) {
-                               mnstr_printf(GDKout,"%s.%s[%2d] %s\n", 
+                               mnstr_printf(out,"%s.%s[%2d] %s\n", 
                                        getModuleId(sig), 
getFunctionId(sig),j++,msg+3);
                                GDKfree(msg);
                        }
@@ -714,7 +714,7 @@ void showMalBlkHistory(MalBlkPtr mb)
        if( p->token == REMsymbol){
                msg= instruction2str(mb, 0, p, FALSE);
                if (msg) {
-                       mnstr_printf(GDKout,"%s.%s[%2d] %s\n", 
+                       mnstr_printf(out,"%s.%s[%2d] %s\n", 
                                getModuleId(sig), getFunctionId(sig),j++,msg+3);
                                GDKfree(msg);
                }
diff --git a/monetdb5/mal/mal_listing.h b/monetdb5/mal/mal_listing.h
--- a/monetdb5/mal/mal_listing.h
+++ b/monetdb5/mal/mal_listing.h
@@ -34,5 +34,6 @@ mal_export void promptInstruction(stream
 mal_export str instruction2str(MalBlkPtr mb, MalStkPtr stl, InstrPtr p, int 
hidden);
 mal_export str mal2str(MalBlkPtr mb, int flg, int first, int last);
 mal_export str function2str(MalBlkPtr mb, int flg);
+mal_export void showMalBlkHistory(stream *out, MalBlkPtr mb);
 
 #endif /*  _MAL_LIST_H */
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -618,8 +618,11 @@ addOptimizerPipe(Client cntxt, MalBlkPtr
        
        (void) cntxt;
 
+       for( i=0; i < MAXOPTPIPES && pipes[i].name; i++)
+       if ( strcmp(pipes[i].name, name) == 0)
+               break;
+
        /* compile pipes first */
-       for( i=0; i < MAXOPTPIPES && pipes[i].name; i++)
        if ( pipes[i].mb == 0){
                /* precompile the pipeline as MAL string */
                c= MCinitClient((oid)1,0,0);
@@ -649,8 +652,7 @@ addOptimizerPipe(Client cntxt, MalBlkPtr
                        return msg;
        }
 
-       for( i=0; i < MAXOPTPIPES && pipes[i].name; i++)
-       if ( strcmp(pipes[i].name, name) == 0 && pipes[i].mb) {
+       if ( pipes[i].mb) {
                for ( j =1; j < pipes[i].mb->stop-1; j++) {
                        p =  copyInstruction(pipes[i].mb->stmt[j]);
                        for ( k =0; k < p->argc; k++) 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to