Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory
23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4255/src/backends/monet5/merovingian
Modified Files:
monetdb.c
Log Message:
propagated changes of Thursday Oct 08 2009
from the Nov2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/10/08 - mr-meltdown: src/backends/monet5/merovingian/monetdb.c,1.65.2.6
Add optpipe setting to control the SQL optimiser pipeline, useful for
experimentation per database, implemented a FIXME and string abbreviation like
monetdb status does for monetdb get.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: monetdb.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/monetdb.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- monetdb.c 8 Oct 2009 11:20:50 -0000 1.69
+++ monetdb.c 8 Oct 2009 13:35:48 -0000 1.70
@@ -1066,10 +1066,16 @@
property = argv[i];
argv[i] = NULL;
if (strcmp(property, "all") == 0) {
+ size_t off = 0;
/* die hard leak (can't use constant, strtok
modifies
* (and hence crashes)) */
- /* FIXME: make this read keys from defaultprops
*/
- property =
GDKstrdup("name,forward,shared,nthreads,master,slave");
+ property = GDKmalloc(sizeof(char) * 512);
+ kv = defprops;
+ off += snprintf(property, 512, "name");
+ while (kv->key != NULL) {
+ off += snprintf(property + off, 512 -
off, ",%s", kv->key);
+ kv++;
+ }
}
} else {
doall = 0;
@@ -1133,9 +1139,10 @@
/* name = 15 */
/* prop = 8 */
/* source = 7 */
- twidth -= 15 - 2 - 8 - 2 - 7 - 2;
+ twidth -= 15 + 2 + 8 + 2 + 7 + 2;
if (twidth < 6)
twidth = 6;
+ value = alloca(sizeof(char) * twidth + 1);
printf(" name prop source value\n");
while ((p = strtok(property, ",")) != NULL) {
property = NULL;
@@ -1144,7 +1151,7 @@
/* special virtual case */
if (strcmp(p, "name") == 0) {
source = "-";
- value = stats->dbname;
+ abbreviateString(value, stats->dbname, twidth);
} else {
e = control_send(&buf, mero_host, mero_port,
stats->dbname, "get", 1,
mero_pass);
@@ -1168,10 +1175,11 @@
if (kv->val == NULL) {
kv = findConfKey(defprops, p);
source = "default";
- value = kv != NULL && kv->val != NULL ?
kv->val : "<unknown>";
+ abbreviateString(value,
+ kv != NULL && kv->val
!= NULL ? kv->val : "<unknown>", twidth);
} else {
source = "local";
- value = kv->val;
+ abbreviateString(value, kv->val,
twidth);
}
}
printf("%-15s %-8s %-7s %s\n",
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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/devconference
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins