Changeset: 0edf4c9e5066 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0edf4c9e5066
Modified Files:
clients/src/mapiclient/mclient.mx
Branch: default
Log Message:
only print timings when we operate statement at a time, in batchmode the
numbers are useless
diffs (95 lines):
diff -r 17107727052d -r 0edf4c9e5066 clients/src/mapiclient/mclient.mx
--- a/clients/src/mapiclient/mclient.mx Wed Jul 21 12:56:20 2010 +0200
+++ b/clients/src/mapiclient/mclient.mx Wed Jul 21 13:22:02 2010 +0200
@@ -1008,7 +1008,7 @@
}
static void
-SQLrenderer(MapiHdl hdl)
+SQLrenderer(MapiHdl hdl, char singleinstr)
{
int i, total, vartotal, fields, oldfields = 0, max = 1, graphwaste = 0;
int *len = NULL, *hdr = NULL, *numeric = NULL;
@@ -1201,7 +1201,10 @@
rows = mapi_get_row_count(hdl);
snprintf(buf, sizeof(buf), LLFMT " rows", rows);
mark2 = strdup(buf); /* for the timer output */
- printf(LLFMT " tuple%s (%s)\n", rows, rows != 1 ? "s" : "",
timerHuman());
+ printf(LLFMT " tuple%s%s%s%s\n", rows, rows != 1 ? "s" : "",
+ singleinstr ? " (" : "",
+ singleinstr ? timerHuman() : "",
+ singleinstr ? ")" : "");
if (len)
free(len);
if (hdr)
@@ -1307,7 +1310,7 @@
#endif
static int
-format_result(Mapi mid, MapiHdl hdl)
+format_result(Mapi mid, MapiHdl hdl, char singleinstr)
{
MapiMsg rc = MERROR;
mapi_int64 aff, lid;
@@ -1352,17 +1355,21 @@
if (lid != -1) {
stream_printf(toConsole,
LLFMT " affected row%s,
"
- "last generated key: "
LLFMT " (%s)\n",
+ "last generated key: "
LLFMT "%s%s%s\n",
aff,
(aff == 1 ? "" : "s"),
lid,
- timerHuman());
+ singleinstr ? " (" : "",
+ singleinstr ?
timerHuman() : "",
+ singleinstr ? ")" : "");
} else {
stream_printf(toConsole,
- LLFMT " affected row%s
(%s)\n",
+ LLFMT " affected
row%s%s%s%s\n",
aff,
(aff == 1 ? "" : "s"),
- timerHuman());
+ singleinstr ? " (" : "",
+ singleinstr ?
timerHuman() : "",
+ singleinstr ? ")" : "");
}
}
continue;
@@ -1425,7 +1432,7 @@
SQLdebugRendering(hdl);
break;
default:
- SQLrenderer(hdl);
+ SQLrenderer(hdl, singleinstr);
break;
}
break;
@@ -1464,7 +1471,7 @@
return 1;
}
- format_result(mid, hdl);
+ format_result(mid, hdl, 0);
if (mapi_get_active(mid) == NULL || !interactive)
mapi_close_handle(hdl);
@@ -1604,7 +1611,7 @@
CHECK_RESULT(mid, hdl, buf + skip, continue);
- rc = format_result(mid, hdl);
+ rc = format_result(mid, hdl, 0);
if (rc == MMORE && (length > 0 || mapi_query_done(hdl) != MOK))
continue; /* get more data */
@@ -2095,7 +2102,7 @@
}
CHECK_RESULT(mid, hdl, buf, continue);
- rc = format_result(mid, hdl);
+ rc = format_result(mid, hdl, 1);
if (rc == MMORE && (line != NULL || mapi_query_done(hdl) !=
MOK))
continue; /* get more data */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list