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

Modified Files:
        merovingian_controlrunner.c monetdb_set.c 
Log Message:
moved property setting to merovingian

U merovingian_controlrunner.c
Index: merovingian_controlrunner.c
===================================================================
RCS file: 
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian_controlrunner.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- merovingian_controlrunner.c 9 Sep 2009 19:11:24 -0000       1.11
+++ merovingian_controlrunner.c 9 Sep 2009 20:12:19 -0000       1.12
@@ -326,6 +326,52 @@
                                                len = snprintf(buf2, 
sizeof(buf2), "OK\n");
                                                send(msgsock, buf2, len, 0);
                                        }
+                               } else if (strchr(p, '=') != NULL) {
+                                       char *val;
+                                       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 property signal for "
+                                                               "unknown 
database: %s\n", q);
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "unknown 
database: %s\n", q);
+                                               send(msgsock, buf2, len, 0);
+                                               continue;
+                                       }
+
+                                       val = strchr(p, '=');
+                                       *val++ = '\0';
+                                       if (*val == '\0')
+                                               val = NULL;
+                                       if ((e = setProp(stats->path, p, val)) 
!= NULL) {
+                                               Mfprintf(_mero_ctlerr, "setting 
property failed: %s\n",
+                                                               e);
+                                               len = snprintf(buf2, 
sizeof(buf2),
+                                                               "%s\n", e);
+                                               send(msgsock, buf2, len, 0);
+                                               free(e);
+                                               SABAOTHfreeStatus(&stats);
+                                               continue;
+                                       }
+
+                                       SABAOTHfreeStatus(&stats);
+
+                                       if (val != NULL) {
+                                               Mfprintf(_mero_ctlout, "set 
property '%s' for "
+                                                               "database '%s' 
to '%s'\n", p, q, val);
+                                       } else {
+                                               Mfprintf(_mero_ctlout, 
"inherited property '%s' for "
+                                                               "database 
'%s'\n", p, q);
+                                       }
+                                       len = snprintf(buf2, sizeof(buf2), 
"OK\n");
+                                       send(msgsock, buf2, len, 0);
                                } else if (strcmp(q, "anelosimus") == 0 &&
                                                strcmp(p, "eximius") == 0)
                                {

U monetdb_set.c
Index: monetdb_set.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb_set.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- monetdb_set.c       9 Sep 2009 19:11:24 -0000       1.9
+++ monetdb_set.c       9 Sep 2009 20:12:19 -0000       1.10
@@ -76,6 +76,8 @@
                                *p++ = '=';
                                value = p;
                                p = argv[i];
+                       } else {
+                               snprintf(property, sizeof(property), "%s", 
argv[i]);
                        }
                        argv[i] = NULL;
                }
@@ -83,7 +85,7 @@
 
        if (property[0] == '\0') {
                fprintf(stderr, "%s: need a property argument\n", argv[0]);
-               command_help(2, &argv[0]);
+               command_help(2, &argv[-1]);
                exit(1);
        }
 
@@ -145,7 +147,6 @@
                                fprintf(stderr, "%s: %s\n", argv[0], e);
                                free(e);
                                state |= 1;
-                               continue;
                        }
 
                        SABAOTHfreeStatus(&stats);
@@ -153,6 +154,10 @@
                        char *res;
                        char *out;
 
+                       if (type == INHERIT) {
+                               strncat(property, "=", sizeof(property));
+                               p = property;
+                       }
                        out = control_send(&res, mero_control, 0, argv[i], p);
                        if (out != NULL || strcmp(res, "OK") != 0) {
                                res = out == NULL ? res : out;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to