Changeset: 950d67c7c2b3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=950d67c7c2b3
Modified Files:
        clients/src/mapiclient/mclient.c
Branch: Oct2010
Log Message:

Only handle "small" files on a line-by-line basis when echoing.
When echoing queries, we process a file line-by-line, but this is too
slow for large files, so when the file is large, we revert back to
chunk-at-a-time.


diffs (28 lines):

diff -r 68a859f8a583 -r 950d67c7c2b3 clients/src/mapiclient/mclient.c
--- a/clients/src/mapiclient/mclient.c  Sat Oct 16 10:38:07 2010 +0200
+++ b/clients/src/mapiclient/mclient.c  Mon Oct 18 10:44:54 2010 +0200
@@ -2727,14 +2727,18 @@
        if (optind < argc) {
                /* execute from file(s) */
                while (optind < argc) {
-                       if (echoquery) {
+                       if (echoquery &&
+                           stat(argv[optind], &statb) == 0 &&
+                           S_ISREG(statb.st_mode) &&
+                           statb.st_size < 1024*1024) {
                                /* a bit of a hack: process file
                                   line-by-line if using -e (--echo)
-                                  so that the queries that are echoed
-                                  have something to do with the
-                                  output that follows (otherwise we
-                                  just echo the start of the file for
-                                  each query) */
+                                  and the input file isn't "too
+                                  large" so that the queries that are
+                                  echoed have something to do with
+                                  the output that follows (otherwise
+                                  we just echo the start of the file
+                                  for each query) */
                                FILE *fp;
                                if ((fp = fopen(argv[optind], "r")) == NULL) {
                                        fprintf(stderr, "%s: cannot open\n", 
argv[optind]);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to