Changeset: 1945384d96ae for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1945384d96ae
Modified Files:
        MonetDB5/src/mal/mal_box.mx
        MonetDB5/src/mal/mal_resolve.mx
        MonetDB5/src/modules/mal/box.mx
        MonetDB5/src/modules/mal/remote.mx
        MonetDB5/src/optimizer/opt_compression.mx
        MonetDB5/src/optimizer/opt_joinpath.mx
Branch: Oct2010
Log Message:

More coverity issues


diffs (truncated from 772 to 300 lines):

diff -r 77e5b6410033 -r 1945384d96ae MonetDB5/src/mal/mal_box.mx
--- a/MonetDB5/src/mal/mal_box.mx       Sat Jan 15 16:55:28 2011 +0100
+++ b/MonetDB5/src/mal/mal_box.mx       Sat Jan 15 17:33:24 2011 +0100
@@ -436,7 +436,7 @@
        vr.vtype = TYPE_str;
        vr.val.sval = val? val: (str)str_nil;
        vr.len = (int)strlen(vr.val.sval);
-       depositBox(box, nme, TYPE_str, &vr);
+       (void) depositBox(box, nme, TYPE_str, &vr);
 }
 
 @-
diff -r 77e5b6410033 -r 1945384d96ae MonetDB5/src/mal/mal_resolve.mx
--- a/MonetDB5/src/mal/mal_resolve.mx   Sat Jan 15 16:55:28 2011 +0100
+++ b/MonetDB5/src/mal/mal_resolve.mx   Sat Jan 15 17:33:24 2011 +0100
@@ -1,694 +1,4 @@
 @/
