Changeset: 3347325e39e0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3347325e39e0
Modified Files:
        monetdb5/optimizer/opt_dataflow.c
Branch: parappend
Log Message:

Temporarily wrap OPTdataflowImplementation for easy debugging

Write the before/after plan to file


diffs (50 lines):

diff --git a/monetdb5/optimizer/opt_dataflow.c 
b/monetdb5/optimizer/opt_dataflow.c
--- a/monetdb5/optimizer/opt_dataflow.c
+++ b/monetdb5/optimizer/opt_dataflow.c
@@ -152,8 +152,8 @@ dflowGarbagesink(Client cntxt, MalBlkPtr
 /* dataflow blocks are transparent, because they are always
    executed, either sequentially or in parallel */
 
-str
-OPTdataflowImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p)
+static str
+OPTdataflowImplementation_wrapped(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p)
 {
        int i,j,k, start=1, slimit, breakpoint, actions=0, simple = TRUE;
        int flowblock= 0;
@@ -307,3 +307,35 @@ wrapup:
        if(old)    GDKfree(old);
        return msg;
 }
+
+
+str
+OPTdataflowImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p)
+{
+       int list_flags = LIST_MAL_ALL | LIST_MAL_NOCOMMENTS;
+       stream *before = open_wastream("a0");
+       stream *after = open_wastream("a1");
+
+       if (before == NULL) {
+               return createException(MAL,"optimizer.dataflow", 
SQLSTATE(HY013) "Couldn't open a0: %s", mnstr_peek_error(NULL));
+       }
+       if (after == NULL) {
+               return createException(MAL,"optimizer.dataflow", 
SQLSTATE(HY013) "Couldn't open a1: %s", mnstr_peek_error(NULL));
+       }
+
+       printFunction(before, mb, stk, list_flags);
+       mnstr_flush(before, MNSTR_FLUSH_ALL);
+
+       str msg = OPTdataflowImplementation_wrapped(cntxt, mb, stk, p);
+
+       if (msg != MAL_SUCCEED) {
+               mnstr_printf(after, "ERROR: %s\n", msg);
+       }
+       printFunction(after, mb, stk, list_flags);
+       mnstr_flush(after, MNSTR_FLUSH_ALL);
+
+       close_stream(before);
+       close_stream(after);
+
+       return msg;
+}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to