Changeset: 7f208370b408 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f208370b408
Modified Files:
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_optimizer.c
Branch: Dec2016
Log Message:

Fix optimize debugging
The history of the optimizers should be kept around until execution.


diffs (40 lines):

diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -274,6 +274,8 @@ SQLrun(Client c, backend *be, mvc *m){
                return createException(PARSE, "SQLparser", "%s", m->errstr);
        // locate and inline the query template instruction
        mb = copyMalBlk(c->curprg->def);
+       mb->history = c->curprg->def->history;
+       c->curprg->def->history =0;
 
        /* only consider a re-optimization when we are dealing with query 
templates */
        for ( i= 1; i < mb->stop;i++){
diff --git a/sql/backends/monet5/sql_optimizer.c 
b/sql/backends/monet5/sql_optimizer.c
--- a/sql/backends/monet5/sql_optimizer.c
+++ b/sql/backends/monet5/sql_optimizer.c
@@ -171,6 +171,7 @@ addOptimizers(Client c, MalBlkPtr mb, ch
        if (msg){
                return msg;
        }
+       mb->keephistory |= be->mvc->emod & mod_debug;
        if (be->mvc->no_mitosis) {
                for (i = mb->stop - 1; i > 0; i--) {
                        q = getInstrPtr(mb, i);
@@ -200,7 +201,7 @@ SQLoptimizeFunction(Client c, MalBlkPtr 
        msg = addOptimizers(c, mb, pipe, TRUE);
        if (msg)
                return msg;
-       mb->keephistory = be->mvc->emod & mod_debug;
+       mb->keephistory |= be->mvc->emod & mod_debug;
        msg = optimizeMALBlock(c, mb);
        mb->keephistory = FALSE;
        return msg;
@@ -249,6 +250,7 @@ SQLoptimizeQuery(Client c, MalBlkPtr mb)
        msg = addOptimizers(c, mb, pipe, FALSE);
        if (msg)
                return msg;
+       mb->keephistory |= be->mvc->emod & mod_debug;
        msg = optimizeMALBlock(c, mb);
        return msg;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to