-@/
-The contents of this file are subject to the MonetDB Public License
-Version 1.1 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations
-under the License.
-
-The Original Code is the MonetDB Database System.
-
-The Initial Developer of the Original Code is CWI.
-Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-Copyright August 2008-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f mal_scenario
-@a M. Kersten
-@v 0.0
-@+ Session Scenarios
-In MonetDB multiple languages, optimizers, and execution engines can
-be combined at run time to satisfy a wide user-community.
-Such an assemblage of components is called a @emph{scenario}
-and consists of a @emph{reader}, @emph{parser}, @emph{optimizer},
-@emph{tactic scheduler} and @emph{engine}. These hooks allow
-for both linked-in and external components.
-
-The languages supported are SQL, XQuery, 
-and the Monet Assembly Language (MAL).
-The default scenario handles MAL instructions, which is used
-to illustrate the behavior of the scenario steps.
-
-The MAL reader component handles interaction with
-a front-end to obtain a string for subsequent compilation and
-execution. The reader uses the common stream package to read
-data in large chunks, if possible. In interactive mode the lines
-are processed one at a time. 
-
-The MAL parser component turns the string into
-an internal representation of the MAL program. 
-During this phase semantic checks are performed, such that
-we end up with a type correct program.
-
-The code block is subsequently sent to an MAL optimizer.
-In the default case the program is left untouched. For other languages, 
-the optimizer deploys language specific code transformations,
-e.g., foreign-key optimizations in joins and remote query execution.
-All optimization information is statically derived from the
-code blocks and possible catalogues maintained for the query language
-at hand. Optimizers leave advice and their findings in properties
-in the symbol table, see @ref{Property Management}.
-
-Once the program has thus been refined, the
-MAL scheduler prepares for execution using tactical optimizations.
-For example, it may parallelize the code, generate an ad-hoc
-user-defined function, or prepare for efficient replication management.
-In the default case, the program is handed over to the MAL interpreter
-without any further modification.
-
-The final stage is to choose an execution paradigm,
-i.e. interpretative (default), compilation of an ad-hoc user
-defined function, dataflow driven interpretation,
-or vectorized pipe-line execution by a dedicated engine.
-
-A failure encountered in any of the steps terminates the scenario
-cycle. It returns to the user for a new command.
-
-@+ Scenario management
-Scenarios are captured in modules; they can be dynamically loaded
-and remain active until the system is brought to a halt.
-The first time a scenario @sc{xyz} is used, the system looks for a scenario
-initialization routine @sc{xyzinitSystem()} and executes it. 
-It is typically used to prepare the server for language specific interactions.
-Thereafter its components are set to those required by
-the scenario and the client initialization takes place.
-
-When the last user interested in a particular scenario leaves the
-scene, we activate its finalization routine calling @sc{xyzexitSystem()}.
-It typically perform cleanup, backup and monitoring functions.
-
-A scenario is interpreted in a strictly linear fashion,
-i.e. performing a symbolic optimization before scheduling decisions
-are taken.
-The routines associated with each state in
-the scenario may patch the code so as to assure that subsequent
-execution can use a different scenario, e.g., to handle dynamic
-code fragments.
-
-@{
-The state of execution is maintained in the scenario record for
-each individual client. Sharing this information between clients
-should be dealt with in the implementation of the scenario managers.
-Upon need, the client can postpone a session scenario by 
-pushing a new one(language, optimize, tactic, 
-processor). Propagation of the state information is
-encapsulated a scenario2scenario() call. Not all transformations
-may be legal.
-
-@+ Scenario administration
-Administration of scenarios follows the access rules 
-defined for code modules in general.
-
-@h
-
-#ifndef _MAL_SCENARIO_H
-#define _MAL_SCENARIO_H
-
-#include "mal_import.h"
-
-#define MAL_SCENARIO_READER 0
-#define MAL_SCENARIO_PARSER  1
-#define MAL_SCENARIO_OPTIMIZE 2
-#define MAL_SCENARIO_SCHEDULER 3
-#define MAL_SCENARIO_ENGINE 4
-#define MAL_SCENARIO_INITCLIENT 5
-#define MAL_SCENARIO_EXITCLIENT 6
-
-/*#define MAL_SCENARIO_DEBUG*/
-@-
-The scenario descriptions contains all information to
-implement the scenario. Each client gets a copy.
-An exception or error detected while parsing is turned
-into an exception and aborts the scenario.
-@h
-#define MAXSCEN 128
-
-typedef struct SCENARIO {
-       str name, language;
-       str initSystem;
-       MALfcn initSystemCmd;
-       str exitSystem;
-       MALfcn exitSystemCmd;
-       str initClient;
-       MALfcn initClientCmd;
-       str exitClient;
-       MALfcn exitClientCmd;
-       str reader;
-       MALfcn readerCmd;
-       void *readerState;
-       str parser;
-       MALfcn parserCmd;
-       void *parserState;
-       str optimizer;
-       MALfcn optimizerCmd;
-       void *optimizerState;
-       str tactics;
-       MALfcn tacticsCmd;
-       void *tacticsState;
-       str engine;
-       MALfcn engineCmd;
-       void *engineState;
-       struct SCENARIO *next;
-} *Scenario;
-
-mal_export str setScenario(Client c, str nme);
-mal_export str runScenario(Client c);
-mal_export str fillScenario(Client c, Scenario scen);
-mal_export void clrScenario(Client c);
-mal_export str getScenarioLanguage(Client c);
-mal_export Scenario getFreeScenario(void);
-
-mal_export str defaultScenario(Client c);      /* used in 
src/mal/mal_session.c */
-mal_export void exitScenario(Client c);        /* used in 
src/mal/mal_session.c */
-mal_export str initScenario(Client c, Scenario s);
-
-mal_export void showCurrentScenario(void);
-mal_export void showScenarioByName(stream *f, str s);
-mal_export void showScenario(stream *f, Scenario s);
-mal_export void showAllScenarios(stream *f);
-mal_export void resetScenario(Client c);
-
-mal_export Scenario findScenario(str nme);
-mal_export void updateScenario(str scen, str nme, MALfcn fcn);
-
-#endif /* _MAL_SCENARIO_H */
-@-
-@c
-#include "mal_config.h"
-#include "mal_scenario.h"
-#include "mal_linker.h"                /* for getAddress() */
-#include "mal_client.h"
-#include "mal_authorize.h"
-#include "mal_exception.h"
-
-#ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-#endif
-
-struct SCENARIO scenarioRec[MAXSCEN] = {
-       {"mal", "mal",
-        0, 0,                  /* hardwired MALinit*/
-        0, 0,                  /* implicit */
-        "MALinitClient", (MALfcn) &MALinitClient,
-        "MALexitClient", (MALfcn) &MALexitClient,
-        "MALreader", (MALfcn) &MALreader, 0,
-        "MALparser", (MALfcn) &MALparser, 0,
-        "MALoptimizer", 0, 0,                  
-        0, 0, 0,
-        "MALengine", (MALfcn) &MALengine, 0, 0},
-       {0,0,                   /* name */
-        0, 0,                  /* init */
-        0, 0,                  /* exit */
-        0, 0,                  /* initClient */
-        0, 0,                  /* exitClient */
-        0, 0, 0,               /* reader */
-        0, 0, 0,               /* parser */
-        0, 0, 0,               /* optimizer */
-        0, 0, 0,               /* scheduler */
-        0, 0, 0, 0             /* engine */
-        }
-};
-
-@-
-Currently each user can define a new scenario, provided we have a free slot.
-Scenarios not hardwired can always be dropped.
-@c
-Scenario
-getFreeScenario()
-{
-       int i;
-       Scenario scen = NULL;
-
-       mal_set_lock(mal_contextLock, "Scenario");
-       for (i = 0; i < MAXSCEN && scenarioRec[i].name; i++)
-               ;
-
-       if (i == MAXSCEN) {
-               showException(MAL,"freeScenario", "no scenario space left (%d); 
adjust MAXSCEN and recompile", MAXSCEN);
-       } else {
-               scen = scenarioRec + i;
-       }
-       mal_unset_lock(mal_contextLock, "Scenario");
-
-       return scen;
-}
-
-@-
-A scenario is initialized only once per session. 
-All other requests are silently ignored. 
-After initialization, all state functions should have been set.
-Initialization includes searching for the scenario startup file in
-the etc/MonetDB directory. This creates a dependency, because the
-malInclude also needs a scenario. To break this cycle, the system should
-call once the routine default scenario for each client first.
-@c
-str
-initScenario(Client c, Scenario s)
-{
-       str l = s->language;
-       str msg = MAL_SUCCEED;
-
-       if (s->initSystemCmd)
-               return(fillScenario(c, s));
-       /* prepare for conclicts */
-       mal_set_lock(mal_contextLock, "Scenario");
-       if (s->initSystem && s->initSystemCmd == 0) {
-               s->initSystemCmd = (MALfcn) getAddress(l, l, s->initSystem,1);
-               if (s->initSystemCmd) {
-                       msg = (*s->initSystemCmd) (c);
-               } else {
-                       char buf[BUFSIZ];
-                       snprintf(buf,BUFSIZ,"%s.init", l);
-                       msg = createException(MAL, buf, "Scenario not 
initialized"); 
-               }
-       }
-       if (msg) {
-               mal_unset_lock(mal_contextLock, "Scenario");
-               return msg;
-       }
-
-       if (s->exitSystem && s->exitSystemCmd == 0) 
-               s->exitSystemCmd = (MALfcn) getAddress(l, l, s->exitSystem,1);
-       if (s->initClient && s->initClientCmd == 0) 
-               s->initClientCmd = (MALfcn) getAddress(l, l, s->initClient,1);
-       if (s->exitClient && s->exitClientCmd == 0) 
-               s->exitClientCmd = (MALfcn) getAddress(l, l, s->exitClient,1);
-       if (s->reader && s->readerCmd == 0) 
-               s->readerCmd = (MALfcn) getAddress(l, l, s->reader,1);
-       if (s->parser && s->parserCmd == 0) 
-               s->parserCmd = (MALfcn) getAddress(l, l, s->parser,1);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to