Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1199

Modified Files:
        merovingian_controlrunner.c monetdb_get.c 
Log Message:
free sabdb list, thanks compiler: merovingian_controlrunner.c:430: variable 
"topdb" was set but never used

U merovingian_controlrunner.c
Index: merovingian_controlrunner.c
===================================================================
RCS file: 
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_controlrunner.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- merovingian_controlrunner.c 16 Sep 2009 09:37:28 -0000      1.15
+++ merovingian_controlrunner.c 17 Sep 2009 20:02:53 -0000      1.16
@@ -289,7 +289,41 @@
                                                send(msgsock, buf2, len, 0);
                                        }
                                } else if (strcmp(p, "get") == 0) {
+                                       confkeyval *props = getDefaultProps();
+                                       char *pbuf;
+
+                                       if ((e = SABAOTHgetStatus(&stats, q)) 
!= MAL_SUCCEED) {
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "internal 
error, please review the logs\n");
+                                               send(msgsock, buf2, len, 0);
+                                               Mfprintf(_mero_ctlerr, "share: 
SABAOTHgetStatus: "
+                                                               "%s\n", e);
+                                               freeErr(e);
+                                               continue;
+                                       }
+                                       if (stats == NULL) {
+                                               Mfprintf(_mero_ctlerr, 
"received get signal for "
+                                                               "unknown 
database: %s\n", q);
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "unknown 
database: %s\n", q);
+                                               send(msgsock, buf2, len, 0);
+                                               continue;
+                                       }
+
+                                       /* from here we'll always succeed, even 
if we don't
+                                        * send anything */
+                                       len = snprintf(buf2, sizeof(buf2), 
"OK\n");
+                                       send(msgsock, buf2, len, 0);
                                
+                                       readProps(props, stats->path);
+                                       writePropsBuf(props, &pbuf);
+                                       send(msgsock, pbuf, strlen(pbuf), 0);
+                                       freeConfFile(props);
+                                       GDKfree(props);
+                                       SABAOTHfreeStatus(&stats);
+
+                                       Mfprintf(_mero_ctlout, "served property 
list for "
+                                                       "database '%s'\n", q);
                                } else if (strncmp(p, "share=", 
strlen("share=")) == 0) {
                                        sabdb *stats;
                                        err e;
@@ -462,6 +496,8 @@
                                        } else {
                                                Mfprintf(_mero_ctlout, 
"returned status for '%s'\n", q);
                                        }
+
+                                       SABAOTHfreeStatus(&topdb);
                                } else if (strcmp(q, "anelosimus") == 0 &&
                                                strcmp(p, "eximius") == 0)
                                {

U monetdb_get.c
Index: monetdb_get.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb_get.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- monetdb_get.c       4 Sep 2009 09:45:11 -0000       1.2
+++ monetdb_get.c       17 Sep 2009 20:02:54 -0000      1.3
@@ -130,7 +130,19 @@
                                source = "-";
                                value = stats->dbname;
                        } else {
-                               readProps(props, stats->path);
+                               if (mero_running == 1) {
+                                       char *buf;
+                                       e = control_send(&buf, mero_control, 
-1, stats->dbname, "get");
+                                       if (e != NULL) {
+                                               fprintf(stderr, "get: internal 
error: %s\n", e);
+                                               free(e);
+                                               exit(2);
+                                       }
+                                       readPropsBuf(props, buf);
+                                       free(buf);
+                               } else {
+                                       readProps(props, stats->path);
+                               }
                                kv = findConfKey(props, p);
                                if (kv == NULL) {
                                        fprintf(stderr, "get: no such property: 
%s\n", p);


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to