Changeset: a53c79270c9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a53c79270c9a
Modified Files:
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_scenario.c
Branch: simplify_scenario
Log Message:

removed old* fields


diffs (87 lines):

diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -237,7 +237,6 @@ MCinitClientRecord(Client c, oid user, b
        c->user = user;
        c->username = 0;
        c->scenario = NULL;
-       c->oldscenario = NULL;
        c->srcFile = NULL;
        c->blkmode = 0;
 
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -57,8 +57,7 @@ typedef struct CLIENT {
         * provided to temporarily switch to another scenario.
         */
        str     scenario;  /* scenario management references */
-       str     oldscenario;
-       MALfcn  phase[SCENARIO_PROPERTIES], oldphase[SCENARIO_PROPERTIES];
+       MALfcn  phase[SCENARIO_PROPERTIES];
                                                /* if set to 'S' it will put 
the process to sleep */
        bit             sqlprofiler;            /* control off-line sql 
performance monitoring */
        /*
diff --git a/monetdb5/mal/mal_scenario.c b/monetdb5/mal/mal_scenario.c
--- a/monetdb5/mal/mal_scenario.c
+++ b/monetdb5/mal/mal_scenario.c
@@ -244,9 +244,6 @@ updateScenario(str nme, str fnme, MALfcn
                        if (c1->scenario &&
                            strcmp(c1->scenario, scen->name) == 0)
                                c1->phase[phase] = fcn;
-                       if (c1->oldscenario &&
-                           strcmp(c1->oldscenario, scen->name) == 0)
-                               c1->oldphase[phase] = fcn;
                }
        }
 }
@@ -277,9 +274,7 @@ str getScenarioLanguage(Client c){
 }
 /*
  * Changing the scenario for a particular client invalidates the
- * state maintained for the previous scenario. The old scenario is
- * retained in the client record to facilitate propagation of
- * state information, or to simply switch back to the previous one.
+ * state maintained for the previous scenario.
  * Before we initialize a scenario the client scenario is reset to
  * the MAL scenario. This implies that all scenarios are initialized
  * using the same scenario. After the scenario initialization file
@@ -319,22 +314,13 @@ setScenario(Client c, str nme)
        if (scen == NULL)
                throw(MAL, "setScenario", SCENARIO_NOT_FOUND " '%s'", nme);
 
-       if (c->scenario) {
-               c->oldscenario = c->scenario;
-               for (i = 0; i < SCENARIO_PROPERTIES; i++) {
-                       c->oldphase[i] = c->phase[i];
-               }
-       }
-
        msg = fillScenario(c, scen);
        if (msg) {
                /* error occurred, reset the scenario , assume default always 
works */
-               c->scenario = c->oldscenario;
+               c->scenario = NULL;
                for (i = 0; i < SCENARIO_PROPERTIES; i++) {
-                       c->phase[i] = c->oldphase[i];
-                       c->oldphase[i] = NULL;
+                       c->phase[i] = NULL;
                }
-               c->oldscenario = NULL;
                return msg;
        }
        return MAL_SUCCEED;
@@ -368,11 +354,10 @@ resetScenario(Client c)
                freeException(msg);
        }
 
-       c->scenario = c->oldscenario;
+       c->scenario = NULL;
        for (i = 0; i < SCENARIO_PROPERTIES; i++) {
-               c->phase[i] = c->oldphase[i];
+               c->phase[i] = NULL;
        }
-       c->oldscenario = 0;
 }
 
 /*
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to