Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19583/src/backends/monet5
Modified Files:
sql_scenario.mx
Log Message:
Ignoring errors returned by functions is NOT a good idea:
- they are errors, so you might want to know about them
- if they do return an error and you just (void) them, you leak memory
Fixed todos by throwing an error if that is necessary.
Index: sql_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_scenario.mx,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -d -r1.249 -r1.250
--- sql_scenario.mx 20 Feb 2007 13:01:54 -0000 1.249
+++ sql_scenario.mx 20 Feb 2007 13:23:37 -0000 1.250
@@ -146,9 +146,10 @@
SQLprelude(void)
{
int res = 0;
+ str tmp;
Scenario s = getFreeScenario();
if (!s)
- return NULL; /* should be an error */
+ throw(MAL, "sql.start", "out of scenario slots");
s->name = "sql";
s->language = "sql";
s->initSystem = "SQLinit";
@@ -160,11 +161,13 @@
/* s->optimizer = "SQLoptimizer";
* s->tactics = .. */
s->engine = "SQLengine";
- (void)SABAOTHmarchScenario(&res, &s->name);
+ tmp = SABAOTHmarchScenario(&res, &s->name);
+ if (tmp != MAL_SUCCEED)
+ return(tmp);
s = getFreeScenario();
if (!s)
- return NULL; /* should be an error */
+ throw(MAL, "sql.start", "out of scenario slots");
s->name = "msql";
s->language = "msql";
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins